New lemmas for List - #1072
Conversation
|
@namasikanam Did you change some lemmas? |
|
The SHA3 one could be a |
|
I didn't change any statement of existing lemmas (only update some proofs when they are not running on my machine). I coudn't find |
Maybe the sha3 dev contains rogue |
e221166 to
e211fc2
Compare
I fixed the inconsistency in docker. I couldn't reproduce the failure for SHA3. But it turned out that the failure in SHA3 gets also resolved magically :) |
|
I will always test within docker before creating a PR in the future :) |
| (* rfind p l = index of the last element of l satisfying p *) | ||
| (* (or -1 if there is none). *) | ||
| (* -------------------------------------------------------------------- *) | ||
| op rfind ['a] (p : 'a -> bool) (l : 'a list) : int = |
There was a problem hiding this comment.
This rfind operator should have lemmas corresponding to all existing find lemmas when possible.
This section should be next to the find section if possible.
| (* interval *) | ||
| (* interval s l r = the slice s[l..r) (l included, r excluded) *) | ||
| (* -------------------------------------------------------------------- *) | ||
| op interval ['a] (s : 'a list) (l r : int) = drop l (take r s). |
There was a problem hiding this comment.
I think a name like sublist would be better. This has precedence (https://www.w3schools.com/java/ref_arraylist_sublist.asp)
| size s <= r => interval s l r = drop l s. | ||
| proof. by move=> *; rewrite /interval take_oversize. qed. | ||
|
|
||
| lemma interval_subseq ['a] (s : 'a list) (l1 l2 r1 r2 : int) : |
There was a problem hiding this comment.
I would expect a lemma with this name to prove subseq (interval s l r) s. Change the name to interval_subseq_interval
There are a few new lemmas and four new operators:
isprefix: whether one list is a prefix of the other listprefixes: the sets of all prefixes of a listinterval: a consecutive subsequence of a listrfind: reverse finding (start from the end of the list)Also, I reduced smt usage in some old proofs, as smt solving in those proof fails on my machine. I believe these updates only make proofs better :)