Repository navigation
feat: More explicit alternative to unused let expressions for triggering quantifier instantiation
#2930
wood-ghost
started this conversation in
Feature requests
Replies: 1 comment
|
I think this is a good question. There are many instances where you just want to add some expressions for the sake of triggering, without necessarily asserting anything new. However, all the idiomatic ways to invoke triggers is to write an assert. As a more complex example, I frequently want to do something like, "if I think we should have an idiomatic, documented way to do this kind of thing. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
playground
When testing
Iterator::zipspecification together withIterator::all, I encountered a proof that succeeds only after adding a semantically unused let expression, so I also test it forIterator::rev. This manual trigger in an assertion body causes me to write extra proofs to meet the precondition of other related specs.A similar technique appears in source/vstd/iset.rs for example. #2486
There is also a related example in the forall and triggers. The following assertion
can be replaced by
to trigger
is_even(s[3]).Is
let _ = trigger_term;considered an intended and stable way to request quantifier instantiation? If so, should this technique be documented? If not, is there a more explicit or recommended way to request a particular instantiation?Possible directions might include:
iterator::rev, so that common compositions withallor closure with indexing do not require this workaround.All reactions