Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properties of List.Tot.no_repeats_p #3094

Merged
merged 1 commit into from
Nov 14, 2023
Merged

Conversation

tahina-pro
Copy link
Member

@tahina-pro tahina-pro commented Nov 14, 2023

This pull request introduces some reasoning principles to prove that a list is (or is not) without repetitions, using the no_repeats_p predicate that does not require the type of list elements to have decidable equality.

Many of those properties already exist for noRepeats (which works only on eqtypes); I replicated those properties for no_repeats_p in this PR.

Regarding no_repeats_p_append_permut with 5 arguments, I expect users to use this lemma with l2 and l4 being singletons; and similarly for l in no_repeats_p_false_intro

@TWal
Copy link
Contributor

TWal commented Nov 14, 2023

The bool and prop properties are causing a lot of redundancy in ulib, but is it needed?
While I agree that we need to define each predicate twice (although it would have been better with some consistent naming convention, e.g. noRepeats vs no_repeats_p, or memP vs no_repeats_p), probably that each lemma could be defined only once?
I feel like we could define lemmas only on the prop predicates, and using a lemma stating the equivalence between bool / prop predicates it would suffice to deduce the lemmas on bool predicates?
Probably that it could even be done automatically with carefully crafted SMT patterns?

The comment above the lemma mem_memP seem to go in this direction

(** Correctness of [mem] for types with decidable equality. TODO:
replace [mem] with [memP] in relevant lemmas and define the right
SMTPat to automatically recover lemmas about [mem] for types with
decidable equality *)

@tahina-pro
Copy link
Member Author

Thanks Théophile for your remark; I opened issue #3095 to this end, which would be solved as a separate, more general PR that would also cover memP, etc.

@tahina-pro tahina-pro merged commit def881f into master Nov 14, 2023
2 checks passed
@tahina-pro tahina-pro deleted the _taramana_list_no_repeats_p branch November 14, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants