fact stringlengths 6 103k | type stringclasses 14
values | library stringclasses 13
values | imports listlengths 1 10 | filename stringclasses 157
values | symbolic_name stringlengths 1 54 | docstring stringclasses 185
values |
|---|---|---|---|---|---|---|
build_eq_Term:
forall f l, 2 <= length l -> build f l = Term f (quicksort l). | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | build_eq_Term | null |
well_formed_cf_build:
forall f l, arity f = AC ->
1 <= length l ->
(forall t, In t l -> well_formed_cf t) ->
(forall t, In t l -> match t with | Var _ => True | Term g _ => f <> g end) ->
well_formed_cf (build f l). | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_build | null |
well_formed_cf_build_cons:
forall f t l, arity f = AC ->
well_formed_cf (Term f (t :: l)) -> well_formed_cf (build f l). | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_build_cons | null |
well_formed_cf_build_inside:
forall f t l1 l2, arity f = AC ->
well_formed_cf (Term f (l1 ++ t :: l2)) -> well_formed_cf (build f (l1 ++ l2)). | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_build_inside | null |
flatten_build:
forall f l, arity f = AC ->
(forall t, In t l -> match t with | Var _ => True | Term g _ => f <> g end) ->
permut (flatten f ((build f l) :: nil)) l. | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | flatten_build | null |
flatten_build_cons:
forall f t l, arity f = AC -> well_formed_cf (Term f (t :: l)) ->
permut (flatten f ((build f l) :: nil)) l. | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | flatten_build_cons | null |
flatten_build_inside:
forall f t l1 l2, arity f = AC ->
well_formed_cf (Term f (l1 ++ t :: l2)) ->
permut (flatten f ((build f (l1 ++ l2)) :: nil)) (l1 ++ l2). | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | flatten_build_inside | null |
flatten_apply_cf_subst:
forall sigma f l, arity f = AC ->
permut (flatten f (map (apply_cf_subst sigma) l))
(flatten f (apply_cf_subst sigma (build f l) :: nil)). | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | flatten_apply_cf_subst | null |
well_formed_cf_apply_subst:
forall sigma, well_formed_cf_subst sigma ->
forall t, well_formed_cf t -> well_formed_cf (apply_cf_subst sigma t). | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_apply_subst | null |
length_flatten_ter:
forall f sigma, arity f = AC -> well_formed_cf_subst sigma ->
forall l, (forall t, In t l -> well_formed_cf t) ->
length l <= length (flatten f (map (apply_cf_subst sigma) l)). | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | length_flatten_ter | null |
ac_cf_eq: forall t1 t2, ac t1 t2 -> canonical_form t1 = canonical_form t2. | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_cf_eq | null |
ac_size_eq: forall t1 t2, ac t1 t2 -> size t1 = size t2. | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_size_eq | null |
ac_size_unfold:
forall t,
ac_size t = match t with
| Var _ => 1
| Term f l =>
(match arity f with
| AC => (length l) - 1
| C => 1
| Free _ => 1
end) + list_size ac_size l
end.
Parameter size... | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_size_unfold | null |
size_size:
forall t, well_formed t -> size t = ac_size (canonical_form t). | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | size_size | null |
ac_size_ge_one: forall t, well_formed_cf t -> 1 <= ac_size t. | Parameter | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_size_ge_one | null |
ac_one_step_at_top: term -> term -> Prop :=
| a_axiom :
forall (f:symbol) (t1 t2 t3:term),
arity f = AC ->
ac_one_step_at_top
(Term f ((Term f (t1 :: t2 :: nil)) :: t3 :: nil))
(Term f (t1 :: ((Term f (t2 :: t3 :: nil)) :: nil)))
| c_axiom :
forall (f:symbol) (t1 t2:t... | Inductive | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_one_step_at_top | null |
ac:= th_eq ac_one_step_at_top. | Definition | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac | null |
no_need_of_instance:
forall t1 t2, axiom (sym_refl ac_one_step_at_top) t1 t2 ->
(sym_refl ac_one_step_at_top) t1 t2.
Proof.
unfold sym_refl; intros t1 t2 H.
inversion_clear H as [ u1 u2 sigma H']; destruct H' as [H' | [H' | H']].
inversion_clear H'.
left; simpl; apply a_axiom; trivial.
left; si... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | no_need_of_instance | null |
l_assoc:
forall f t1 t2 t3, arity f = AC ->
ac (Term f (Term f (t1 :: t2 :: nil) :: t3 :: nil))
(Term f (t1 :: (Term f (t2 :: t3 :: nil)) :: nil)).
Proof.
intros f t1 t2 t3 Af.
unfold ac, th_eq.
do 2 left.
rewrite <- (empty_subst_is_id (Term f (Term f (t1 :: t2 :: nil) :: t3 :: nil))).
rewrite <- (empty_subs... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | l_assoc | null |
r_assoc:
forall f t1 t2 t3, arity f = AC ->
ac (Term f (t1 :: (Term f (t2 :: t3 :: nil)) :: nil))
(Term f (Term f (t1 :: t2 :: nil) :: t3 :: nil)).
Proof.
intros f t1 t2 t3 Af.
unfold ac, th_eq.
do 2 left.
rewrite <- (empty_subst_is_id (Term f (Term f (t1 :: t2 :: nil) :: t3 :: nil))).
rewrite <- (empty_subs... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | r_assoc | null |
comm:
forall f t1 t2, arity f = C \/ arity f = AC ->
ac (Term f (t1 :: t2 :: nil)) (Term f (t2 :: t1 :: nil)).
Proof.
intros f t1 t2 Af.
unfold ac, th_eq.
do 2 left.
rewrite <- (empty_subst_is_id (Term f (t1 :: t2 :: nil))).
rewrite <- (empty_subst_is_id (Term f (t2 :: t1 :: nil))).
apply instance.
left; apply c_ax... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | comm | null |
ac_one_step_at_top_top_eq:
forall t1 t2, (sym_refl ac_one_step_at_top) t1 t2 ->
match t1, t2 with
| Var x1, Var x2 => x1 = x2
| Term _ _, Var _ => False
| Var _, Term _ _ => False
| Term f1 _, Term f2 _ => f1 = f2
end.
Proof.
unfold sym_refl; intros t1 t2 [Ac | [Ac | t1_eq_t2]].
inversion_clear Ac... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_one_step_at_top_top_eq | null |
ac_one_step_top_eq:
forall t1 t2 : term, one_step (sym_refl ac_one_step_at_top) t1 t2 ->
match t1, t2 with
| Var x1, Var x2 => x1 = x2
| Term _ _, Var _ => False
| Var _, Term _ _ => False
| Term f1 _, Term f2 _ => f1 = f2
end.
Proof.
intros t1 t2 Ac; inversion Ac; trivial.
apply ac_one_step_at... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_one_step_top_eq | null |
ac_top_eq:
forall t1 t2 : term, ac t1 t2 ->
match t1, t2 with
| Var x1, Var x2 => x1 = x2
| Term _ _, Var _ => False
| Var _, Term _ _ => False
| Term f1 _, Term f2 _ => f1 = f2
end.
Proof.
intros t1 t2 Ac; induction Ac.
inversion H as [ H1 H2 H' H4 H5 | f l1 l2 H' H1 H2]; subst; trivial.
apply ac... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_top_eq | null |
flatten(f : symbol) (l : list term) : list term :=
match l with
| nil => nil
| (Var _ as t) :: tl => t :: (flatten f tl)
| (Term g ll as t) :: tl =>
if F.Symb.eq_bool f g
then ll ++ (flatten f tl)
else t :: (flatten f tl)
end. | Fixpoint | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | flatten | null |
canonical_form(t : term) : term :=
match t with
| Var _ => t
| Term f l =>
Term f
(match arity f with
| Free _ => map canonical_form l
| C => quicksort (map canonical_form l)
| AC => quicksort (flatten f (map canonical_form l))
end)
end. | Fixpoint | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | canonical_form | null |
well_formed_cf(t:term) : Prop :=
match t with
| Var _ => True
| Term f l =>
let wf_cf_list :=
(fix wf_cf_list (l:list term) : Prop :=
match l with
| nil => True
| h :: tl => well_formed_cf h /\ wf_cf_list tl
end) in
wf_cf_list l /\
(match arity f with
| Fre... | Fixpoint | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf | null |
well_formed_cf_unfold: forall t,
well_formed_cf t -> match t with
| Var _ => True
| Term f l =>
(forall u, In u l -> well_formed_cf u) /\
(match arity f with
| AC => length l >= 2 /\ is_sorted l /\
... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_unfold | null |
well_formed_cf_subterms:
forall f l, well_formed_cf (Term f l) -> (forall t, In t l -> well_formed_cf t).
Proof.
intros f l W; elim (well_formed_cf_unfold _ W); trivial.
Qed. | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_subterms | null |
well_formed_cf_length:
forall f l, arity f = AC -> well_formed_cf (Term f l) -> 2 <= length l.
Proof.
intros f l Af [_ Ll]; rewrite Af in Ll; intuition.
Qed. | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_length | null |
well_formed_cf_sorted:
forall f l, arity f = AC -> well_formed_cf (Term f l) -> is_sorted l.
Proof.
intros f l Af [_ Ll]; rewrite Af in Ll; intuition.
Qed. | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_sorted | null |
well_formed_cf_alien:
forall f l, arity f = AC -> well_formed_cf (Term f l) ->
(forall t, In t l -> match t with
| Var _ => True
| Term g _ => f <> g
end).
Proof.
intros f l Af [_ Ll]; rewrite Af in Ll; intuition.
Qed. | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_alien | null |
well_formed_cf_fold:
forall t, (match t with
| Var _ => True
| Term f l =>
(forall u, In u l -> well_formed_cf u) /\
(match arity f with
| AC => length l >= 2 /\ is_sorted l /\
(for... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_fold | null |
flatten_app:
forall f l1 l2, flatten f (l1 ++ l2) = (flatten f l1) ++ (flatten f l2).
Proof.
intros f l1; induction l1 as [ | [v1 | g1 ll1]]; simpl; trivial.
intros l2; rewrite IHl1; trivial.
intros l2; rewrite IHl1; generalize (F.Symb.eq_bool_ok f g1); case (F.Symb.eq_bool f g1); [intro f_eq_g1 | intro f_diff_g1].
... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | flatten_app | null |
list_permut_flatten:
forall f l1 l2, permut l1 l2 -> permut (flatten f l1) (flatten f l2).
Proof.
intros f l1; induction l1 as [ | t1 l1]; intros l2 P.
rewrite (permut_nil (permut_sym P)); apply permut_refl.
assert (In_t1 : mem (@eq _) t1 l2). rewrite <- P; left; reflexivity.
destruct (mem_split_set _ _ eq_bool_ok _ ... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | list_permut_flatten | null |
well_formed_cf_is_well_formed_cf:
forall cf, well_formed_cf cf -> exists t, well_formed t /\ cf = canonical_form t.
Proof.
intros cf Wcf; generalize (well_formed_cf_unfold _ Wcf);
pattern cf; apply term_rec3; clear cf Wcf.
intros v _; exists (Var v); unfold well_formed; simpl; split; trivial.
intros f l Hrec [Wl Ll]; ... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_is_well_formed_cf | null |
length_flatten_bis:
forall f, arity f = AC ->
forall l, (forall t, In t l -> well_formed_cf t) ->
(length l) <= length (flatten f l).
Proof.
intros f Af l Wl; induction l as [ | t l].
simpl; auto with arith.
simpl; destruct t as [v | g ll].
simpl; apply le_n_S; apply IHl; intros; apply Wl; right; trivial.
generalize... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | length_flatten_bis | null |
length_flatten:
forall f, forall l, arity f = AC -> (forall u, In u l -> well_formed u) ->
length l <= length (flatten f (map canonical_form l)).
Proof.
intros f l; pattern l; apply (list_rec3 size); clear l; induction n;
destruct l as [ | t l].
simpl; trivial.
simpl; intro S_l; absurd (1 <= 0); auto with arith;
... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | length_flatten | null |
well_formed_cf_is_well_formed_cf_conv:
forall cf, (exists t, well_formed t /\ cf = canonical_form t) -> well_formed_cf cf.
Proof.
intros cf [t [Wt Ct]]; subst; generalize Wt; clear Wt.
pattern t; apply term_rec2; clear t; induction n as [ | n ];
intros t St Wt.
absurd (1 <= 0); auto with arith;
apply Nat.le_trans wit... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_is_well_formed_cf_conv | null |
flatten_cf:
forall f t1 t2, arity f = AC -> well_formed_cf t1 -> well_formed_cf t2 ->
permut (flatten f (t1 :: nil)) (flatten f (t2 :: nil)) -> t1 = t2.
Proof.
intros f t1 t2 Af Wt1 Wt2; destruct t1 as [v1 | f1 l1]; destruct t2 as [v2 | f2 l2].
simpl; intros; apply permut_length_1; trivial.
simpl; generalize (F.Symb.... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | flatten_cf | null |
flatten_cf_cf:
forall f t1 t2, arity f = AC -> well_formed t1 -> well_formed t2 ->
permut (flatten f (canonical_form t1 :: nil))
(flatten f (canonical_form t2 :: nil)) ->
canonical_form t1 = canonical_form t2.
Proof.
intros f t1 t2 Af Wt1 Wt2 P;
apply flatten_cf with f; trivial.
apply well_formed_cf_is_well_formed... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | flatten_cf_cf | null |
build(f : symbol) l :=
match l with
| t :: nil => t
| _ => Term f (quicksort l)
end. | Definition | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | build | null |
build_eq_Term:
forall f l, 2 <= length l -> build f l = Term f (quicksort l).
Proof.
intros f l Ll; destruct l as [ | u [ | v l]]; simpl; trivial.
simpl in Ll; absurd (2 <= 1); auto with arith.
Qed. | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | build_eq_Term | null |
well_formed_cf_build:
forall f l, arity f = AC ->
1 <= length l ->
(forall t, In t l -> well_formed_cf t) ->
(forall t, In t l -> match t with | Var _ => True | Term g _ => f <> g end) ->
well_formed_cf (build f l).
Proof.
intros f l Af Ll Wl Al; destruct l as [ | t1 [ | t2 l]].
simpl in Ll; absurd (1 <= 0); trivi... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_build | null |
well_formed_cf_build_cons:
forall f t l, arity f = AC ->
well_formed_cf (Term f (t :: l)) -> well_formed_cf (build f l).
Proof.
intros f t l Af W; apply well_formed_cf_build; trivial.
apply le_S_n; replace (S (length l)) with (length (t :: l)); trivial;
apply well_formed_cf_length with f; trivial.
intros; apply (wel... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_build_cons | null |
well_formed_cf_build_inside:
forall f t l1 l2, arity f = AC ->
well_formed_cf (Term f (l1 ++ t :: l2)) -> well_formed_cf (build f (l1 ++ l2)).
Proof.
intros f t l1 l2 Af W;
assert (H : forall u, In u (l1 ++ l2) -> In u (l1 ++ t :: l2)).
intros u In_u; elim (in_app_or _ _ _ In_u); clear In_u; intro In_u;
apply in_or... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_build_inside | null |
flatten_build:
forall f l, arity f = AC ->
(forall t, In t l -> match t with | Var _ => True | Term g _ => f <> g end) ->
permut (flatten f ((build f l) :: nil)) l.
Proof.
intros f [ | t1 [ | t2 l]] Af Al.
simpl; generalize (F.Symb.eq_bool_ok f f); case (F.Symb.eq_bool f f); [intros _; apply Pnil | intro f_diff_f; ... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | flatten_build | null |
flatten_build_cons:
forall f t l, arity f = AC -> well_formed_cf (Term f (t :: l)) ->
permut (flatten f ((build f l) :: nil)) l.
Proof.
intros f t l Af W; apply flatten_build; trivial.
intros; apply (well_formed_cf_alien Af W); right; trivial.
Qed. | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | flatten_build_cons | null |
flatten_build_inside:
forall f t l1 l2, arity f = AC ->
well_formed_cf (Term f (l1 ++ t :: l2)) ->
permut (flatten f ((build f (l1 ++ l2)) :: nil)) (l1 ++ l2).
Proof.
intros f t l1 l2 Af W;
apply flatten_build; trivial.
intros u In_u; apply (well_formed_cf_alien Af W);
elim (in_app_or _ _ _ In_u); clear In_u;
int... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | flatten_build_inside | null |
is_subst_canonical_formsigma sigma_cf :=
forall v, match find X.eq_bool v sigma with
| None => find X.eq_bool v sigma_cf = None
| Some v_sigma =>
find X.eq_bool v sigma_cf = Some (canonical_form v_sigma)
end. | Definition | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | is_subst_canonical_form | null |
is_subst_cf_is_subst_cf:
forall sigma, is_subst_canonical_form sigma (map_subst (fun _ t => canonical_form t) sigma).
Proof.
intros sigma; unfold is_subst_canonical_form.
intro v; rewrite subst_comp_is_subst_comp_aux1.
destruct (find X.eq_bool v sigma); trivial.
Qed. | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | is_subst_cf_is_subst_cf | null |
well_formed_cf_substsigma :=
forall v, match find X.eq_bool v sigma with
| None => True
| Some t => well_formed_cf t
end. | Definition | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_subst | null |
well_formed_cf_subst_is_well_formed_cf_subst_aux:
forall sigma, well_formed_cf_subst sigma ->
(forall v, nb_occ X.eq_bool v sigma <= 1) ->
exists sigma', well_formed_subst sigma' /\
is_subst_canonical_form sigma' sigma.
Proof.
unfold well_formed_cf_subst, is_subst_canonical_form;
intros sigma Wsigma Nb_occ_sigm... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_subst_is_well_formed_cf_subst_aux | null |
well_formed_cf_subst_is_well_formed_cf_subst:
forall sigma, well_formed_cf_subst sigma ->
exists sigma', well_formed_subst sigma' /\
is_subst_canonical_form sigma' sigma.
Proof.
assert (E : equivalence _ (@eq variable)).
repeat split.
intros t1 t2 t3 H1 H2; subst; reflexivity.
intros t1 t2 H... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_subst_is_well_formed_cf_subst | null |
apply_cf_subst(sigma : substitution) (t : term) {struct t} : term :=
match t with
| Var v =>
match find X.eq_bool v sigma with
| None => t
| Some v_sigma => v_sigma
end
| Term f l =>
let l_sigma :=
match arity f with
| AC => quicksort (flatten f (map (apply_cf_subst sigma) l)... | Fixpoint | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | apply_cf_subst | null |
flatten_apply_cf_subst:
forall sigma f l, arity f = AC ->
permut (flatten f (map (apply_cf_subst sigma) l))
(flatten f (apply_cf_subst sigma (build f l) :: nil)).
Proof.
intros sigma f l Af; induction l as [ | t1 l].
simpl; generalize (F.Symb.eq_bool_ok f f); case (F.Symb.eq_bool f f); [intros _ | intro f_diff_f; ... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | flatten_apply_cf_subst | null |
apply_cf_subst_is_sound:
forall sigma sigma_cf, is_subst_canonical_form sigma sigma_cf ->
forall t, apply_cf_subst sigma_cf (canonical_form t) =
canonical_form (apply_subst sigma t).
Proof.
intros sigma sigma_cf H t; pattern t; apply term_rec3; clear t.
intro v; generalize (H v); simpl;
destruct (... | Theorem | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | apply_cf_subst_is_sound | null |
well_formed_cf_apply_subst:
forall sigma, well_formed_cf_subst sigma ->
forall t, well_formed_cf t -> well_formed_cf (apply_cf_subst sigma t).
Proof.
intros sigma Wsigma t Wt;
elim (well_formed_cf_is_well_formed_cf _ Wt);
intros u [Wu Hu]; subst;
elim (well_formed_cf_subst_is_well_formed_cf_subst Wsigma);
intros ... | Theorem | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | well_formed_cf_apply_subst | null |
length_flatten_ter:
forall f sigma, arity f = AC -> well_formed_cf_subst sigma ->
forall l, (forall t, In t l -> well_formed_cf t) ->
length l <= length (flatten f (map (apply_cf_subst sigma) l)).
Proof.
intros f sigma Af Wsigma l Wl; induction l as [ | t l]; trivial.
replace (t::l) with ((t::nil) ++ l); trivial;
r... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | length_flatten_ter | null |
ac_one_step_at_top_cf_eq:
forall t1 t2, ac_one_step_at_top t1 t2 -> canonical_form t1 = canonical_form t2.
Proof.
assert (P12 : forall t1 t2, permut (t1 :: t2 :: nil) (t2 :: t1 :: nil)).
intros t1 t2;
replace (t1 :: t2 :: nil) with ((t1 :: nil) ++ (t2 :: nil)); trivial;
replace (t2 :: t1 :: nil) with ((t2 :: nil) +... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_one_step_at_top_cf_eq | null |
sym_refl_ac_one_step_at_top_cf_eq:
forall t1 t2, (sym_refl ac_one_step_at_top) t1 t2 -> canonical_form t1 = canonical_form t2.
Proof.
intros t1 t2; unfold sym_refl; intros [H | [H | H]].
apply ac_one_step_at_top_cf_eq; trivial.
apply sym_eq; apply ac_one_step_at_top_cf_eq; trivial.
subst; trivial.
Qed. | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | sym_refl_ac_one_step_at_top_cf_eq | null |
ac_one_step_cf_eq:
forall t1 t2, one_step (sym_refl ac_one_step_at_top) t1 t2 -> canonical_form t1 = canonical_form t2.
Proof.
intros t1; pattern t1; apply term_rec3; clear t1.
intros v1 t2 H; inversion_clear H as [H1 H2 H' | f l1 l2 H'].
apply sym_refl_ac_one_step_at_top_cf_eq; apply no_need_of_instance; trivial.
i... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_one_step_cf_eq | null |
ac_cf_eq:
forall t1 t2, ac t1 t2 -> canonical_form t1 = canonical_form t2.
Proof.
unfold ac, th_eq;
intros t1 t2 H.
refine (rwr_inv _ _ _ _ (@trans_eq term) _ _ _ H).
clear t1 t2 H; intros t1 t2 H; apply ac_one_step_cf_eq; trivial.
Qed. | Theorem | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_cf_eq | null |
ac_one_step_at_top_size_eq:
forall t1 t2, ac_one_step_at_top t1 t2 -> size t1 = size t2.
Proof.
intros t1 t2 H; destruct H; simpl; repeat rewrite Nat.add_0_r; auto with arith;
rewrite (Nat.add_comm (size t1) (S (size t2 + size t3))); simpl;
apply (f_equal (fun n => S (S n)));
rewrite <- (Nat.add_assoc (size t1) (size... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_one_step_at_top_size_eq | null |
sym_refl_ac_one_step_at_top_size_eq:
forall t1 t2, (sym_refl ac_one_step_at_top) t1 t2 -> size t1 = size t2.
Proof.
intros t1 t2; unfold sym_refl; intros [H | [H | H]].
apply ac_one_step_at_top_size_eq; trivial.
apply sym_eq; apply ac_one_step_at_top_size_eq; trivial.
subst; trivial.
Qed. | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | sym_refl_ac_one_step_at_top_size_eq | null |
ac_one_step_size_eq:
forall t1 t2, one_step (sym_refl ac_one_step_at_top) t1 t2 -> size t1 = size t2.
Proof.
intros t1; pattern t1; apply term_rec3; clear t1.
intros v1 t2 H; inversion_clear H as [H1 H2 H' | f l1 l2 H'].
apply sym_refl_ac_one_step_at_top_size_eq; apply no_need_of_instance; trivial.
intros f l1 IHl1 ... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_one_step_size_eq | null |
ac_size_eq:
forall t1 t2, ac t1 t2 -> size t1 = size t2.
Proof.
intros t1 t2 H; refine (rwr_inv _ _ _ _ (@trans_eq nat) _ _ _ H).
intros; apply ac_one_step_size_eq; trivial.
Qed. | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_size_eq | null |
ac_size(t:term) : nat :=
match t with
| Var v => 1
| Term f l =>
let ac_size_list :=
(fix ac_size_list (l : list term) {struct l} : nat :=
match l with
| nil => 0
| t :: lt => ac_size t + ac_size_list lt
end) in
(match arity f with
| AC =... | Fixpoint | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_size | null |
ac_size_unfold:
forall t,
ac_size t = match t with
| Var _ => 1
| Term f l =>
(match arity f with
| AC => (length l) - 1
| C => 1
| Free _ => 1
end) + list_size ac_size l
end.
Proof.
intro t; ... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_size_unfold | null |
size_size_aux2:
forall f t, arity f = AC -> well_formed t ->
ac_size (canonical_form t) =
list_size ac_size (flatten f (canonical_form t :: nil)) +
(length (flatten f (canonical_form t :: nil))) - 1.
Proof.
intros f t Af Wt; assert (Wu : well_formed_cf (canonical_form t)).
apply well_formed_cf_is_well_formed_cf_co... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | size_size_aux2 | null |
size_size_aux3:
forall f t, arity f = AC -> well_formed t ->
1 <= length (A:=term) (flatten f (canonical_form t :: nil)).
Proof.
intros f t Ar Wt; apply (length_flatten (t :: nil) Ar);
intros u In_u; elim In_u; clear In_u; intro In_u.
subst u; trivial.
contradiction.
Qed. | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | size_size_aux3 | null |
size_size:
forall t, well_formed t -> size t = ac_size (canonical_form t).
Proof.
intros t; pattern t; apply term_rec3; clear t.
intros v _; trivial.
intros f l H Wt; destruct (well_formed_unfold Wt) as [Wl Ll].
assert (Hl : forall t, In t l -> size t = ac_size (canonical_form t)).
intros; apply H; trivial; apply Wl; ... | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | size_size | null |
ac_size_ge_one:
forall t, well_formed_cf t -> 1 <= ac_size t.
Proof.
intros t Wt; elim (well_formed_cf_is_well_formed_cf _ Wt);
intros u [Wu Hu]; subst; rewrite <- size_size; trivial;
apply size_ge_one.
Qed. | Lemma | Coccinelle | [
"From Stdlib Require Import Relations List Arith Morphisms",
"From CoLoR Require Import more_list list_permut list_sort term_spec term_o equational_theory_spec equational_theory"
] | Coccinelle/ac_matching/ac.v | ac_size_ge_one | null |
cf_eq_ac:
forall t1 t2, well_formed t1 -> well_formed t2 ->
canonical_form t1 = canonical_form t2 -> ac t1 t2. | Parameter | Coccinelle | [
"From Stdlib Require Import Setoid Arith List Morphisms",
"From CoLoR Require Import closure more_list weaved_relation list_sort term_spec ac"
] | Coccinelle/ac_matching/cf_eq_ac.v | cf_eq_ac | null |
split_cf:
forall f, arity f = AC -> forall t u1 u2, well_formed t ->
permut (flatten f (canonical_form t :: nil)) (u1 ++ u2) ->
u1 = nil \/
u2 = nil \/
(exists t1, exists t2,
well_formed t1 /\ well_formed t2 /\
ac t (Term f (t1 :: t2 :: nil)) /\
permut (flatten f (canonical_form t1 :: nil)) u1 /\ ... | Lemma | Coccinelle | [
"From Stdlib Require Import Setoid Arith List Morphisms",
"From CoLoR Require Import closure more_list weaved_relation list_sort term_spec ac"
] | Coccinelle/ac_matching/cf_eq_ac.v | split_cf | null |
syntactic_dec:
forall n, (forall t1, size t1 <= n -> forall t2, well_formed t1 ->
well_formed t2 ->
canonical_form t1 = canonical_form t2 -> ac t1 t2) ->
forall f, arity f = AC -> forall a1 a2 a3 a4,
size a1 <= n -> well_formed a1 ->
size a2 <= n -> well_formed a2 ->
w... | Lemma | Coccinelle | [
"From Stdlib Require Import Setoid Arith List Morphisms",
"From CoLoR Require Import closure more_list weaved_relation list_sort term_spec ac"
] | Coccinelle/ac_matching/cf_eq_ac.v | syntactic_dec | null |
commutativity:
forall n, (forall t1, size t1 <= n -> forall t2, well_formed t1 ->
well_formed t2 ->
canonical_form t1 = canonical_form t2 -> ac t1 t2) ->
forall f, arity f = AC -> forall a1 a2 a3 a4,
size a1 <= n -> well_formed a1 ->
size a2 <= n -> well_formed a2 ->
well... | Lemma | Coccinelle | [
"From Stdlib Require Import Setoid Arith List Morphisms",
"From CoLoR Require Import closure more_list weaved_relation list_sort term_spec ac"
] | Coccinelle/ac_matching/cf_eq_ac.v | commutativity | null |
associativity:
forall n, (forall t1, size t1 <= n -> forall t2, well_formed t1 ->
well_formed t2 ->
canonical_form t1 = canonical_form t2 -> ac t1 t2) ->
forall f, arity f = AC -> forall a1 a2 a3 a4,
size a1 <= n -> well_formed a1 ->
size a2 <= n -> well_formed a2 ->
siz... | Lemma | Coccinelle | [
"From Stdlib Require Import Setoid Arith List Morphisms",
"From CoLoR Require Import closure more_list weaved_relation list_sort term_spec ac"
] | Coccinelle/ac_matching/cf_eq_ac.v | associativity | null |
swap_left:
forall n, (forall t1, size t1 <= n -> forall t2, well_formed t1 ->
well_formed t2 ->
canonical_form t1 = canonical_form t2 -> ac t1 t2) ->
forall f, arity f = AC -> forall a1 a2 a3 a4,
size a1 <= n -> well_formed a1 ->
size a2 <= n -> well_formed a2 ->
size a3... | Lemma | Coccinelle | [
"From Stdlib Require Import Setoid Arith List Morphisms",
"From CoLoR Require Import closure more_list weaved_relation list_sort term_spec ac"
] | Coccinelle/ac_matching/cf_eq_ac.v | swap_left | null |
swap_right:
forall n, (forall t1, size t1 <= n -> forall t2, well_formed t1 ->
well_formed t2 ->
canonical_form t1 = canonical_form t2 -> ac t1 t2) ->
forall f, arity f = AC -> forall a1 a2 a3 a4,
size a1 <= n -> well_formed a1 ->
size a2 <= n -> well_formed a2 ->
size a... | Lemma | Coccinelle | [
"From Stdlib Require Import Setoid Arith List Morphisms",
"From CoLoR Require Import closure more_list weaved_relation list_sort term_spec ac"
] | Coccinelle/ac_matching/cf_eq_ac.v | swap_right | null |
middle_commutativity:
forall n, (forall t1, size t1 <= n -> forall t2, well_formed t1 ->
well_formed t2 ->
canonical_form t1 = canonical_form t2 -> ac t1 t2) ->
forall f, arity f = AC -> forall a1 a2 a3 a4,
size a1 <= n -> well_formed a1 ->
size a2 <= n -> well_formed a2 -... | Lemma | Coccinelle | [
"From Stdlib Require Import Setoid Arith List Morphisms",
"From CoLoR Require Import closure more_list weaved_relation list_sort term_spec ac"
] | Coccinelle/ac_matching/cf_eq_ac.v | middle_commutativity | null |
cf_eq_ac:
forall t1 t2, well_formed t1 -> well_formed t2 ->
canonical_form t1 = canonical_form t2 -> ac t1 t2.
Proof.
intro t1; pattern t1; apply term_rec2; clear t1; induction n as [ | n].
intros t1 St1; absurd (1 <= 0); auto with arith;
apply Nat.le_trans with (size t1); trivial; apply size_ge_one.
intros [v1 |... | Theorem | Coccinelle | [
"From Stdlib Require Import Setoid Arith List Morphisms",
"From CoLoR Require Import closure more_list weaved_relation list_sort term_spec ac"
] | Coccinelle/ac_matching/cf_eq_ac.v | cf_eq_ac | null |
partly_solved_term: Type :=
mk_pst
{
head_symb : symbol;
new_var : variable;
closed_term : term
}. | Record | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | partly_solved_term | null |
matching_problem: Type :=
mk_pb
{
existential_vars : list variable;
unsolved_part : list (term * term);
solved_part : substitution;
partly_solved_part : list (variable * partly_solved_term)
}. | Record | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | matching_problem | null |
is_rough_solpb sigma :=
(forall t1 t2, In (t1,t2) pb.(unsolved_part) -> apply_cf_subst sigma t1 = t2) /\
(forall v, match find X.eq_bool v pb.(partly_solved_part) with
| None => True
| Some pst =>
let l := (apply_cf_subst sigma (Var pst.(new_var))) :: pst.(closed_term) :: nil in
... | Definition | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | is_rough_sol | null |
is_solpb sigma :=
exists sigma', is_rough_sol pb sigma' /\
(forall v, In v (existential_vars pb) \/
apply_cf_subst sigma (Var v) = apply_cf_subst sigma' (Var v)). | Definition | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | is_sol | null |
occurs_in_term(v : variable) (t : term) {struct t} : Prop :=
match t with
| Var v' => v=v'
| Term _ l =>
let occurs_in_term_list :=
(fix occurs_in_term_list v (l : list _) {struct l} : Prop :=
match l with
| nil => False
| h :: tl => (occurs_in_term v h) \/ (occurs_in_term_li... | Fixpoint | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | occurs_in_term | null |
occurs_in_term_list(v : variable) (l : list term) {struct l} : Prop :=
match l with
| nil => False
| cons h tl => (occurs_in_term v h) \/ (occurs_in_term_list v tl)
end. | Fixpoint | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | occurs_in_term_list | null |
occurs_in_pbv pb :=
(occurs_in_term_list v (map (fun p => match p with | (t1,t2) => t1 end) pb.(unsolved_part))) \/
(match find X.eq_bool v pb.(partly_solved_part) with
| None => False | Some _ => True end) \/
(match find X.eq_bool v pb.(solved_part) with
| None => False | Some _ => True end). | Definition | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | occurs_in_pb | null |
fresh_var: matching_problem -> variable. | Parameter | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | fresh_var | null |
fresh_var_spec: forall pb, ~(occurs_in_pb (fresh_var pb) pb). | Parameter | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | fresh_var_spec | null |
ac_elementary_solve_term_term_termpb f g lg list_of_terms l' list_of_equations : list matching_problem :=
map_without_repetition T.eq_bool
(fun t =>
match t with
| Term h _ =>
if F.Symb.eq_bool g h
then
match remove T.eq_bool t l' with
| None => None
| Some rmv =>... | Definition | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | ac_elementary_solve_term_term_term | null |
ac_elementary_solve_term_var_with_val_termpb f x_val list_of_terms l' list_of_equations : list matching_problem :=
match remove T.eq_bool x_val l' with
| None =>
match x_val with
| Var _ => nil
| Term g ll =>
if F.Symb.eq_bool f g
then
match remove_list ll l' with
... | Definition | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | ac_elementary_solve_term_var_with_val_term | null |
ac_elementary_solve_term_var_with_part_val_termpb f x_part_val list_of_terms l' list_of_equations : list matching_problem :=
if (F.Symb.eq_bool f (head_symb x_part_val))
then
match remove T.eq_bool (closed_term x_part_val) l' with
| None => nil
| Some rmv =>
let t1' := build f (cons (Var (... | Definition | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | ac_elementary_solve_term_var_with_part_val_term | null |
ac_elementary_solve_term_var_without_val_termpb f x list_of_terms l' list_of_equations : list matching_problem :=
map12_without_repetition T.eq_bool
(fun t =>
match remove T.eq_bool t l' with
| None => (None, None)
| Some rmv =>
let l'_without_t := rmv in
let t1' := build f list_of_terms i... | Definition | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | ac_elementary_solve_term_var_without_val_term | null |
ac_elementary_solvepb t1 t2 list_of_equations :=
match t1, t2 with
| (Term f (s :: list_of_terms as l)), (Term _ l') =>
match s with
| Term g lg =>
ac_elementary_solve_term_term_term
pb f g lg list_of_terms l' list_of_equations
| Var x =>
match find X.eq_bool x (solved_part pb)... | Definition | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | ac_elementary_solve | null |
solvepb : list matching_problem :=
match unsolved_part pb with
| (tt1,tt2 as e) :: list_of_equations =>
match tt1, tt2 with
| Var x, _ =>
match find X.eq_bool x (solved_part pb) with
| Some x_val =>
if T.eq_bool x_val tt2
then
let new_pb :=
mk_pb (existen... | Definition | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | solve | null |
well_sorted_partly_solved_part(l : list (variable * partly_solved_term)) : Prop :=
match l with
| nil => True
| (v,p) :: tl =>
v <> new_var p /\
(forall v', 1 <= nb_occ X.eq_bool v' tl -> v' <> new_var p) /\
well_sorted_partly_solved_part tl
end. | Fixpoint | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | well_sorted_partly_solved_part | null |
well_formed_pbpb :=
(forall t1 t2, In (t1,t2) pb.(unsolved_part) ->
well_formed_cf t1 /\ well_formed_cf t2) /\
(forall v, match (find X.eq_bool v pb.(solved_part)) with
| None => True
| Some t => well_formed_cf t
end) /\
(forall v, match (find X.eq_bool v pb.(partly_solved_part)) with
| None... | Definition | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | well_formed_pb | null |
is_well_formed_solpb sigma :=
(exists sigma', is_rough_sol pb sigma' /\
(forall v, In v (existential_vars pb) \/
apply_cf_subst sigma (Var v) = apply_cf_subst sigma' (Var v)) /\
(well_formed_cf_subst sigma')). | Definition | Coccinelle | [
"From Stdlib Require Import Arith List",
"From CoLoR Require Import more_list list_sort term_spec ac cf_eq_ac"
] | Coccinelle/ac_matching/matching.v | is_well_formed_sol | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.