Closed MikaelMayer closed 1 year ago
I got errors I could not find a simple way to fix, besides the obvious fix of adding Witness as a child to SubsetTypeDecl Basically, Dafny is creating a trigger like this: ImapSimulator(iset{}, (x: A) requires false => match() {}).apply.requires(i) Which, translated to Boogie, creates tons of error like
3792module.bpl(3299,31): Error: quantifiers are not allowed in triggers 3792module.bpl(3300,35): Error: quantifiers are not allowed in triggers 3792module.bpl(3301,29): Error: quantifiers are not allowed in triggers 3792module.bpl(3302,72): Error: boolean operators are not allowed in triggers looking at the generated code, I see in a trigger AtLayer((lambda $l#9#ly#0: LayerType :: ... and ...$IsBox($l#9#x#0, _module.ImapSimulator$A) && false), which are responsible for the boogie errors. Now, removing these triggers in Boogie make the code to verify without issue. On the dafny side, there is a test if (!CanSafelyInline(fexp, f)) { that is taking the "else" branch, but if I had take it the "then" branch, it verifies without error. Obviously, I would like to tell Dafny that it's not safe to inline (fexp, f) where fexp isImapSimulator(iset{}, (x: A) requires false => match () { }).Valid() and f is the Valid predicate. But the check tests only variables, not the presence of lambda expressions. @leino why is it failing and what is the best course forward? I thought of either Saying it's never safe to inline a function Creating a test on the object to ensure it can be converted to trigger (do we have a function like that) Something else that works.
Dafny version
4.0.1
Code to produce this issue
Command to run and resulting output
What happened?
A crash occurred and no translation/verification was made.
What type of operating system are you experiencing the problem on?
Windows