Use Seq drop_last in recursive definitions #821
Replies: 2 comments 1 reply
-
I'm not sure which set of indices you have in mind here.
I'm all for less manual work, and the axiom you have above (which hopefully one day would be proven) seems reasonable. In Dafny, however, it seemed like the style of "operate on the head of a sequence and recurse on the tail" generally provided better automation than your proposed "operate on the tail and recurse on the prefix". Related to the above, can you expand on why the latter is likely to automate better in Verus? |
Beta Was this translation helpful? Give feedback.
-
Sorry, I should have written more detail. I have in mind proofs like the following in Dafny:
Both work as-is in Dafny. The relevant Dafny axioms for
The relevant Dafny axiom for
Notice that there's an asymmetry in these axioms, with the single axiom for For the I don't think this is specific to Verus; I think the issues are the same as in Dafny. In both Verus and Dafny, I would expect the |
Beta Was this translation helpful? Give feedback.
-
I noticed that some recursive functions in seq_lib.rs (e.g. max, min, max_via, min_via) are defined in terms of drop_first or subrange(1, ...). If we used drop_last instead, the Seq indices would line up and proofs should require less manual work, especially if we add the following axiom (which Dafny uses for seq take):
Beta Was this translation helpful? Give feedback.
All reactions