Dataset Viewer
Auto-converted to Parquet Duplicate
prompt
stringlengths
134
5.79k
completion
stringlengths
5
2.16k
meta
stringlengths
120
394
Proof State: ``` 2 goals A : Set a : A l : list A H : forall (a : A) (l1 : list A), In (a, l1) (split_one l) -> Permutation (a :: l1) l a0 : A l1 : list A H0 : (a, l) = (a0, l1) ============================ Permutation (a0 :: l1) (a :: l) goal 2 is: Permutation (a0 :: l1) (a :: l) ``` Commit Diff: ``` diff --git a/Div.v b/Div.v index 7e7d694..e83d601 100644 --- a/Div.v +++ b/Div.v @@ -57,2 +57,2 @@ n) p) (c2 := mod n p); try apply mod_lt; auto with arith. -rewrite mult_plus_distr_r; rewrite <- plus_assoc; repeat -rewrite <- div_mod_correct; auto with arith. +rewrite mult_plus_distr_r, <- plus_assoc; repeat rewrite +<- div_mod_correct; auto with arith. @@ -67,4 +67,2 @@ intros n m p H; apply plus_reg_l with (div (p * m + n) p * p). -rewrite <- div_mod_correct; auto. -rewrite div_mult_comp; auto. -rewrite mult_plus_distr_r; rewrite (mult_comm p); rewrite <- plus_assoc. -eq_tac; apply div_mod_correct; auto. +rewrite <- div_mod_correct, div_mult_comp, mult_plus_distr_r, (mult_comm p), <- plus_assoc by assumption. +f_equal. now apply div_mod_correct. diff --git a/ListAux.v b/ListAux.v index 82a8d82..986e88b 100644 --- a/ListAux.v +++ b/ListAux.v @@ -76 +76 @@ exists (nil (A:=A)); exists l; simpl; auto. -eq_tac; auto. +f_equal; auto. @@ -78 +78 @@ case H; auto; intros l1 [l2 Hl2]; exists (a1 :: l1); exists l2; simpl; auto. -eq_tac; auto. +f_equal; auto. @@ -146 +146 @@ intros a l H l2 l3 l4 a0; case l3; simpl. -intros H0; left; exists l; eq_tac; injection H0; auto. +intros H0; left; exists l; f_equal; injection H0; auto. @@ -150 +150 @@ intros [l5 H1]. -left; exists l5; eq_tac; injection H0; auto. +left; exists l5; f_equal; injection H0; auto. @@ -165,2 +165,2 @@ intros H0; right; right; injection H0; split; auto. -eq_tac; auto. -intros b0 l0 H0; left; exists l0; injection H0; intros; (repeat eq_tac); auto. +f_equal; auto. +intros b0 l0 H0; left; exists l0; injection H0; intros; (repeat f_equal); auto. @@ -169 +169 @@ injection H0; auto. -intros [l5 HH1]; left; exists l5; eq_tac; auto; injection H0; auto. +intros [l5 HH1]; left; exists l5; f_equal; auto; injection H0; auto. @@ -171 +171 @@ intros [H1|[H1 H2]]; auto. -right; right; split; auto; eq_tac; auto; injection H0; auto. +right; right; split; auto; f_equal; auto; injection H0; auto. @@ -190 +190 @@ exists (b :: l4); exists l5; exists b1; (repeat (simpl; split; auto)). -eq_tac; auto. +f_equal; auto. @@ -237 +237 @@ intros H4 H5; split; auto. -eq_tac; auto. +f_equal; auto. @@ -278 +278 @@ intros A l1 l2; elim l1; simpl; auto. -intros a l H; rewrite length_app; rewrite length_map; rewrite H; auto. +intros a l H; rewrite length_app, length_map, H; auto. diff --git a/ListOp.v b/ListOp.v index b9797d9..e1936ca 100644 --- a/ListOp.v +++ b/ListOp.v @@ -138,2 +138 @@ intros a b c; elim c; simpl; auto. -intros n H; rewrite jump_nil; rewrite -take_nil; rewrite H; auto with arith. +intros n H; rewrite jump_nil, take_nil, H; auto with arith. @@ -146,2 +145,2 @@ intros k Rec i j s H; -rewrite length_app; rewrite length_take1; auto with arith. -eq_tac; auto. +rewrite length_app, length_take1; auto with arith. +f_equal; auto. @@ -199 +198 @@ intros l; elim l; simpl; auto with datatypes. -intros; eq_tac; auto. +intros; f_equal; auto. @@ -206 +205 @@ intros H; contradict H; auto with arith. -intros n1 H; eq_tac; auto with arith. +intros n1 H; f_equal; auto with arith. @@ -219 +218 @@ intros a l1 Rec n; case n; auto; clear n. -simpl length; intros n H; simpl; eq_tac; auto with arith. +simpl length; intros n H; simpl; f_equal; auto with arith. diff --git a/OrderedList.v b/OrderedList.v index f2762b8..3136749 100644 --- a/OrderedList.v +++ b/OrderedList.v @@ -624 +624 @@ intros; discriminate. -intros; eq_tac; auto. +intros; f_equal; auto. diff --git a/Permutation.v b/Permutation.v index ecfa699..3f52951 100644 --- a/Permutation.v +++ b/Permutation.v @@ -33,2 +32,0 @@ Variable A : Set. -Definition permutation (l1 l2 : list A) := @Permutation A l1 l2. - @@ -37,66 +34,0 @@ Hint Constructors Permutation : core. -Definition permutation_trans := perm_trans. - - - - - -Theorem permutation_refl : forall l : list A, permutation l l. -Proof. -simple induction l. -apply perm_nil. -intros a l1 H. -apply perm_skip with (1 := H). -Qed. -Hint Resolve permutation_refl : core. - - - ``` Ongoing Proof History: ``` Proof. intros a l1 l2; generalize a l1; elim l2; clear a l1 l2; simpl in |- *; auto. intros a l1 H1; case H1. intros a l H a0 l1 [H0| H0]. ? injection H0; intros H1 H2; rewrite H2; rewrite H1; auto. ? generalize H H0; elim (split_one l); simpl in |- *; auto. ? intros H1 H2; case H2. ``` Next Tactic: ```
injection H0; intros H1 H2; rewrite H2, H1; auto. ```
{"final_commit":"82eb0678991955dfa8f12720d652ad5adb465c3e","project":"sudoku","repair_file":"\/data\/coq-pearls\/repairs\/sudoku\/repair-sudoku-b5543771d6bdeab13ec58ac6c8d281815d96ed62-82eb0678991955dfa8f12720d652ad5adb465c3e-8_15_2-8_15_2-35.git.json","initial_commit":"b5543771d6bdeab13ec58ac6c8d281815d96ed62","file":"Permutation.v"}
Ongoing Proof History: ``` Proof. intros n m p Hp H. apply gcd_unique; trivial. - apply H. apply divide_refl. ``` Proof State: ``` This subproof is complete, but there are some unfocused goals. Focus next goal with bullet -. 2 subgoals subgoal 1 is: (p | m) subgoal 2 is: forall q : t, (q | n) -> (q | m) -> (q | p) ``` Next Tactic: ```
- ```
{"package":"coq","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/theories\/Numbers\/NatInt\/NZGcd.v"}
Proof State: ``` 1 subgoal E : Type -> Type R : Type S : Type classicT : forall P : Type, P + (P -> False) r : itrace E S -> itrace E R -> Prop CIH : forall (b : itrace E R) (t : itree E S) (f : S -> itree E R), b βŠ‘ ITree.bind t f -> r (peel b t) b b : itrace E R t : itree E S f : S -> itree E R A0 : Type e1 : E A0 ans : A0 k : unit -> itree (EvAns E) R k0 : A0 -> itree E R t0 : itree E S k' : A0 -> itree E S Hvis : eqit_ eq true true id (upaco2 (eqit_ eq true true id) bot2) (Vis e1 (fun x : A0 => ITree.bind (k' x) f)) (Vis e1 k0) Href : rutt_ (REvRef E) (RAnsRef E) eq (upaco2 (rutt_ (REvRef E) (RAnsRef E) eq) bot2) (Vis (evans A0 e1 ans) k) (Vis e1 (fun x : A0 => ITree.bind (k' x) f)) Ht0 : eqitF eq true true id (upaco2 (eqit_ eq true true id) bot2) (observe t0) (VisF e1 k') H6 : forall (a : unit) (b : A0), RAnsRef E unit A0 (evans A0 e1 ans) a e1 b -> upaco2 (rutt_ (REvRef E) (RAnsRef E) eq) bot2 (k a) (ITree.bind (k' b) f) k4 : A0 -> itree E R REL : forall v : A0, paco2 (eqit_ eq true true id) bot2 (k4 v) (k0 v) ============================ trace_prefixF (upaco2 trace_prefix_ r) (observe (peel_ (VisF (evans A0 e1 ans) k) (observe t0))) (VisF (evans A0 e1 ans) k) ``` Ongoing Proof History: ``` cbn in *. destruct (observe t0) eqn : Heqt0; try discriminate. + right. exists r0. pfold. red. cbn. rewrite Heqt0. - auto. + auto with itree. + injection x as Ht1. symmetry in Heqt0. apply simpobs in Heqt0. setoid_rewrite Heqt0. setoid_rewrite tau_eutt. eapply IHHvis; eauto. rewrite Ht1. auto. } destruct H as [ [B [k' [e1 Ht0] ] ] | [s Ht0] ]. + rewrite Heqt in Href. rewrite tau_eutt in Href. rewrite Ht0 in Href. rewrite bind_vis in Href. pinversion Href. subst; ddestruction; subst. rewrite Ht0 in Hvis. rewrite bind_vis in Hvis. pinversion Hvis. subst; ddestruction; subst. clear Heqt Heqb. punfold Ht0. red in Ht0. cbn in *. destruct e. * inv H1. ddestruction; subst. cbn. constructor. ? eapply trace_prefix_vis_evans; eauto. ? * ? eapply trace_prefix_vis_evempty; eauto. ``` Commit Diff: ``` diff --git a/theories/Basics/Basics.v b/theories/Basics/Basics.v index ff16faf..1f991e2 100644 --- a/theories/Basics/Basics.v +++ b/theories/Basics/Basics.v @@ -57,0 +58,2 @@ Definition state (s a : Type) := s -> prod s a. +Definition run_stateT {s m a} (x : stateT s m a) : s -> m (s * a)%type := x. + diff --git a/theories/Basics/HeterogeneousRelations.v b/theories/Basics/HeterogeneousRelations.v index 8894184..ad37cca 100644 --- a/theories/Basics/HeterogeneousRelations.v +++ b/theories/Basics/HeterogeneousRelations.v @@ -751 +751,21 @@ cbn in *. unfold diagonal_prop in *; tauto. -Qed. \ No newline at end of file +Qed. + + + + + +Definition option_rel {X : Type} (R : +relation X) : relation (option X) := +fun mx my => match mx,my with +| Some x, Some y => R +x y | None, None => True +| _, _ => False end. +Hint Unfold option_rel : core. + +Lemma option_rel_eq : forall {A : Type}, +eq_rel (@eq (option A)) (option_rel eq). +Proof. +intros ?; split; intros [] [] EQ; subst; try inv EQ; cbn; auto. +Qed. + +#[global] Hint Unfold option_rel : core. \ No newline at end of file diff --git a/theories/Core/ITreeDefinition.v b/theories/Core/ITreeDefinition.v index 3f88726..eff8f67 100644 --- a/theories/Core/ITreeDefinition.v +++ b/theories/Core/ITreeDefinition.v @@ -69,0 +70,2 @@ Arguments itreeF _ _ : clear implicits. +Create HintDb itree. + diff --git a/theories/Core/KTreeFacts.v b/theories/Core/KTreeFacts.v index a1c2431..9949acf 100644 --- a/theories/Core/KTreeFacts.v +++ b/theories/Core/KTreeFacts.v @@ -113 +113 @@ intros ? ? ?. red. -induction 1; auto. +induction 1; auto with itree. diff --git a/theories/Dijkstra/ITreeDijkstra.v b/theories/Dijkstra/ITreeDijkstra.v ``` Next Tactic: ```
eapply <LOOKUP>trace_prefix_vis_evans : forall (E : Type -> Type) (R S : Type) (r : itrace E S -> itrace E R -> Prop) (A0 : Type) (ev : E A0) (ans : A0) (k : unit -> itree (EvAns E) R) (k' : A0 -> itree E S) (t0 : itree E S) (f : S -> itree E R), (forall (a : unit) (b : A0), RAnsRef E unit A0 (evans A0 ev ans) a ev b -> id (upaco2 (rutt_ (REvRef E) (RAnsRef E) eq) bot2) (k a) (ITree.bind (k' b) f)) -> t0 β‰ˆ Vis ev k' -> (forall (b : itrace E R) (t : itree E S) (f0 : S -> itree E R), b βŠ‘ ITree.bind t f0 -> r (peel b t) b) -> trace_prefixF (upaco2 trace_prefix_ r) (observe (peel_ (VisF (evans A0 ev ans) k) (observe t0))) (VisF (evans A0 ev ans) k)</LOOKUP>; eauto with itree. ```
{"final_commit":"8fcf6f5f81ec9289d56e777b3885e715b3328486","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-8447a4e3e92c94e5ec1f23f35b6ecd63fae0c880-8fcf6f5f81ec9289d56e777b3885e715b3328486-8_10_2-8_12_2-83.git.json","initial_commit":"8447a4e3e92c94e5ec1f23f35b6ecd63fae0c880","file":"theories\/ITrace\/ITraceBind.v"}
Ongoing Proof History: ``` Proof. induction p. - intro x. simpl. destruct (stop (f x)) eqn:des1. exists xH. split. reflexivity. split. ``` Proof State: ``` 3 subgoals X : Type f : X β†’ X stop : X β†’ bool p : positive IHp : βˆ€ x : X, βˆƒ q : positive, iterate_stop p x ≑ iterate q x ∧ (βˆ€ r : positive, (r < q)%positive β†’ stop (iterate r x) ≑ false) ∧ (p ≑ q ∨ (q < p)%positive ∧ stop (iterate q x) ≑ true) x : X des1 : stop (f x) ≑ true ============================ βˆ€ r : positive, (r < 1)%positive β†’ stop (iterate r x) ≑ false subgoal 2 is: (p~1)%positive ≑ 1%positive ∨ (1 < p~1)%positive ∧ stop (iterate 1 x) ≑ true subgoal 3 is: βˆƒ q : positive, (if stop (iterate_stop p (f x)) then iterate_stop p (f x) else iterate_stop p (iterate_stop p (f x))) ≑ iterate q x ∧ (βˆ€ r : positive, (r < q)%positive β†’ stop (iterate r x) ≑ false) ∧ ((p~1)%positive ≑ q ∨ (q < p~1)%positive ∧ stop (iterate q x) ≑ true) ``` Next Tactic: ```
intros. ```
{"package":"coq-corn","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/CoRN\/reals\/fast\/CRstreams.v"}
Proof State: ``` 1 subgoal A : Type t1, t2 : btree A l1, l2, l3 : list (btree A) H : ordered_cover l1 t1 H0 : forall l2 : list (btree A), length l1 = length l2 -> exists t2 : btree A, subst_pred l1 l2 t1 t2 H1 : ordered_cover l2 t2 H2 : forall l3 : list (btree A), length l2 = length l3 -> exists t3 : btree A, subst_pred l2 l3 t2 t3 l0 : list (btree A) H3 : length (l1 ++ l2) = length l0 t4 : btree A HH1 : subst_pred l1 (firstn (length l1) l0) t1 t4 ============================ exists t0 : btree A, subst_pred (l1 ++ l2) l0 (node t1 t2) t0 ``` Ongoing Proof History: ``` Proof using. intros t1 l1 l2 H; generalize l2; elim H; clear t1 l1 l2 H. intros t l l2; case l2. simpl in |- *; intros; discriminate. intros b l0; case l0; simpl in |- *; auto. intros H; exists b; auto. intros; discriminate. intros t1 t2 l1 l2 l3 H H0 H1 H2 l0 H3. - case (H0 (first_n l0 (length l1))); auto. + case (H0 (firstn (length l1) l0)); auto. - rewrite first_n_length; auto; (rewrite <- H3; rewrite length_app; auto with arith). + rewrite firstn_le_length_eq; auto; (rewrite <- H3; rewrite app_length; auto with arith). intros t4 HH1. ? case (H2 (skip_n l0 (length l1))); auto. ? rewrite skip_n_length; auto; (rewrite <- H3; rewrite length_app; rewrite minus_plus; auto with arith). ? intros t5 HH2. ``` Commit Diff: ``` diff --git a/theories/Aux.v b/theories/Aux.v index c7e8186..355e02d 100644 --- a/theories/Aux.v +++ b/theories/Aux.v @@ -132 +132,2 @@ End LeBool. -Section fold. +Section Fold. + @@ -137,7 +137,0 @@ Variable h : A -> A. -Variable eqA_dec : forall a b : A, {a = b} + {a <> b}. - -Theorem fold_left_app : forall a l1 l2, fold_left f (l1 ++ -l2) a = fold_left f l2 (fold_left f l1 a). -Proof using. -intros a l1; generalize a; elim l1; simpl in |- *; auto; clear a l1. -Qed. @@ -161,8 +154,0 @@ Qed. -Theorem fold_right_app : forall a l1 l2, -fold_right g a (l1 ++ l2) = -fold_right g (fold_right g a l2) l1. -Proof using. -intros a l1; generalize a; elim l1; simpl in |- *; auto; clear a l1. -intros a l H a0 l2; rewrite H; auto. -Qed. - @@ -178 +164 @@ Qed. -End fold. +End Fold. @@ -181,0 +168 @@ Section List. + @@ -227,31 +213,0 @@ Qed. - -Theorem length_app : forall l1 l2 : list A, length -(l1 ++ l2) = length l1 + length l2. -Proof using. -intros l1; elim l1; simpl in |- *; auto. -Qed. - -Theorem app_inv_head : forall l1 l2 l3 : list A, l1 -++ l2 = l1 ++ l3 -> l2 = l3. -Proof using. -intros l1; elim l1; simpl in |- *; auto. -intros a l H l2 l3 H0; apply H; injection H0; auto. -Qed. - -Theorem app_inv_tail : forall l1 l2 l3 : list A, l2 -++ l1 = l3 ++ l1 -> l2 = l3. -Proof using. -intros l1 l2; generalize l1; elim l2; clear l1 l2; simpl in |- *; auto. -intros l1 l3; case l3; auto. -intros b l H; absurd (length ((b :: l) ++ l1) <= length l1). -simpl in |- *; rewrite length_app; auto with arith. -rewrite <- H; auto with arith. -intros a l H l1 l3; case l3. -simpl in |- *; intros H1; absurd (length (a :: l ++ l1) <= length l1). -simpl in |- *; rewrite length_app; auto with arith. -rewrite H1; auto with arith. -simpl in |- *; intros b l0 H0; injection H0. -intros H1 H2; apply f_equal2 with (f := cons (A:=A)); auto. -apply H with (1 := H1); auto. -Qed. - @@ -341,4 +296,0 @@ Qed. -Theorem length_map : forall l, length (map f l) = length l. -Proof using. -intros l; elim l; simpl in |- *; auto. -Qed. @@ -346,8 +298 @@ Qed. -Theorem map_app : forall l1 l2, map f (l1 ++ l2) = map f l1 ++ map f l2. -Proof using. -intros l; elim l; simpl in |- *; auto. -intros a l0 H l2; apply f_equal2 with (f := cons (A:=B)); auto. -Qed. - - -Theorem in_flat_map : forall (l : list B) (f : +Theorem in_flat_map_in : forall (l : list B) (f : @@ -357,4 +302 @@ Proof using. -intros l g; elim l; simpl in |- *; auto. -intros a l0 H a0 b H0 [H1| H1]; apply in_or_app; auto. -left; rewrite H1; auto. -right; apply H with (b := b); auto. +intros; apply in_flat_map; exists b; split; auto. @@ -367,6 +309 @@ Proof using. -intros l g; elim l; simpl in |- *; auto. -intros a H; case H. -intros a l0 H a0 H0; case in_app_or with (1 := H0); simpl in |- *; auto. -intros H1; exists a; auto. -intros H1; case H with (1 := H1). -intros b (H2, H3); exists b; simpl in |- *; auto. +intros; apply in_flat_map; auto. @@ -416,14 +353,3 @@ Variable A : Type. -Fixpoint first_n (l : list -A) (n : nat) {struct -n} : list A := -match n with | O -=> [] | S n1 -=> match l with | -[] => [] | a -:: l1 => a :: ``` Next Tactic: ```
case (H2 (<LOOKUP>skipn : forall A : Type, nat -> list A -> list A</LOOKUP> (<LOOKUP>length : forall A : Type, list A -> nat</LOOKUP> l1) l0)); auto. ```
{"final_commit":"b6befe10be8f4acefcd6424a3eec659dbd39c0c4","project":"huffman","repair_file":"\/data\/coq-pearls\/repairs\/huffman\/repair-huffman-6e3f37b2113e34f74c6b5a6ff2c7346a9cdf9e4e-b6befe10be8f4acefcd6424a3eec659dbd39c0c4-8_11_2-8_11_2-18.git.json","initial_commit":"6e3f37b2113e34f74c6b5a6ff2c7346a9cdf9e4e","file":"theories\/SubstPred.v"}
Proof State: ``` 1 subgoal X, Y : MetricSpace XY := ProductMS X Y : MetricSpace f : X --> Complete Y plX : PrelengthSpace X plFEX : PrelengthSpace (FinEnum X) x : Complete X y : Complete Y s : Compact X H0 : inCompact x s H1 : msp_eq y (Cbind plX f x) ============================ inCompact (Couple (PairMS x (Cbind plX f x))) (CompactGraph_b plFEX s) ``` Ongoing Proof History: ``` Proof. intros plX plFEX x y s. split; intros H. split; rewrite <- (CoupleCorrect2 x y). apply (@CompactGraph_b_correct2 plFEX). exact H. symmetry. transitivity (Csnd (Couple (x,y))). refine (CompactGraph_b_correct3 _ _). apply H. apply CoupleCorrect3. destruct H as [H0 H1]. change (x, y) with (PairMS x y). rewrite -> H1. ``` Next Tactic: ```
apply <LOOKUP>CompactGraph_b_correct1 : forall [plX : PrelengthSpace X] (plFEX : PrelengthSpace (FinEnum X)) [x : Complete X] [s : Compact X], inCompact x s -> inCompact (Couple (x, Cbind plX f x)) (CompactGraph_b plFEX s)</LOOKUP>. ```
{"package":"coq-corn","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/CoRN\/metric2\/Graph.v"}
Commit Diff: ``` diff --git a/theories/Basics/CategoryFacts.v b/theories/Basics/CategoryFacts.v index 732b8d2..a684e54 100644 --- a/theories/Basics/CategoryFacts.v +++ b/theories/Basics/CategoryFacts.v @@ -121,0 +122,13 @@ Qed. +Context {t : obj}. +Context {Terminal_t : Terminal C t}. +Context {TerminalObject_t : TerminalObject C t}. + + +Lemma terminal_unique : forall a (f g +: C a t), f β©― g. +Proof. +intros. +rewrite (terminal_object f), (terminal_object g). +reflexivity. +Qed. + @@ -402,0 +416,281 @@ End CoproductFacts. + + + +Section ProductFacts. + +Context {obj : Type} {C : Hom obj}. + +Context {Eq2_C : Eq2 C}. +Context {E_Eq2_C : forall a b, @Equivalence (C a b) eq2}. + +Context {Id_C : Id_ C} {Cat_C : Cat C}. + +Context {Category_C : Category C}. + +Context {bif : binop obj}. +Context {Prod_C : Pair C bif} +{Fst_C : Fst C bif} +{Snd_C : Snd C bif}. +Context {Product_C : Product C bif}. + +Lemma pair_fst' {a b c d} (ca : C c a) (cb : C c b) (dc +: C d c) : dc >>> pair_ ca cb >>> fst_ β©― dc >>> ca. +Proof. +rewrite cat_assoc, pair_fst. reflexivity. +Qed. + +Lemma pair_snd' {a b c d} (ca : C c a) (cb : C c b) (dc +: C d c) : dc >>> pair_ ca cb >>> snd_ β©― dc >>> cb. +Proof. +rewrite cat_assoc, pair_snd. reflexivity. +Qed. + + +Lemma pair_cat {a b c d} (ab : C a b) (bc : C b c) (bd : +C b d) : (ab >>> pair_ bc bd β©― pair_ (ab >>> bc) (ab >>> bd)). +Proof. +apply pair_universal. +- rewrite pair_fst'; reflexivity. +- rewrite pair_snd'; reflexivity. +Qed. + + +Corollary pair_eta {a b} : id_ (bif a b) β©― pair_ fst_ snd_. +Proof. +apply pair_universal; rewrite cat_id_l; reflexivity. +Qed. + +Lemma pair_eta' {a b c} (f : C a (bif b +c)) : f β©― pair_ (f >>> fst_) (f >>> snd_). +Proof. +eapply pair_universal; reflexivity. +Qed. + + + +Lemma pair_split {a b c} (f g : C +a (bif b c)) : (f >>> fst_ +β©― g >>> fst_) -> (f >>> snd_ +β©― g >>> snd_) -> f β©― g. +Proof. +intros. rewrite (pair_eta' g). +apply pair_universal; assumption. +Qed. + +Existing Instance Bimap_Product. +Existing Instance Swap_Product. +Existing Instance AssocR_Product. +Existing Instance AssocL_Product. +Existing Instance UnitL_Product. +Existing Instance UnitL'_Product. +Existing Instance UnitR_Product. +Existing Instance UnitR'_Product. + +Ltac unfold_product +:= unfold +bimap, Bimap_Product, +assoc_r, AssocR_Product, +assoc_l, AssocL_Product, +unit_l, UnitL_Product, +unit_l', UnitL'_Product, +unit_r, UnitR_Product, +unit_r', UnitR'_Product, +swap, Swap_Product. + + +Ltac cat_auto_simpl_prod := match goal with +| [ |- eq2 ?lhs ?rhs +] => repeat (rewrite cat_id_l || +rewrite cat_id_r || rewrite pair_fst || +rewrite <- (cat_assoc (pair_ _ _) +fst_), pair_fst || rewrite pair_snd || +rewrite <- (cat_assoc (pair_ _ _) +snd_), pair_snd || rewrite !cat_assoc); reflexivity ``` Ongoing Proof History: ``` Proof. unfold map_default_eq, interp_map. repeat intro. revert x y H s1 s2 H0. einit. ecofix CH. intros. rewrite! unfold_interp_state. punfold H0. red in H0. revert s1 s2 H1. induction H0; intros; subst; simpl; pclearbot. - eret. - etau. - ebind. apply pbc_intro_h with (RU := prod_rel (@eq_map _ _ _ _ d) eq). { ? unfold over. ? destruct (case e). ? - ``` Proof State: ``` 1 subgoal K, V : Type map : Type M : Map K V map MOk : MapOk eq M Kdec : RelDec eq KdecOk : RelDec_Correct Kdec R : Type E : Type -> Type d : V RR : R -> R -> Prop gL' : itree E (map * R) -> itree E (map * R) -> Prop INCL : forall x0 x1 : itree E (map * R), bot2 x0 x1 -> gL' x0 x1 gH' : itree E (map * R) -> itree E (map * R) -> Prop INCH : forall x0 x1 : itree E (map * R), bot2 x0 x1 -> gH' x0 x1 CHL : forall x x0 : itree (mapE K d +' E) R, eutt RR x x0 -> forall x2 x3 : map, eq_map x2 x3 -> gL' (interp_state (case_ (handle_map (V:=V)) pure_state) x x2) (interp_state (case_ (handle_map (V:=V)) pure_state) x0 x3) CHH : forall x x0 : itree (mapE K d +' E) R, eutt RR x x0 -> forall x2 x3 : map, eq_map x2 x3 -> gH' (interp_state (case_ (handle_map (V:=V)) pure_state) x x2) (interp_state (case_ (handle_map (V:=V)) pure_state) x0 x3) x, y : itree (mapE K d +' E) R u : Type e : (mapE K d +' E) u k1, k2 : u -> itree (mapE K d +' E) R REL : forall v : u, paco2 (eqit_ RR true true id) bot2 (k1 v) (k2 v) s1, s2 : map H1 : eq_map s1 s2 ============================ eqit (prod_rel eq_map eq) true true (case_ (handle_map (V:=V)) pure_state u e s1) (case_ (handle_map (V:=V)) pure_state u e s2) ``` Next Tactic: ```
unfold case_. ```
{"final_commit":"81a1ac45e6eac7285942c92f0079e632d7200904","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-440b18da2c80560f3454b2cbc1736209a76d64ad-81a1ac45e6eac7285942c92f0079e632d7200904-8_10_2-8_10_2-3.git.json","initial_commit":"440b18da2c80560f3454b2cbc1736209a76d64ad","file":"theories\/Events\/MapDefaultFacts.v"}
Ongoing Proof History: ``` Proof. intro. ``` Proof State: ``` 1 subgoal I : interval pI : proper I F, G : PartFunct IR diffF : Diffble I pI F diffG : Diffble I pI G X : bnd_away_zero_in_P G I ============================ Diffble I pI (F {/} G) ``` Next Tactic: ```
apply <LOOKUP>Diffble_wd : forall (I : interval) (pI : proper I) (F H : PartFunct IR), Feq I F H -> Diffble I pI F -> Diffble I pI H</LOOKUP> with (F{*}{1/}G). ```
{"package":"coq-corn","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/CoRN\/ftc\/MoreFunctions.v"}
Ongoing Proof History: ``` Proof. intros C HnotEM. set (R := fun A b => A /\ true = b \/ ~ A /\ false = b). assert (H : exists f : Prop -> bool, (forall A:Prop, R A (f A))). apply unique_choice. intro A. destruct (classic A) as [Ha| Hnota]. exists true; split. left; split; [ assumption | reflexivity ]. intros y [[_ Hy]| [Hna _]]. assumption. contradiction. exists false; split. right; split; [ assumption | reflexivity ]. intros y [[Ha _]| [_ Hy]]. contradiction. assumption. ``` Proof State: ``` 1 subgoal C : Prop HnotEM : (forall P : Prop, {P} + {~ P}) -> C R := fun (A : Prop) (b : bool) => A /\ true = b \/ ~ A /\ false = b : Prop -> bool -> Prop H : exists f : Prop -> bool, forall A : Prop, R A (f A) ============================ C ``` Next Tactic: ```
destruct H as [f Hf]. ```
{"package":"coq","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/theories\/Logic\/ClassicalUniqueChoice.v"}
Ongoing Proof History: ``` Proof. repeat red. intros. subst. split. - revert_until y1. pcofix CIH. intros. pstep. - punfold H1. + punfold H0. - red in H1. + red in H0. red. ? hinduction H1 before CIH; intros; eauto. ? + ? apply EqRet. ``` Proof State: ``` 1 subgoal E : Type -> Type R1 : Type R2 : Type x, y : relationH R1 R2 H : eq_rel x y y0, y1 : bool r : rel2 (itree E R1) (fun _ : itree E R1 => itree E R2) CIH0 : forall (a0 : itree E R1) (a1 : itree E R2), bot2 a0 a1 -> r a0 a1 CIH : forall (x0 : itree E R1) (x1 : itree E R2), eqit x y0 y1 x0 x1 -> r x0 x1 y2 : itree E R1 y3 : itree E R2 H0 : eqitF x y0 y1 id (upaco2 (eqit_ x y0 y1 id) bot2) (observe y2) (observe y3) ============================ eqitF y y0 y1 id (upaco2 (eqit_ y y0 y1 id) r) (observe y2) (observe y3) ``` Commit Diff: ``` diff --git a/theories/Core/ITreeDefinition.v b/theories/Core/ITreeDefinition.v index b8604b4..1d0cd49 100644 --- a/theories/Core/ITreeDefinition.v +++ b/theories/Core/ITreeDefinition.v @@ -253,2 +253,2 @@ t2)) (at level 61, t1 at next level, right associativity) : itree_scope. -Notation "` x : t <- t1 ;; t2" := (ITree.bind t1 (fun x : t => t2)) -(at level 61, t at next level, t1 at next level, x ident, right associativity) : itree_scope. +Notation "` x : t <- t1 ;; t2" := (ITree.bind t1 (fun x : t => t2)) (at +level 61, t at next level, t1 at next level, x ident, right associativity, only parsing) : itree_scope. diff --git a/theories/Core/KTreeFacts.v b/theories/Core/KTreeFacts.v index b911a90..32f56a6 100644 --- a/theories/Core/KTreeFacts.v +++ b/theories/Core/KTreeFacts.v @@ -6,2 +6 @@ Require Import -Program Classes.Morphisms -Setoids.Setoid +Classes.Morphisms Setoids.Setoid @@ -24 +23,2 @@ Eq.Eq -Eq.UpToTaus. +Eq.UpToTaus +Eq.Paco2. @@ -68 +68 @@ Proof. -ginit. gcofix CIH. intros. +ginit. pcofix CIH. intros. @@ -205,2 +205,2 @@ Proof. -revert A B C f g a0. -ginit. gcofix CIH. intros. +revert f g a0. +ginit. pcofix CIH. intros. @@ -268 +268 @@ revert a0. -ginit. gcofix CIH. intros. +ginit. pcofix CIH. intros. @@ -277 +277 @@ revert a. -gcofix CIH'. intros. +pcofix CIH'. intros. @@ -337,2 +337 @@ etau. -specialize (CIH xa). -cbn in CIH. +specialize (CIHL xa). cbn in CIHL. diff --git a/theories/Eq/Eq.v b/theories/Eq/Eq.v index 21ac7e0..9f80143 100644 --- a/theories/Eq/Eq.v +++ b/theories/Eq/Eq.v @@ -29 +29,2 @@ Basics.Basics Basics.HeterogeneousRelations -Core.ITreeDefinition. +Core.ITreeDefinition +Eq.Paco2. @@ -165,0 +167,54 @@ Hint Unfold id: core. +Lemma eqitF_VisF_inv_r {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 vclo sim} +t1 X2 (e2 : E X2) (k2 : X2 -> _) : eqitF RR b1 +b2 vclo sim t1 (VisF e2 k2) -> (exists k1, t1 = VisF e2 k1 +/\ forall v, vclo sim (k1 v) (k2 v)) \/ (b1 /\ exists t1', t1 += TauF t1' /\ eqitF RR b1 b2 vclo sim (observe t1') (VisF e2 k2)). +Proof. +refine (fun H => match H +in eqitF _ _ _ _ +_ _ t2 return match t2 +return Prop with | VisF e2 +k2 => _ | _ +=> True end with | +EqVis _ _ _ _ +_ _ _ _ _ +=> _ | _ => +_ end); try exact I. +- left; eauto. +- destruct i0; eauto. +Qed. + +Lemma eqitF_VisF_inv {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 vclo sim} X1 +(e1 : E X1) (k1 : X1 -> _) X2 (e2 : E X2) (k2 : X2 +-> _) : eqitF RR b1 b2 vclo sim (VisF e1 k1) (VisF e2 k2) -> exists +p : X1 = X2, eqeq E p e1 e2 /\ pweqeq (vclo sim) p k1 k2. +Proof. +refine (fun H => match H in +eqitF _ _ _ _ _ t1 +t2 return match t1, t2 return Prop +with | VisF e1 k1, VisF e2 +k2 => _ | _, _ => +True end with | EqVis _ +_ _ _ _ _ _ +_ _ => _ | _ +=> _ end); try exact I. +- exists eq_refl; cbn; eauto. +- destruct i; exact I. +Qed. + +Lemma eqitF_VisF_inv_strong {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 +vclo sim} X (e : E X) (k1 : X -> _) (k2 +: X -> _) : eqitF RR b1 b2 vclo sim (VisF e +k1) (VisF e k2) -> forall x, vclo sim (k1 x) (k2 x). +Proof. +intros H. dependent destruction H. assumption. +Qed. + +Lemma eqitF_VisF {E R1 R2} {RR : R1 -> R2 -> Prop} {b1 b2 vclo sim} {X1 +X2} (p : X1 = X2) (e1 : E X1) (k1 : X1 -> _) (e2 : +E X2) (k2 : X2 -> _) : eqeq E p e1 e2 -> pweqeq (vclo sim) ``` Next Tactic: ```
hinduction H0 before CIH; intros; eauto. ```
{"final_commit":"f3853150994e962978fa4cf0ed18dcb8c42e3262","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-fbba5fd82470aa824ec0eab20c275063ca38fb75-f3853150994e962978fa4cf0ed18dcb8c42e3262-8_10_2-8_11_2-0.git.json","initial_commit":"fbba5fd82470aa824ec0eab20c275063ca38fb75","file":"theories\/Eq\/Eq.v"}
Proof State: ``` 1 subgoal x, y : t H : y <= x ============================ match x ?= y with | Lt => y | _ => x end == x ``` Ongoing Proof History: ``` Proof. intros. unfold max, gmax. ``` Next Tactic: ```
case <LOOKUP>compare_spec : forall x y : t, CompareSpec (x == y) (x < y) (y < x) (x ?= y)</LOOKUP>; auto with relations. ```
{"package":"coq","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/theories\/Structures\/GenericMinMax.v"}
Commit Diff: ``` diff --git a/theories/Basics/Basics.v b/theories/Basics/Basics.v index ff16faf..1f991e2 100644 --- a/theories/Basics/Basics.v +++ b/theories/Basics/Basics.v @@ -57,0 +58,2 @@ Definition state (s a : Type) := s -> prod s a. +Definition run_stateT {s m a} (x : stateT s m a) : s -> m (s * a)%type := x. + diff --git a/theories/Basics/HeterogeneousRelations.v b/theories/Basics/HeterogeneousRelations.v index 8894184..ad37cca 100644 --- a/theories/Basics/HeterogeneousRelations.v +++ b/theories/Basics/HeterogeneousRelations.v @@ -751 +751,21 @@ cbn in *. unfold diagonal_prop in *; tauto. -Qed. \ No newline at end of file +Qed. + + + + + +Definition option_rel {X : Type} (R : +relation X) : relation (option X) := +fun mx my => match mx,my with +| Some x, Some y => R +x y | None, None => True +| _, _ => False end. +Hint Unfold option_rel : core. + +Lemma option_rel_eq : forall {A : Type}, +eq_rel (@eq (option A)) (option_rel eq). +Proof. +intros ?; split; intros [] [] EQ; subst; try inv EQ; cbn; auto. +Qed. + +#[global] Hint Unfold option_rel : core. \ No newline at end of file diff --git a/theories/Core/ITreeDefinition.v b/theories/Core/ITreeDefinition.v index 3f88726..eff8f67 100644 --- a/theories/Core/ITreeDefinition.v +++ b/theories/Core/ITreeDefinition.v @@ -69,0 +70,2 @@ Arguments itreeF _ _ : clear implicits. +Create HintDb itree. + diff --git a/theories/Core/KTreeFacts.v b/theories/Core/KTreeFacts.v index a1c2431..9949acf 100644 --- a/theories/Core/KTreeFacts.v +++ b/theories/Core/KTreeFacts.v @@ -113 +113 @@ intros ? ? ?. red. -induction 1; auto. +induction 1; auto with itree. diff --git a/theories/Dijkstra/ITreeDijkstra.v b/theories/Dijkstra/ITreeDijkstra.v index 9529757..b25a16e 100644 --- a/theories/Dijkstra/ITreeDijkstra.v +++ b/theories/Dijkstra/ITreeDijkstra.v @@ -189 +189 @@ is_inf_cons (h : A) (t : stream A) : F t -> is_infF F (ConsF h t). -Hint Constructors is_infF : core. +Hint Constructors is_infF : itree. @@ -198 +198 @@ Proof. -red. intros. red in IN. red. induction IN; auto. +red. intros. red in IN. red. induction IN; auto with itree. @@ -217 +217 @@ s2 : stream A) : F s1 s2 -> bisimF F (ConsF h s1) (ConsF h s2). -Hint Constructors bisimF : core. +Hint Constructors bisimF : itree. @@ -226 +226 @@ Proof. -red. intros. red in IN. red. induction IN; auto. +red. intros. red in IN. red. induction IN; auto with itree. @@ -234 +234 @@ constructor; red. -- pcofix CIH. intros. pfold. red. destruct (observe_stream x); auto. +- pcofix CIH. intros. pfold. red. destruct (observe_stream x); auto with itree. @@ -237 +237 @@ pfold. red. -pinversion H0; subst; auto. +pinversion H0; subst; auto with itree. @@ -239 +239 @@ pinversion H0; subst; auto. -pinversion H0; pinversion H1; auto. +pinversion H0; pinversion H1; auto with itree. @@ -250 +250 @@ pfold. red. unfold app. pinversion H12. -- simpl. destruct s3. destruct s4. pinversion H34; simpl in *; subst; auto. +- simpl. destruct s3. destruct s4. pinversion H34; simpl in *; subst; auto with itree. @@ -282 +282 @@ stream' A -> Prop := | forall_nil : forall_streamF P F NilF | forall_cons (h : A -Hint Constructors forall_streamF : core. +Hint Constructors forall_streamF : itree. @@ -289 +289 @@ Proof. -red. intros. red. red in IN. destruct IN; auto. +red. intros. red. red in IN. destruct IN; auto with itree. @@ -301 +301 @@ F (observe_stream t) -> inf_manyF P F (ConsF h t) | cons_found (h : A) (t -Hint Constructors inf_manyF : core. +Hint Constructors inf_manyF : itree. @@ -308 +308 @@ Proof. -red. intros. red in IN. red. induction IN; auto. +red. intros. red in IN. red. induction IN; auto with itree. @@ -320,2 +320,2 @@ punfold Him. red in Him. pfold. red. -induction Him; auto. pclearbot. -auto. +induction Him; auto with itree. pclearbot. +auto with itree. @@ -355 +355 @@ sim ot1 (observe t2) -> eqitEF RR sim ot1 (TauF t2). -Hint Constructors eqitEF : core. +Hint Constructors eqitEF : itree. @@ -367 +367 @@ repeat red. intros. rename x0 into t1. rename x1 into t2. -induction IN; eauto. +induction IN; eauto with itree. @@ -378 +378 @@ r) | eventlessTau (t : itree E R) : F t -> eventlessF F (TauF t). -Hint Constructors eventlessF : core. +Hint Constructors eventlessF : itree. @@ -383 +383 @@ Prop) : itree E R -> Prop := fun t => eventlessF F (observe t). -Hint Unfold eventless_ : core. +Hint Unfold eventless_ : itree. @@ -390 +390 @@ Proof. -red. intros. red in IN. red. inversion IN; auto. +red. intros. red in IN. red. inversion IN; auto with itree. ``` Proof State: ``` 1 subgoal E : Type -> Type R : Type eq_ : itree E R -> itree E R -> Prop ============================ Equivalence eq_ -> Equivalence (going eq_) ``` Ongoing Proof History: ``` Proof. ? intros []; constructor; cbv; eauto. ? - ? intros ? ? []; auto. ``` Next Tactic: ```
intros []; constructor; cbv; eauto with itree. ```
{"final_commit":"8fcf6f5f81ec9289d56e777b3885e715b3328486","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-8447a4e3e92c94e5ec1f23f35b6ecd63fae0c880-8fcf6f5f81ec9289d56e777b3885e715b3328486-8_10_2-8_12_2-5.git.json","initial_commit":"8447a4e3e92c94e5ec1f23f35b6ecd63fae0c880","file":"theories\/Eq\/Shallow.v"}
Ongoing Proof History: ``` apply Rle_pow. unfold C; apply RmaxLess1. replace (4 * N)%nat with (2 * (2 * N))%nat; [ idtac | ring ]. apply (fun m n p:nat => mult_le_compat_l p n m). replace (2 * N)%nat with (S (N + pred N)). apply le_n_S. apply plus_le_compat_l; assumption. rewrite pred_of_minus. lia. apply Rle_trans with (sum_f_R0 (fun k:nat => sum_f_R0 (fun l:nat => C ^ (4 * N) * Rsqr (/ INR (fact (S (N + k))))) (pred (N - k))) (pred N)). apply sum_Rle; intros. apply sum_Rle; intros. rewrite <- (Rmult_comm (C ^ (4 * N))). apply Rmult_le_compat_l. apply pow_le. left; apply Rlt_le_trans with 1. apply Rlt_0_1. unfold C; apply RmaxLess1. replace (/ INR (fact (2 * S (n0 + n)) * fact (2 * (N - n0)))) with (Binomial.C (2 * S (N + n)) (2 * S (n0 + n)) / INR (fact (2 * S (N + n)))). apply Rle_trans with (Binomial.C (2 * S (N + n)) (S (N + n)) / INR (fact (2 * S (N + n)))). unfold Rdiv; do 2 rewrite <- (Rmult_comm (/ INR (fact (2 * S (N + n))))). apply Rmult_le_compat_l. left; apply Rinv_0_lt_compat; apply INR_fact_lt_0. apply C_maj. lia. right. unfold Rdiv; rewrite Rmult_comm. unfold Binomial.C. unfold Rdiv; repeat rewrite <- Rmult_assoc. rewrite <- Rinv_l_sym. rewrite Rmult_1_l. replace (2 * S (N + n) - S (N + n))%nat with (S (N + n)). rewrite Rinv_mult_distr. unfold Rsqr; reflexivity. apply INR_fact_neq_0. apply INR_fact_neq_0. lia. apply INR_fact_neq_0. unfold Rdiv; rewrite Rmult_comm. unfold Binomial.C. unfold Rdiv; repeat rewrite <- Rmult_assoc. rewrite <- Rinv_l_sym. rewrite Rmult_1_l. replace (2 * S (N + n) - 2 * S (n0 + n))%nat with (2 * (N - n0))%nat. rewrite mult_INR. reflexivity. lia. apply INR_fact_neq_0. apply Rle_trans with (sum_f_R0 (fun k:nat => INR N / INR (fact (S N)) * C ^ (4 * N)) (pred N)). apply sum_Rle; intros. rewrite <- (scal_sum (fun _:nat => C ^ (4 * N)) (pred (N - n)) (Rsqr (/ INR (fact (S (N + n)))))). rewrite sum_cte. rewrite <- Rmult_assoc. do 2 rewrite <- (Rmult_comm (C ^ (4 * N))). rewrite Rmult_assoc. apply Rmult_le_compat_l. apply pow_le. left; apply Rlt_le_trans with 1. apply Rlt_0_1. unfold C; apply RmaxLess1. apply Rle_trans with (Rsqr (/ INR (fact (S (N + n)))) * INR N). apply Rmult_le_compat_l. apply Rle_0_sqr. apply le_INR. lia. rewrite Rmult_comm; unfold Rdiv; apply Rmult_le_compat_l. apply pos_INR. apply Rle_trans with (/ INR (fact (S (N + n)))). pattern (/ INR (fact (S (N + n)))) at 2; rewrite <- Rmult_1_r. unfold Rsqr. apply Rmult_le_compat_l. left; apply Rinv_0_lt_compat; apply INR_fact_lt_0. apply Rmult_le_reg_l with (INR (fact (S (N + n)))). apply INR_fact_lt_0. rewrite <- Rinv_r_sym. rewrite Rmult_1_r. apply (le_INR 1). apply lt_le_S. apply INR_lt; apply INR_fact_lt_0. apply INR_fact_neq_0. apply Rmult_le_reg_l with (INR (fact (S (N + n)))). apply INR_fact_lt_0. rewrite <- Rinv_r_sym. apply Rmult_le_reg_l with (INR (fact (S N))). apply INR_fact_lt_0. rewrite Rmult_1_r. rewrite (Rmult_comm (INR (fact (S N)))). rewrite Rmult_assoc. rewrite <- Rinv_l_sym. rewrite Rmult_1_r. apply le_INR. apply fact_le. apply le_n_S. apply le_plus_l. apply INR_fact_neq_0. apply INR_fact_neq_0. rewrite sum_cte. apply Rle_trans with (C ^ (4 * N) / INR (fact (pred N))). rewrite <- (Rmult_comm (C ^ (4 * N))). unfold Rdiv; rewrite Rmult_assoc; apply Rmult_le_compat_l. apply pow_le. left; apply Rlt_le_trans with 1. apply Rlt_0_1. unfold C; apply RmaxLess1. cut (S (pred N) = N). intro; rewrite H0. pattern N at 2; rewrite <- H0. do 2 rewrite fact_simpl. rewrite H0. repeat rewrite mult_INR. repeat rewrite Rinv_mult_distr. rewrite (Rmult_comm (/ INR (S N))). repeat rewrite <- Rmult_assoc. rewrite <- Rinv_r_sym. rewrite Rmult_1_l. pattern (/ INR (fact (pred N))) at 2; rewrite <- Rmult_1_r. rewrite Rmult_assoc. apply Rmult_le_compat_l. left; apply Rinv_0_lt_compat; apply INR_fact_lt_0. apply Rmult_le_reg_l with (INR (S N)). apply lt_INR_0; apply lt_O_Sn. rewrite <- Rmult_assoc; rewrite <- Rinv_r_sym. rewrite Rmult_1_r; rewrite Rmult_1_l. apply le_INR; apply le_n_Sn. apply not_O_INR; discriminate. apply not_O_INR. red; intro; rewrite H1 in H; elim (lt_irrefl _ H). apply not_O_INR. red; intro; rewrite H1 in H; elim (lt_irrefl _ H). ``` Proof State: ``` 5 subgoals x, y : R N : nat H : (0 < N)%nat C := Rmax 1 (Rmax (Rabs x) (Rabs y)) : R H0 : S (Init.Nat.pred N) = N ============================ INR (fact (Init.Nat.pred N)) <> 0 subgoal 2 is: INR (S N) <> 0 subgoal 3 is: INR N * INR (fact (Init.Nat.pred N)) <> 0 subgoal 4 is: S (Init.Nat.pred N) = N subgoal 5 is: C ^ (4 * N) / INR (fact (Init.Nat.pred N)) <= Majxy x y (Init.Nat.pred N) ``` Next Tactic: ```
apply <LOOKUP>INR_fact_neq_0 : forall n : nat, INR (fact n) <> 0</LOOKUP>. ```
{"package":"coq","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/theories\/Reals\/Cos_plus.v"}
Commit Diff: ``` diff --git a/Reachability.v b/Reachability.v index 5c47635..f125ad9 100644 --- a/Reachability.v +++ b/Reachability.v @@ -18,5 +18,20 @@ Import Eval.Evaluator. - -Inductive reachability : Store -> Loc -> Loc ->Prop := |rch_heap : forall l Οƒ, l < (dom Οƒ) -> (reachability Οƒ -l l) |rch_trans : forall l0 l1 l2 C Ο‰ Οƒ, (reachability Οƒ l0 l1) -> (getObj Οƒ l1 = Some -(C, Ο‰)) -> (exists f, (getVal Ο‰ f = Some l2)) -> (l2 < dom Οƒ) -> (reachability Οƒ l0 l2). -Notation "Οƒ ⊨ l1 ⇝ l2" := (reachability Οƒ l1 l2) (at level 80, l1 at level 80, l2 at level 80). +Reserved Notation "Οƒ ⊨ l1 ⇝ l2" (at level 80, l1 at level 80, l2 at level 80). +Inductive reachability : Store -> Loc +-> Loc ->Prop := | rch_heap: +forall l Οƒ, l < (dom +Οƒ) -> Οƒ ⊨ l ⇝ +l | rch_step: forall l0 l1 +C f Ο‰ Οƒ, l1 < +(dom Οƒ) -> getObj Οƒ l0 += Some (C, Ο‰) -> getVal +Ο‰ f = Some l1 -> +Οƒ ⊨ l0 ⇝ l1 +| rch_trans: forall l0 l1 +l2 Οƒ, Οƒ ⊨ l0 +⇝ l1 -> Οƒ ⊨ +l1 ⇝ l2 -> Οƒ +⊨ l0 ⇝ l2 where +"Οƒ ⊨ l1 ⇝ l2" +:= (reachability Οƒ l1 l2). +Hint Resolve rch_heap rch_step rch_trans: rch. +Hint Rewrite update_dom: rch. @@ -41,3 +56 @@ Proof. -intros Οƒ l1 l2 l3 H1 H2. -induction H2 => //. -apply (rch_trans l1 l2 l3 C Ο‰ Οƒ (IHreachability H1) H H0 H3). +eauto using rch_trans. @@ -44,0 +58 @@ Qed. + @@ -60 +74 @@ intros. -induction H; steps. +induction H; repeat steps || eapply_anywhere getObj_dom. @@ -64,11 +78,11 @@ Qed. -Lemma reachability_rev: forall Οƒ l l', Οƒ ⊨ l -⇝ l' -> (l = l' /\ l < -dom Οƒ) \/ (exists C Ο‰ f l0, getObj -Οƒ l = Some(C, Ο‰) /\ getVal Ο‰ f -= Some l0 /\ Οƒ ⊨ l0 ⇝ l'). -Proof. -intros. -induction H; steps. -+ right. repeat eexists; eauto using rch_heap. -+ right. repeat eexists; eauto using rch_heap, rch_trans. -Qed. + + + + + + + + + + + @@ -85,3 +98,0 @@ induction H2; eauto. -steps. -pose proof (H1 l1 l2 C Ο‰ f). -eapply H0; eauto. @@ -99,25 +110,4 @@ intros Οƒ x C Ο‰ l Hx Hobj. -apply reachability_rev_ind; intros. -+ left; rewrite_anywhere update_dom; eauto using rch_heap. -+ steps; eauto using reachability_trans. -+ destruct (PeanoNat.Nat.eq_dec l0 x) as [Heq | Hneq]; steps. -++ move: (H1) => H1cp. -rewrite_anywhere getObj_update1 => //. -invert_constructor_equalities; subst. -unfold getVal in *. -assert (f < length Ο‰ \/ f = length Ο‰) as [Hf | Hf]. { -apply Lt.le_lt_or_eq, Lt.lt_n_Sm_le. -pose proof (nth_error_Some (Ο‰ ++ [l]) f) as Hf. -rewrite app_length PeanoNat.Nat.add_1_r in Hf. -apply Hf. steps. -} -+++ rewrite_anywhere nth_error_app1; steps. -rewrite_anywhere update_dom. -left. eapply rch_trans; eauto using rch_heap. -+++ rewrite nth_error_app2 in H2; steps. -rewrite PeanoNat.Nat.sub_diag in H2. simpl in H2. -steps. rewrite_anywhere update_dom. -right; eauto -using rch_heap. -++ rewrite_anywhere getObj_update2; steps. -rewrite_anywhere update_dom. -left. eapply rch_trans; eauto using rch_heap, getObj_dom. +apply reachability_rev_ind; steps; eauto with rch; +rewrite_anywhere update_dom; eauto with rch. +eapply_anywhere getObj_update3; steps; eauto with rch. +eapply_anywhere getVal_add; steps; eauto with rch. @@ -127,2 +116,0 @@ Qed. - - @@ -138,10 +126,3 @@ Proof. ``` Proof State: ``` 1 subgoal Οƒ : list (ClN * list Value) C : ClN L : LocSet l1 : Loc l : nat H : S l <= dom Οƒ C0 : ClN Ο‰ : Env H1 : S l1 <= S (dom Οƒ) H2 : getObj (Οƒ ++ [(C, [])]) l1 = Some (C0, Ο‰) f : nat H0 : getVal Ο‰ f = Some l H4 : S l <= S (dom Οƒ) ============================ Οƒ ⊨ l1 ⇝ l ``` Ongoing Proof History: ``` Proof. intros. inversion H0 as [l1 [Hl1 Hrch]]. exists l1; split => //. apply reachable_path_reachability in Hrch as [Hrch | [p Hrch]]. + - steps; eauto using rch_heap. + steps; eauto with rch. + clear Hl1 H0. generalize dependent l. generalize dependent l1. induction p; intros. ++ steps; unfold reachable_one_step in *; steps. - unfold dom in H1. + repeat rewrite_anywhere dom_app. ? repeat rewrite_anywhere app_length ; steps. ? pose proof (getObj_last_empty _ _ _ _ _ _ _ H2 H0) as [Hobj Hl1]. ? eapply rch_trans; eauto using rch_trans, rch_heap. ``` Next Tactic: ```
eapply <LOOKUP>getObj_last_empty : forall (Οƒ : list (ClN * list Value)) (C C' : ClN) (Ο‰ : Env) (l f : nat) (v : Value), getObj (Οƒ ++ [(C, [])]) l = Some (C', Ο‰) -> getVal Ο‰ f = Some v -> getObj Οƒ l = Some (C', Ο‰) /\ l < dom Οƒ</LOOKUP> in H2; eauto; steps. ```
{"final_commit":"2dfd0b6c87b32ebd6bd1dd83e76e654e73dd3696","project":"celsius","repair_file":"\/data\/coq-pearls\/repairs\/celsius\/repair-celsius-a726b4d083864e7cb26d15bceeb49fbc418b2811-2dfd0b6c87b32ebd6bd1dd83e76e654e73dd3696-8_13_2-8_13_2-16.git.json","initial_commit":"a726b4d083864e7cb26d15bceeb49fbc418b2811","file":"Reachability.v"}
Ongoing Proof History: ``` Proof. intros. unfold decode_val in H. revert H; case_eq (getN 4 i b); intros. inv H. unfold getN in H. destruct l; inv H. destruct (proj_bytes (ZMap.get i b :: ZMap.get (i + 1) b :: ZMap.get (i + 1 + 1) b :: ZMap.get (i + 1 + 1 + 1) b :: nil)) eqn:PB. * simpl proj_bytes in PB. destruct (ZMap.get i b); inv PB. destruct (ZMap.get (i+1) b); inv H2. destruct (ZMap.get (i+1+1) b); inv H3. destruct (ZMap.get (i+1+1+1) b); inv H2. unfold decode_int in H1. assert (Int.repr (int_of_bytes (rev_if_be (i0 :: i1 :: i2 :: i3 :: nil))) = Int.repr 0) by (forget (Int.repr (int_of_bytes (rev_if_be (i0 :: i1 :: i2 :: i3 :: nil)))) as foo; inv H1; auto). clear H1. assert (forall b0 b1 b2 b3, Int.repr (int_of_bytes (b0::b1::b2::b3::nil)) = Int.repr 0 -> (Byte.unsigned b0=0/\Byte.unsigned b1=0/\Byte.unsigned b2=0/\Byte.unsigned b3=0)). clear. intros. simpl in H. pose proof (Byte.unsigned_range b0). pose proof (Byte.unsigned_range b1). pose proof (Byte.unsigned_range b2). pose proof (Byte.unsigned_range b3). replace (Byte.modulus) with 256 in * by reflexivity. pose proof (Int.unsigned_repr (Byte.unsigned b0 + (Byte.unsigned b1 + (Byte.unsigned b2 + (Byte.unsigned b3 + 0) * 256) * 256) * 256)). spec H4. clear H. rewrite max_unsigned_eq; lia. ``` Proof State: ``` 2 subgoals b0, b1, b2, b3 : byte H : Int.repr (Byte.unsigned b0 + (Byte.unsigned b1 + (Byte.unsigned b2 + (Byte.unsigned b3 + 0) * 256) * 256) * 256) = Int.repr 0 H0 : 0 <= Byte.unsigned b0 < 256 H1 : 0 <= Byte.unsigned b1 < 256 H2 : 0 <= Byte.unsigned b2 < 256 H3 : 0 <= Byte.unsigned b3 < 256 H4 : Int.unsigned (Int.repr (Byte.unsigned b0 + (Byte.unsigned b1 + (Byte.unsigned b2 + (Byte.unsigned b3 + 0) * 256) * 256) * 256)) = Byte.unsigned b0 + (Byte.unsigned b1 + (Byte.unsigned b2 + (Byte.unsigned b3 + 0) * 256) * 256) * 256 ============================ Byte.unsigned b0 = 0 /\ Byte.unsigned b1 = 0 /\ Byte.unsigned b2 = 0 /\ Byte.unsigned b3 = 0 subgoal 2 is: nth (Z.to_nat (j - i)) (Byte i0 :: Byte i1 :: Byte i2 :: Byte i3 :: nil) Undef = Byte Byte.zero ``` Next Tactic: ```
rewrite H in H4. ```
{"package":"coq-vst","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/VST\/veric\/initialize.v"}
Commit Diff: ``` diff --git a/theories/Basics/Basics.v b/theories/Basics/Basics.v index ff16faf..1f991e2 100644 --- a/theories/Basics/Basics.v +++ b/theories/Basics/Basics.v @@ -57,0 +58,2 @@ Definition state (s a : Type) := s -> prod s a. +Definition run_stateT {s m a} (x : stateT s m a) : s -> m (s * a)%type := x. + diff --git a/theories/Basics/HeterogeneousRelations.v b/theories/Basics/HeterogeneousRelations.v index 8894184..ad37cca 100644 --- a/theories/Basics/HeterogeneousRelations.v +++ b/theories/Basics/HeterogeneousRelations.v @@ -751 +751,21 @@ cbn in *. unfold diagonal_prop in *; tauto. -Qed. \ No newline at end of file +Qed. + + + + + +Definition option_rel {X : Type} (R : +relation X) : relation (option X) := +fun mx my => match mx,my with +| Some x, Some y => R +x y | None, None => True +| _, _ => False end. +Hint Unfold option_rel : core. + +Lemma option_rel_eq : forall {A : Type}, +eq_rel (@eq (option A)) (option_rel eq). +Proof. +intros ?; split; intros [] [] EQ; subst; try inv EQ; cbn; auto. +Qed. + +#[global] Hint Unfold option_rel : core. \ No newline at end of file diff --git a/theories/Core/ITreeDefinition.v b/theories/Core/ITreeDefinition.v index 3f88726..eff8f67 100644 --- a/theories/Core/ITreeDefinition.v +++ b/theories/Core/ITreeDefinition.v @@ -69,0 +70,2 @@ Arguments itreeF _ _ : clear implicits. +Create HintDb itree. + diff --git a/theories/Core/KTreeFacts.v b/theories/Core/KTreeFacts.v index a1c2431..9949acf 100644 --- a/theories/Core/KTreeFacts.v +++ b/theories/Core/KTreeFacts.v @@ -113 +113 @@ intros ? ? ?. red. -induction 1; auto. +induction 1; auto with itree. diff --git a/theories/Dijkstra/ITreeDijkstra.v b/theories/Dijkstra/ITreeDijkstra.v index 9529757..b25a16e 100644 --- a/theories/Dijkstra/ITreeDijkstra.v +++ b/theories/Dijkstra/ITreeDijkstra.v @@ -189 +189 @@ is_inf_cons (h : A) (t : stream A) : F t -> is_infF F (ConsF h t). -Hint Constructors is_infF : core. +Hint Constructors is_infF : itree. @@ -198 +198 @@ Proof. -red. intros. red in IN. red. induction IN; auto. +red. intros. red in IN. red. induction IN; auto with itree. @@ -217 +217 @@ s2 : stream A) : F s1 s2 -> bisimF F (ConsF h s1) (ConsF h s2). -Hint Constructors bisimF : core. +Hint Constructors bisimF : itree. @@ -226 +226 @@ Proof. -red. intros. red in IN. red. induction IN; auto. +red. intros. red in IN. red. induction IN; auto with itree. @@ -234 +234 @@ constructor; red. -- pcofix CIH. intros. pfold. red. destruct (observe_stream x); auto. +- pcofix CIH. intros. pfold. red. destruct (observe_stream x); auto with itree. @@ -237 +237 @@ pfold. red. -pinversion H0; subst; auto. +pinversion H0; subst; auto with itree. @@ -239 +239 @@ pinversion H0; subst; auto. -pinversion H0; pinversion H1; auto. +pinversion H0; pinversion H1; auto with itree. @@ -250 +250 @@ pfold. red. unfold app. pinversion H12. -- simpl. destruct s3. destruct s4. pinversion H34; simpl in *; subst; auto. +- simpl. destruct s3. destruct s4. pinversion H34; simpl in *; subst; auto with itree. @@ -282 +282 @@ stream' A -> Prop := | forall_nil : forall_streamF P F NilF | forall_cons (h : A -Hint Constructors forall_streamF : core. +Hint Constructors forall_streamF : itree. @@ -289 +289 @@ Proof. -red. intros. red. red in IN. destruct IN; auto. +red. intros. red. red in IN. destruct IN; auto with itree. @@ -301 +301 @@ F (observe_stream t) -> inf_manyF P F (ConsF h t) | cons_found (h : A) (t -Hint Constructors inf_manyF : core. +Hint Constructors inf_manyF : itree. @@ -308 +308 @@ Proof. -red. intros. red in IN. red. induction IN; auto. ``` Proof State: ``` 1 subgoal E : Type -> Type A : Type B : Type R : A -> B -> Prop a : A u : itree E A FIN : a ∈ u IHFIN : forall u0 : itree E B, eutt R u u0 -> exists b : B, b ∈ u0 /\ R a b u2 : itree E B i : itree' E A Heqi : i = TauF u ou2 : itree' E B Heqou2 : ou2 = observe u2 EQ : eqitF R true true id (upaco2 (eqit_ R true true id) bot2) i ou2 ============================ exists b : B, b ∈ u2 /\ R a b ``` Ongoing Proof History: ``` Proof. intros * EQ FIN; revert u EQ. induction FIN; intros u2 EQ. - punfold EQ. red in EQ; rewrite H in EQ; clear H t. remember (RetF a); genobs u2 ou. hinduction EQ before R; intros; try now discriminate. + + - inv Heqi; eauto. + inv Heqi; eauto with itree. + + - edestruct IHEQ as (b & IN & HR); eauto. + edestruct IHEQ as (b & IN & HR); eauto with itree. - punfold EQ; red in EQ; rewrite H in EQ; clear H t. remember (TauF u); genobs u2 ou2. ? hinduction EQ before R; intros; try discriminate; pclearbot; inv Heqi; eauto. ? edestruct IHFIN as (? & ? & ?); eauto. ? edestruct IHEQ as (? & ? & ?); eauto. ``` Next Tactic: ```
hinduction EQ before <LOOKUP>R : A -> B -> Prop</LOOKUP>; intros; try discriminate; pclearbot; inv Heqi. ```
{"final_commit":"8fcf6f5f81ec9289d56e777b3885e715b3328486","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-1158ff1cbb628aeaa69973bf098058744d458c36-8fcf6f5f81ec9289d56e777b3885e715b3328486-8_10_2-8_12_2-92.git.json","initial_commit":"1158ff1cbb628aeaa69973bf098058744d458c36","file":"theories\/Props\/Leaf.v"}
Ongoing Proof History: ``` Proof. intros until m0. intros NR H8 ? ?. destruct (eq_dec loc (nextblock m0, 0)). * subst loc. unfold initial_core. unfold inflate_initial_mem. rewrite !resource_at_make_rmap. unfold inflate_initial_mem'. rewrite !resource_at_make_rmap. rewrite nextblock_access_empty by (apply Pos2Nat.inj_ge; lia). split; intros _; [ |apply NO_identity]. unfold Genv.alloc_global in H. destruct (alloc m0 0 1) eqn:?. assert (H9: 0 <= 0 < 1) by (clear; lia). assert (H6 := alloc_result _ _ _ _ _ Heqp); subst b. assert (H1 := perm_drop_1 _ _ _ _ _ _ H 0 Cur H9). destruct (perm_mem_access _ _ _ _ H1) as [p [H4 H5]]. assert (H2 := perm_drop_2 _ _ _ _ _ _ H 0 Cur p H9). rewrite H5. unfold perm in *. unfold access_at in H5. simpl in H5. destruct ((mem_access m) !! (nextblock m0) 0 Cur); inv H5. spec H2; [constructor | ]. destruct p; try solve [inv H2]. unfold initial_core'. simpl. rewrite Genv.find_invert_symbol with (id:=i) by auto. destruct (list_in_map_inv _ _ _ H0) as [[i' fd] [H10 H11]]; simpl in H10, H11. subst i'. rewrite find_id_i with (fs:=fd); auto. destruct fd. apply PURE_identity. apply in_app. right; auto. * clear NR. unfold initial_core. unfold inflate_initial_mem. rewrite !resource_at_make_rmap. unfold inflate_initial_mem'. rewrite !resource_at_make_rmap. pose proof (Pos.ltb_spec (fst loc) (nextblock m0)). destruct ((fst loc <? nextblock m0)%positive); inv H1. destruct (alloc_global_old _ _ _ _ H loc H2) as [? ?]. rewrite H3. rewrite H1; split; intro; auto. destruct loc as [b ofs]. simpl fst in *; simpl snd in *. rewrite (nextblock_access_empty m0) by (apply Pos.le_ge; auto). split; intros _; [ |apply NO_identity]. replace (access_at m (b,ofs) Cur) with (@None permission). apply NO_identity. symmetry. unfold Genv.alloc_global in H. destruct (alloc m0 0 1) eqn:?. assert (H6 := alloc_result _ _ _ _ _ Heqp); subst b0. clear - n0 H2 Heqp H. assert (b <> nextblock m0 \/ ofs <> 0). { ``` Proof State: ``` 1 subgoal m : Memory.mem b : block ofs : Z m0, m1 : mem' H : drop_perm m1 (nextblock m0) 0 1 Nonempty = Some m Heqp : alloc m0 0 1 = (m1, nextblock m0) n0 : (b, ofs) <> (nextblock m0, 0) H2 : (nextblock m0 <= b)%positive ============================ b <> nextblock m0 \/ ofs <> 0 ``` Next Tactic: ```
destruct (<LOOKUP>eq_block : forall x y : positive, {x = y} + {x <> y}</LOOKUP> b (<LOOKUP>nextblock : mem' -> block</LOOKUP> m0)). ```
{"package":"coq-vst","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/VST\/veric\/initialize.v"}
Proof State: ``` 1 subgoal p : positive x : nat H : p = Pos.of_succ_nat x ============================ (- Pos.to_nat p)%Z = Z.neg p ``` Ongoing Proof History: ``` Proof. intro p. elim (p_is_some_anti_convert p). intros x H. ``` Next Tactic: ```
rewrite H. ```
{"package":"coq-corn","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/CoRN\/logic\/CornBasics.v"}
Ongoing Proof History: ``` Proof. intros. punfold H. unfold eqit_ in H. cbn in *. remember (ITree.bind ma kab) as tl. assert (tl β‰… (ITree.bind ma kab)) by (subst; reflexivity). clear Heqtl. genobs tl tl'. remember (VisF e kxc) as tr. revert ma kab tl Heqtl' H0 kxc Heqtr. induction H. - intros. inv Heqtr. - intros. inv Heqtr. - intros. rewrite unfold_bind in H0. destruct (observe ma) eqn: Hobma; cbn in *; rewrite itree_eta in H0; rewrite <- Heqtl' in H0. + right. exists r. split. rewrite itree_eta. rewrite Hobma. reflexivity. rewrite <- H0. apply eqit_Vis. intros. destruct (REL u0); auto. inv H. + symmetry in H0. apply eqitree_inv_tau_vis in H0. contradiction. + setoid_rewrite itree_eta at 1. rewrite Hobma. clear Hobma Heqtl'. - red in H0. + inv Heqtr; auto_inj_pair2; subst. - apply eqit_inv_vis_weak in H0. + apply eq_itree_inv_vis in H0. ? destruct H0 as [<- [<- H0]]; cbn in H0. ? inv_Vis. ? left. ``` Proof State: ``` 1 subgoal A : Type B : Type C : Type E : Type -> Type X : Type RR : B -> C -> Prop b1, b2 : bool e : E X k1 : X -> itree E B kxc : X -> itree E C REL : forall v : X, id (upaco2 (fun (sim : itree E B -> itree E C -> Prop) (t1 : itree E B) (t2 : itree E C) => eqitF RR b1 b2 id sim (observe t1) (observe t2)) bot2) (k1 v) (kxc v) ma : itree E A kab : A -> itree E B tl : itree E B X0 : Type e1 : E X0 k : X0 -> itree E A H0 : exists k' : X0 -> itree E B, observe (Vis e k1) = VisF e1 k' /\ (forall u : X0, k' u β‰… x <- k u;; kab x) ============================ (exists kxa : X -> itree E A, eqit eq b1 b2 (Vis e1 k) (Vis e kxa) /\ (forall x : X, eqit RR b1 b2 (x <- kxa x;; kab x) (kxc x))) \/ (exists a : A, eqit eq b1 b2 ma (Ret a) /\ eqit RR b1 b2 (kab a) (Vis e kxc)) ``` Commit Diff: ``` diff --git a/theories/Core/KTreeFacts.v b/theories/Core/KTreeFacts.v index 32f56a6..b911a90 100644 --- a/theories/Core/KTreeFacts.v +++ b/theories/Core/KTreeFacts.v @@ -6 +6,2 @@ Require Import -Classes.Morphisms Setoids.Setoid +Program Classes.Morphisms +Setoids.Setoid @@ -23,2 +24 @@ Eq.Eq -Eq.UpToTaus -Eq.Paco2. +Eq.UpToTaus. @@ -68 +68 @@ Proof. -ginit. pcofix CIH. intros. +ginit. gcofix CIH. intros. @@ -205,2 +205,2 @@ Proof. -revert f g a0. -ginit. pcofix CIH. intros. +revert A B C f g a0. +ginit. gcofix CIH. intros. @@ -268 +268 @@ revert a0. -ginit. pcofix CIH. intros. +ginit. gcofix CIH. intros. @@ -277 +277 @@ revert a. -pcofix CIH'. intros. +gcofix CIH'. intros. @@ -337 +337,2 @@ etau. -specialize (CIHL xa). cbn in CIHL. +specialize (CIH xa). +cbn in CIH. diff --git a/theories/Eq/Eq.v b/theories/Eq/Eq.v index 42a3038..1c90dcb 100644 --- a/theories/Eq/Eq.v +++ b/theories/Eq/Eq.v @@ -29,2 +29 @@ Basics.Basics Basics.HeterogeneousRelations -Core.ITreeDefinition -Eq.Paco2. +Core.ITreeDefinition. @@ -167,54 +165,0 @@ Hint Unfold id: core. -Lemma eqitF_VisF_inv_r {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 vclo sim} -t1 X2 (e2 : E X2) (k2 : X2 -> _) : eqitF RR b1 -b2 vclo sim t1 (VisF e2 k2) -> (exists k1, t1 = VisF e2 k1 -/\ forall v, vclo sim (k1 v) (k2 v)) \/ (b1 /\ exists t1', t1 -= TauF t1' /\ eqitF RR b1 b2 vclo sim (observe t1') (VisF e2 k2)). -Proof. -refine (fun H => match H -in eqitF _ _ _ _ -_ _ t2 return match t2 -return Prop with | VisF e2 -k2 => _ | _ -=> True end with | -EqVis _ _ _ _ -_ _ _ _ _ -=> _ | _ => -_ end); try exact I. -- left; eauto. -- destruct i0; eauto. -Qed. - -Lemma eqitF_VisF_inv {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 vclo sim} X1 -(e1 : E X1) (k1 : X1 -> _) X2 (e2 : E X2) (k2 : X2 --> _) : eqitF RR b1 b2 vclo sim (VisF e1 k1) (VisF e2 k2) -> exists -p : X1 = X2, eqeq E p e1 e2 /\ pweqeq (vclo sim) p k1 k2. -Proof. -refine (fun H => match H in -eqitF _ _ _ _ _ t1 -t2 return match t1, t2 return Prop -with | VisF e1 k1, VisF e2 -k2 => _ | _, _ => -True end with | EqVis _ -_ _ _ _ _ _ -_ _ => _ | _ -=> _ end); try exact I. -- exists eq_refl; cbn; eauto. -- destruct i; exact I. -Qed. - -Lemma eqitF_VisF_inv_strong {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 -vclo sim} X (e : E X) (k1 : X -> _) (k2 ``` Next Tactic: ```
destruct H0 as (? & ? & ?). ```
{"final_commit":"f4bacabbc5b1556a723e3cb4efb1cd614c156d8f","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-f3853150994e962978fa4cf0ed18dcb8c42e3262-f4bacabbc5b1556a723e3cb4efb1cd614c156d8f-8_11_2-8_10_2-13.git.json","initial_commit":"f3853150994e962978fa4cf0ed18dcb8c42e3262","file":"theories\/Eq\/Eq.v"}
Ongoing Proof History: ``` Proof. split; try (split; try apply _). intros ?? E1 ?? E2. now rewrite !le_correct, E1, E2. ``` Proof State: ``` 5 subgoals L : Type Ae : Equiv L Ameet : Meet L H : MeetSemiLattice L H0 : Le L le_correct : βˆ€ x y : L, x ≀ y ↔ x βŠ“ y = x ============================ PreOrder le subgoal 2 is: AntiSymmetric le subgoal 3 is: βˆ€ x y : L, x βŠ“ y ≀ x subgoal 4 is: βˆ€ x y : L, x βŠ“ y ≀ y subgoal 5 is: βˆ€ x y z : L, z ≀ x β†’ z ≀ y β†’ z ≀ x βŠ“ y ``` Next Tactic: ```
split. ```
{"package":"coq-math-classes","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/MathClasses\/orders\/lattices.v"}
Commit Diff: ``` diff --git a/theories/Core/KTreeFacts.v b/theories/Core/KTreeFacts.v index b911a90..32f56a6 100644 --- a/theories/Core/KTreeFacts.v +++ b/theories/Core/KTreeFacts.v @@ -6,2 +6 @@ Require Import -Program Classes.Morphisms -Setoids.Setoid +Classes.Morphisms Setoids.Setoid @@ -24 +23,2 @@ Eq.Eq -Eq.UpToTaus. +Eq.UpToTaus +Eq.Paco2. @@ -68 +68 @@ Proof. -ginit. gcofix CIH. intros. +ginit. pcofix CIH. intros. @@ -205,2 +205,2 @@ Proof. -revert A B C f g a0. -ginit. gcofix CIH. intros. +revert f g a0. +ginit. pcofix CIH. intros. @@ -268 +268 @@ revert a0. -ginit. gcofix CIH. intros. +ginit. pcofix CIH. intros. @@ -277 +277 @@ revert a. -gcofix CIH'. intros. +pcofix CIH'. intros. @@ -337,2 +337 @@ etau. -specialize (CIH xa). -cbn in CIH. +specialize (CIHL xa). cbn in CIHL. diff --git a/theories/Eq/Eq.v b/theories/Eq/Eq.v index 21ac7e0..4f26bd0 100644 --- a/theories/Eq/Eq.v +++ b/theories/Eq/Eq.v @@ -29 +29,2 @@ Basics.Basics Basics.HeterogeneousRelations -Core.ITreeDefinition. +Core.ITreeDefinition +Eq.Paco2. @@ -165,0 +167,54 @@ Hint Unfold id: core. +Lemma eqitF_VisF_inv_r {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 vclo sim} +t1 X2 (e2 : E X2) (k2 : X2 -> _) : eqitF RR b1 +b2 vclo sim t1 (VisF e2 k2) -> (exists k1, t1 = VisF e2 k1 +/\ forall v, vclo sim (k1 v) (k2 v)) \/ (b1 /\ exists t1', t1 += TauF t1' /\ eqitF RR b1 b2 vclo sim (observe t1') (VisF e2 k2)). +Proof. +refine (fun H => match H +in eqitF _ _ _ _ +_ _ t2 return match t2 +return Prop with | VisF e2 +k2 => _ | _ +=> True end with | +EqVis _ _ _ _ +_ _ _ _ _ +=> _ | _ => +_ end); try exact I. +- left; eauto. +- destruct i0; eauto. +Qed. + +Lemma eqitF_VisF_inv {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 vclo sim} X1 +(e1 : E X1) (k1 : X1 -> _) X2 (e2 : E X2) (k2 : X2 +-> _) : eqitF RR b1 b2 vclo sim (VisF e1 k1) (VisF e2 k2) -> exists +p : X1 = X2, eqeq E p e1 e2 /\ pweqeq (vclo sim) p k1 k2. +Proof. +refine (fun H => match H in ``` Ongoing Proof History: ``` Proof. econstructor. pmonauto. intros. - dependent destruction PR. + destruct PR. punfold EQVl. punfold EQVr. unfold_eqit. hinduction REL before r; intros; clear t1' t2'. - remember (RetF r1) as x. hinduction EQVl before r; intros; subst; try inv Heqx; eauto. remember (RetF r3) as y. hinduction EQVr before r; intros; subst; try inv Heqy; eauto. - remember (TauF m1) as x. hinduction EQVl before r; intros; subst; try inv Heqx; try inv CHECK; eauto. remember (TauF m3) as y. hinduction EQVr before r; intros; subst; try inv Heqy; try inv CHECK; eauto. pclearbot. econstructor. gclo. - econstructor; cycle -1; eauto with paco. + econstructor; eauto with paco. - remember (VisF e k1) as x. - hinduction EQVl before r; intros; subst; try dependent destruction Heqx; try inv CHECK; eauto. + hinduction EQVl before r; intros; try discriminate Heqx; eauto; inv_Vis. ? remember (VisF e0 k3) as y. ? hinduction EQVr before r; intros; subst; try dependent destruction Heqy; try inv CHECK; eauto. ? econstructor. ``` Proof State: ``` 1 subgoal E : Type -> Type R1 : Type R2 : Type RR : R1 -> R2 -> Prop b1, b2 : bool vclo : rel2 (itree E R1) (fun _ : itree E R1 => itree E R2) -> rel2 (itree E R1) (fun _ : itree E R1 => itree E R2) MON : monotone2 vclo CMP : forall (x0 : rel2 (itree E R1) (fun _ : itree E R1 => itree E R2)) (x1 : itree E R1) (x2 : itree E R2), (eqitC b1 b2 ∘ vclo) x0 x1 x2 -> (vclo ∘ eqitC b1 b2) x0 x1 x2 r : rel2 (itree E R1) (fun _ : itree E R1 => itree E R2) t1 : itree E R1 RR1 : R1 -> R1 -> Prop u : Type e : E u k1, k2 : u -> itree E R1 REL : forall v : u, id (upaco2 (eqit_ RR1 b1 false id) bot2) (k1 v) (k2 v) k3 : u -> itree E R2 REL0 : forall v : u, vclo r (k2 v) (k3 v) t2 : itree E R2 RR2 : R2 -> R2 -> Prop EQVr : eqitF RR2 b2 false id (upaco2 (eqit_ RR2 b2 false id) bot2) (observe t2) (VisF e k3) LERR1 : forall (x x' : R1) (y : R2), RR1 x x' -> RR x' y -> RR x y LERR2 : forall (x : R1) (y y' : R2), RR2 y y' -> RR x y' -> RR x y ============================ eqitF RR b1 b2 vclo (gupaco2 (eqit_ RR b1 b2 vclo) (eqitC b1 b2) r) (VisF e k1) (observe t2) ``` Next Tactic: ```
remember (<LOOKUP>VisF : forall (E : Type -> Type) (R itree X : Type), E X -> (X -> itree) -> itreeF E R itree</LOOKUP> e k3) as y. ```
{"final_commit":"f3853150994e962978fa4cf0ed18dcb8c42e3262","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-1fcd2d39e27da8068431211b7952365e163782cc-f3853150994e962978fa4cf0ed18dcb8c42e3262-8_10_2-8_11_2-57.git.json","initial_commit":"1fcd2d39e27da8068431211b7952365e163782cc","file":"theories\/Eq\/Eq.v"}
Commit Diff: ``` diff --git a/ListAux.v b/ListAux.v index 986e88b..769776a 100644 --- a/ListAux.v +++ b/ListAux.v @@ -131,6 +130,0 @@ Qed. -Theorem length_app: forall (l1 l2 : list A), length -(l1 ++ l2) = length l1 + length l2. -Proof. -apply app_length. -Qed. - @@ -278 +272 @@ intros A l1 l2; elim l1; simpl; auto. -intros a l H; rewrite length_app, length_map, H; auto. +intros a l H; rewrite app_length, length_map, H; auto. diff --git a/ListOp.v b/ListOp.v index e1936ca..7a13f04 100644 --- a/ListOp.v +++ b/ListOp.v @@ -145 +145 @@ intros k Rec i j s H; -rewrite length_app, length_take1; auto with arith. +rewrite app_length, length_take1; auto with arith. diff --git a/Sudoku.v b/Sudoku.v index 5083f1b..9b556eb 100644 --- a/Sudoku.v +++ b/Sudoku.v @@ -675 +675 @@ assert (F1: div y w < h). -apply div_lt; rewrite mult_comm; auto. +apply div_lt; rewrite mult_comm... @@ -677,6 +677,2 @@ apply div_lt; rewrite mult_comm; auto. -repeat (rewrite (fun x => -mult_comm x h)); rewrite mod_mult_comp... -rewrite div_mult_comp; auto. -rewrite (mod_small (div y w) h); auto. -rewrite (div_is_0 (div y w) h); auto. -rewrite plus_0_r. +repeat (rewrite (fun x => mult_comm x h)); rewrite mod_mult_comp... +rewrite div_mult_comp, (mod_small (div y w) h), (div_is_0 (div y w) h), plus_0_r... @@ -703,3 +699,3 @@ cut (w <= size). -intros U3 n; generalize h; elim n; simpl; -auto with arith; clear n H1 H2 U1. -+ intros h1; case h1; simpl; auto. +intros U3 n; generalize h; elim n; simpl... +clear n H1 H2 U1. ++ intros h1; case h1; simpl... @@ -713,3 +709,2 @@ apply sym_equal; apply take_nth... -** apply le_trans with (1 := H1)... -apply le_trans with (2 := U3). -apply lt_le_weak; apply mod_lt... +** pose proof (mod_lt y w). +lia. @@ -726 +721 @@ apply mod_lt... -case (le_or_lt (length l) w); intros H1. +case (le_or_lt (length l) w); intros H3. @@ -728,2 +723 @@ case (le_or_lt (length l) w); intros H1. -** rewrite length_take_small... -rewrite jump_too_far. +** rewrite length_take_small, jump_too_far... @@ -732,2 +726,2 @@ repeat rewrite nth_default... -apply le_trans with (1 := H1)... -*** apply le_trans with (1 := H1)... +apply le_trans with (1 := H3)... +*** apply le_trans with (1 := H3)... @@ -738,2 +732 @@ repeat rewrite <- plus_assoc; rewrite minus_plus... -rewrite jump_nth; rewrite jump_add. -rewrite <- jump_nth... +rewrite jump_nth, jump_add, <- jump_nth... @@ -750 +743 @@ generalize (w_pos _ H); intros U2. -rewrite length_take_and_jump; auto. +rewrite length_take_and_jump... @@ -767,2 +760 @@ rewrite (plus_assoc w). -pattern w at 1; rewrite <- mult_1_r; rewrite <- mult_plus_distr_l. -rewrite le_plus_minus_r... +pattern w at 1; rewrite <- mult_1_r, <- mult_plus_distr_l, le_plus_minus_r... @@ -854,2 +846,2 @@ l2 l3 -> lit_test l1 l3 = lit_test l1 l2. -Proof. -intros l1 l2 l3; case l1; case l2; case l3; simpl; auto. +Proof with auto. +intros l1 l2 l3; case l1; case l2; case l3; simpl... @@ -859 +851 @@ case_eq (pos_test p2 p3); intros H1. -rewrite (pos_test_trans p1 p2 p3); rewrite H; auto. +rewrite (pos_test_trans p1 p2 p3); rewrite H... @@ -861,2 +853,2 @@ assert (p2 = p3); subst. -apply pos_test_exact with (1 := H1); auto. -rewrite H; auto. ``` Proof State: ``` 2 goals h, w : nat s : list nat H : length s = size * size H1 : empty s z1, x1, y1 : nat Hl : In (L (Pos x1 y1) z1) (gen_row x1 z1) n1 : nat V1 : In x1 indexes V2 : In z1 ref_list Hy : y1 < size ============================ valid_lit (L (Pos x1 y1) z1) s goal 2 is: In (n, c) (fold_right (fun (iz : nat * nat) (l0 : clauses) => clause_insert (gen_column (fst iz) (snd iz)) l0) (fold_right (fun (iz : nat * nat) (l0 : clauses) => clause_insert (gen_rect (fst iz) (snd iz)) l0) all_cell cross1) cross1) -> valid_lit l s ``` Ongoing Proof History: ``` - Proof. + Proof with auto with arith. unfold init_c; intros s H H1 n c Hn l Hl. case (fold_clause_insert1 _ (fun iz => gen_row (fst iz) (snd iz))) with (1 := Hn); clear Hn. intros ((x,z), (n1, (HH1, HH2))); simpl in HH2. injection HH2; intros; subst; clear HH2. case (cross1_correct (x, z)); intros tmp _; case (tmp HH1); clear tmp HH1. intros x1 (z1, (V1, (V2, V3))); injection V3; intros; subst; clear V3. case (gen_row_correct l x1 z1). intros tmp _; case (tmp Hl); clear tmp. intros y1 (Hl1, Hy); subst. ? repeat (split; auto); case (in_indexes x1); auto. ? intros Hn; case (fold_clause_insert1 _ (fun iz => gen_column (fst iz) (snd iz))) with (1 := Hn); clear Hn. ? intros ((y,z), (n1, (HH1, HH2))); simpl in HH2. ``` Next Tactic: ```
repeat (split; auto); case (<LOOKUP>in_indexes : forall i : nat, In i indexes <-> i < size</LOOKUP> x1)... ```
{"final_commit":"5337edcaf31b9f036a0a6651b2f733d3068b8f8f","project":"sudoku","repair_file":"\/data\/coq-pearls\/repairs\/sudoku\/repair-sudoku-427448011e3341d35aa5b9e00f675f6582fcd477-5337edcaf31b9f036a0a6651b2f733d3068b8f8f-8_15_2-8_15_2-36.git.json","initial_commit":"427448011e3341d35aa5b9e00f675f6582fcd477","file":"Sudoku.v"}
Ongoing Proof History: ``` Proof. cut (forall (x1 x2 : Q2), msp_eq x1 x2 -> forall x3 x4 : Q2, msp_eq x3 x4 -> forall y, InFinEnumC y (CentersOfPixels bm x1 x3) -> InFinEnumC y (CentersOfPixels bm x2 x4)). { intro L. split. discriminate. split. intros q H1 abs. contradiction (abs q). split. exact (L x y H x0 y0 H0 q H1). reflexivity. intros q H1 abs. contradiction (abs q). split. symmetry in H, H0. exact (L y x H y0 x0 H0 q H1). reflexivity. } intros [x1l x1r] x2 Hx [y1l y1r] y2 Hy z Hz. destruct (@InStrengthen _ _ Hz) as [[ax ay] [Ha0 Ha1]]. destruct (InterpRaster_correct2 _ _ _ _ _ _ _ bmWf Ha0) as [[bx by'] [Hb0 [Hb1 Hb2]]]. rewrite Hb1 in Ha1. rewrite Hb2 in Ha1. unfold snd, fst in Ha1. destruct x2 as [x2l x2r]. destruct y2 as [y2l y2r]. assert (L0:msp_eq z ((x2l + (y2l - x2l) * (2 * Z.of_nat by' + 1 # 1) / (2 * Zpos n # 1)), (x2r + (y2r - x2r) * (2 * Z.of_nat bx + 1 # 1) / (2 * Zpos m # 1)))). transitivity ((x1l + (y1l - x1l) * (2 * Z.of_nat by' + 1 # 1) / (2 * Zpos n # 1)), (x1r + (y1r - x1r) * (2 * Z.of_nat bx + 1 # 1) / (2 * Zpos m # 1))). auto. clear - Hx Hy. destruct Hx as [Hx1 Hx2]. destruct Hy as [Hy1 Hy2]. split; unfold fst,snd in *. apply Qball_0 in Hx1. apply Qball_0 in Hy1. rewrite -> Hx1, Hy1. reflexivity. apply Qball_0 in Hx2. apply Qball_0 in Hy2. rewrite -> Hx2, Hy2. reflexivity. ``` Proof State: ``` 1 subgoal n, m : positive bm : raster n m bmWf : raster_well_formed bm x1l, x1r, x2l, x2r : Q_as_MetricSpace Hx : msp_eq (x1l, x1r) (x2l, x2r) y1l, y1r, y2l, y2r : Q_as_MetricSpace Hy : msp_eq (y1l, y1r) (y2l, y2r) z : Q2 Hz : InFinEnumC z (CentersOfPixels bm (x1l, x1r) (y1l, y1r)) ax, ay : Q_as_MetricSpace Ha0 : In (ax, ay) (CentersOfPixels bm (x1l, x1r) (y1l, y1r)) bx, by' : nat Ha1 : msp_eq z (x1l + (y1l - x1l) * (2 * Z.of_nat by' + 1 # 1) / (2 * Z.pos n # 1), x1r + (y1r - x1r) * (2 * Z.of_nat bx + 1 # 1) / (2 * Z.pos m # 1)) Hb0 : Is_true (RasterIndex bm (fst (bx, by')) (snd (bx, by'))) Hb1 : ax = x1l + (y1l - x1l) * (2 * Z.of_nat (snd (bx, by')) + 1 # 1) / (2 * Z.pos n # 1) Hb2 : ay = x1r + (y1r - x1r) * (2 * Z.of_nat (fst (bx, by')) + 1 # 1) / (2 * Z.pos m # 1) L0 : msp_eq z (x2l + (y2l - x2l) * (2 * Z.of_nat by' + 1 # 1) / (2 * Z.pos n # 1), x2r + (y2r - x2r) * (2 * Z.of_nat bx + 1 # 1) / (2 * Z.pos m # 1)) ============================ InFinEnumC z (CentersOfPixels bm (x2l, x2r) (y2l, y2r)) ``` Next Tactic: ```
unfold InFinEnumC. ```
{"package":"coq-corn","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/CoRN\/reals\/fast\/RasterQ.v"}
Ongoing Proof History: ``` Proof. repeat red. intros until T. ginit. gcofix CIH. intros. rewrite !unfold_interp. punfold H1. red in H1. induction H1; intros; subst; pclearbot; simpl. - gstep. constructor. eauto. - gstep. constructor. eauto with paco. - guclo eqit_clo_bind; econstructor; [apply H|]. intros; subst. gstep; constructor; eauto with paco. - - rewrite tau_eutt, unfold_interp. + rewrite tau_euttge, unfold_interp. auto. - ? rewrite tau_eutt, unfold_interp. ? auto. ? Qed. ``` Proof State: ``` 1 subgoal F : Type -> Type T : Type E : Type -> Type x, y : Handler E F H : eq2 x y r : itree F T -> itree F T -> Prop CIH : forall a1 a2 : itree E T, a1 β‰ˆ a2 -> r (interp x a1) (interp y a2) a1, a2 : itree E T ot1 : itree' E T t2 : itree E T CHECK : true H1 : eqitF eq true true id (upaco2 (eqit_ eq true true id) bot2) ot1 (observe t2) IHeqitF : gpaco2 (eqit_ eq true true id) (eqitC eq true true) bot2 r (_interp x ot1) (_interp y (observe t2)) ============================ gpaco2 (eqit_ eq true true id) (eqitC eq true true) bot2 r (_interp x ot1) (Tau (interp y t2)) ``` Commit Diff: ``` diff --git a/theories/Core/ITreeDefinition.v b/theories/Core/ITreeDefinition.v index 57c2013..9b33167 100644 --- a/theories/Core/ITreeDefinition.v +++ b/theories/Core/ITreeDefinition.v @@ -242 +242 @@ Notation "t1 >>= k2" := (ITree.bind t1 k2) -(at level 50, left associativity) : itree_scope. +(at level 58, left associativity) : itree_scope. diff --git a/theories/Core/KTree.v b/theories/Core/KTree.v index 7740c5f..49acfb6 100644 --- a/theories/Core/KTree.v +++ b/theories/Core/KTree.v @@ -69,4 +69 @@ Local Notation ktree := (ktree E). -End Operations. - -Notation iter := (@iter _ (ktree _) sum _ _ _). -Notation loop := (@loop _ (ktree _) sum _ _ _ _ _ _ _ _ _). \ No newline at end of file +End Operations. \ No newline at end of file diff --git a/theories/Core/KTreeFacts.v b/theories/Core/KTreeFacts.v index 37d0ea8..1c27491 100644 --- a/theories/Core/KTreeFacts.v +++ b/theories/Core/KTreeFacts.v @@ -47 +47 @@ intros [a | b] _ []. -- rewrite bind_ret_l, tau_eutt. +- rewrite bind_ret_l, tau_euttge. @@ -129,4 +129,4 @@ Qed. -Definition eutt_iter_gen {F A B R S} : @Proper -((A -> itree F (A + B)) -> A --> itree F B) ((R ==> eutt (sum_rel -R S)) ==> R ==> (eutt S)) KTree.iter. +Definition eutt_iter_gen {F A B R S} : @Proper ((A +-> itree F (A + B)) -> A -> itree +F B) ((R ==> eutt (sum_rel R S)) ==> +R ==> (eutt S)) (iter (C := ktree F)). @@ -185,18 +185,18 @@ Qed. -Lemma iter_dinatural_ktree {E A B C} -(f : ktree E A (C -+ B)) (g : ktree E -C (A + B)) (a0 : -A) : iter (fun a => -cb <- f a ;; match -cb with | inl c => -Tau (g c) | inr b -=> Ret (inr b) end) a0 -β‰… cb <- f a0 ;; -match cb with | inl c0 -=> Tau (iter (fun c => -ab <- g c ;; match -ab with | inl a -=> Tau (f a) | -inr b => Ret (inr -b) end) c0) | inr -b => Ret b end. +Lemma iter_dinatural_ktree {E A B C} (f +: ktree E A (C + B)) +(g : ktree E C (A + +B)) (a0 : A) : iter +(C := ktree E) (fun a +=> cb <- f a ;; +match cb with | inl c +=> Tau (g c) | inr +b => Ret (inr b) end) +a0 β‰… cb <- f a0 +;; match cb with | inl +c0 => Tau (iter (C := +ktree E) (fun c => ab +<- g c ;; match ab +with | inl a => Tau +(f a) | inr b => +Ret (inr b) end) c0) | +inr b => Ret b end. @@ -230,6 +230,6 @@ cbn. -transitivity (iter (fun t => -x <- f t;; match -x with | inl a1 -=> Tau (g a1) | -inr b0 => Ret -(inr b0) end) a0). +transitivity (iter (C := ktree E) +(fun t => x <- f +t;; match x with | +inl a1 => Tau (g +a1) | inr b0 => +Ret (inr b0) end) a0). @@ -256,9 +256,9 @@ Qed. -Lemma iter_codiagonal_ktree {E A B} (f : -ktree E A (A + (A + -B))) (a0 : A) : iter (iter -f) a0 β‰… iter (fun a => -r <- f a ;; match r -with | inl a' => Ret (inl -a') | inr (inl a') => Ret -(inl a') | inr (inr b) -=> Ret (inr b) end) a0. +Lemma iter_codiagonal_ktree {E A B} (f : ktree +E A (A + (A + B))) (a0 +: A) : iter (iter f) a0 +β‰… iter (C := ktree _) (fun +a => r <- f a ;; +match r with | inl a' => +Ret (inl a') | inr (inl a') ``` Next Tactic: ```
rewrite <LOOKUP>tau_euttge : forall (E : Type -> Type) (R : Type) (t : itree E R), Tau t ≳ t</LOOKUP>, <LOOKUP>unfold_interp : forall (E F : Type -> Type) (R : Type) (f : forall T : Type, E T -> itree F T) (t : itree E R), interp f t β‰… _interp f (observe t)</LOOKUP>. ```
{"final_commit":"4e1301e834381725b933593fcf1f3b973986b630","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-66f56a8a4d02a262dbe75a676a4064f18ea7c3a0-4e1301e834381725b933593fcf1f3b973986b630-8_10_2-8_10_2-6.git.json","initial_commit":"66f56a8a4d02a262dbe75a676a4064f18ea7c3a0","file":"theories\/Interp\/InterpFacts.v"}
Proof State: ``` This subproof is complete, but there are some unfocused goals. Focus next goal with bullet -. 3 subgoals subgoal 1 is: x ^Z Z.pos_sub n m = x ^ Pos.to_nat n * / x ^ Pos.to_nat m subgoal 2 is: x ^Z Z.pos_sub m n = / x ^ Pos.to_nat n * x ^ Pos.to_nat m subgoal 3 is: / x ^ Pos.to_nat (n + m) = / x ^ Pos.to_nat n * / x ^ Pos.to_nat m ``` Ongoing Proof History: ``` Proof. intros x [|n|n] [|m|m]; simpl; intros; auto with real. - rewrite Pos2Nat.inj_add; auto with real. ``` Next Tactic: ```
- ```
{"package":"coq","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/theories\/Reals\/Rfunctions.v"}
Commit Diff: ``` diff --git a/theories/Core/KTreeFacts.v b/theories/Core/KTreeFacts.v index 32f56a6..b911a90 100644 --- a/theories/Core/KTreeFacts.v +++ b/theories/Core/KTreeFacts.v @@ -6 +6,2 @@ Require Import -Classes.Morphisms Setoids.Setoid +Program Classes.Morphisms +Setoids.Setoid @@ -23,2 +24 @@ Eq.Eq -Eq.UpToTaus -Eq.Paco2. +Eq.UpToTaus. @@ -68 +68 @@ Proof. -ginit. pcofix CIH. intros. +ginit. gcofix CIH. intros. @@ -205,2 +205,2 @@ Proof. -revert f g a0. -ginit. pcofix CIH. intros. +revert A B C f g a0. +ginit. gcofix CIH. intros. @@ -268 +268 @@ revert a0. -ginit. pcofix CIH. intros. +ginit. gcofix CIH. intros. @@ -277 +277 @@ revert a. -pcofix CIH'. intros. +gcofix CIH'. intros. @@ -337 +337,2 @@ etau. -specialize (CIHL xa). cbn in CIHL. +specialize (CIH xa). +cbn in CIH. diff --git a/theories/Eq/Eq.v b/theories/Eq/Eq.v index 42a3038..21ac7e0 100644 --- a/theories/Eq/Eq.v +++ b/theories/Eq/Eq.v @@ -29,2 +29 @@ Basics.Basics Basics.HeterogeneousRelations -Core.ITreeDefinition -Eq.Paco2. +Core.ITreeDefinition. @@ -167,54 +165,0 @@ Hint Unfold id: core. -Lemma eqitF_VisF_inv_r {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 vclo sim} -t1 X2 (e2 : E X2) (k2 : X2 -> _) : eqitF RR b1 -b2 vclo sim t1 (VisF e2 k2) -> (exists k1, t1 = VisF e2 k1 -/\ forall v, vclo sim (k1 v) (k2 v)) \/ (b1 /\ exists t1', t1 -= TauF t1' /\ eqitF RR b1 b2 vclo sim (observe t1') (VisF e2 k2)). -Proof. -refine (fun H => match H -in eqitF _ _ _ _ -_ _ t2 return match t2 -return Prop with | VisF e2 -k2 => _ | _ -=> True end with | -EqVis _ _ _ _ -_ _ _ _ _ -=> _ | _ => -_ end); try exact I. -- left; eauto. -- destruct i0; eauto. -Qed. - -Lemma eqitF_VisF_inv {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 vclo sim} X1 -(e1 : E X1) (k1 : X1 -> _) X2 (e2 : E X2) (k2 : X2 --> _) : eqitF RR b1 b2 vclo sim (VisF e1 k1) (VisF e2 k2) -> exists -p : X1 = X2, eqeq E p e1 e2 /\ pweqeq (vclo sim) p k1 k2. -Proof. -refine (fun H => match H in -eqitF _ _ _ _ _ t1 -t2 return match t1, t2 return Prop -with | VisF e1 k1, VisF e2 -k2 => _ | _, _ => -True end with | EqVis _ -_ _ _ _ _ _ -_ _ => _ | _ -=> _ end); try exact I. -- exists eq_refl; cbn; eauto. -- destruct i; exact I. -Qed. - -Lemma eqitF_VisF_inv_strong {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 -vclo sim} X (e : E X) (k1 : X -> _) (k2 -: X -> _) : eqitF RR b1 b2 vclo sim (VisF e -k1) (VisF e k2) -> forall x, vclo sim (k1 x) (k2 x). -Proof. -intros H. dependent destruction H. assumption. -Qed. - -Lemma eqitF_VisF {E R1 R2} {RR : R1 -> R2 -> Prop} {b1 b2 vclo sim} {X1 -X2} (p : X1 = X2) (e1 : E X1) (k1 : X1 -> _) (e2 : -E X2) (k2 : X2 -> _) : eqeq E p e1 e2 -> pweqeq (vclo sim) -p k1 k2 -> eqitF RR b1 b2 vclo sim (VisF e1 k1) (VisF e2 k2). -Proof. -destruct p; intros <-; cbn; constructor; auto. -Qed. - @@ -270,2 +215,2 @@ split. -pstep. punfold H0. red in H0. red. -hinduction H0 before CIH; intros; eauto. +pstep. punfold H1. red in H1. red. +hinduction H1 before CIH; intros; eauto. @@ -278,2 +223,2 @@ red in REL. pclearbot. pinversion REL. -pstep. punfold H0. red in H0. red. -hinduction H0 before CIH; intros; eauto. +pstep. punfold H1. red in H1. red. +hinduction H1 before CIH; intros; eauto. @@ -381 +326 @@ econstructor. pmonauto. -intros. destruct PR. ``` Proof State: ``` 1 subgoal E : Type -> Type R2 : Type R1 : Type RR : R1 -> R2 -> Prop rH, rL, gL, gH, x : itree E R1 -> itree E R2 -> Prop H : forall (x0 : itree E R1) (x1 : itree E R2), x x0 x1 -> euttG rH rL (gL \2/ x) (gH \2/ x) x0 x1 r : itree E R1 -> itree E R2 -> Prop CIH0 : forall (x0 : itree E R1) (x1 : itree E R2), gL x0 x1 \/ transU RR rH x0 x1 \/ rL x0 x1 -> r x0 x1 CIH : forall (x2 : itree E R1) (x3 : itree E R2), x x2 x3 -> r x2 x3 x2 : itree E R1 x3 : itree E R2 PR : x x2 x3 ============================ gpaco2 (eqit_ RR true true (euttVC RR gH)) (transD RR) (transU RR rH \2/ rL) r x2 x3 ``` Ongoing Proof History: ``` Proof. intros. apply euttG_gen. econstructor. revert x0 x1 PR. - pcofix CIH. + gcofix CIH. + intros. ? intros t1 t2 PR. ? apply H in PR. ? destruct PR as [IN]. ``` Next Tactic: ```
apply H in PR. ```
{"final_commit":"f4bacabbc5b1556a723e3cb4efb1cd614c156d8f","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-f3853150994e962978fa4cf0ed18dcb8c42e3262-f4bacabbc5b1556a723e3cb4efb1cd614c156d8f-8_11_2-8_10_2-18.git.json","initial_commit":"f3853150994e962978fa4cf0ed18dcb8c42e3262","file":"theories\/Eq\/UpToTaus.v"}
Commit Diff: ``` diff --git a/theories/Core/KTreeFacts.v b/theories/Core/KTreeFacts.v index 32f56a6..b911a90 100644 --- a/theories/Core/KTreeFacts.v +++ b/theories/Core/KTreeFacts.v @@ -6 +6,2 @@ Require Import -Classes.Morphisms Setoids.Setoid +Program Classes.Morphisms +Setoids.Setoid @@ -23,2 +24 @@ Eq.Eq -Eq.UpToTaus -Eq.Paco2. +Eq.UpToTaus. @@ -68 +68 @@ Proof. -ginit. pcofix CIH. intros. +ginit. gcofix CIH. intros. @@ -205,2 +205,2 @@ Proof. -revert f g a0. -ginit. pcofix CIH. intros. +revert A B C f g a0. +ginit. gcofix CIH. intros. @@ -268 +268 @@ revert a0. -ginit. pcofix CIH. intros. +ginit. gcofix CIH. intros. @@ -277 +277 @@ revert a. -pcofix CIH'. intros. +gcofix CIH'. intros. @@ -337 +337,2 @@ etau. -specialize (CIHL xa). cbn in CIHL. +specialize (CIH xa). +cbn in CIH. diff --git a/theories/Eq/Eq.v b/theories/Eq/Eq.v index 42a3038..21ac7e0 100644 --- a/theories/Eq/Eq.v +++ b/theories/Eq/Eq.v @@ -29,2 +29 @@ Basics.Basics Basics.HeterogeneousRelations -Core.ITreeDefinition -Eq.Paco2. +Core.ITreeDefinition. @@ -167,54 +165,0 @@ Hint Unfold id: core. -Lemma eqitF_VisF_inv_r {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 vclo sim} -t1 X2 (e2 : E X2) (k2 : X2 -> _) : eqitF RR b1 -b2 vclo sim t1 (VisF e2 k2) -> (exists k1, t1 = VisF e2 k1 -/\ forall v, vclo sim (k1 v) (k2 v)) \/ (b1 /\ exists t1', t1 -= TauF t1' /\ eqitF RR b1 b2 vclo sim (observe t1') (VisF e2 k2)). -Proof. -refine (fun H => match H -in eqitF _ _ _ _ -_ _ t2 return match t2 -return Prop with | VisF e2 -k2 => _ | _ -=> True end with | -EqVis _ _ _ _ -_ _ _ _ _ -=> _ | _ => -_ end); try exact I. -- left; eauto. -- destruct i0; eauto. -Qed. - -Lemma eqitF_VisF_inv {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 vclo sim} X1 -(e1 : E X1) (k1 : X1 -> _) X2 (e2 : E X2) (k2 : X2 --> _) : eqitF RR b1 b2 vclo sim (VisF e1 k1) (VisF e2 k2) -> exists -p : X1 = X2, eqeq E p e1 e2 /\ pweqeq (vclo sim) p k1 k2. -Proof. -refine (fun H => match H in -eqitF _ _ _ _ _ t1 -t2 return match t1, t2 return Prop -with | VisF e1 k1, VisF e2 -k2 => _ | _, _ => -True end with | EqVis _ -_ _ _ _ _ _ -_ _ => _ | _ -=> _ end); try exact I. -- exists eq_refl; cbn; eauto. -- destruct i; exact I. -Qed. - -Lemma eqitF_VisF_inv_strong {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 -vclo sim} X (e : E X) (k1 : X -> _) (k2 -: X -> _) : eqitF RR b1 b2 vclo sim (VisF e -k1) (VisF e k2) -> forall x, vclo sim (k1 x) (k2 x). -Proof. -intros H. dependent destruction H. assumption. -Qed. - -Lemma eqitF_VisF {E R1 R2} {RR : R1 -> R2 -> Prop} {b1 b2 vclo sim} {X1 -X2} (p : X1 = X2) (e1 : E X1) (k1 : X1 -> _) (e2 : -E X2) (k2 : X2 -> _) : eqeq E p e1 e2 -> pweqeq (vclo sim) -p k1 k2 -> eqitF RR b1 b2 vclo sim (VisF e1 k1) (VisF e2 k2). -Proof. -destruct p; intros <-; cbn; constructor; auto. -Qed. - @@ -270,2 +215,2 @@ split. -pstep. punfold H0. red in H0. red. -hinduction H0 before CIH; intros; eauto. +pstep. punfold H1. red in H1. red. +hinduction H1 before CIH; intros; eauto. @@ -278,2 +223,2 @@ red in REL. pclearbot. pinversion REL. -pstep. punfold H0. red in H0. red. -hinduction H0 before CIH; intros; eauto. +pstep. punfold H1. red in H1. red. ``` Ongoing Proof History: ``` Proof. intros. apply euttG_gen. econstructor. revert x0 x1 PR. - pcofix CIH. + gcofix CIH. - intros t1 t2 PR. + intros. apply H in PR. ? destruct PR as [IN]. ? revert t1 t2 IN. ? pcofix CIH. ``` Proof State: ``` 1 subgoal E : Type -> Type R2 : Type R1 : Type RR : R1 -> R2 -> Prop rH, rL, gL, gH, x : itree E R1 -> itree E R2 -> Prop H : forall (x0 : itree E R1) (x1 : itree E R2), x x0 x1 -> euttG rH rL (gL \2/ x) (gH \2/ x) x0 x1 r : itree E R1 -> itree E R2 -> Prop CIH0 : forall (x0 : itree E R1) (x1 : itree E R2), gL x0 x1 \/ transU RR rH x0 x1 \/ rL x0 x1 -> r x0 x1 CIH : forall (x2 : itree E R1) (x3 : itree E R2), x x2 x3 -> r x2 x3 x2 : itree E R1 x3 : itree E R2 PR : euttG rH rL (gL \2/ x) (gH \2/ x) x2 x3 ============================ gpaco2 (eqit_ RR true true (euttVC RR gH)) (transD RR) (transU RR rH \2/ rL) r x2 x3 ``` Next Tactic: ```
destruct PR. ```
{"final_commit":"f4bacabbc5b1556a723e3cb4efb1cd614c156d8f","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-f3853150994e962978fa4cf0ed18dcb8c42e3262-f4bacabbc5b1556a723e3cb4efb1cd614c156d8f-8_11_2-8_10_2-18.git.json","initial_commit":"f3853150994e962978fa4cf0ed18dcb8c42e3262","file":"theories\/Eq\/UpToTaus.v"}
Ongoing Proof History: ``` intros l1; elim l1; simpl; auto. intros l2 H H0; exists l2; simpl; auto. intros a l H l2 H0 H1; auto. case (in_permutation_ex _ a l2); auto with datatypes. intros l3 Hl3. case (H l3); auto. apply ulist_inv with ( 1 := H0 ); auto. intros b Hb. assert (H2: In b (a :: l3)). - apply permutation_in with ( 1 := permutation_sym _ _ _ Hl3 ); auto with datatypes. + apply Permutation_in with ( 1 := Permutation_sym Hl3 ); auto with datatypes. simpl in H2 |-; case H2; intros H3; simpl; auto. inversion_clear H0 as [|c lc Hk1]; auto. case Hk1; subst a; auto. intros l4 H4; exists l4. ? apply permutation_trans with (a :: l3); auto. ? apply permutation_sym; auto. ? Qed. ``` Proof State: ``` 1 goal A : Set eqA_dec : forall a b : A, {a = b} + {a <> b} l1 : list A a : A l : list A H : forall l2 : list A, ulist l -> incl l l2 -> exists l3 : list A, Permutation l2 (l ++ l3) l2 : list A H0 : ulist (a :: l) H1 : incl (a :: l) l2 l3 : list A Hl3 : Permutation (a :: l3) l2 l4 : list A H4 : Permutation l3 (l ++ l4) ============================ Permutation l2 (a :: l ++ l4) ``` Commit Diff: ``` diff --git a/Permutation.v b/Permutation.v index ecfa699..af80c37 100644 --- a/Permutation.v +++ b/Permutation.v @@ -33,2 +32,0 @@ Variable A : Set. -Definition permutation (l1 l2 : list A) := @Permutation A l1 l2. - @@ -37,66 +34,0 @@ Hint Constructors Permutation : core. -Definition permutation_trans := perm_trans. - - - - - -Theorem permutation_refl : forall l : list A, permutation l l. -Proof. -simple induction l. -apply perm_nil. -intros a l1 H. -apply perm_skip with (1 := H). -Qed. -Hint Resolve permutation_refl : core. - - - - - -Theorem permutation_sym : forall l m : list -A, permutation l m -> permutation m l. -Proof. -apply Permutation_sym. -Qed. - - - - - -Theorem permutation_length : forall l m : list A, -permutation l m -> length l = length m. -Proof. -apply Permutation_length. -Qed. - - - - - -Theorem perm_nil_inv : forall l : list A, permutation l nil -> l = nil. -Proof. -intros l H. -apply Permutation_nil. -apply Permutation_sym; assumption. -Qed. - - - - -Theorem permutation_one_inv : forall (a : A) (l : list A), -permutation (a :: nil) l -> l = a :: nil. -Proof. -apply Permutation_length_1_inv. -Qed. - - - - - -Theorem permutation_in : forall (a : A) (l m : list A), -permutation l m -> In a l -> In a m. -Proof. -intros a l m H H0. -eapply Permutation_in; eassumption. -Qed. - @@ -107,26 +39,3 @@ Qed. -Theorem permutation_app_comp : forall l1 l2 l3 l4, -permutation l1 l2 -> permutation l3 l4 -> -permutation (l1 ++ l3) (l2 ++ l4). -Proof. -intros l1 l2 l3 l4 H H0. -apply Permutation_app; auto. -Qed. -Hint Resolve permutation_app_comp : core. - - - - - -Theorem permutation_app_swap : forall l1 l2, permutation -(l1 ++ l2) (l2 ++ l1). -Proof. -apply Permutation_app_comm. -Qed. - - - - - -Theorem perm_transposition : forall a b l1 l2 l3, permutation -(l1 ++ a :: l2 ++ b :: l3) -(l1 ++ b :: l2 ++ a :: l3). +Theorem perm_transposition : forall a b (l1 l2 l3 : list +A), Permutation (l1 ++ a :: l2 ++ b :: +l3) (l1 ++ b :: l2 ++ a :: l3). @@ -135,2 +44,2 @@ intros a b l1 l2 l3. -apply permutation_app_comp; auto. -change (permutation ((a :: nil) ++ l2 ++ (b +apply Permutation_app; auto. +change (Permutation ((a :: nil) ++ l2 ++ (b @@ -140 +49 @@ repeat rewrite <- app_ass. -apply permutation_app_comp; auto. +apply Permutation_app; auto. @@ -142 +51 @@ apply perm_trans with ((b :: nil) ++ (a :: nil) ++ l2); auto. -apply permutation_app_swap; auto. +apply Permutation_app_comm; auto. @@ -144,2 +53,2 @@ repeat rewrite app_ass. -apply permutation_app_comp; auto. -apply permutation_app_swap; auto. +apply Permutation_app; auto. +apply Permutation_app_comm; auto. @@ -153 +62 @@ Theorem in_permutation_ex : forall a l, In a l -> -exists l1 : list A, permutation (a :: l1) l. +exists l1 : list A, Permutation (a :: l1) l. @@ -167,13 +75,0 @@ Qed. -Theorem permutation_inv : forall (a : A) (l1 -l2 : list A), permutation (a :: l1) -(a :: l2) -> permutation l1 l2. -Proof. -intros a l1 l2 H. -eapply Permutation_cons_inv. -eassumption. -Qed. - - - - - @@ -195 +91 @@ l2 : list A), In (a, l1) (split_one -l2) -> permutation (a :: l1) l2. +l2) -> Permutation (a :: l1) l2. @@ -256 +152 @@ Lemma all_permutations_aux_permutation : forall (n : nat) (l1 l2 -l1 (all_permutations_aux l2 n) -> permutation l1 l2. +l1 (all_permutations_aux l2 n) -> Permutation l1 l2. @@ -276,2 +172,2 @@ change (length l2 = length (a1 :: l3)) in |- *. -apply permutation_length; auto. ``` Next Tactic: ```
apply <LOOKUP>perm_trans : forall [A : Type] [l l' l'' : list A], Permutation l l' -> Permutation l' l'' -> Permutation l l''</LOOKUP> with (a :: l3); auto. ```
{"final_commit":"5a29a619b6acc23531ef31506b909056de730bf6","project":"sudoku","repair_file":"\/data\/coq-pearls\/repairs\/sudoku\/repair-sudoku-b5543771d6bdeab13ec58ac6c8d281815d96ed62-5a29a619b6acc23531ef31506b909056de730bf6-8_15_2-8_15_2-7.git.json","initial_commit":"b5543771d6bdeab13ec58ac6c8d281815d96ed62","file":"UList.v"}
Commit Diff: ``` diff --git a/theories/Aux.v b/theories/Aux.v index d240627..c7e8186 100644 --- a/theories/Aux.v +++ b/theories/Aux.v @@ -27 +26,0 @@ - @@ -30,0 +30 @@ Require Export List. +Export ListNotations. @@ -85,11 +84,0 @@ Hint Resolve le_minus: arith. -Section EqBool. - -Definition eq_bool_dec : forall a b : bool, {a = b} + {a <> b}. -Proof. -intros a b; case a; case b; simpl in |- *; auto. -right; red in |- *; intros; discriminate. -Defined. - -End EqBool. - - @@ -231 +220 @@ intros a1 l H [H1| H1]; auto. -exists (nil (A:=A)); exists l; simpl in |- *; auto. +exists []; exists l; simpl in |- *; auto. @@ -270,4 +259,4 @@ Theorem app_inv_app : forall l1 l2 l3 l4 a, -l1 ++ l2 = l3 ++ a :: l4 --> (exists l5 : list A, l1 = l3 -++ a :: l5) \/ (exists l5 : -_, l2 = l5 ++ a :: l4). +l1 ++ l2 = l3 ++ a :: +l4 -> (exists l5 : list A, l1 += l3 ++ a :: l5) \/ (exists +l5, l2 = l5 ++ a :: l4). @@ -288,2 +277,2 @@ Theorem app_inv_app2 : forall l1 l2 l3 l4 a b, l1 -(exists l5 : list A, l1 = l3 ++ a :: -b :: l5) \/ (exists l5 : _, l2 = l5 +(exists l5 : list A, l1 = l3 ++ a +:: b :: l5) \/ (exists l5, l2 = l5 @@ -291 +280 @@ b :: l5) \/ (exists l5 : _, l2 = l5 -++ a :: nil /\ l2 = b :: l4. +++ a :: [] /\ l2 = b :: l4. @@ -310,7 +299,7 @@ Qed. -Theorem same_length_ex : forall (a : A) l1 -l2 l3, length (l1 ++ a :: l2) -= length l3 -> exists l4 : -_, (exists l5 : _, (exists b -: B, length l1 = length l4 -/\ length l2 = length l5 /\ -l3 = l4 ++ b :: l5)). +Theorem same_length_ex : forall (a : A) +l1 l2 l3, length (l1 ++ a +:: l2) = length l3 -> exists +l4, (exists l5, (exists b : B, +length l1 = length l4 /\ length +l2 = length l5 /\ l3 += l4 ++ b :: l5)). @@ -320 +309 @@ intros l2 l3; case l3; simpl in |- *; try (intros; discriminate). -intros b l H; exists (nil (A:=B)); exists l; exists b; repeat (split; auto). +intros b l H; exists []; exists l; exists b; repeat (split; auto). @@ -341,3 +330,3 @@ Qed. -Theorem in_map_fst_inv : forall a (l : list (B -* C)), In a (map (fst (B:=_)) l) -> -exists c : _, In (a, c) l. +Theorem in_map_fst_inv : forall a (l : list +(B * C)), In a (map (fst (B:=_)) +l) -> exists c, In (a, c) l. ``` Ongoing Proof History: ``` apply trans_equal with (1 := E1); rewrite HH; auto. intros (HH1, HH2). - cut (ln0 = nil /\ ln4 = nil /\ a = S n); [ intros (HH3, (HH4, HH5)) | generalize HH1; rewrite H7; case ln0; simpl in |- *; [ case ln4; try (intros; discriminate); (intros HH6; injection HH6; auto) | intros n0 l; case l; simpl in |- *; intros; discriminate ] ]. + cut (ln0 = [] /\ ln4 = [] /\ a = S n); [ intros (HH3, (HH4, HH5)) | generalize HH1; rewrite H7; case ln0; simpl in |- *; [ case ln4; try (intros; discriminate); (intros HH6; injection HH6; auto) | intros n0 l; case l; simpl in |- *; intros; discriminate ] ]. generalize E1 H1; case ln2; simpl in |- *; auto; clear E1 H1. intros E1 H1; case height_pred_not_nil2 with (1 := H1); auto. generalize (height_pred_length _ _ _ _ H1); case l2; simpl in |- *; auto; intros; discriminate. intros n0 ln5 E1 H1; case height_pred_larger_strict with (n1 := n0) (1 := H1); simpl in |- *; auto with datatypes. intros HH6; Contradict HH6; apply le_not_lt; rewrite <- HH5; apply H5; rewrite E1; auto with datatypes. ? intros (H8, H9); left; exists (nil (A:=nat)); injection H8. ? intros HH7 HH8; rewrite HH5; rewrite <- HH8; rewrite <- HH7; rewrite E1; rewrite HH4; auto. ? intros (ln4, H7); auto. ``` Proof State: ``` 2 subgoals A : Type f : A -> nat eqA_dec : forall a b : A, {a = b} + {a <> b} n : nat ln1, ln2 : list nat t1, t2 : btree A l1, l2 : list (btree A) H : height_pred (S n) ln1 l1 t1 ln0, ln3 : list nat a : nat H3 : ln1 ++ ln2 = ln0 ++ a :: ln3 H4 : forall n1 : nat, In n1 ln0 -> n1 < a H5 : forall n1 : nat, In n1 ln3 -> n1 <= a ln4 : list nat H7 : ln1 = ln0 ++ a :: ln4 HH1 : ln1 = [S n] HH2 : l1 = [t1] HH3 : ln0 = [] HH4 : ln4 = [] HH5 : a = S n n0 : nat ln5 : list nat E1 : ln3 = ln4 ++ n0 :: ln5 H1 : height_pred (S n) (n0 :: ln5) l2 t2 ============================ n0 :: ln5 = [S n] /\ l2 = [t2] -> (exists ln6 : list nat, ln3 = a :: ln6) \/ ln1 ++ n0 :: ln5 = [n] /\ l1 ++ l2 = [node t1 t2] subgoal 2 is: (exists l5 : list nat, ln2 = l5 ++ a :: ln3) -> (exists ln4 : list nat, ln3 = a :: ln4) \/ ln1 ++ ln2 = [n] /\ l1 ++ l2 = [node t1 t2] ``` Next Tactic: ```
intros (H8, H9); left; exists []; injection H8. ```
{"final_commit":"6e3f37b2113e34f74c6b5a6ff2c7346a9cdf9e4e","project":"huffman","repair_file":"\/data\/coq-pearls\/repairs\/huffman\/repair-huffman-773c1feea03edc5e845ecafc7c9752fa403e7faf-6e3f37b2113e34f74c6b5a6ff2c7346a9cdf9e4e-8_11_2-8_11_2-27.git.json","initial_commit":"773c1feea03edc5e845ecafc7c9752fa403e7faf","file":"theories\/HeightPred.v"}
Commit Diff: ``` diff --git a/theories/Core/KTreeFacts.v b/theories/Core/KTreeFacts.v index b911a90..32f56a6 100644 --- a/theories/Core/KTreeFacts.v +++ b/theories/Core/KTreeFacts.v @@ -6,2 +6 @@ Require Import -Program Classes.Morphisms -Setoids.Setoid +Classes.Morphisms Setoids.Setoid @@ -24 +23,2 @@ Eq.Eq -Eq.UpToTaus. +Eq.UpToTaus +Eq.Paco2. @@ -68 +68 @@ Proof. -ginit. gcofix CIH. intros. +ginit. pcofix CIH. intros. @@ -205,2 +205,2 @@ Proof. -revert A B C f g a0. -ginit. gcofix CIH. intros. +revert f g a0. +ginit. pcofix CIH. intros. @@ -268 +268 @@ revert a0. -ginit. gcofix CIH. intros. +ginit. pcofix CIH. intros. @@ -277 +277 @@ revert a. -gcofix CIH'. intros. +pcofix CIH'. intros. @@ -337,2 +337 @@ etau. -specialize (CIH xa). -cbn in CIH. +specialize (CIHL xa). cbn in CIHL. diff --git a/theories/Eq/Eq.v b/theories/Eq/Eq.v index 21ac7e0..7f12983 100644 --- a/theories/Eq/Eq.v +++ b/theories/Eq/Eq.v @@ -29 +29,2 @@ Basics.Basics Basics.HeterogeneousRelations -Core.ITreeDefinition. +Core.ITreeDefinition +Eq.Paco2. @@ -165,0 +167,54 @@ Hint Unfold id: core. +Lemma eqitF_inv_VisF_r {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 vclo sim} +t1 X2 (e2 : E X2) (k2 : X2 -> _) : eqitF RR b1 +b2 vclo sim t1 (VisF e2 k2) -> (exists k1, t1 = VisF e2 k1 +/\ forall v, vclo sim (k1 v) (k2 v)) \/ (b1 /\ exists t1', t1 += TauF t1' /\ eqitF RR b1 b2 vclo sim (observe t1') (VisF e2 k2)). +Proof. +refine (fun H => match H +in eqitF _ _ _ _ +_ _ t2 return match t2 +return Prop with | VisF e2 +k2 => _ | _ +=> True end with | +EqVis _ _ _ _ +_ _ _ _ _ +=> _ | _ => +_ end); try exact I. +- left; eauto. +- destruct i0; eauto. +Qed. + +Lemma eqitF_inv_VisF_weak {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 vclo sim} X1 +(e1 : E X1) (k1 : X1 -> _) X2 (e2 : E X2) (k2 : X2 +-> _) : eqitF RR b1 b2 vclo sim (VisF e1 k1) (VisF e2 k2) -> exists +p : X1 = X2, eqeq E p e1 e2 /\ pweqeq (vclo sim) p k1 k2. +Proof. +refine (fun H => match H in +eqitF _ _ _ _ _ t1 +t2 return match t1, t2 return Prop +with | VisF e1 k1, VisF e2 ``` Proof State: ``` 1 subgoal E : Type -> Type X : Type R1 : Type R2 : Type RR : R1 -> R2 -> Prop b1, b2 : bool t1 : itree E R1 CHECK : b1 b : R2 ma : itree E X IHeqitF : t1 β‰… ma;; t1 -> forall b0 : R2, RetF b = RetF b0 -> exists a : X, eqit eq b1 b2 ma (Ret a) /\ eqit RR b1 b2 ((fun _ : X => t1) a) (Ret b) H : eqitF RR b1 b2 id (upaco2 (fun (sim : itree E R1 -> itree E R2 -> Prop) (t1 : itree E R1) (t2 : itree E R2) => eqitF RR b1 b2 id sim (observe t1) (observe t2)) bot2) (observe t1) (RetF b) kb : X -> itree E R1 r : X Hobma : observe ma = RetF r H0 : Tau t1 β‰… kb r a : X H1 : eqit eq b1 b2 (Ret r) (Ret a) H2 : eqit RR b1 b2 t1 (Ret b) ============================ eqit RR b1 b2 (kb a) (Ret b) ``` Ongoing Proof History: ``` revert ma kb tl Heqtl' H0 b Heqtr. induction H. - intros; subst. inv Heqtr. destruct (observe tl) eqn: Hobtl; inv Heqtl'. rewrite unfold_bind in H0. destruct (observe ma) eqn: Hobma. * exists r0. split. rewrite <- Hobma. tau_steps. reflexivity. cbn in *. rewrite <- H0. rewrite itree_eta, Hobtl. apply eqit_Ret; auto. * cbn in H0. rewrite itree_eta in H0. rewrite Hobtl in H0. - apply eqitree_inv_ret_tau in H0. + apply eqit_inv in H0. contradiction. * cbn in H0. rewrite itree_eta, Hobtl in H0. - apply eqitree_inv_ret_vis in H0. + apply eqit_inv in H0. contradiction. - intros. inversion Heqtr. - intros. inversion Heqtr. - intros. subst. apply simpobs in Heqtl'. rewrite Heqtl' in H0; clear tl Heqtl'. rewrite unfold_bind in H0. destruct (observe ma) eqn: Hobma. + cbn in *. specialize (IHeqitF ma (fun _ => t1) t1 eq_refl). edestruct IHeqitF as (a & ? & ?);[| reflexivity |]. * setoid_rewrite itree_eta at 4. rewrite Hobma, bind_ret_l. reflexivity. * exists a; split; auto. rewrite itree_eta, Hobma in H1. ? apply eqit_inv_ret in H1; subst. ? rewrite <- H0. ? destruct b1; [| inv CHECK]. ``` Next Tactic: ```
apply <LOOKUP>eqit_inv_Ret : forall (E : Type -> Type) (R1 R2 : Type) (RR : R1 -> R2 -> Prop) (b1 b2 : bool) (r1 : R1) (r2 : R2), eqit RR b1 b2 (Ret r1) (Ret r2) -> RR r1 r2</LOOKUP> in H1; subst. ```
{"final_commit":"7f00358aeb230f7970571fddaa8b256375910c62","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-672193e2507cf3326b834f5fa47b7518af829b4b-7f00358aeb230f7970571fddaa8b256375910c62-8_10_2-8_10_2-15.git.json","initial_commit":"672193e2507cf3326b834f5fa47b7518af829b4b","file":"theories\/Eq\/Eq.v"}
Proof State: ``` 2 goals h, w : nat Eq1 : ulist ref_list Eq2 : length ref_list = size s : list nat H : length s = size * size H1 : sat init_c s HH0 : forall i : nat, i < size -> incl ref_list (row i s) HH1 : forall i : nat, i < size -> incl ref_list (column i s) HH2 : forall i : nat, i < size -> incl ref_list (rect i s) HH3 : forall p : pos, valid_pos p -> In (get p s) ref_list ============================ length s = size * size /\ (forall i : nat, i < size -> Permutation (row i s) ref_list) /\ (forall i : nat, i < size -> Permutation (column i s) ref_list) /\ (forall i : nat, i < size -> Permutation (rect i s) ref_list) goal 2 is: sat init_c s ``` Ongoing Proof History: ``` - Proof with auto. + Proof. generalize (ref_list_ulist); intros Eq1. generalize (ref_list_length); intros Eq2. intros s H; case (init_c_sat s); auto; intros HH0 HH1; split; intros H1. case HH0; clear HH0 HH1; auto; intros HH0 (HH1, (HH2, HH3)); unfold sudoku. ? split... ? repeat split; intros i U; apply Permutation_sym; apply ulist_eq_permutation... ? rewrite length_row... ``` Commit Diff: ``` diff --git a/ListAux.v b/ListAux.v index 769776a..986e88b 100644 --- a/ListAux.v +++ b/ListAux.v @@ -130,0 +131,6 @@ Qed. +Theorem length_app: forall (l1 l2 : list A), length +(l1 ++ l2) = length l1 + length l2. +Proof. +apply app_length. +Qed. + @@ -272 +278 @@ intros A l1 l2; elim l1; simpl; auto. -intros a l H; rewrite app_length, length_map, H; auto. +intros a l H; rewrite length_app, length_map, H; auto. diff --git a/ListOp.v b/ListOp.v index 7a13f04..e1936ca 100644 --- a/ListOp.v +++ b/ListOp.v @@ -145 +145 @@ intros k Rec i j s H; -rewrite app_length, length_take1; auto with arith. +rewrite length_app, length_take1; auto with arith. diff --git a/Sudoku.v b/Sudoku.v index f9e372e..3a01485 100644 --- a/Sudoku.v +++ b/Sudoku.v @@ -675 +675 @@ assert (F1: div y w < h). -apply div_lt; rewrite mult_comm... +apply div_lt; rewrite mult_comm; auto. @@ -677,2 +677,6 @@ apply div_lt; rewrite mult_comm... -repeat (rewrite (fun x => mult_comm x h)); rewrite mod_mult_comp... -rewrite div_mult_comp, (mod_small (div y w) h), (div_is_0 (div y w) h), plus_0_r... +repeat (rewrite (fun x => +mult_comm x h)); rewrite mod_mult_comp... +rewrite div_mult_comp; auto. +rewrite (mod_small (div y w) h); auto. +rewrite (div_is_0 (div y w) h); auto. +rewrite plus_0_r. @@ -699,3 +703,3 @@ cut (w <= size). -intros U3 n; generalize h; elim n; simpl... -clear n H1 H2 U1. -+ intros h1; case h1; simpl... +intros U3 n; generalize h; elim n; simpl; +auto with arith; clear n H1 H2 U1. ++ intros h1; case h1; simpl; auto. @@ -709,2 +713,3 @@ apply sym_equal; apply take_nth... -** pose proof (mod_lt y w). -lia. +** apply le_trans with (1 := H1)... +apply le_trans with (2 := U3). +apply lt_le_weak; apply mod_lt... @@ -721 +726 @@ apply mod_lt... -case (le_or_lt (length l) w); intros H3. +case (le_or_lt (length l) w); intros H1. @@ -723 +728,2 @@ case (le_or_lt (length l) w); intros H3. -** rewrite length_take_small, jump_too_far... +** rewrite length_take_small... +rewrite jump_too_far. @@ -726,2 +732,2 @@ repeat rewrite nth_default... -apply le_trans with (1 := H3)... -*** apply le_trans with (1 := H3)... +apply le_trans with (1 := H1)... +*** apply le_trans with (1 := H1)... @@ -732 +738,2 @@ repeat rewrite <- plus_assoc; rewrite minus_plus... -rewrite jump_nth, jump_add, <- jump_nth... +rewrite jump_nth; rewrite jump_add. +rewrite <- jump_nth... @@ -743 +750 @@ generalize (w_pos _ H); intros U2. -rewrite length_take_and_jump... +rewrite length_take_and_jump; auto. @@ -760 +767,2 @@ rewrite (plus_assoc w). -pattern w at 1; rewrite <- mult_1_r, <- mult_plus_distr_l, le_plus_minus_r... +pattern w at 1; rewrite <- mult_1_r; rewrite <- mult_plus_distr_l. +rewrite le_plus_minus_r... @@ -846,2 +854,2 @@ l2 l3 -> lit_test l1 l3 = lit_test l1 l2. -Proof with auto. -intros l1 l2 l3; case l1; case l2; case l3; simpl... +Proof. +intros l1 l2 l3; case l1; case l2; case l3; simpl; auto. @@ -851 +859 @@ case_eq (pos_test p2 p3); intros H1. -rewrite (pos_test_trans p1 p2 p3); rewrite H... +rewrite (pos_test_trans p1 p2 p3); rewrite H; auto. @@ -853,2 +861,2 @@ assert (p2 = p3); subst. -apply pos_test_exact with (1 := H1)... -rewrite H... +apply pos_test_exact with (1 := H1); auto. +rewrite H; auto. @@ -856,4 +864,4 @@ intros; discriminate. -replace p1 with p2... -case_eq (pos_test p2 p3); intros H1... -intros; apply test_trans... -apply sym_equal; apply pos_test_exact with (1 := H)... +replace p1 with p2; auto. +case_eq (pos_test p2 p3); intros H1; auto. +intros; apply test_trans; auto. +apply sym_equal; apply pos_test_exact with (1 := H); auto. @@ -863,3 +871,3 @@ assert (p2 = p3); subst. ``` Next Tactic: ```
split; auto. ```
{"final_commit":"427448011e3341d35aa5b9e00f675f6582fcd477","project":"sudoku","repair_file":"\/data\/coq-pearls\/repairs\/sudoku\/repair-sudoku-dc8d4294a32dbb6e0a642dc553b64495f27e6d60-427448011e3341d35aa5b9e00f675f6582fcd477-8_15_2-8_15_2-72.git.json","initial_commit":"dc8d4294a32dbb6e0a642dc553b64495f27e6d60","file":"Sudoku.v"}
Commit Diff: ``` diff --git a/src/DblibTactics.v b/src/DblibTactics.v index 2a08b3e..2aa54e9 100644 --- a/src/DblibTactics.v +++ b/src/DblibTactics.v @@ -2,3 +2 @@ Set Implicit Arguments. -Require Import Compare_dec. -Require Import Peano_dec. -Require Import Lia. +Require Export Omega. @@ -12,7 +10,8 @@ Hint Extern 1 => f_equal : f_equal. -Hint Extern 1 (_ = _ :> nat) => reflexivity : lia. -Hint Extern 3 (_ = _ :> nat) => lia : lia. -Hint Extern 3 (_ <> _ :> nat) => lia : lia. -Hint Extern 3 (_ < _) => lia : lia. -Hint Extern 3 (_ > _) => lia : lia. -Hint Extern 3 (_ <= _) => lia : lia. -Hint Extern 3 (_ >= _) => lia : lia. +Hint Extern 1 (_ = _ :> nat) => reflexivity : omega. + +Hint Extern 1 (_ = _ :> nat) => omega : omega. +Hint Extern 1 (_ <> _ :> nat) => omega : omega. +Hint Extern 1 (_ < _) => omega : omega. +Hint Extern 1 (_ > _) => omega : omega. +Hint Extern 1 (_ <= _) => omega : omega. +Hint Extern 1 (_ >= _) => omega : omega. @@ -43 +42 @@ Ltac dblib_by_cases := repeat dblib_inspect_cases; try solve -[ intros; exfalso; lia ]; intros. \ No newline at end of file +[ intros; exfalso; omega ]; intros. \ No newline at end of file diff --git a/src/DeBruijn.v b/src/DeBruijn.v index 45bfa51..7a58a05 100644 --- a/src/DeBruijn.v +++ b/src/DeBruijn.v @@ -3,2 +2,0 @@ Generalizable All Variables. -Require Import Arith. -Require Import Lia. @@ -286,3 +284,3 @@ intros. -replace k with (ws + (k - ws)) by lia. -erewrite <- lift_lift by lia. -replace (ws + (k - ws) - ws) with (k - ws) by lia. +replace k with (ws + (k - ws)) by omega. +erewrite <- lift_lift by omega. +replace (ws + (k - ws) - ws) with (k - ws) by omega. @@ -456,2 +454,2 @@ eapply traverse_relative with (p := 0). -intros m ?. replace (m + 0) with m by lia. eauto. -lia. +intros m ?. replace (m + 0) with m by omega. eauto. +omega. @@ -483,4 +481,3 @@ Qed. -Ltac just_do_it := unfold -subst, Subst_idx, subst_idx, lift, -Lift_idx, var, Var_idx; intros; -dblib_by_cases; eauto with lia. +Ltac just_do_it := unfold subst, Subst_idx, subst_idx, +lift, Lift_idx, var, Var_idx; intros; solve [ +dblib_by_cases; eauto with f_equal omega ]. @@ -512,2 +509,2 @@ Ltac lift_idx := first [ rewrite @lift_idx_recent by -solve [ lia | eauto with lift_idx_hints -] | rewrite @lift_idx_old by lia ]. +solve [ omega | eauto with lift_idx_hints +] | rewrite @lift_idx_old by omega ]. @@ -518,2 +515,2 @@ Ltac lift_idx_in h := first [ rewrite @lift_idx_recent in -h by solve [ lia | eauto with lift_idx_hints -] | rewrite @lift_idx_old in h by lia ]. +h by solve [ omega | eauto with lift_idx_hints +] | rewrite @lift_idx_old in h by omega ]. @@ -522,2 +519,2 @@ Ltac lift_idx_all := first [ rewrite @lift_idx_recent in * -by solve [ lia | eauto with lift_idx_hints ] -| rewrite @lift_idx_old in * by lia ]. +by solve [ omega | eauto with lift_idx_hints ] +| rewrite @lift_idx_old in * by omega ]. @@ -587,2 +584,2 @@ Ltac subst_idx := first -lia | rewrite -@subst_idx_miss_1 by lia +omega | rewrite +@subst_idx_miss_1 by omega @@ -590 +587 @@ lia | rewrite -by lia ]. +by omega ]. @@ -594,2 +591,2 @@ Ltac subst_idx_in h := first -by lia | rewrite @subst_idx_miss_1 -in h by lia +by omega | rewrite @subst_idx_miss_1 +in h by omega @@ -597 +594 @@ in h by lia -h by lia ]. +h by omega ]. @@ -601,2 +598,2 @@ rewrite @subst_idx_identity in * by -lia | rewrite @subst_idx_miss_1 -in * by lia +omega | rewrite @subst_idx_miss_1 +in * by omega @@ -604 +601 @@ in * by lia -* by lia ]. +* by omega ]. @@ -667 +664 @@ intros. subst. simpl. -eapply traverse_relative; [ | instantiate (1 := k1); lia ]. +eapply traverse_relative; [ | instantiate (1 := k1); omega ]. @@ -820,2 +817,2 @@ intros. f_equal. -rewrite lift_lift by lia. -f_equal. lia. +rewrite lift_lift by omega. +f_equal. omega. ``` Proof State: ``` 1 subgoal A : Type s : nat IHs : forall (k : nat) (a b : option A) (e : env A), k <= s -> raw_insert k a (raw_insert s b e) = raw_insert (1 + s) b (raw_insert k a e) k : nat a, b : option A e : env A H : S k <= S s ============================ raw_insert (S k) a (raw_insert (S s) b e) = raw_insert (1 + S s) b (raw_insert (S k) a e) ``` Ongoing Proof History: ``` Proof. intros ? k s. generalize s k; clear s k. induction s; intros. - - destruct k; [ | elimtype False; lia ]. + destruct k; [ | elimtype False; omega ]. reflexivity. - { destruct k. - reflexivity. - ? destruct e; replace (1 + S s) with (S (1 + s)) by lia; simpl; f_equal; intuition. ? } ? Qed. ``` Next Tactic: ```
destruct e; replace (1 + <LOOKUP>S : nat -> nat</LOOKUP> s) with (<LOOKUP>S : nat -> nat</LOOKUP> (1 + s)) by omega; simpl; f_equal; eauto with omega. ```
{"final_commit":"3de04cadb63c28bfcffb194cf9e64e75a0c1f697","project":"dblib","repair_file":"\/data\/coq-pearls\/repairs\/dblib\/repair-dblib-d4ece98bb63f75c2a53e9d125338454e6e1393b2-3de04cadb63c28bfcffb194cf9e64e75a0c1f697-8_12_2-8_12_2-24.git.json","initial_commit":"d4ece98bb63f75c2a53e9d125338454e6e1393b2","file":"src\/Environments.v"}
Ongoing Proof History: ``` Proof. intros. repeat rewrite two_power_nat_two_p in *. unfold Z.divide. exists (two_p (Z.of_nat m - Z.of_nat n)). assert ((Z.of_nat m) = (Z.of_nat m - Z.of_nat n) + Z.of_nat n) by lia. rewrite H0 at 1. assert (Z.of_nat m >= 0) by lia. ``` Proof State: ``` 1 subgoal n, m : nat H : two_p (Z.of_nat n) <= two_p (Z.of_nat m) H0 : Z.of_nat m = Z.of_nat m - Z.of_nat n + Z.of_nat n H1 : Z.of_nat m >= 0 ============================ two_p (Z.of_nat m - Z.of_nat n + Z.of_nat n) = two_p (Z.of_nat m - Z.of_nat n) * two_p (Z.of_nat n) ``` Next Tactic: ```
assert (<LOOKUP>Z.of_nat : nat -> Z</LOOKUP> n >= 0) by lia. ```
{"package":"coq-vst","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/VST\/veric\/coqlib4.v"}
Ongoing Proof History: ``` Proof. intros. transitivity (PROPx P (LOCALx Q (EX x:A, SEPx (replace_nth n R (S x))))). * f_equal. f_equal. unfold SEPx. simpl. extensionality rho. revert R H; induction n; destruct R; intros. unfold replace_nth, fold_right. simpl. unfold nth in H. rewrite H; clear H. apply pred_ext. apply exp_left; intro x. apply exp_right with x. apply exp_right with x. auto. apply exp_left; intro x. auto. unfold replace_nth, nth in *. subst m. unfold fold_right_sepcon. fold (fold_right_sepcon R). normalize. unfold nth in H. unfold replace_nth. ``` Proof State: ``` 2 subgoals n : nat P : list Prop Q : list localdef A : Type S : A -> mpred rho : environ IHn : forall R : list mpred, nth n R emp = EX y, S y -> fold_right_sepcon R = EX x : A, fold_right_sepcon (replace_nth n R (S x)) H : emp = EX y, S y ============================ fold_right_sepcon nil = EX _ : A, fold_right_sepcon nil subgoal 2 is: fold_right_sepcon (m :: R) = EX x : A, fold_right_sepcon (replace_nth (Datatypes.S n) (m :: R) (S x)) ``` Next Tactic: ```
simpl. ```
{"package":"coq-vst","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/VST\/floyd\/client_lemmas.v"}
Proof State: ``` 1 subgoal s, s', s'' : t x, y, z : elt ============================ choose empty = None ``` Ongoing Proof History: ``` Proof. ``` Next Tactic: ```
generalize (@choose_1 <LOOKUP>empty : t</LOOKUP>). ```
{"package":"coq","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/theories\/FSets\/FSetEqProperties.v"}
Ongoing Proof History: ``` + unfold size; rewrite (mult_comm h); apply mult_lt_plus; auto. - apply div_lt; rewrite mult_comm... + apply div_lt; rewrite mult_comm; auto. apply ref_list_ulist. repeat rewrite (fun x => mult_comm x h). - unfold out in H4; rewrite H4... + unfold out in H4; rewrite H4; auto. - repeat rewrite (mult_comm h)... + repeat rewrite (mult_comm h); auto. - unfold size; repeat rewrite (mult_comm h); apply mult_lt_plus... + unfold size; repeat rewrite (mult_comm h); apply mult_lt_plus; auto. - unfold size; rewrite (mult_comm w); apply mult_lt_plus... + unfold size; rewrite (mult_comm w); apply mult_lt_plus; auto. - apply div_lt; rewrite mult_comm... + apply div_lt; rewrite mult_comm; auto. repeat rewrite div_mult_comp; auto with arith. rewrite (div_is_0 x1); auto with arith. rewrite (div_is_0 y1); auto with arith. case H; clear H; intros V1 V2; rewrite V1 in H3; rewrite V2 in H3. match goal with H:(In ?X _) |- _ => apply (rm_not_in _ lit_test) with (a := X) (l1 := X::nil) (l2 := gen_rect (div x h * h + div y w) z); auto with datatypes end. exact lit_test_trans. intros; apply lit_test_anti_sym. exact lit_test_exact. apply olist_one. apply gen_rect_ordered. repeat rewrite (fun x => mult_comm x h). repeat ((rewrite mod_mult_comp || rewrite div_mult_comp); auto). - rewrite (div_is_0 (div y w) h)... + rewrite (div_is_0 (div y w) h); auto. - rewrite (mod_small (div y w) h)... + rewrite (mod_small (div y w) h); auto. ? apply div_lt; rewrite (mult_comm w)... ? apply div_lt; rewrite (mult_comm w)... ? case (gen_cell_correct l x y); auto; intros tmp; case tmp; auto; clear tmp. ``` Commit Diff: ``` diff --git a/ListAux.v b/ListAux.v index 769776a..986e88b 100644 --- a/ListAux.v +++ b/ListAux.v @@ -130,0 +131,6 @@ Qed. +Theorem length_app: forall (l1 l2 : list A), length +(l1 ++ l2) = length l1 + length l2. +Proof. +apply app_length. +Qed. + @@ -272 +278 @@ intros A l1 l2; elim l1; simpl; auto. -intros a l H; rewrite app_length, length_map, H; auto. +intros a l H; rewrite length_app, length_map, H; auto. diff --git a/ListOp.v b/ListOp.v index 7a13f04..e1936ca 100644 --- a/ListOp.v +++ b/ListOp.v @@ -145 +145 @@ intros k Rec i j s H; -rewrite app_length, length_take1; auto with arith. +rewrite length_app, length_take1; auto with arith. diff --git a/Sudoku.v b/Sudoku.v index f9e372e..838c038 100644 --- a/Sudoku.v +++ b/Sudoku.v @@ -675 +675 @@ assert (F1: div y w < h). -apply div_lt; rewrite mult_comm... +apply div_lt; rewrite mult_comm; auto. @@ -677,2 +677,6 @@ apply div_lt; rewrite mult_comm... -repeat (rewrite (fun x => mult_comm x h)); rewrite mod_mult_comp... -rewrite div_mult_comp, (mod_small (div y w) h), (div_is_0 (div y w) h), plus_0_r... +repeat (rewrite (fun x => +mult_comm x h)); rewrite mod_mult_comp... +rewrite div_mult_comp; auto. +rewrite (mod_small (div y w) h); auto. +rewrite (div_is_0 (div y w) h); auto. +rewrite plus_0_r. @@ -699,3 +703,3 @@ cut (w <= size). -intros U3 n; generalize h; elim n; simpl... -clear n H1 H2 U1. -+ intros h1; case h1; simpl... +intros U3 n; generalize h; elim n; simpl; +auto with arith; clear n H1 H2 U1. ++ intros h1; case h1; simpl; auto. @@ -709,2 +713,3 @@ apply sym_equal; apply take_nth... -** pose proof (mod_lt y w). -lia. +** apply le_trans with (1 := H1)... +apply le_trans with (2 := U3). +apply lt_le_weak; apply mod_lt... @@ -721 +726 @@ apply mod_lt... -case (le_or_lt (length l) w); intros H3. +case (le_or_lt (length l) w); intros H1. @@ -723 +728,2 @@ case (le_or_lt (length l) w); intros H3. -** rewrite length_take_small, jump_too_far... +** rewrite length_take_small... +rewrite jump_too_far. @@ -726,2 +732,2 @@ repeat rewrite nth_default... -apply le_trans with (1 := H3)... -*** apply le_trans with (1 := H3)... +apply le_trans with (1 := H1)... +*** apply le_trans with (1 := H1)... @@ -732 +738,2 @@ repeat rewrite <- plus_assoc; rewrite minus_plus... -rewrite jump_nth, jump_add, <- jump_nth... +rewrite jump_nth; rewrite jump_add. +rewrite <- jump_nth... @@ -743 +750 @@ generalize (w_pos _ H); intros U2. -rewrite length_take_and_jump... +rewrite length_take_and_jump; auto. @@ -760 +767,2 @@ rewrite (plus_assoc w). -pattern w at 1; rewrite <- mult_1_r, <- mult_plus_distr_l, le_plus_minus_r... +pattern w at 1; rewrite <- mult_1_r; rewrite <- mult_plus_distr_l. +rewrite le_plus_minus_r... ``` Proof State: ``` 3 goals h, w : nat Eq1 : ulist ref_list x, y, z : nat s : list nat H1 : sudoku s U1 : x < size U2 : y < size H2 : get (Pos x y) s = z x1, y1 : nat U3 : 0 < h U4 : 0 < w U5 : forall a b c : nat, a < b * c -> div a b < c U6 : forall n m : nat, 0 < m -> mod n m < m H6 : x1 < h H7 : y1 < w ============================ div y w < h goal 2 is: div y w < h goal 3 is: False ``` Next Tactic: ```
apply <LOOKUP>div_lt : forall a b c : nat, a < b * c -> div a b < c</LOOKUP>; rewrite (mult_comm w); auto. ```
{"final_commit":"427448011e3341d35aa5b9e00f675f6582fcd477","project":"sudoku","repair_file":"\/data\/coq-pearls\/repairs\/sudoku\/repair-sudoku-dc8d4294a32dbb6e0a642dc553b64495f27e6d60-427448011e3341d35aa5b9e00f675f6582fcd477-8_15_2-8_15_2-16.git.json","initial_commit":"dc8d4294a32dbb6e0a642dc553b64495f27e6d60","file":"Sudoku.v"}
Proof State: ``` 1 subgoal E : Type -> Type R : Type r1, r2 : R ============================ Ret r1 β‰ˆ Ret r2 -> r1 = r2 ``` Commit Diff: ``` diff --git a/theories/Core/KTreeFacts.v b/theories/Core/KTreeFacts.v index b911a90..32f56a6 100644 --- a/theories/Core/KTreeFacts.v +++ b/theories/Core/KTreeFacts.v @@ -6,2 +6 @@ Require Import -Program Classes.Morphisms -Setoids.Setoid +Classes.Morphisms Setoids.Setoid @@ -24 +23,2 @@ Eq.Eq -Eq.UpToTaus. +Eq.UpToTaus +Eq.Paco2. @@ -68 +68 @@ Proof. -ginit. gcofix CIH. intros. +ginit. pcofix CIH. intros. @@ -205,2 +205,2 @@ Proof. -revert A B C f g a0. -ginit. gcofix CIH. intros. +revert f g a0. +ginit. pcofix CIH. intros. @@ -268 +268 @@ revert a0. -ginit. gcofix CIH. intros. +ginit. pcofix CIH. intros. @@ -277 +277 @@ revert a. -gcofix CIH'. intros. +pcofix CIH'. intros. @@ -337,2 +337 @@ etau. -specialize (CIH xa). -cbn in CIH. +specialize (CIHL xa). cbn in CIHL. diff --git a/theories/Eq/Eq.v b/theories/Eq/Eq.v index 21ac7e0..b6665d0 100644 --- a/theories/Eq/Eq.v +++ b/theories/Eq/Eq.v @@ -29 +29,2 @@ Basics.Basics Basics.HeterogeneousRelations -Core.ITreeDefinition. +Core.ITreeDefinition +Eq.Paco2. @@ -165,0 +167,54 @@ Hint Unfold id: core. +Lemma eqitF_inv_VisF_r {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 vclo sim} +t1 X2 (e2 : E X2) (k2 : X2 -> _) : eqitF RR b1 +b2 vclo sim t1 (VisF e2 k2) -> (exists k1, t1 = VisF e2 k1 +/\ forall v, vclo sim (k1 v) (k2 v)) \/ (b1 /\ exists t1', t1 += TauF t1' /\ eqitF RR b1 b2 vclo sim (observe t1') (VisF e2 k2)). +Proof. +refine (fun H => match H +in eqitF _ _ _ _ +_ _ t2 return match t2 +return Prop with | VisF e2 +k2 => _ | _ +=> True end with | +EqVis _ _ _ _ +_ _ _ _ _ +=> _ | _ => +_ end); try exact I. +- left; eauto. +- destruct i0; eauto. +Qed. + +Lemma eqitF_inv_VisF_weak {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 vclo sim} X1 +(e1 : E X1) (k1 : X1 -> _) X2 (e2 : E X2) (k2 : X2 +-> _) : eqitF RR b1 b2 vclo sim (VisF e1 k1) (VisF e2 k2) -> exists +p : X1 = X2, eqeq E p e1 e2 /\ pweqeq (vclo sim) p k1 k2. +Proof. +refine (fun H => match H in +eqitF _ _ _ _ _ t1 +t2 return match t1, t2 return Prop +with | VisF e1 k1, VisF e2 +k2 => _ | _, _ => +True end with | EqVis _ +_ _ _ _ _ _ +_ _ => _ | _ +=> _ end); try exact I. +- exists eq_refl; cbn; eauto. +- destruct i; exact I. +Qed. + +Lemma eqitF_inv_VisF {E R1 R2} (RR : R1 -> R2 -> Prop) {b1 b2 +vclo sim} X (e : E X) (k1 : X -> _) (k2 +: X -> _) : eqitF RR b1 b2 vclo sim (VisF e +k1) (VisF e k2) -> forall x, vclo sim (k1 x) (k2 x). +Proof. +intros H. dependent destruction H. assumption. +Qed. + +Lemma eqitF_VisF_gen {E R1 R2} {RR : R1 -> R2 -> Prop} {b1 b2 vclo sim} {X1 +X2} (p : X1 = X2) (e1 : E X1) (k1 : X1 -> _) (e2 : +E X2) (k2 : X2 -> _) : eqeq E p e1 e2 -> pweqeq (vclo sim) +p k1 k2 -> eqitF RR b1 b2 vclo sim (VisF e1 k1) (VisF e2 k2). +Proof. +destruct p; intros <-; cbn; constructor; auto. +Qed. + @@ -215,2 +270,2 @@ split. -pstep. punfold H1. red in H1. red. -hinduction H1 before CIH; intros; eauto. +pstep. punfold H0. red in H0. red. +hinduction H0 before CIH; intros; eauto. @@ -223,2 +278,2 @@ red in REL. pclearbot. pinversion REL. -pstep. punfold H1. red in H1. red. -hinduction H1 before CIH; intros; eauto. +pstep. punfold H0. red in H0. red. +hinduction H0 before CIH; intros; eauto. @@ -326 +381 @@ econstructor. pmonauto. -intros. dependent destruction PR. +intros. destruct PR. @@ -338 +393 @@ pclearbot. econstructor. gclo. -econstructor; cycle -1; eauto with paco. +econstructor; eauto with paco. @@ -340,3 +395,3 @@ econstructor; cycle -1; eauto with paco. -hinduction EQVl before r; intros; subst; try dependent destruction Heqx; try inv CHECK; eauto. -remember (VisF e0 k3) as y. -hinduction EQVr before r; intros; subst; try dependent destruction Heqy; try inv CHECK; eauto. +hinduction EQVl before r; intros; try discriminate Heqx; eauto; inv_Vis. +remember (VisF e k3) as y. +hinduction EQVr before r; intros; try discriminate Heqy; eauto; inv_Vis. @@ -425 +480 @@ Proof. -gcofix CIH. gstep; intros. +pcofix CIH. gstep; intros. @@ -443 +498 @@ Proof. -ginit. gcofix CIH. intros. ``` Ongoing Proof History: ``` Proof. ? apply ITree.Eq.Eq.eqit_inv_ret. ? Qed. ``` Next Tactic: ```
apply ITree.Eq.Eq.eqit_inv_Ret. ```
{"final_commit":"7f00358aeb230f7970571fddaa8b256375910c62","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-672193e2507cf3326b834f5fa47b7518af829b4b-7f00358aeb230f7970571fddaa8b256375910c62-8_10_2-8_10_2-58.git.json","initial_commit":"672193e2507cf3326b834f5fa47b7518af829b4b","file":"theories\/Simple.v"}
Ongoing Proof History: ``` Proof. ``` Proof State: ``` 1 subgoal R : ringType a : R ============================ 'X - a%:P = [:: - a; 1] ``` Next Tactic: ```
by rewrite -['X]<LOOKUP>mul1r : forall [R : ringType], left_id 1 *%R</LOOKUP> -<LOOKUP>polyCN : {morph polyC : c / - c >-> - c}</LOOKUP> -<LOOKUP>cons_poly_def : forall p a, cons_poly a p = p * 'X + a%:P</LOOKUP> <LOOKUP>polyseq_cons : forall c p, cons_poly c p = (if ~~ nilp p then c :: p else c%:P)</LOOKUP> <LOOKUP>polyseq1 : (1 : {poly R}) = [:: 1]</LOOKUP>. ```
{"package":"coq-mathcomp-algebra","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/mathcomp\/algebra\/poly.v"}
Proof State: ``` 3 focused subgoals (shelved: 4) f : R -> R r, r1 : R r2 : Rlist H0 : forall (l2 lf1 lf2 : Rlist) (a b : R), a <= b -> adapted_couple f a b (r1 :: r2) lf1 -> adapted_couple_opt f a b l2 lf2 -> Int_SF lf1 (r1 :: r2) = Int_SF lf2 l2 l2 : Rlist r3 : R lf1 : Rlist r4 : R lf2 : Rlist a, b : R H1 : a <= b H2 : adapted_couple f a b (r :: r1 :: r2) (r3 :: lf1) s1, s2 : R s3 : Rlist H : adapted_couple f a b (s1 :: s2 :: s3) (r4 :: lf2) H3 : (forall i : nat, (i < Init.Nat.pred (Rlength (r4 :: lf2)))%nat -> pos_Rl (r4 :: lf2) i <> pos_Rl (r4 :: lf2) (S i) \/ f (pos_Rl l2 (S i)) <> pos_Rl (r4 :: lf2) i) /\ (forall i : nat, (i < Init.Nat.pred (Rlength l2))%nat -> pos_Rl l2 i <> pos_Rl l2 (S i)) H4 : a <> b Hyp_min : Rmin a b = a Hyp_max : Rmax a b = b H5 : l2 = s1 :: s2 :: s3 H6 : r = s1 H7 : r <> r1 ============================ adapted_couple f a b (?s1 :: s2 :: ?s3) (?r4 :: ?lf2) subgoal 2 is: (forall i : nat, (i < Init.Nat.pred (Rlength (?r4 :: ?lf2)))%nat -> pos_Rl (?r4 :: ?lf2) i <> pos_Rl (?r4 :: ?lf2) (S i) \/ f (pos_Rl (?s1 :: s2 :: ?s3) (S i)) <> pos_Rl (?r4 :: ?lf2) i) /\ (forall i : nat, (i < Init.Nat.pred (Rlength (?s1 :: s2 :: ?s3)))%nat -> pos_Rl (?s1 :: s2 :: ?s3) i <> pos_Rl (?s1 :: s2 :: ?s3) (S i)) subgoal 3 is: Int_SF (r3 :: lf1) (r :: r1 :: r2) = Int_SF (r4 :: lf2) (s1 :: s2 :: s3) ``` Ongoing Proof History: ``` Proof. induction l1 as [ | r r0 H0]. intros l2 lf1 lf2 a b Hyp H H0; unfold adapted_couple in H; decompose [and] H; clear H H0 H2 H3 H1 H6; simpl in H4; discriminate. induction r0 as [|r1 r2 H]. intros; case (Req_dec a b); intro. unfold adapted_couple_opt in H2; elim H2; intros; rewrite (StepFun_P8 H4 H3); rewrite (StepFun_P8 H1 H3); reflexivity. assert (H4 := StepFun_P9 H1 H3); simpl in H4; elim (le_Sn_O _ (le_S_n _ _ H4)). intros; clear H; unfold adapted_couple_opt in H3; elim H3; clear H3; intros; case (Req_dec a b); intro. rewrite (StepFun_P8 H2 H4); rewrite (StepFun_P8 H H4); reflexivity. assert (Hyp_min : Rmin a b = a). unfold Rmin; decide (Rle_dec a b) with H1; reflexivity. assert (Hyp_max : Rmax a b = b). unfold Rmax; decide (Rle_dec a b) with H1; reflexivity. elim (RList_P20 _ (StepFun_P9 H H4)); intros s1 [s2 [s3 H5]]; rewrite H5 in H; rewrite H5; induction lf1 as [| r3 lf1 Hreclf1]. unfold adapted_couple in H2; decompose [and] H2; clear H H2 H4 H5 H3 H6 H8 H7 H11; simpl in H9; discriminate. clear Hreclf1; induction lf2 as [| r4 lf2 Hreclf2]. unfold adapted_couple in H; decompose [and] H; clear H H2 H4 H5 H3 H6 H8 H7 H11; simpl in H9; discriminate. clear Hreclf2; assert (H6 : r = s1). unfold adapted_couple in H, H2; decompose [and] H; decompose [and] H2; clear H H2; simpl in H13; simpl in H8; rewrite H13; rewrite H8; reflexivity. assert (H7 : r3 = r4 \/ r = r1). case (Req_dec r r1); intro. right; assumption. left; cut (r1 <= s2). intro; unfold adapted_couple in H2, H; decompose [and] H; decompose [and] H2; clear H H2; set (x := (r + r1) / 2); assert (H18 := H14 0%nat); assert (H20 := H19 0%nat); unfold constant_D_eq, open_interval in H18, H20; simpl in H18; simpl in H20; rewrite <- (H18 (lt_O_Sn _) x). rewrite <- (H20 (lt_O_Sn _) x). reflexivity. assert (H21 := H13 0%nat (lt_O_Sn _)); simpl in H21; elim H21; intro; [ idtac | elim H7; assumption ]; unfold x; split. apply Rmult_lt_reg_l with 2; [ prove_sup0 | unfold Rdiv; rewrite <- (Rmult_comm (/ 2)); rewrite <- Rmult_assoc; rewrite <- Rinv_r_sym; [ rewrite Rmult_1_l; rewrite double; apply Rplus_lt_compat_l; apply H | discrR ] ]. apply Rmult_lt_reg_l with 2; [ prove_sup0 | unfold Rdiv; rewrite <- (Rmult_comm (/ 2)); rewrite <- Rmult_assoc; rewrite <- Rinv_r_sym; [ rewrite Rmult_1_l; rewrite <- (Rplus_comm r1); rewrite double; apply Rplus_lt_compat_l; apply H | discrR ] ]. rewrite <- H6; assert (H21 := H13 0%nat (lt_O_Sn _)); simpl in H21; elim H21; intro; [ idtac | elim H7; assumption ]; unfold x; split. apply Rmult_lt_reg_l with 2; [ prove_sup0 | unfold Rdiv; rewrite <- (Rmult_comm (/ 2)); rewrite <- Rmult_assoc; rewrite <- Rinv_r_sym; [ rewrite Rmult_1_l; rewrite double; apply Rplus_lt_compat_l; apply H | discrR ] ]. apply Rlt_le_trans with r1; [ apply Rmult_lt_reg_l with 2; [ prove_sup0 | unfold Rdiv; rewrite <- (Rmult_comm (/ 2)); rewrite <- Rmult_assoc; rewrite <- Rinv_r_sym; [ rewrite Rmult_1_l; rewrite <- (Rplus_comm r1); rewrite double; apply Rplus_lt_compat_l; apply H | discrR ] ] | assumption ]. eapply StepFun_P13. apply H4. apply H2. unfold adapted_couple_opt; split. ``` Next Tactic: ```
apply H. ```
{"package":"coq","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/theories\/Reals\/RiemannInt_SF.v"}
Proof State: ``` 1 subgoal E : Type -> Type S : Type R : Type A : Type e0 : E A ans : A ks : unit -> itrace E S k2 : unit -> itree (EvAns E) S REL : forall v : unit, paco2 (eqit_ eq true true id) bot2 (ks v) (k2 v) m2 : itree (EvAns E) S r : itrace E R -> itrace E S -> Prop k : unit -> itree (EvAns E) R H : paco2 trace_prefix_ bot2 (k tt) (ks tt) m1 : itree (EvAns E) S x : VisF (evans A e0 ans) k2 = observe m2 x0 : VisF (evans A e0 ans) ks = observe m1 CIH : forall (b : itrace E R) (b1 b2 : itrace E S), b1 β‰ˆ b2 -> trace_prefix b b1 -> r b b2 ============================ r (k tt) (k2 tt) ``` Ongoing Proof History: ``` Proof. intros E S R m1 m2 REL r X e k H1 CIH. punfold REL. red in REL. dependent induction H1. - eapply IHtrace_prefixF; auto. rewrite <- x in REL. assert (Tau bs β‰ˆ m2). { pfold. auto. } rewrite tau_eutt in H. punfold H. - rewrite <- x in REL. dependent induction REL. + rewrite <- x. constructor. + rewrite <- x. constructor. eapply IHREL; eauto. - pclearbot. rewrite <- x in REL. dependent induction REL. + rewrite <- x. constructor. right. pclearbot. ? eapply CIH; eauto. ? + ? rewrite <- x. ``` Commit Diff: ``` diff --git a/theories/Basics/Basics.v b/theories/Basics/Basics.v index ff16faf..1f991e2 100644 --- a/theories/Basics/Basics.v +++ b/theories/Basics/Basics.v @@ -57,0 +58,2 @@ Definition state (s a : Type) := s -> prod s a. +Definition run_stateT {s m a} (x : stateT s m a) : s -> m (s * a)%type := x. + diff --git a/theories/Basics/HeterogeneousRelations.v b/theories/Basics/HeterogeneousRelations.v index 8894184..ad37cca 100644 --- a/theories/Basics/HeterogeneousRelations.v +++ b/theories/Basics/HeterogeneousRelations.v @@ -751 +751,21 @@ cbn in *. unfold diagonal_prop in *; tauto. -Qed. \ No newline at end of file +Qed. + + + + + +Definition option_rel {X : Type} (R : +relation X) : relation (option X) := +fun mx my => match mx,my with +| Some x, Some y => R +x y | None, None => True +| _, _ => False end. +Hint Unfold option_rel : core. + +Lemma option_rel_eq : forall {A : Type}, +eq_rel (@eq (option A)) (option_rel eq). +Proof. +intros ?; split; intros [] [] EQ; subst; try inv EQ; cbn; auto. +Qed. + +#[global] Hint Unfold option_rel : core. \ No newline at end of file diff --git a/theories/Core/ITreeDefinition.v b/theories/Core/ITreeDefinition.v index 3f88726..eff8f67 100644 --- a/theories/Core/ITreeDefinition.v +++ b/theories/Core/ITreeDefinition.v @@ -69,0 +70,2 @@ Arguments itreeF _ _ : clear implicits. +Create HintDb itree. + diff --git a/theories/Core/KTreeFacts.v b/theories/Core/KTreeFacts.v index a1c2431..9949acf 100644 --- a/theories/Core/KTreeFacts.v +++ b/theories/Core/KTreeFacts.v @@ -113 +113 @@ intros ? ? ?. red. -induction 1; auto. +induction 1; auto with itree. diff --git a/theories/Dijkstra/ITreeDijkstra.v b/theories/Dijkstra/ITreeDijkstra.v index 9529757..b25a16e 100644 --- a/theories/Dijkstra/ITreeDijkstra.v +++ b/theories/Dijkstra/ITreeDijkstra.v @@ -189 +189 @@ is_inf_cons (h : A) (t : stream A) : F t -> is_infF F (ConsF h t). -Hint Constructors is_infF : core. +Hint Constructors is_infF : itree. @@ -198 +198 @@ Proof. -red. intros. red in IN. red. induction IN; auto. +red. intros. red in IN. red. induction IN; auto with itree. @@ -217 +217 @@ s2 : stream A) : F s1 s2 -> bisimF F (ConsF h s1) (ConsF h s2). -Hint Constructors bisimF : core. +Hint Constructors bisimF : itree. @@ -226 +226 @@ Proof. -red. intros. red in IN. red. induction IN; auto. +red. intros. red in IN. red. induction IN; auto with itree. @@ -234 +234 @@ constructor; red. -- pcofix CIH. intros. pfold. red. destruct (observe_stream x); auto. +- pcofix CIH. intros. pfold. red. destruct (observe_stream x); auto with itree. @@ -237 +237 @@ pfold. red. -pinversion H0; subst; auto. +pinversion H0; subst; auto with itree. @@ -239 +239 @@ pinversion H0; subst; auto. -pinversion H0; pinversion H1; auto. +pinversion H0; pinversion H1; auto with itree. @@ -250 +250 @@ pfold. red. unfold app. pinversion H12. -- simpl. destruct s3. destruct s4. pinversion H34; simpl in *; subst; auto. +- simpl. destruct s3. destruct s4. pinversion H34; simpl in *; subst; auto with itree. @@ -282 +282 @@ stream' A -> Prop := | forall_nil : forall_streamF P F NilF | forall_cons (h : A -Hint Constructors forall_streamF : core. +Hint Constructors forall_streamF : itree. @@ -289 +289 @@ Proof. -red. intros. red. red in IN. destruct IN; auto. +red. intros. red. red in IN. destruct IN; auto with itree. @@ -301 +301 @@ F (observe_stream t) -> inf_manyF P F (ConsF h t) | cons_found (h : A) (t -Hint Constructors inf_manyF : core. +Hint Constructors inf_manyF : itree. ``` Next Tactic: ```
eapply CIH; eauto with itree. ```
{"final_commit":"8fcf6f5f81ec9289d56e777b3885e715b3328486","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-1158ff1cbb628aeaa69973bf098058744d458c36-8fcf6f5f81ec9289d56e777b3885e715b3328486-8_10_2-8_12_2-76.git.json","initial_commit":"1158ff1cbb628aeaa69973bf098058744d458c36","file":"theories\/ITrace\/ITracePrefix.v"}
Commit Diff: ``` diff --git a/theories/Basics/Basics.v b/theories/Basics/Basics.v index ff16faf..1f991e2 100644 --- a/theories/Basics/Basics.v +++ b/theories/Basics/Basics.v @@ -57,0 +58,2 @@ Definition state (s a : Type) := s -> prod s a. +Definition run_stateT {s m a} (x : stateT s m a) : s -> m (s * a)%type := x. + diff --git a/theories/Basics/HeterogeneousRelations.v b/theories/Basics/HeterogeneousRelations.v index 8894184..ad37cca 100644 --- a/theories/Basics/HeterogeneousRelations.v +++ b/theories/Basics/HeterogeneousRelations.v @@ -751 +751,21 @@ cbn in *. unfold diagonal_prop in *; tauto. -Qed. \ No newline at end of file +Qed. + + + + + +Definition option_rel {X : Type} (R : +relation X) : relation (option X) := +fun mx my => match mx,my with +| Some x, Some y => R +x y | None, None => True +| _, _ => False end. +Hint Unfold option_rel : core. + +Lemma option_rel_eq : forall {A : Type}, +eq_rel (@eq (option A)) (option_rel eq). +Proof. +intros ?; split; intros [] [] EQ; subst; try inv EQ; cbn; auto. +Qed. + +#[global] Hint Unfold option_rel : core. \ No newline at end of file diff --git a/theories/Core/ITreeDefinition.v b/theories/Core/ITreeDefinition.v index 3f88726..eff8f67 100644 --- a/theories/Core/ITreeDefinition.v +++ b/theories/Core/ITreeDefinition.v @@ -69,0 +70,2 @@ Arguments itreeF _ _ : clear implicits. +Create HintDb itree. + diff --git a/theories/Core/KTreeFacts.v b/theories/Core/KTreeFacts.v index a1c2431..9949acf 100644 --- a/theories/Core/KTreeFacts.v +++ b/theories/Core/KTreeFacts.v @@ -113 +113 @@ intros ? ? ?. red. -induction 1; auto. +induction 1; auto with itree. diff --git a/theories/Dijkstra/ITreeDijkstra.v b/theories/Dijkstra/ITreeDijkstra.v index 9529757..b25a16e 100644 --- a/theories/Dijkstra/ITreeDijkstra.v +++ b/theories/Dijkstra/ITreeDijkstra.v @@ -189 +189 @@ is_inf_cons (h : A) (t : stream A) : F t -> is_infF F (ConsF h t). -Hint Constructors is_infF : core. +Hint Constructors is_infF : itree. @@ -198 +198 @@ Proof. -red. intros. red in IN. red. induction IN; auto. +red. intros. red in IN. red. induction IN; auto with itree. @@ -217 +217 @@ s2 : stream A) : F s1 s2 -> bisimF F (ConsF h s1) (ConsF h s2). -Hint Constructors bisimF : core. +Hint Constructors bisimF : itree. @@ -226 +226 @@ Proof. -red. intros. red in IN. red. induction IN; auto. +red. intros. red in IN. red. induction IN; auto with itree. @@ -234 +234 @@ constructor; red. -- pcofix CIH. intros. pfold. red. destruct (observe_stream x); auto. +- pcofix CIH. intros. pfold. red. destruct (observe_stream x); auto with itree. ``` Proof State: ``` 1 subgoal E : Type -> Type S : Type R : Type A : Type e0 : E A ans : A kr : unit -> itrace E R k2 : unit -> itree (EvAns E) R REL0 : forall v : unit, paco2 (eqit_ eq true true id) bot2 (kr v) (k2 v) m2 : itree (EvAns E) R r : itrace E R -> itrace E S -> Prop b1, b2 : itrace E R b : itrace E S k : unit -> itree (EvAns E) S H : paco2 trace_prefix_ bot2 (kr tt) (k tt) m1 : itree (EvAns E) R REL : paco2 (eqit_ eq true true id) bot2 m1 m2 CIH : forall (b1 b2 : itrace E R) (b : itrace E S), b1 β‰ˆ b2 -> trace_prefix b1 b -> r b2 b x0 : m1 β‰… Vis (evans A e0 ans) kr x : VisF (evans A e0 ans) k2 = observe m2 ============================ r (k2 tt) (k tt) ``` Ongoing Proof History: ``` apply simpobs in x. assert (m1 β‰ˆ m2); auto. rewrite x in H. rewrite tau_eutt in H. auto. + constructor. right. eapply CIH; eauto. eapply trace_prefix_tau_inv; eauto. + constructor. clear Heqb. inv Hbp. dependent induction H0. * apply simpobs in x0. assert (m1 β‰ˆ m2); auto. rewrite x0 in H. punfold H. red in H. cbn in *. dependent induction H. ++ rewrite <- x. apply trace_prefix_ret. ++ rewrite <- x. constructor. eapply IHeqitF; eauto. assert (m1 β‰ˆ m2); auto. apply simpobs in x. rewrite x in H0. rewrite tau_eutt in H0. auto. * eapply IHtrace_prefixF; auto. assert (m1 β‰ˆ m2); auto. apply simpobs in x. rewrite x in H. rewrite tau_eutt in H. auto. * assert (m1 β‰ˆ m2); auto. apply simpobs in x. rewrite x in H0. punfold H0. red in H0. cbn in *. dependent induction H0. ++ rewrite <- x. constructor. ++ rewrite <- x. constructor. eapply IHeqitF; eauto. assert (m1 β‰ˆ m2); auto. apply simpobs in x. rewrite x in H1. rewrite tau_eutt in H1. auto. * pclearbot. apply simpobs in x. assert (m1 β‰ˆ m2); auto. rewrite x in H0. punfold H0. red in H0. cbn in *. dependent induction H0. ++ rewrite <- x. constructor. right. pclearbot. ? eapply CIH; eauto. ? ++ ? rewrite <- x. ``` Next Tactic: ```
eapply CIH; eauto with itree. ```
{"final_commit":"8fcf6f5f81ec9289d56e777b3885e715b3328486","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-1158ff1cbb628aeaa69973bf098058744d458c36-8fcf6f5f81ec9289d56e777b3885e715b3328486-8_10_2-8_12_2-75.git.json","initial_commit":"1158ff1cbb628aeaa69973bf098058744d458c36","file":"theories\/ITrace\/ITracePrefix.v"}
Proof State: ``` 1 subgoal m, n : nat p : t m IHn : t (n + m) ============================ t (S n + m) ``` Ongoing Proof History: ``` Proof. induction n as [|n IHn]. - exact p. - ``` Next Tactic: ```
exact ((fix LS k (<LOOKUP>p : t m</LOOKUP>: <LOOKUP>t : nat -> Set</LOOKUP> k) := match <LOOKUP>p : t m</LOOKUP> with |@F1 k' => @F1 (<LOOKUP>S : nat -> nat</LOOKUP> k') |FS p' => <LOOKUP>FS : forall {n : nat}, t n -> t (S n)</LOOKUP> (LS _ p') end) _ IHn). ```
{"package":"coq","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/theories\/Vectors\/Fin.v"}
Proof State: ``` 1 subgoal S : ident -> Prop i : ident H : ~ S i ============================ closed_wrt_vars S (fun rho : environ => env_set (globals_only rho) ret_temp (eval_id i rho)) ``` Ongoing Proof History: ``` Proof. intros. unfold get_result1. simpl. ``` Next Tactic: ```
hnf; intros. ```
{"package":"coq-vst","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/VST\/floyd\/closed_lemmas.v"}
Ongoing Proof History: ``` Proof. induction n; destruct a; simpl in *; intros; auto. - exfalso; omega. + exfalso; lia. f_equal. eapply IHn; eauto. ? omega. ? Qed. ``` Commit Diff: ``` diff --git a/examples/ConsiderDemo.v b/examples/ConsiderDemo.v index 2151e52..9490a21 100644 --- a/examples/ConsiderDemo.v +++ b/examples/ConsiderDemo.v @@ -7,0 +8 @@ Require Import Coq.ZArith.ZArith. +Require Import Coq.micromega.Lia. @@ -18 +19 @@ consider (ltb x y && ltb y z). -consider (ltb x z); auto. intros. exfalso. omega. +consider (ltb x z); auto. intros. exfalso. lia. @@ -27 +28 @@ intros. consider (ltb x y); consider (ltb y z); consider (ltb x z); intros; auto -exfalso; omega. +exfalso; lia. diff --git a/theories/Data/ListFirstnSkipn.v b/theories/Data/ListFirstnSkipn.v index cf126d1..dda9dff 100644 --- a/theories/Data/ListFirstnSkipn.v +++ b/theories/Data/ListFirstnSkipn.v @@ -2,0 +3 @@ Require Import Coq.ZArith.ZArith. +Require Import Coq.micromega.Lia. @@ -18,2 +19,2 @@ induction n; destruct a; simpl in *; intros; auto. -exfalso; omega. -f_equal. eapply IHn; eauto. omega. +exfalso; lia. +f_equal. eapply IHn; eauto. lia. @@ -27,2 +28,2 @@ induction n; destruct a; simpl; intros; auto. -exfalso; omega. -simpl. f_equal. eapply IHn; omega. +exfalso; lia. +simpl. f_equal. eapply IHn; lia. @@ -43,2 +44,2 @@ destruct n; intros. -omega. -simpl. replace (n - 0) with n; [ | omega ]. reflexivity. +lia. +simpl. replace (n - 0) with n; [ | lia ]. reflexivity. @@ -47 +48 @@ Qed. -Hint Rewrite firstn_app_L firstn_app_R firstn_all firstn_0 firstn_cons using omega : list_rw. +Hint Rewrite firstn_app_L firstn_app_R firstn_all firstn_0 firstn_cons using lia : list_rw. @@ -54,2 +55,2 @@ induction n; destruct a; simpl in *; intros; auto. -exfalso; omega. -eapply IHn. omega. +exfalso; lia. +eapply IHn. lia. @@ -63,2 +64,2 @@ induction n; destruct a; simpl in *; intros; auto. -exfalso; omega. -eapply IHn. omega. +exfalso; lia. +eapply IHn. lia. @@ -79,2 +80,2 @@ induction n; destruct a; simpl in *; intros; auto. -exfalso; omega. -apply IHn; omega. +exfalso; lia. +apply IHn; lia. @@ -88,2 +89,2 @@ destruct n; intros. -omega. -simpl. replace (n - 0) with n; [ | omega ]. reflexivity. +lia. +simpl. replace (n - 0) with n; [ | lia ]. reflexivity. @@ -92 +93 @@ Qed. -Hint Rewrite skipn_app_L skipn_app_R skipn_0 skipn_all skipn_cons using omega : list_rw. \ No newline at end of file +Hint Rewrite skipn_app_L skipn_app_R skipn_0 skipn_all skipn_cons using lia : list_rw. \ No newline at end of file diff --git a/theories/Data/ListNth.v b/theories/Data/ListNth.v index d6a09d0..c2394fd 100644 --- a/theories/Data/ListNth.v +++ b/theories/Data/ListNth.v @@ -1,0 +2 @@ Require Import Coq.Lists.List. +Require Import Coq.Arith.Lt Coq.Arith.Plus. diff --git a/theories/Data/Map/FMapAList.v b/theories/Data/Map/FMapAList.v index 9d25baf..6d62e97 100644 --- a/theories/Data/Map/FMapAList.v +++ b/theories/Data/Map/FMapAList.v @@ -8,0 +9,9 @@ Require Import ExtLib.Structures.Functor. +From Coq Require +Import Basics. +From ExtLib +Require Import +Extras OptionMonad. +Import +FunNotation +FunctorNotation. +Open Scope program_scope. @@ -37,0 +47,14 @@ alist_find k ms end. +Definition alist_find' (k: K) : alist -> option V +:= fmap snd ∘ find (rel_dec k ∘ fst). + +Lemma alist_find_alt (m: alist) : forall k: K, +alist_find k m = alist_find' k m. +Proof. +induction m; intuition. +unfold alist_find', compose. +simpl. +destruct (k ?[ R ] a0) eqn:Heq; intuition. +rewrite IHm. +reflexivity. +Qed. + @@ -51,0 +75,13 @@ in fold_alist acc m end. + +Definition fold_alist' : T -> alist -> T +:= flip $ fold_left (flip $ uncurry f). + +Lemma fold_alist_alt (map: alist) : forall acc: T, +fold_alist acc map = fold_alist' acc map. +Proof. +induction map; intuition. +simpl. +rewrite IHmap. +reflexivity. +Qed. + diff --git a/theories/Data/Monads/ListMonad.v b/theories/Data/Monads/ListMonad.v index fd6906f..7023710 100644 --- a/theories/Data/Monads/ListMonad.v +++ b/theories/Data/Monads/ListMonad.v @@ -7,8 +7,4 @@ Set Strict Implicit. -Global Instance Monad_list : Monad list := -{ ret := fun _ v -=> v :: nil ; bind -:= fun _ _ => fix -recur c1 c2 := match c1 -with | nil => nil | -a :: b => c2 a -++ recur b c2 end }. ``` Proof State: ``` 1 goal T : Type n : nat IHn : forall a b : list T, n <= length a -> firstn n (a ++ b) = firstn n a t : T a, b : list T H : S n <= S (length a) ============================ n <= length a ``` Next Tactic: ```
lia. ```
{"final_commit":"8f0f0228332007a1b73abb01fb9bf828023007fa","project":"coq-ext-lib","repair_file":"\/data\/coq-pearls\/repairs\/coq-ext-lib\/repair-coq-ext-lib-7532d92d1d6a9d7c9c45e111766f65421f6e09ba-8f0f0228332007a1b73abb01fb9bf828023007fa-8_12_2-8_14_1-2.git.json","initial_commit":"7532d92d1d6a9d7c9c45e111766f65421f6e09ba","file":"theories\/Data\/ListFirstnSkipn.v"}
Ongoing Proof History: ``` Proof. induction e; simpl; intros. - - replace n with k by lia. + replace n with k by omega. assumption. - ? eauto using agree_insert with lia. ? Qed. ``` Commit Diff: ``` diff --git a/src/DblibTactics.v b/src/DblibTactics.v index 2a08b3e..2aa54e9 100644 --- a/src/DblibTactics.v +++ b/src/DblibTactics.v @@ -2,3 +2 @@ Set Implicit Arguments. -Require Import Compare_dec. -Require Import Peano_dec. -Require Import Lia. +Require Export Omega. @@ -12,7 +10,8 @@ Hint Extern 1 => f_equal : f_equal. -Hint Extern 1 (_ = _ :> nat) => reflexivity : lia. -Hint Extern 3 (_ = _ :> nat) => lia : lia. -Hint Extern 3 (_ <> _ :> nat) => lia : lia. -Hint Extern 3 (_ < _) => lia : lia. -Hint Extern 3 (_ > _) => lia : lia. -Hint Extern 3 (_ <= _) => lia : lia. -Hint Extern 3 (_ >= _) => lia : lia. +Hint Extern 1 (_ = _ :> nat) => reflexivity : omega. + +Hint Extern 1 (_ = _ :> nat) => omega : omega. +Hint Extern 1 (_ <> _ :> nat) => omega : omega. +Hint Extern 1 (_ < _) => omega : omega. +Hint Extern 1 (_ > _) => omega : omega. +Hint Extern 1 (_ <= _) => omega : omega. +Hint Extern 1 (_ >= _) => omega : omega. @@ -43 +42 @@ Ltac dblib_by_cases := repeat dblib_inspect_cases; try solve -[ intros; exfalso; lia ]; intros. \ No newline at end of file +[ intros; exfalso; omega ]; intros. \ No newline at end of file diff --git a/src/DeBruijn.v b/src/DeBruijn.v index 45bfa51..7a58a05 100644 --- a/src/DeBruijn.v +++ b/src/DeBruijn.v @@ -3,2 +2,0 @@ Generalizable All Variables. -Require Import Arith. -Require Import Lia. @@ -286,3 +284,3 @@ intros. -replace k with (ws + (k - ws)) by lia. -erewrite <- lift_lift by lia. -replace (ws + (k - ws) - ws) with (k - ws) by lia. +replace k with (ws + (k - ws)) by omega. +erewrite <- lift_lift by omega. +replace (ws + (k - ws) - ws) with (k - ws) by omega. @@ -456,2 +454,2 @@ eapply traverse_relative with (p := 0). -intros m ?. replace (m + 0) with m by lia. eauto. -lia. +intros m ?. replace (m + 0) with m by omega. eauto. +omega. @@ -483,4 +481,3 @@ Qed. -Ltac just_do_it := unfold -subst, Subst_idx, subst_idx, lift, -Lift_idx, var, Var_idx; intros; -dblib_by_cases; eauto with lia. +Ltac just_do_it := unfold subst, Subst_idx, subst_idx, +lift, Lift_idx, var, Var_idx; intros; solve [ +dblib_by_cases; eauto with f_equal omega ]. @@ -512,2 +509,2 @@ Ltac lift_idx := first [ rewrite @lift_idx_recent by -solve [ lia | eauto with lift_idx_hints -] | rewrite @lift_idx_old by lia ]. +solve [ omega | eauto with lift_idx_hints +] | rewrite @lift_idx_old by omega ]. @@ -518,2 +515,2 @@ Ltac lift_idx_in h := first [ rewrite @lift_idx_recent in -h by solve [ lia | eauto with lift_idx_hints -] | rewrite @lift_idx_old in h by lia ]. +h by solve [ omega | eauto with lift_idx_hints +] | rewrite @lift_idx_old in h by omega ]. @@ -522,2 +519,2 @@ Ltac lift_idx_all := first [ rewrite @lift_idx_recent in * -by solve [ lia | eauto with lift_idx_hints ] -| rewrite @lift_idx_old in * by lia ]. +by solve [ omega | eauto with lift_idx_hints ] +| rewrite @lift_idx_old in * by omega ]. @@ -587,2 +584,2 @@ Ltac subst_idx := first -lia | rewrite -@subst_idx_miss_1 by lia +omega | rewrite +@subst_idx_miss_1 by omega @@ -590 +587 @@ lia | rewrite -by lia ]. +by omega ]. @@ -594,2 +591,2 @@ Ltac subst_idx_in h := first -by lia | rewrite @subst_idx_miss_1 -in h by lia +by omega | rewrite @subst_idx_miss_1 +in h by omega @@ -597 +594 @@ in h by lia -h by lia ]. +h by omega ]. @@ -601,2 +598,2 @@ rewrite @subst_idx_identity in * by -lia | rewrite @subst_idx_miss_1 -in * by lia +omega | rewrite @subst_idx_miss_1 +in * by omega @@ -604 +601 @@ in * by lia -* by lia ]. +* by omega ]. @@ -667 +664 @@ intros. subst. simpl. -eapply traverse_relative; [ | instantiate (1 := k1); lia ]. +eapply traverse_relative; [ | instantiate (1 := k1); omega ]. @@ -820,2 +817,2 @@ intros. f_equal. -rewrite lift_lift by lia. -f_equal. lia. +rewrite lift_lift by omega. +f_equal. omega. @@ -835 +832 @@ intros. f_equal. -rewrite lift_lift_fuse by lia. reflexivity. +rewrite lift_lift_fuse by omega. reflexivity. ``` Proof State: ``` 1 subgoal A : Type a : A e : list A IHe : forall (e1 e2 : env A) (k n : nat), agree e1 e2 k -> k + length e = n -> agree (concat e1 e) (concat e2 e) n e1, e2 : env A k, n : nat H : agree e1 e2 k H0 : k + S (length e) = n ============================ agree (concat (insert 0 a e1) e) (concat (insert 0 a e2) e) n ``` Next Tactic: ```
eauto using <LOOKUP>agree_insert : forall [A : Type] [e1 e2 : env A] [k : nat], agree e1 e2 k -> forall (x : nat) (o : option A), x <= k -> agree (raw_insert x o e1) (raw_insert x o e2) (1 + k)</LOOKUP> with omega. ```
{"final_commit":"3de04cadb63c28bfcffb194cf9e64e75a0c1f697","project":"dblib","repair_file":"\/data\/coq-pearls\/repairs\/dblib\/repair-dblib-d4ece98bb63f75c2a53e9d125338454e6e1393b2-3de04cadb63c28bfcffb194cf9e64e75a0c1f697-8_12_2-8_12_2-36.git.json","initial_commit":"d4ece98bb63f75c2a53e9d125338454e6e1393b2","file":"src\/Environments.v"}
Proof State: ``` 4 subgoals x, h, eps, l1, alp_f2, alp_f2t2 : R eps_f2 : posreal f2 : R -> R H : 0 < eps H0 : f2 x <> 0 H1 : f2 (x + h) <> 0 H2 : forall a : R, Rabs a < alp_f2t2 -> Rabs (f2 (x + a) - f2 x) < Rabs (eps * (f2 x)Β² / (8 * l1)) H3 : forall a : R, Rabs a < Rmin eps_f2 alp_f2 -> / Rabs (f2 (x + a)) < 2 / Rabs (f2 x) H4 : h <> 0 H5 : Rabs h < alp_f2t2 H6 : Rabs h < Rmin eps_f2 alp_f2 H7 : l1 <> 0 H8 : / Rabs (f2 (x + h)) < 2 / Rabs (f2 x) H9 : Rabs (f2 (x + h) - f2 x) < Rabs (eps * (f2 x)Β² / (8 * l1)) ============================ 2 * (Rabs l1 * (/ Rabs (f2 x) * / Rabs (f2 x))) * (eps * (Rabs (f2 x) * Rabs (f2 x)) * (/ 8 * / Rabs l1)) = eps * / 4 subgoal 2 is: 2 = Rabs 2 subgoal 3 is: 8 = Rabs 8 subgoal 4 is: eps = Rabs eps ``` Ongoing Proof History: ``` Proof. intros. assert (H8 := H3 h H6). assert (H9 := H2 h H5). apply Rle_lt_trans with (Rabs (l1 / (f2 x * f2 (x + h))) * Rabs (eps * Rsqr (f2 x) / (8 * l1))). rewrite Rabs_mult; apply Rmult_le_compat_l. apply Rabs_pos. rewrite <- (Rabs_Ropp (f2 x - f2 (x + h))); rewrite Ropp_minus_distr. left; apply H9. apply Rlt_le_trans with (Rabs (2 * (l1 / (f2 x * f2 x))) * Rabs (eps * Rsqr (f2 x) / (8 * l1))). apply Rmult_lt_compat_r. apply Rabs_pos_lt. unfold Rdiv; unfold Rsqr; repeat apply prod_neq_R0; try assumption || discrR. red; intro H10; rewrite H10 in H; elim (Rlt_irrefl _ H). apply Rinv_neq_0_compat; apply prod_neq_R0; try assumption || discrR. unfold Rdiv. repeat rewrite Rinv_mult_distr; try assumption. repeat rewrite Rabs_mult. replace (Rabs 2) with 2. rewrite (Rmult_comm 2). replace (Rabs l1 * (Rabs (/ f2 x) * Rabs (/ f2 x)) * 2) with (Rabs l1 * (Rabs (/ f2 x) * (Rabs (/ f2 x) * 2))); [ idtac | ring ]. repeat apply Rmult_lt_compat_l. apply Rabs_pos_lt; assumption. apply Rabs_pos_lt; apply Rinv_neq_0_compat; assumption. repeat rewrite Rabs_Rinv; try assumption. rewrite <- (Rmult_comm 2). unfold Rdiv in H8; exact H8. symmetry ; apply Rabs_right; left; prove_sup0. right. unfold Rsqr, Rdiv. do 1 rewrite Rinv_mult_distr; try assumption || discrR. do 1 rewrite Rinv_mult_distr; try assumption || discrR. repeat rewrite Rabs_mult. repeat rewrite Rabs_Rinv; try assumption || discrR. replace (Rabs eps) with eps. replace (Rabs 8) with 8. replace (Rabs 2) with 2. ``` Next Tactic: ```
replace 8 with (4 * 2); [ idtac | ring ]. ```
{"package":"coq","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/theories\/Reals\/Ranalysis2.v"}
Proof State: ``` 1 subgoal n : nat r : AV.address -> resource m1, m2 : ghost s2 : {g : ghost.Ghost & {a : ghost.G | ghost.valid a}} p2 : preds g0 : list (option ({g : ghost.Ghost & {a : ghost.G | ghost.valid a}} * preds)) IHghost_join : forall g1 : ghost, ghost_fmap (approx n) (approx n) g0 = ghost_fmap (approx n) (approx n) g1 -> ghost_fmap (approx n) (approx n) m1 = m1 H0 : ghost_join m1 m2 (ghost_fmap (approx n) (approx n) g0) s : {g : ghost.Ghost & {a : ghost.G | ghost.valid a}} p : preds s0 : {g : ghost.Ghost & {a : ghost.G | ghost.valid a}} p0 : preds H : join s s0 s2 H2 : join p p0 (preds_fmap (approx n) (approx n) p2) ============================ Some (s, preds_fmap (approx n) (approx n) p) = Some (s, p) ``` Ongoing Proof History: ``` Proof. intros. rewrite rmap_level_eq. unfold ghost_of in *. revert H; case_eq (unsquash phi); intros n ? ?. generalize H; rewrite <- (squash_unsquash phi). rewrite H. rewrite unsquash_squash. simpl; intros. injection H0. clear H0. intro. clear phi H. rewrite <- H0 in H1. clear H0. unfold rmap_fmap in *. destruct r. simpl in H1; destruct H1. remember (ghost_fmap (approx n) (approx n) g0) as g'. revert dependent g0; induction H; auto; intros; subst. - rewrite ghost_fmap_fmap, approx_oo_approx; auto. - destruct g0; inv Heqg'. simpl; f_equal; eauto. inv H; auto; simpl. + destruct o as [[]|]; auto; simpl. rewrite preds_fmap_fmap, approx_oo_approx; auto. + destruct a0, a3, a4; inv H4; simpl in *. destruct o as [[]|]; inv H1. ``` Next Tactic: ```
inv H2. ```
{"package":"coq-vst","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/VST\/veric\/rmaps_lemmas.v"}
Proof State: ``` 2 focused subgoals (shelved: 1) n : nat H_strong2 : forall k : nat, k < S n -> forall (e : Expr) (Οƒ Οƒ' : Store) (ρ : Env) (ψ l : Value), (⟦ e ⟧ (Οƒ, ρ, ψ )( k)) = Success l Οƒ' -> wf Οƒ -> (codom ρ βˆͺ {ψ}) βͺ½ Οƒ -> ((Οƒ, codom ρ βˆͺ {ψ}) β‹– (Οƒ', {l})) /\ (Οƒ ⇝ Οƒ' β‹– codom ρ βˆͺ {ψ}) e0 : Expr f : Var Οƒ, Οƒ' : Store ρ : Env ψ, l, v : Value matched : (⟦ e0 ⟧ (Οƒ, ρ, ψ )( n)) = Success v Οƒ' c : ClN e : Env matched0 : getObj Οƒ' v = Some (c, e) matched2 : getVal e f = Some l H_wf : wf Οƒ H_codom : (codom ρ βˆͺ {ψ}) βͺ½ Οƒ H_strong : forall (e : Expr) (Οƒ Οƒ' : Store) (ρ : Env) (ψ l : Value), (⟦ e ⟧ (Οƒ, ρ, ψ )( n)) = Success l Οƒ' -> wf Οƒ -> (codom ρ βˆͺ {ψ}) βͺ½ Οƒ -> ((Οƒ, codom ρ βˆͺ {ψ}) β‹– (Οƒ', {l})) /\ (Οƒ ⇝ Οƒ' β‹– codom ρ βˆͺ {ψ}) H : dom Οƒ <= dom Οƒ' A2 : (Οƒ, codom ρ βˆͺ {ψ}) β‹– (Οƒ', {v}) A3 : Οƒ ⇝ Οƒ' β‹– codom ρ βˆͺ {ψ} ============================ Οƒ' ⊨ v ⇝ ?l1 subgoal 2 is: Οƒ' ⊨ ?l1 ⇝ l ``` Commit Diff: ``` diff --git a/Reachability.v b/Reachability.v index 5c47635..1b96ea3 100644 --- a/Reachability.v +++ b/Reachability.v @@ -18,5 +18,20 @@ Import Eval.Evaluator. - -Inductive reachability : Store -> Loc -> Loc ->Prop := |rch_heap : forall l Οƒ, l < (dom Οƒ) -> (reachability Οƒ -l l) |rch_trans : forall l0 l1 l2 C Ο‰ Οƒ, (reachability Οƒ l0 l1) -> (getObj Οƒ l1 = Some -(C, Ο‰)) -> (exists f, (getVal Ο‰ f = Some l2)) -> (l2 < dom Οƒ) -> (reachability Οƒ l0 l2). -Notation "Οƒ ⊨ l1 ⇝ l2" := (reachability Οƒ l1 l2) (at level 80, l1 at level 80, l2 at level 80). +Reserved Notation "Οƒ ⊨ l1 ⇝ l2" (at level 80, l1 at level 80, l2 at level 80). +Inductive reachability : Store -> Loc +-> Loc ->Prop := | rch_heap: +forall l Οƒ, l < (dom +Οƒ) -> Οƒ ⊨ l ⇝ +l | rch_step: forall l0 l1 +C f Ο‰ Οƒ, l1 < +(dom Οƒ) -> getObj Οƒ l0 += Some (C, Ο‰) -> getVal +Ο‰ f = Some l1 -> +Οƒ ⊨ l0 ⇝ l1 +| rch_trans: forall l0 l1 +l2 Οƒ, Οƒ ⊨ l0 +⇝ l1 -> Οƒ ⊨ +l1 ⇝ l2 -> Οƒ +⊨ l0 ⇝ l2 where +"Οƒ ⊨ l1 ⇝ l2" +:= (reachability Οƒ l1 l2). +Hint Resolve rch_heap rch_step rch_trans: rch. +Hint Rewrite update_dom: rch. @@ -41,3 +56 @@ Proof. -intros Οƒ l1 l2 l3 H1 H2. -induction H2 => //. -apply (rch_trans l1 l2 l3 C Ο‰ Οƒ (IHreachability H1) H H0 H3). +eauto using rch_trans. @@ -44,0 +58 @@ Qed. + @@ -60 +74 @@ intros. -induction H; steps. +induction H; repeat steps || eapply_anywhere getObj_dom. @@ -64,11 +78,11 @@ Qed. -Lemma reachability_rev: forall Οƒ l l', Οƒ ⊨ l -⇝ l' -> (l = l' /\ l < -dom Οƒ) \/ (exists C Ο‰ f l0, getObj -Οƒ l = Some(C, Ο‰) /\ getVal Ο‰ f -= Some l0 /\ Οƒ ⊨ l0 ⇝ l'). -Proof. -intros. -induction H; steps. -+ right. repeat eexists; eauto using rch_heap. -+ right. repeat eexists; eauto using rch_heap, rch_trans. -Qed. + + + + + + + + + + + @@ -85,3 +98,0 @@ induction H2; eauto. -steps. -pose proof (H1 l1 l2 C Ο‰ f). -eapply H0; eauto. ``` Ongoing Proof History: ``` Proof. apply strong_induction. unfold ScopabilityProp. intros n H_strong2 e Οƒ Οƒ' ρ ψ l H_success H_wf H_codom. destruct n => //. move: (H_strong2 n (le_n (S n)) ) => H_strong. destruct e as [x | this | e0 f | e0 m el | C el | e0 f e1 e2]; simpl in H_success; repeat destruct_match; try discriminate; try invert_constructor_equalities; subst. + split. unfold scoping; steps. exists l; steps. apply Union_introl. unfold codom, In. eauto using nth_error_In. apply_anywhere reachability_singleton => //. unfold scoping_preservation; steps. + split. unfold scoping; steps. unfold reachability_set in *; steps. inSingleton. exists l. steps; eauto using Union_intror. unfold scoping_preservation; steps. + unfold scoping; intros; simpl. pose proof (PartialMonotonicity.partialMonotonicity_theorem_dom _ _ _ _ _ _ _ matched). move : (H_strong _ _ _ _ _ _ matched H_wf H_codom) => [A2 A3]. assert ((Οƒ', {v}) β‹– (Οƒ', {l})) as B1. { apply scoping_reachability. eapply rch_trans; eauto. ? apply rch_heap; eauto using getObj_dom. ? eapply wellformedness_conserved in matched0; eauto. ? } ``` Next Tactic: ```
eauto using <LOOKUP>getObj_dom : forall (Οƒ : Store) (o : Obj) (l : nat), getObj Οƒ l = Some o -> l < dom Οƒ</LOOKUP> with rch. ```
{"final_commit":"2dfd0b6c87b32ebd6bd1dd83e76e654e73dd3696","project":"celsius","repair_file":"\/data\/coq-pearls\/repairs\/celsius\/repair-celsius-a726b4d083864e7cb26d15bceeb49fbc418b2811-2dfd0b6c87b32ebd6bd1dd83e76e654e73dd3696-8_13_2-8_13_2-17.git.json","initial_commit":"a726b4d083864e7cb26d15bceeb49fbc418b2811","file":"Scopability.v"}
Commit Diff: ``` diff --git a/Div.v b/Div.v index 7e7d694..e83d601 100644 --- a/Div.v +++ b/Div.v @@ -57,2 +57,2 @@ n) p) (c2 := mod n p); try apply mod_lt; auto with arith. -rewrite mult_plus_distr_r; rewrite <- plus_assoc; repeat -rewrite <- div_mod_correct; auto with arith. +rewrite mult_plus_distr_r, <- plus_assoc; repeat rewrite +<- div_mod_correct; auto with arith. @@ -67,4 +67,2 @@ intros n m p H; apply plus_reg_l with (div (p * m + n) p * p). -rewrite <- div_mod_correct; auto. -rewrite div_mult_comp; auto. -rewrite mult_plus_distr_r; rewrite (mult_comm p); rewrite <- plus_assoc. -eq_tac; apply div_mod_correct; auto. +rewrite <- div_mod_correct, div_mult_comp, mult_plus_distr_r, (mult_comm p), <- plus_assoc by assumption. +f_equal. now apply div_mod_correct. diff --git a/ListAux.v b/ListAux.v index 82a8d82..986e88b 100644 --- a/ListAux.v +++ b/ListAux.v @@ -76 +76 @@ exists (nil (A:=A)); exists l; simpl; auto. -eq_tac; auto. +f_equal; auto. @@ -78 +78 @@ case H; auto; intros l1 [l2 Hl2]; exists (a1 :: l1); exists l2; simpl; auto. -eq_tac; auto. +f_equal; auto. @@ -146 +146 @@ intros a l H l2 l3 l4 a0; case l3; simpl. -intros H0; left; exists l; eq_tac; injection H0; auto. +intros H0; left; exists l; f_equal; injection H0; auto. @@ -150 +150 @@ intros [l5 H1]. -left; exists l5; eq_tac; injection H0; auto. +left; exists l5; f_equal; injection H0; auto. @@ -165,2 +165,2 @@ intros H0; right; right; injection H0; split; auto. -eq_tac; auto. -intros b0 l0 H0; left; exists l0; injection H0; intros; (repeat eq_tac); auto. +f_equal; auto. +intros b0 l0 H0; left; exists l0; injection H0; intros; (repeat f_equal); auto. @@ -169 +169 @@ injection H0; auto. -intros [l5 HH1]; left; exists l5; eq_tac; auto; injection H0; auto. +intros [l5 HH1]; left; exists l5; f_equal; auto; injection H0; auto. @@ -171 +171 @@ intros [H1|[H1 H2]]; auto. -right; right; split; auto; eq_tac; auto; injection H0; auto. +right; right; split; auto; f_equal; auto; injection H0; auto. @@ -190 +190 @@ exists (b :: l4); exists l5; exists b1; (repeat (simpl; split; auto)). -eq_tac; auto. +f_equal; auto. @@ -237 +237 @@ intros H4 H5; split; auto. -eq_tac; auto. +f_equal; auto. @@ -278 +278 @@ intros A l1 l2; elim l1; simpl; auto. -intros a l H; rewrite length_app; rewrite length_map; rewrite H; auto. +intros a l H; rewrite length_app, length_map, H; auto. diff --git a/ListOp.v b/ListOp.v index b9797d9..e1936ca 100644 --- a/ListOp.v +++ b/ListOp.v @@ -138,2 +138 @@ intros a b c; elim c; simpl; auto. -intros n H; rewrite jump_nil; rewrite -take_nil; rewrite H; auto with arith. +intros n H; rewrite jump_nil, take_nil, H; auto with arith. @@ -146,2 +145,2 @@ intros k Rec i j s H; -rewrite length_app; rewrite length_take1; auto with arith. -eq_tac; auto. +rewrite length_app, length_take1; auto with arith. +f_equal; auto. @@ -199 +198 @@ intros l; elim l; simpl; auto with datatypes. -intros; eq_tac; auto. +intros; f_equal; auto. @@ -206 +205 @@ intros H; contradict H; auto with arith. -intros n1 H; eq_tac; auto with arith. +intros n1 H; f_equal; auto with arith. @@ -219 +218 @@ intros a l1 Rec n; case n; auto; clear n. -simpl length; intros n H; simpl; eq_tac; auto with arith. +simpl length; intros n H; simpl; f_equal; auto with arith. diff --git a/OrderedList.v b/OrderedList.v index f2762b8..3136749 100644 --- a/OrderedList.v +++ b/OrderedList.v @@ -624 +624 @@ intros; discriminate. -intros; eq_tac; auto. +intros; f_equal; auto. diff --git a/Permutation.v b/Permutation.v index ecfa699..ccd8195 100644 --- a/Permutation.v +++ b/Permutation.v @@ -33,2 +32,0 @@ Variable A : Set. -Definition permutation (l1 l2 : list A) := @Permutation A l1 l2. - ``` Ongoing Proof History: ``` Proof. intros n; elim n; simpl in |- *; auto. intros l1 l2; case l2. ? intros H H0; rewrite perm_nil_inv with (1 := H0); auto with datatypes. ? simpl in |- *; intros; discriminate. ? intros n0 H l1; case l1. ``` Proof State: ``` 3 goals A : Set n : nat l1, l2 : list A ============================ 0 = length nil -> Permutation l1 nil -> nil = l1 \/ False goal 2 is: forall (a : A) (l : list A), 0 = length (a :: l) -> Permutation l1 (a :: l) -> nil = l1 \/ False goal 3 is: forall n0 : nat, (forall l1 l2 : list A, n0 = length l2 -> Permutation l1 l2 -> In l1 (all_permutations_aux l2 n0)) -> forall l1 l2 : list A, S n0 = length l2 -> Permutation l1 l2 -> In l1 (flat_map (fun p : A * list A => map (cons (fst p)) (all_permutations_aux (snd p) n0)) (split_one l2)) ``` Next Tactic: ```
intros H H0; rewrite (<LOOKUP>Permutation_nil : forall [A : Type] [l : list A], Permutation nil l -> l = nil</LOOKUP> (<LOOKUP>Permutation_sym : forall [A : Type] [l l' : list A], Permutation l l' -> Permutation l' l</LOOKUP> H0)); auto with datatypes. ```
{"final_commit":"82eb0678991955dfa8f12720d652ad5adb465c3e","project":"sudoku","repair_file":"\/data\/coq-pearls\/repairs\/sudoku\/repair-sudoku-b5543771d6bdeab13ec58ac6c8d281815d96ed62-82eb0678991955dfa8f12720d652ad5adb465c3e-8_15_2-8_15_2-37.git.json","initial_commit":"b5543771d6bdeab13ec58ac6c8d281815d96ed62","file":"Permutation.v"}
Ongoing Proof History: ``` + Proof. ? Proof with auto. ? generalize (ref_list_ulist); intros Eq1. ? generalize (ref_list_length); intros Eq2. ``` Proof State: ``` 1 goal h, w : nat ============================ forall s : list nat, length s = size * size -> sat init_c s <-> sudoku s ``` Commit Diff: ``` diff --git a/ListAux.v b/ListAux.v index 769776a..986e88b 100644 --- a/ListAux.v +++ b/ListAux.v @@ -130,0 +131,6 @@ Qed. +Theorem length_app: forall (l1 l2 : list A), length +(l1 ++ l2) = length l1 + length l2. +Proof. +apply app_length. +Qed. + @@ -272 +278 @@ intros A l1 l2; elim l1; simpl; auto. -intros a l H; rewrite app_length, length_map, H; auto. +intros a l H; rewrite length_app, length_map, H; auto. diff --git a/ListOp.v b/ListOp.v index 7a13f04..e1936ca 100644 --- a/ListOp.v +++ b/ListOp.v @@ -145 +145 @@ intros k Rec i j s H; -rewrite app_length, length_take1; auto with arith. +rewrite length_app, length_take1; auto with arith. diff --git a/Sudoku.v b/Sudoku.v index f9e372e..3a01485 100644 --- a/Sudoku.v +++ b/Sudoku.v @@ -675 +675 @@ assert (F1: div y w < h). -apply div_lt; rewrite mult_comm... +apply div_lt; rewrite mult_comm; auto. @@ -677,2 +677,6 @@ apply div_lt; rewrite mult_comm... -repeat (rewrite (fun x => mult_comm x h)); rewrite mod_mult_comp... -rewrite div_mult_comp, (mod_small (div y w) h), (div_is_0 (div y w) h), plus_0_r... +repeat (rewrite (fun x => +mult_comm x h)); rewrite mod_mult_comp... +rewrite div_mult_comp; auto. +rewrite (mod_small (div y w) h); auto. +rewrite (div_is_0 (div y w) h); auto. +rewrite plus_0_r. @@ -699,3 +703,3 @@ cut (w <= size). -intros U3 n; generalize h; elim n; simpl... -clear n H1 H2 U1. -+ intros h1; case h1; simpl... +intros U3 n; generalize h; elim n; simpl; +auto with arith; clear n H1 H2 U1. ++ intros h1; case h1; simpl; auto. @@ -709,2 +713,3 @@ apply sym_equal; apply take_nth... -** pose proof (mod_lt y w). -lia. +** apply le_trans with (1 := H1)... +apply le_trans with (2 := U3). +apply lt_le_weak; apply mod_lt... @@ -721 +726 @@ apply mod_lt... -case (le_or_lt (length l) w); intros H3. +case (le_or_lt (length l) w); intros H1. @@ -723 +728,2 @@ case (le_or_lt (length l) w); intros H3. -** rewrite length_take_small, jump_too_far... +** rewrite length_take_small... +rewrite jump_too_far. @@ -726,2 +732,2 @@ repeat rewrite nth_default... -apply le_trans with (1 := H3)... -*** apply le_trans with (1 := H3)... +apply le_trans with (1 := H1)... +*** apply le_trans with (1 := H1)... @@ -732 +738,2 @@ repeat rewrite <- plus_assoc; rewrite minus_plus... -rewrite jump_nth, jump_add, <- jump_nth... +rewrite jump_nth; rewrite jump_add. +rewrite <- jump_nth... @@ -743 +750 @@ generalize (w_pos _ H); intros U2. -rewrite length_take_and_jump... +rewrite length_take_and_jump; auto. @@ -760 +767,2 @@ rewrite (plus_assoc w). -pattern w at 1; rewrite <- mult_1_r, <- mult_plus_distr_l, le_plus_minus_r... +pattern w at 1; rewrite <- mult_1_r; rewrite <- mult_plus_distr_l. +rewrite le_plus_minus_r... @@ -846,2 +854,2 @@ l2 l3 -> lit_test l1 l3 = lit_test l1 l2. -Proof with auto. -intros l1 l2 l3; case l1; case l2; case l3; simpl... +Proof. +intros l1 l2 l3; case l1; case l2; case l3; simpl; auto. @@ -851 +859 @@ case_eq (pos_test p2 p3); intros H1. -rewrite (pos_test_trans p1 p2 p3); rewrite H... +rewrite (pos_test_trans p1 p2 p3); rewrite H; auto. @@ -853,2 +861,2 @@ assert (p2 = p3); subst. -apply pos_test_exact with (1 := H1)... -rewrite H... +apply pos_test_exact with (1 := H1); auto. +rewrite H; auto. @@ -856,4 +864,4 @@ intros; discriminate. -replace p1 with p2... -case_eq (pos_test p2 p3); intros H1... -intros; apply test_trans... -apply sym_equal; apply pos_test_exact with (1 := H)... +replace p1 with p2; auto. +case_eq (pos_test p2 p3); intros H1; auto. +intros; apply test_trans; auto. +apply sym_equal; apply pos_test_exact with (1 := H); auto. @@ -863,3 +871,3 @@ assert (p2 = p3); subst. -apply pos_test_exact with (1 := H1)... -rewrite H... -rewrite (pos_test_trans p1 p2 p3); rewrite H... +apply pos_test_exact with (1 := H1); auto. +rewrite H; auto. +rewrite (pos_test_trans p1 p2 p3); rewrite H; auto. @@ -1445,2 +1453,2 @@ ordered cs -> ordered (clauses_update l c cs). -Proof with auto with datatypes. -intros l c cs; elim cs; simpl... +Proof. +intros l c cs; elim cs; simpl; auto. @@ -1448,7 +1456,7 @@ intros (n1, c1) cs1 Rec H H1; case (lit_is_in l c1). -apply Rec... -intros n2 c2 H2; apply (H1 n2 c2)... -apply clause_insert_ordered... -apply lit_rm_ordered... -apply (H1 n1 c1)... -apply Rec... -intros n2 c2 H2; apply (H1 n2 c2)... +apply Rec; auto. ``` Next Tactic: ```
generalize (<LOOKUP>ref_list_ulist : ulist ref_list</LOOKUP>); intros Eq1. ```
{"final_commit":"427448011e3341d35aa5b9e00f675f6582fcd477","project":"sudoku","repair_file":"\/data\/coq-pearls\/repairs\/sudoku\/repair-sudoku-dc8d4294a32dbb6e0a642dc553b64495f27e6d60-427448011e3341d35aa5b9e00f675f6582fcd477-8_15_2-8_15_2-23.git.json","initial_commit":"dc8d4294a32dbb6e0a642dc553b64495f27e6d60","file":"Sudoku.v"}
Ongoing Proof History: ``` Proof using A_coll B_coll A_conn B_conn L_AB. exists iso. split. - exact: Bijective can_iso_inv can_iso. - move => x a. apply/B_coll => w. rewrite -[_ (iso x) a]/(delta (iso x) [::a]). by rewrite -delta_cat -!delta_iso_inv !can_iso_inv. - move => x. by rewrite -[iso x]/(delta _ [::]) delta_iso. - ``` Proof State: ``` 1 subgoal char : finType A, B : dfa L_AB : dfa_lang A =i dfa_lang B A_coll : collapsed A B_coll : collapsed B A_conn : connected A B_conn : connected B ============================ iso (dfa_s A) = dfa_s B ``` Next Tactic: ```
apply/B_coll => w. ```
{"package":"coq-reglang","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/RegLang\/minimization.v"}
Proof State: ``` 1 subgoal cs : compspecs Qtemp : PTree.t val Qvar : PTree.t (type * val) GV : option globals a : expr Delta : tycontext P : list Prop Q : list localdef R, R' : list mpred fs : funspec argsig : list type retty' : type cc : calling_convention ts : list Type A : rmaps.TypeTree Pre : forall ts : list Type, functors.MixVariantFunctor._functor (rmaps.dependent_type_functor_rec ts (ArgsTT A)) mpred Post : forall ts : list Type, functors.MixVariantFunctor._functor (rmaps.dependent_type_functor_rec ts (AssertTT A)) mpred NEPre : args_super_non_expansive Pre NEPost : super_non_expansive Post witness : functors.MixVariantFunctor._functor (rmaps.dependent_type_functor_rec ts A) mpred Frame : list mpred bl : list expr Ppre : list Prop Rpre : list mpred GV' : option globals gv : list globals args, vl : list val SETUP : call_setup2 cs Qtemp Qvar GV a Delta P Q R R' fs argsig retty' cc ts A Pre Post NEPre NEPost bl vl witness Frame Ppre Rpre GV' gv args retty : type Espec : OracleKind ret : ident ret' : positive Post2 : environ -> mpred Qnew : list localdef B : Type Ppost : B -> list Prop F : B -> val Rpost : B -> list mpred RETinit : (temp_types Delta) ! ret' = Some retty' OKretty : check_retty retty OKretty' : check_retty retty' NEUTRAL : is_neutral_cast retty' retty = true NEret : ret <> ret' POST1 : Post ts witness = (EX vret : B, PROPx (Ppost vret) (RETURN (F vret) (SEPx (Rpost vret)))%assert3)%argsassert DELETE : remove_localdef_temp ret Q = Qnew DELETE' : remove_localdef_temp ret' Q = Q H0 : Post2 = (EX vret : B, PROPx (P ++ Ppost vret) (LOCALx (temp ret (F vret) :: Qnew) (SEPx (Rpost vret ++ Frame))))%argsassert PPRE : fold_right_and True Ppre vret : B rho : environ H : tc_environ Delta rho H1 : fold_right and True (P ++ Ppost vret) H2 : (` and) ((` (eq (F vret))) (eval_id ret')) (` (F vret <> Vundef)) rho H3 : fold_right (fun (x x0 : environ -> Prop) (x1 : environ) => x x1 /\ x0 x1) (fun _ : environ => True) (map locald_denote Q) rho ============================ fold_right_sepcon (Rpost vret ++ Frame) |-- denote_tc_assert (tc_andp (tc_bool (is_neutral_cast (implicit_deref retty) retty) (invalid_cast retty retty)) (isCastResultType (implicit_deref retty) retty (Ecast (Etempvar ret' retty') retty))) rho ``` Ongoing Proof History: ``` Proof. intros. eapply semax_seq'. eapply semax_call_id1_wow; try eassumption; auto. unfold typeof_temp; rewrite RETinit; reflexivity. apply extract_exists_pre; intro vret. eapply semax_pre_post'; [ | | apply semax_set_forward]. + eapply derives_trans; [ | apply now_later ]. instantiate (1:= (PROPx (P ++ Ppost vret) (LOCALx (temp ret' (F vret) :: Qnew) (SEPx (Rpost vret ++ Frame))))). apply andp_right; [apply andp_right |]. - unfold tc_expr. simpl typecheck_expr. rewrite RETinit. simpl @fst. replace ((is_neutral_cast retty' retty' || same_base_type retty' retty')%bool) with true by (clear- OKretty'; destruct retty' as [ | [ | | |] [| ]| [|] | [ | ] | | | | | ]; try contradiction; unfold is_neutral_cast; rewrite ?eqb_type_refl; reflexivity). rewrite denote_tc_assert_andp. apply andp_right; [| intros rho; apply neutral_isCastResultType; auto]. apply PQR_denote_tc_initialized; auto. - unfold tc_temp_id, typecheck_temp_id. unfold typeof_temp in TYret. destruct ((temp_types Delta) ! ret); inversion TYret; clear TYret; try subst t. go_lowerx. ``` Next Tactic: ```
repeat rewrite <LOOKUP>denote_tc_assert_andp : forall {CS : compspecs} (a b : tc_assert), denote_tc_assert (tc_andp a b) = denote_tc_assert a && denote_tc_assert b</LOOKUP>; simpl. ```
{"package":"coq-vst","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/VST\/floyd\/call_lemmas.v"}
Ongoing Proof History: ``` Proof. unfold map_default_eq, interp_map. repeat intro. revert x y H s1 s2 H0. einit. ecofix CH. intros. rewrite! unfold_interp_state. punfold H0. red in H0. revert s1 s2 H1. induction H0; intros; subst; simpl; pclearbot. - eret. - etau. - ebind. apply pbc_intro_h with (RU := prod_rel (@eq_map _ _ _ _ d) eq). { - unfold case_. + unfold over. - unfold Case_sum1, case_sum1. + destruct (case e). - destruct e. + - apply handle_map_eq. assumption. + - - unfold pure_state. + unfold trigger, Trigger_State, trigger, Trigger_ITree, ITree.trigger. pstep. + cbn. + red. + cbn. econstructor. intros. constructor. pfold. ? econstructor. ? constructor; auto. ? } ``` Commit Diff: ``` diff --git a/theories/Core/Subevent.v b/theories/Core/Subevent.v index 42a9534..e0c634e 100644 --- a/theories/Core/Subevent.v +++ b/theories/Core/Subevent.v @@ -4,0 +5,3 @@ +From Coq Require +Import Setoid Morphisms. + @@ -8 +11,6 @@ Require Import -Basics.Basics Basics.CategoryOps +Basics.Basics +Basics.CategoryOps +Basics.CategoryTheory +Basics.CategoryFacts +Basics.Function +Basics.FunctionFacts @@ -11 +19,72 @@ Indexed.Sum -Indexed.Function. +Indexed.Function +Indexed.FunctionFacts. + + +From ExtLib Require +Import Monad. + +Import MonadNotation. +Import CatNotations. +Open Scope cat_scope. + + + +Set Implicit Arguments. + + +Inductive option1 (A : Type +-> Type) X :Type +:= | None1 | +Some1 (_: A X). +Arguments None1 {_ _}. +Arguments Some1 {_} [_]. + +Section Subevent. + + +Class Subevent {A B C : +Type -> Type} : Type := +{ split_E : B ~> A ++' C ; merge_E : (A ++' C) ~> B }. + +Class Subevent_wf {A B C} +(sub: @Subevent A B C): +Prop := { sub_iso :> +Iso _ split_E merge_E }. + +Arguments Subevent : clear implicits. +Arguments split_E {_ _ _ _} [_]. +Arguments merge_E {_ _ _ _} [_]. +Definition inj1 {A B C} `{Subevent A B C} : A ~> B := inl_ >>> merge_E. +Definition inj2 {A B C} `{Subevent A B C} : C ~> B := inr_ >>> merge_E. +Definition case {A B C} `{Subevent A B C} : B ~> (A +' C) := split_E. + +End Subevent. + +Arguments Subevent : clear implicits. +Arguments case {_ _ _ _} [_]. +Arguments inj1 {_ _ _ _} [_]. +Arguments inj2 {_ _ _ _} [_]. + +Notation "A +? C -< B" := (Subevent A +B C) (at level 89, left associativity) : type_scope. + +Lemma case_inj1: forall {A B C: Type -> Type} `{Sub: A +? C -< B} +{SubWF: Subevent_wf Sub} {T} (e: A T), case (inj1 e) = inl_ _ e. +Proof. +intros. +pose proof (iso_epi IFun T (inl_ _ e)). +auto. +Qed. + +Lemma case_inj2: forall {A B C: Type -> Type} `{Sub: A +? C -< B} +{SubWF: Subevent_wf Sub} {T} (e: C T), case (inj2 e) = inr_ _ e. +Proof. +intros. +pose proof (iso_epi IFun T (inr_ _ e)). +auto. +Qed. + +Section Trigger. + @@ -16,0 +96 @@ Indexed.Function. +Class Trigger (E: Type -> Type) (M: Type -> Type) := trigger: E ~> M. @@ -17,0 +98,2 @@ Indexed.Function. +End Trigger. +Arguments trigger {E M Trigger} [T]. @@ -19,0 +102 @@ Indexed.Function. +Notation vis e k := (Vis (inj1 e) k). @@ -25,0 +109,35 @@ Indexed.Function. +Definition over {A B C M : Type -> Type} +{S:A +? C -< B} {T:Trigger C M} (f : +A ~> M) : B ~> M := fun t +b => match case b with | inl1 a => +f _ a | inr1 c => trigger c end. + ``` Proof State: ``` 1 subgoal K, V : Type map : Type M : Map K V map MOk : MapOk eq M Kdec : RelDec eq KdecOk : RelDec_Correct Kdec R : Type E : Type -> Type F : Type -> Type d : V SE : mapE K d +? F -< E RR : R -> R -> Prop gL' : itree F (map * R) -> itree F (map * R) -> Prop INCL : forall x0 x1 : itree F (map * R), bot2 x0 x1 -> gL' x0 x1 gH' : itree F (map * R) -> itree F (map * R) -> Prop INCH : forall x0 x1 : itree F (map * R), bot2 x0 x1 -> gH' x0 x1 CHL : forall x x0 : itree E R, eutt RR x x0 -> forall x2 x3 : map, eq_map x2 x3 -> gL' (interp_state (over (handle_map (V:=V))) x x2) (interp_state (over (handle_map (V:=V))) x0 x3) CHH : forall x x0 : itree E R, eutt RR x x0 -> forall x2 x3 : map, eq_map x2 x3 -> gH' (interp_state (over (handle_map (V:=V))) x x2) (interp_state (over (handle_map (V:=V))) x0 x3) x, y : itree E R u : Type e : E u k1, k2 : u -> itree E R REL : forall v : u, paco2 (eqit_ RR true true id) bot2 (k1 v) (k2 v) s1, s2 : map H1 : eq_map s1 s2 f : F u v : u ============================ eqit_ (prod_rel eq_map eq) true true id (upaco2 (eqit_ (prod_rel eq_map eq) true true id) bot2) (ITree.subst (fun t : u => Ret (s1, t)) (Ret v)) (ITree.subst (fun t : u => Ret (s2, t)) (Ret v)) ``` Next Tactic: ```
red; cbn. ```
{"final_commit":"440b18da2c80560f3454b2cbc1736209a76d64ad","project":"InteractionTrees","repair_file":"\/data\/coq-pearls\/repairs\/InteractionTrees\/repair-InteractionTrees-fe0513e4d0c57354d47c6ed811e0d6a0ce65670d-440b18da2c80560f3454b2cbc1736209a76d64ad-8_10_2-8_10_2-1.git.json","initial_commit":"fe0513e4d0c57354d47c6ed811e0d6a0ce65670d","file":"theories\/Events\/MapDefaultFacts.v"}
Proof State: ``` 6 subgoals h : R H : Rabs h <= 1 H0 : 0 <= 1 + h Hlt : h < 0 ============================ sqrt (1 + h)Β² - 1 < 0 subgoal 2 is: sqrt (1 + h) - 1 < 0 subgoal 3 is: Rabs (sqrt (1 + h) - 1) <= Rabs (sqrt (1 + h)Β² - 1) subgoal 4 is: Rabs (sqrt (1 + h) - 1) <= Rabs (sqrt (1 + h)Β² - 1) subgoal 5 is: Rabs (sqrt (1 + h)Β² - 1) <= Rabs h subgoal 6 is: 0 <= 1 + h ``` Ongoing Proof History: ``` Proof. intros; cut (0 <= 1 + h). intro; apply Rle_trans with (Rabs (sqrt (Rsqr (1 + h)) - 1)). destruct (total_order_T h 0) as [[Hlt|Heq]|Hgt]. repeat rewrite Rabs_left. unfold Rminus; do 2 rewrite <- (Rplus_comm (-1)). change (-1) with (-(1)). do 2 rewrite Ropp_plus_distr; rewrite Ropp_involutive; apply Rplus_le_compat_l. apply Ropp_le_contravar; apply sqrt_le_1. apply Rle_0_sqr. apply H0. pattern (1 + h) at 2; rewrite <- Rmult_1_r; unfold Rsqr; apply Rmult_le_compat_l. apply H0. pattern 1 at 2; rewrite <- Rplus_0_r; apply Rplus_le_compat_l; left; assumption. ``` Next Tactic: ```
apply <LOOKUP>Rplus_lt_reg_l : forall r r1 r2 : R, r + r1 < r + r2 -> r1 < r2</LOOKUP> with 1; rewrite <LOOKUP>Rplus_0_r : forall r : R, r + 0 = r</LOOKUP>; rewrite <LOOKUP>Rplus_comm : forall r1 r2 : R, r1 + r2 = r2 + r1</LOOKUP>; unfold Rminus; rewrite <LOOKUP>Rplus_assoc : forall r1 r2 r3 : R, r1 + r2 + r3 = r1 + (r2 + r3)</LOOKUP>; rewrite <LOOKUP>Rplus_opp_l : forall r : R, - r + r = 0</LOOKUP>; rewrite <LOOKUP>Rplus_0_r : forall r : R, r + 0 = r</LOOKUP>. ```
{"package":"coq","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/theories\/Reals\/Sqrt_reg.v"}
Ongoing Proof History: ``` Proof. intros. apply semax_seq_inv in H. destruct H as [Q [? ?]]. eapply (AuxDefs.semax_loop _ P Q). ``` Proof State: ``` 2 subgoals CS : compspecs Espec : OracleKind Delta : tycontext P : environ -> mpred body, incr : statement R : ret_assert Q : environ -> mpred H : semax Delta P body (overridePost Q (loop_nocontinue_ret_assert P R)) H0 : semax Delta Q incr (loop_nocontinue_ret_assert P R) ============================ AuxDefs.semax Delta P body (loop1_ret_assert Q R) subgoal 2 is: AuxDefs.semax Delta Q incr (loop2_ret_assert P R) ``` Next Tactic: ```
+ ```
{"package":"coq-vst","file":"\/home\/tpr\/.opam\/PackageTable~8.13~2022.01.csv.formatted\/lib\/coq\/user-contrib\/VST\/floyd\/SeparationLogicAsLogic.v"}
Commit Diff: ``` diff --git a/theories/Aux.v b/theories/Aux.v index d240627..c7e8186 100644 --- a/theories/Aux.v +++ b/theories/Aux.v @@ -27 +26,0 @@ - @@ -30,0 +30 @@ Require Export List. +Export ListNotations. @@ -85,11 +84,0 @@ Hint Resolve le_minus: arith. -Section EqBool. - -Definition eq_bool_dec : forall a b : bool, {a = b} + {a <> b}. -Proof. -intros a b; case a; case b; simpl in |- *; auto. -right; red in |- *; intros; discriminate. -Defined. - -End EqBool. - - @@ -231 +220 @@ intros a1 l H [H1| H1]; auto. -exists (nil (A:=A)); exists l; simpl in |- *; auto. +exists []; exists l; simpl in |- *; auto. @@ -270,4 +259,4 @@ Theorem app_inv_app : forall l1 l2 l3 l4 a, -l1 ++ l2 = l3 ++ a :: l4 --> (exists l5 : list A, l1 = l3 -++ a :: l5) \/ (exists l5 : -_, l2 = l5 ++ a :: l4). +l1 ++ l2 = l3 ++ a :: +l4 -> (exists l5 : list A, l1 += l3 ++ a :: l5) \/ (exists +l5, l2 = l5 ++ a :: l4). @@ -288,2 +277,2 @@ Theorem app_inv_app2 : forall l1 l2 l3 l4 a b, l1 -(exists l5 : list A, l1 = l3 ++ a :: -b :: l5) \/ (exists l5 : _, l2 = l5 +(exists l5 : list A, l1 = l3 ++ a +:: b :: l5) \/ (exists l5, l2 = l5 @@ -291 +280 @@ b :: l5) \/ (exists l5 : _, l2 = l5 -++ a :: nil /\ l2 = b :: l4. +++ a :: [] /\ l2 = b :: l4. @@ -310,7 +299,7 @@ Qed. -Theorem same_length_ex : forall (a : A) l1 -l2 l3, length (l1 ++ a :: l2) -= length l3 -> exists l4 : -_, (exists l5 : _, (exists b -: B, length l1 = length l4 -/\ length l2 = length l5 /\ -l3 = l4 ++ b :: l5)). +Theorem same_length_ex : forall (a : A) +l1 l2 l3, length (l1 ++ a +:: l2) = length l3 -> exists +l4, (exists l5, (exists b : B, +length l1 = length l4 /\ length +l2 = length l5 /\ l3 += l4 ++ b :: l5)). @@ -320 +309 @@ intros l2 l3; case l3; simpl in |- *; try (intros; discriminate). -intros b l H; exists (nil (A:=B)); exists l; exists b; repeat (split; auto). +intros b l H; exists []; exists l; exists b; repeat (split; auto). @@ -341,3 +330,3 @@ Qed. -Theorem in_map_fst_inv : forall a (l : list (B -* C)), In a (map (fst (B:=_)) l) -> -exists c : _, In (a, c) l. +Theorem in_map_fst_inv : forall a (l : list +(B * C)), In a (map (fst (B:=_)) +l) -> exists c, In (a, c) l. @@ -375,2 +364,2 @@ Theorem in_flat_map_ex : forall (l : list B) (f : B --> list C) a, In a (flat_map f l) -> exists -b : _, In b l /\ In a (f b). +-> list C) a, In a (flat_map f l) -> +exists b, In b l /\ In a (f b). @@ -397 +386 @@ list C := fun l2 -nil => nil | a +[] => [] | a @@ -399 +388 @@ nil => nil | a -with | nil => nil +with | [] => [] @@ -431 +420 @@ match n with | O -=> nil | S n1 +=> [] | S n1 @@ -433 +422 @@ match n with | O -nil => nil | a +[] => [] | a @@ -482 +471 @@ match n with | O -nil => nil | a +[] => [] | a @@ -512 +501 @@ Qed. -Theorem skip_n_id : forall l : list A, skip_n l (length l) = nil. +Theorem skip_n_id : forall l : list A, skip_n l (length l) = []. @@ -533 +522 @@ Theorem exist_first_max : forall l : list -nat, l <> nil -> exists a +nat, l <> [] -> exists a @@ -544,2 +533,2 @@ intros a l0; case l0. -intros H H0; exists a; exists (nil (A:=nat)); exists (nil -(A:=nat)); repeat (split; simpl in |- *; auto with datatypes). +intros H H0; exists a; exists []; exists []; +repeat (split; simpl in |- *; auto with datatypes). @@ -552,2 +541,2 @@ case (le_or_lt a1 a); intros HH4; auto. -exists a; exists (nil (A:=nat)); exists (n -:: l1); repeat (split; auto with datatypes). +exists a; exists []; exists (n :: +l1); repeat (split; auto with datatypes). ``` Proof State: ``` 2 subgoals A : Type l1 : list A a : A l : list A H : forall l2 : list A, permutation (l ++ l2) (l2 ++ l) l2 : list A ============================ permutation (l ++ [a] ++ l2) (l ++ l2 ++ [a]) subgoal 2 is: (l2 ++ [a]) ++ l = l2 ++ a :: l ``` Ongoing Proof History: ``` Proof using. intros l1; elim l1; auto. intros; rewrite <- app_nil_end; auto. intros a l H l2. - replace (l2 ++ a :: l) with ((l2 ++ a :: nil) ++ l). + replace (l2 ++ a :: l) with ((l2 ++ a :: []) ++ l). - apply permutation_trans with (l ++ l2 ++ a :: nil); auto. + apply permutation_trans with (l ++ l2 ++ a :: []); auto. - apply permutation_trans with (((a :: nil) ++ l2) ++ l); auto. + apply permutation_trans with (((a :: []) ++ l2) ++ l); auto. simpl in |- *; auto. - apply permutation_trans with (l ++ (a :: nil) ++ l2); auto. + apply permutation_trans with (l ++ (a :: []) ++ l2); auto. apply permutation_sym; auto. ? replace (l2 ++ a :: l) with ((l2 ++ a :: nil) ++ l). ? apply permutation_app_comp; auto. ? elim l2; simpl in |- *; auto. ``` Next Tactic: ```
replace (l2 ++ a :: l) with ((l2 ++ a :: []) ++ l). ```
{"final_commit":"6e3f37b2113e34f74c6b5a6ff2c7346a9cdf9e4e","project":"huffman","repair_file":"\/data\/coq-pearls\/repairs\/huffman\/repair-huffman-773c1feea03edc5e845ecafc7c9752fa403e7faf-6e3f37b2113e34f74c6b5a6ff2c7346a9cdf9e4e-8_11_2-8_11_2-4.git.json","initial_commit":"773c1feea03edc5e845ecafc7c9752fa403e7faf","file":"theories\/Permutation.v"}
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
1