Avoid defining let-bound variables on SMT level #948
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When evaluating an expression
let x == (e1) in e2, Silicon emits an(assert (= x e1))for a fresh variablexon the SMT level to make sure thate1is available as a triggering term even when does not occur ine2; this is done to fix viperproject/silver#688.However, these additional variables and equalities can slow down verification significantly (see attached file
floats.txt).
This PR implements a compromise and emits these definitions only when
e1might be triggering and only during function and predicate verification, since in those, let-bound function calls and similar expressions are commonly used e.g. to call lemmas or trigger quantifiers (as in the original issue).