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

Update PrimStringAxioms.v.in #787

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions theories/core/PrimStringAxioms.v.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#[only="8.20"] Definition compare_ok := compare_eq.

#[skip="8.20"] From Corelib Require Import ssreflect ssrbool Uint63Axioms PrimStringAxioms.
#[skip="8.20"] Lemma compare_refl (s : string) : compare s s = Eq.
#[skip="8.20"] Lemma compare_Eq_refl (s : string) : compare s s = Eq.
#[skip="8.20"] Proof.
#[skip="8.20"] rewrite PrimStringAxioms.compare_spec.
#[skip="8.20"] elim: (to_list s) => //= x xs ->.
Expand All @@ -11,13 +11,7 @@
#[skip="8.20"] have [+ _] := ltb_spec x x.
#[skip="8.20"] by case: ltb => // /(_ isT); case: (to_Z x) => //=; elim.
#[skip="8.20"] Qed.
#[skip="8.20"] Lemma to_list_inj (s1 s2 : string) :
#[skip="8.20"] to_list s1 = to_list s2 -> s1 = s2.
#[skip="8.20"] Proof.
#[skip="8.20"] intros H. rewrite -(of_to_list s1) -(of_to_list s2) H.
#[skip="8.20"] reflexivity.
#[skip="8.20"] Qed.
#[skip="8.20"] Lemma compare_eq_correct (s1 s2 : string) :
#[skip="8.20"] Lemma compare_Eq_correct (s1 s2 : string) :
#[skip="8.20"] compare s1 s2 = Eq -> s1 = s2.
#[skip="8.20"] Proof.
#[skip="8.20"] move=> E; rewrite -[s1]of_to_list -[s2]of_to_list; congr (of_list _).
Expand All @@ -31,4 +25,4 @@
#[skip="8.20"] by case: ltb.
#[skip="8.20"] Qed.
#[skip="8.20"] Lemma compare_ok (s1 s2 : string) : compare s1 s2 = Eq <-> s1 = s2.
#[skip="8.20"] Proof. split; [apply compare_eq_correct|intros []; apply compare_refl]. Qed.
#[skip="8.20"] Proof. split; [apply compare_Eq_correct|intros []; apply compare_Eq_refl]. Qed.
Loading