The following code causes Dafny to crash if /autoTriggers:1 is set on the command line:
method Try (a:int, b:int, c:int)
{
forall
ensures a * c == a * c;
ensures b * c == b * c;
{
}
}
Here's the crash output:
Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'Microsoft.Boogie.NAryExpr' to type 'Microsoft.Boogie.ForallExpr'.
at Microsoft.Dafny.Translator.TrForallProof(ForallStmt s, StmtListBuilder definedness, StmtListBuilder exporter, List`1 locals, ExpressionTranslator etran) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 8352
at Microsoft.Dafny.Translator.TrStmt(Statement stmt, StmtListBuilder builder, List`1 locals, ExpressionTranslator etran) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 7431
at Microsoft.Dafny.Translator.TrStmtList(List`1 stmts, StmtListBuilder builder, List`1 locals, ExpressionTranslator etran) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 7663
at Microsoft.Dafny.Translator.TrStmt(Statement stmt, StmtListBuilder builder, List`1 locals, ExpressionTranslator etran) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 7295
at Microsoft.Dafny.Translator.TrStmt2StmtList(StmtListBuilder builder, Statement block, List`1 locals, ExpressionTranslator etran) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 7061
at Microsoft.Dafny.Translator.AddMethodImpl(Method m, Procedure proc, Boolean wellformednessProc) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 2874
at Microsoft.Dafny.Translator.AddClassMembers(ClassDecl c) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 1460
at Microsoft.Dafny.Translator.Translate(Program p) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 523
at Microsoft.Dafny.DafnyDriver.ProcessFiles(IList`1 fileNames, ErrorReporter reporter, Boolean lookForSnapshots, String programId) in f:\Apps\codeplex\dafny\Source\DafnyDriver\DafnyDriver.cs:line 165
at Microsoft.Dafny.DafnyDriver.ThreadMain(String[] args) in f:\Apps\codeplex\dafny\Source\DafnyDriver\DafnyDriver.cs:line 96
at Microsoft.Dafny.DafnyDriver.<>c__DisplayClass1.<Main>b__0() in f:\Apps\codeplex\dafny\Source\DafnyDriver\DafnyDriver.cs:line 33
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Comments: Note that fixing issue #121 (not trying to put auto-triggers on empty forall's) might fix this one as a side effect.
method Try (a:int, b:int, c:int)
{
forall
ensures a * c == a * c;
ensures b * c == b * c;
{
}
}
Here's the crash output:
Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'Microsoft.Boogie.NAryExpr' to type 'Microsoft.Boogie.ForallExpr'.
at Microsoft.Dafny.Translator.TrForallProof(ForallStmt s, StmtListBuilder definedness, StmtListBuilder exporter, List`1 locals, ExpressionTranslator etran) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 8352
at Microsoft.Dafny.Translator.TrStmt(Statement stmt, StmtListBuilder builder, List`1 locals, ExpressionTranslator etran) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 7431
at Microsoft.Dafny.Translator.TrStmtList(List`1 stmts, StmtListBuilder builder, List`1 locals, ExpressionTranslator etran) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 7663
at Microsoft.Dafny.Translator.TrStmt(Statement stmt, StmtListBuilder builder, List`1 locals, ExpressionTranslator etran) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 7295
at Microsoft.Dafny.Translator.TrStmt2StmtList(StmtListBuilder builder, Statement block, List`1 locals, ExpressionTranslator etran) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 7061
at Microsoft.Dafny.Translator.AddMethodImpl(Method m, Procedure proc, Boolean wellformednessProc) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 2874
at Microsoft.Dafny.Translator.AddClassMembers(ClassDecl c) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 1460
at Microsoft.Dafny.Translator.Translate(Program p) in f:\Apps\codeplex\dafny\Source\Dafny\Translator.cs:line 523
at Microsoft.Dafny.DafnyDriver.ProcessFiles(IList`1 fileNames, ErrorReporter reporter, Boolean lookForSnapshots, String programId) in f:\Apps\codeplex\dafny\Source\DafnyDriver\DafnyDriver.cs:line 165
at Microsoft.Dafny.DafnyDriver.ThreadMain(String[] args) in f:\Apps\codeplex\dafny\Source\DafnyDriver\DafnyDriver.cs:line 96
at Microsoft.Dafny.DafnyDriver.<>c__DisplayClass1.<Main>b__0() in f:\Apps\codeplex\dafny\Source\DafnyDriver\DafnyDriver.cs:line 33
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Comments: Note that fixing issue #121 (not trying to put auto-triggers on empty forall's) might fix this one as a side effect.