dafny icon indicating copy to clipboard operation
dafny copied to clipboard

Prover died on simple program

Open MikaelMayer opened this issue 9 months ago • 2 comments

Dafny version

latest-nightly

Code to produce this issue

class KillProver {
  method ProverShouldntDie() returns (k: nat)
    modifies set o: object {:trigger true} :: o
  {
    k := 0;
  }
}

Command to run and resulting output

Paste in VSCode

What happened?

image

What type of operating system are you experiencing the problem on?

Windows

MikaelMayer avatar May 10 '24 16:05 MikaelMayer

This seems to be caused by the trigger. If I run the program without verifying it, I get this boogie translation error: Error: trigger must mention all quantified variables, but does not mention: o#0. Introducing a constant predicate fixes the issue:

predicate T(o: object) {
  true
}

class KillProver {
  method ProverShouldntDie() returns (k: nat)
    modifies set o: object {:trigger T(o)} :: o
  {
    k := 0;
  }
}

stefan-aws avatar May 13 '24 11:05 stefan-aws

This is an error reporting issue. The message Error: trigger must mention all quantified variables, but does not mention: o#0 comes from Boogie but is emitted is a non-standard way, which causes it to be completely ignored by Dafny server, while on the CLI it is printed but otherwise ignored, allowing verification to continue (even though there is an error), leading to additional bad looking error output from the solver.

keyboardDrummer avatar May 14 '24 09:05 keyboardDrummer