Updated snapshot injectivity axiom. #1475
Merged
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.
The snapshot domain axioms do not currently ensure that a snapshot for a variant must correspond to a constructor invocation. As a consequence, given snapshots
s1
ands2
that return the same values for all field access functions, we cannot proves1 == s2
(see the included test).This PR introduces a new injectivity axiom, asserting that each variant snapshot corresponds to a constructor invocation:
The replaces the current injectivity axiom:
The trigger on field access axioms is also made more permissive. This is necessary because the new injectivity axiom is only triggered on field access (and not on snapshot construction).
Previous:
forall args... :: {field(cons(arg_field, other_args...))} field(cons(arg_field, other_args...)) == arg_field
New:
forall args... :: {cons(arg_field, other_args...)} field(cons(arg_field, other_args...)) == arg_field
Finally,
DefinitionCollector
is updated to ensure that functions used in the triggers of domain axioms are always preserved.