Error in inductive proof #4860
Labels
crash
Dafny crashes on this input, or generates malformed code that can not be executed
during 2: compilation of correct program
Dafny rejects a valid program during compilation
kind: bug
Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
part: resolver
Resolution and typechecking
priority: next
Will consider working on this after in progress work is done
Dafny version
4.3.0
Code to produce this issue
Command to run and resulting output
What happened?
% dafny verify opt0_chatgpt.dfy
Unhandled exception. System.AggregateException: One or more errors occurred. (One or more errors occurred. (One or more errors occurred. (Object reference not set to an instance of an object.)))
---> System.AggregateException: One or more errors occurred. (One or more errors occurred. (Object reference not set to an instance of an object.))
---> System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Dafny.MatchFlattener.LetBind(IdPattern var, Expression genExpr, PatternPath bodyPath) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/CompileNestedMatch/MatchFlattener.cs:line 734
at Microsoft.Dafny.MatchFlattener.LetBindNonWildCard(IdPattern idPattern, Expression expr, PatternPath bodyPath) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/CompileNestedMatch/MatchFlattener.cs:line 757
at Microsoft.Dafny.MatchFlattener.CompileHeadsContainingConstructor(MatchCompilationState mti, MatchingContext context, Cons
1 matchees, Dictionary
2 subst, Dictionary2 constructorByName, List
1 paths) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/CompileNestedMatch/MatchFlattener.cs:line 365at Microsoft.Dafny.MatchFlattener.CompilePatternPathsForMatchee(MatchCompilationState state, MatchingContext context, List
1 paths, Cons
1 consMatchees) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/CompileNestedMatch/MatchFlattener.cs:line 262at Microsoft.Dafny.MatchFlattener.CompilePatternPaths(MatchCompilationState state, MatchingContext context, SinglyLinkedList
1 matchees, List
1 paths) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/CompileNestedMatch/MatchFlattener.cs:line 223at Microsoft.Dafny.MatchFlattener.CompileNestedMatchExpr(NestedMatchExpr nestedMatchExpr) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/CompileNestedMatch/MatchFlattener.cs:line 90
at Microsoft.Dafny.MatchFlattener.<>c__DisplayClass5_0.b__0(INode node) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/CompileNestedMatch/MatchFlattener.cs:line 74
at Microsoft.Dafny.Node.Visit(Func
2 beforeChildren, Action
1 afterChildren) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/Generic/Node.cs:line 143at Microsoft.Dafny.MatchFlattener.FlattenNode(Node root) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/CompileNestedMatch/MatchFlattener.cs:line 57
at Microsoft.Dafny.MatchFlattener.<>c__DisplayClass5_0.b__0(INode node) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/CompileNestedMatch/MatchFlattener.cs:line 75
at Microsoft.Dafny.Node.Visit(Func
2 beforeChildren, Action
1 afterChildren) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/Generic/Node.cs:line 143at Microsoft.Dafny.MatchFlattener.FlattenNode(Node root) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/CompileNestedMatch/MatchFlattener.cs:line 57
at Microsoft.Dafny.MatchFlattener.PostResolve(ModuleDefinition module) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/CompileNestedMatch/MatchFlattener.cs:line 53
at Microsoft.Dafny.LiteralModuleDecl.Resolve(ModuleResolver resolver, CompilationData compilation) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/AST/Modules/LiteralModuleDecl.cs:line 168
at Microsoft.Dafny.ModuleResolver.ResolveModuleDeclaration(CompilationData compilation, ModuleDecl decl) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/Resolver/ModuleResolver.cs:line 184
at Microsoft.Dafny.ProgramResolver.ResolveModuleDeclaration(CompilationData compilation, ModuleDecl decl) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/Resolver/ProgramResolver.cs:line 174
at Microsoft.Dafny.ProgramResolver.Resolve(CancellationToken cancellationToken) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/Resolver/ProgramResolver.cs:line 68
at Microsoft.Dafny.DafnyMain.<>c__DisplayClass5_0.b__0() in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/DafnyMain.cs:line 89
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Microsoft.Dafny.DafnyMain.Resolve(Program program) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/DafnyMain.cs:line 89
at Microsoft.Dafny.DafnyMain.ParseCheck(TextReader stdIn, IReadOnlyList
1 files, String programName, DafnyOptions options, Program& program) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyCore/DafnyMain.cs:line 54 at Microsoft.Dafny.DafnyDriver.ProcessFilesAsync(IReadOnlyList
1 dafnyFiles, ReadOnlyCollection1 otherFileNames, DafnyOptions options, Boolean lookForSnapshots, String programId) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyDriver/DafnyDriver.cs:line 453 --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task
1.GetResultCore(Boolean waitCompletionNotification)at System.Threading.Tasks.Task
1.get_Result() at Microsoft.Dafny.DafnyDriver.ThreadMain(TextWriter outputWriter, TextWriter errorWriter, TextReader inputReader, String[] args) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyDriver/DafnyDriver.cs:line 149 at Microsoft.Dafny.DafnyDriver.<>c__DisplayClass11_0.<MainWithWriters>b__0() in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyDriver/DafnyDriver.cs:line 120 at System.Threading.Tasks.Task
1.InnerInvoke()at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task
1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task
1.get_Result()at Microsoft.Dafny.DafnyDriver.MainWithWriters(TextWriter outputWriter, TextWriter errorWriter, TextReader inputReader, String[] args) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyDriver/DafnyDriver.cs:line 120
at Microsoft.Dafny.DafnyDriver.Main(String[] args) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/DafnyDriver/DafnyDriver.cs:line 107
at Dafny.Dafny.Main(String[] args) in /private/tmp/dafny-20230929-7192-1ta7rj5/dafny-4.3.0/Source/Dafny/Dafny.cs:line 7
zsh: abort dafny verify opt0_chatgpt.dfy
What type of operating system are you experiencing the problem on?
Linux, Mac
The text was updated successfully, but these errors were encountered: