Commit b7609d6a authored by Ralf Jung's avatar Ralf Jung

make the library work without any axioms

parent cff4a032
Require Import Ssreflect.ssreflect Ssreflect.ssrfun Omega. Require Import Ssreflect.ssreflect Ssreflect.ssrfun Omega.
Require Import world_prop core_lang lang iris_core iris_plog. Require Import world_prop core_lang lang iris_core iris_plog.
Require Import ModuRes.RA ModuRes.SPred ModuRes.BI ModuRes.PreoMet ModuRes.Finmap ModuRes.Agreement ModuRes.DecEnsemble ModuRes.Axioms ModuRes.CMRA. Require Import ModuRes.RA ModuRes.SPred ModuRes.BI ModuRes.PreoMet ModuRes.Finmap ModuRes.Agreement ModuRes.DecEnsemble ModuRes.CMRA.
Set Bullet Behavior "Strict Subproofs". Set Bullet Behavior "Strict Subproofs".
......
This diff is collapsed.
(* This file defines all axioms we are relying on in our development. *)
Require Import Coq.Logic.ProofIrrelevance.
Require Import Util CSetoid.
Definition ProofIrrelevance := proof_irrelevance.
Ltac rewrite_pi p q := erewrite (ProofIrrelevance _ p q).
Ltac pi := try apply equivR; f_equal; now eapply ProofIrrelevance.
Require Import ssreflect. Require Import ssreflect.
Require Import MetricCore. Require Import MetricCore.
Require Import Axioms.
Require Import PreoMet. Require Import PreoMet.
Require Import RA CMRA SPred. Require Import RA CMRA SPred.
Require Import Arith Min Max List ListSet Lists. Require Import Arith Min Max List ListSet Lists.
...@@ -154,6 +153,14 @@ Section FinDom. ...@@ -154,6 +153,14 @@ Section FinDom.
+ move=>?. discriminate. + move=>?. discriminate.
Qed. Qed.
Lemma fdLookup_indom_pi f k (Hindom1: k dom f) (Hindom2: k dom f):
fdLookup_indom f k Hindom1 = fdLookup_indom f k Hindom2.
Proof.
rewrite /fdLookup_indom. ddes (f k) at 1 3 7 as [v|] deqn:EQf.
- reflexivity.
- exfalso. apply fdLookup_in_strong in Hindom1. apply Hindom1. now rewrite -EQf.
Qed.
End Props. End Props.
Section Instances. Section Instances.
...@@ -575,7 +582,7 @@ Section FinDom. ...@@ -575,7 +582,7 @@ Section FinDom.
End Recursion. End Recursion.
(* No need to restrict this Lemma to fdRectInner - that just messes up the details. *) (* No need to restrict this Lemma to fdRectInner - that just messes up the details. *)
Lemma fdRectInner_eqL l l' f (Heq: dom f = l) (Heq': dom f = l') (* Lemma fdRectInner_eqL l l' f (Heq: dom f = l) (Heq': dom f = l')
(T: (K -f> V) -> Type) (F: forall l (f: K -f> V), dom f = l -> T f) : (T: (K -f> V) -> Type) (F: forall l (f: K -f> V), dom f = l -> T f) :
F l f Heq = F l' f Heq'. F l f Heq = F l' f Heq'.
Proof. Proof.
...@@ -585,8 +592,8 @@ Section FinDom. ...@@ -585,8 +592,8 @@ Section FinDom.
refine (match Heql in eq _ l'' return (forall Heq' : dom f = l'', F l f Heq = F l'' f Heq') with refine (match Heql in eq _ l'' return (forall Heq' : dom f = l'', F l f Heq = F l'' f Heq') with
| eq_refl => _ | eq_refl => _
end). end).
move=>Heq'. f_equal. apply ProofIrrelevance. move=>Heq'. reflexivity.
Qed. Qed. *)
Section Fold. Section Fold.
Context {T: Type}. Context {T: Type}.
...@@ -609,7 +616,18 @@ Section FinDom. ...@@ -609,7 +616,18 @@ Section FinDom.
move=>Heql. assert (Heq': dom f2 = l1). move=>Heql. assert (Heq': dom f2 = l1).
{ now subst l2. } { now subst l2. }
transitivity (fdRectInner (fun _ => T) (fun _ _ _ => id) (Temp) (fun k v _ _ => Tstep k v) l1 f2 Heq'); last first. transitivity (fdRectInner (fun _ => T) (fun _ _ _ => id) (Temp) (fun k v _ _ => Tstep k v) l1 f2 Heq'); last first.
{ rewrite (fdRectInner_eqL l1 l2). reflexivity. } { revert f2 f1 Heq' Heq1 Heq2 H. revert l2 Heql. induction l1; intros.
- destruct l2; last discriminate. simpl. reflexivity.
- destruct l2; first discriminate.
inversion Heql; subst; clear Heql.
simpl. intros. f_equal. f_equal.
+ apply fdLookup_indom_pi.
+ eapply IHl1; last first.
* instantiate (1:= (f2 \ k)). intros. reflexivity.
* rewrite /fdStrongUpdate /dom /=. rewrite Heq' DecEq_refl.
eapply filter_dupes_id. simpl.
move:(dom_nodup f2). rewrite Heq'. intros Hnd. inversion Hnd; subst. assumption.
* reflexivity. }
subst l2. clear Heql. revert f1 f2 Heq1 Heq' H. induction l1; intros f1 f2 Heq1 Heq2 Heqf. subst l2. clear Heql. revert f1 f2 Heq1 Heq' H. induction l1; intros f1 f2 Heq1 Heq2 Heqf.
- reflexivity. - reflexivity.
- simpl. unfold id. - simpl. unfold id.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment