Skip to content

Commit

Permalink
Don't create trivial labeled assumptions (#823)
Browse files Browse the repository at this point in the history
Previously, `{:id ...}` attributes were copied from `assert` statements
to `assume` statements unconditionally, even when subsumption was
disabled. This led to `{:id ...}` attributes on `assume true`
statements, which will never be necessary for a proof, so there's no
reason to track them.
  • Loading branch information
atomb authored Dec 8, 2023
1 parent 4896769 commit 9d96c29
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Source/VCGeneration/VCGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ public static AssumeCmd AssertTurnedIntoAssume(VCGenOptions options, AssertCmd a
}

var assume = new AssumeCmd(assrt.tok, expr);
// Copy any {:id ...} from the assertion to the assumption, so
// we can track it while analyzing verification coverage.
(assume as ICarriesAttributes).CopyIdFrom(assrt.tok, assrt);
if (expr != Expr.True) {
// Copy any {:id ...} from the assertion to the assumption, so
// we can track it while analyzing verification coverage. But
// skip it if it's `true` because that's never useful to track.
(assume as ICarriesAttributes).CopyIdFrom(assrt.tok, assrt);
}
return assume;
}

Expand Down

0 comments on commit 9d96c29

Please sign in to comment.