Proof Assistant Projects
Collection
Digesting proof assistant libraries for AI ingestion. • 103 items • Updated • 3
statement stringlengths 1 9.63k | proof stringlengths 0 31.3k | type stringclasses 19
values | symbolic_name stringlengths 1 54 | library stringclasses 43
values | filename stringclasses 263
values | imports listlengths 1 32 | deps listlengths 0 64 | docstring stringlengths 0 2.1k | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|
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:term),
arity f = C \/ arity f = AC... | Inductive | ac_one_step_at_top | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"arity",
"symbol",
"t1",
"t2",
"t3",
"term"
] | ** Definition of AC. | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb |
ac | := th_eq ac_one_step_at_top. | Definition | ac | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"ac_one_step_at_top",
"th_eq"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | flatten | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"Var",
"eq_bool",
"symbol",
"term"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | canonical_form | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"Var",
"arity",
"flatten",
"map",
"quicksort",
"term"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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
| Free n => length l = n
| C ... | Fixpoint | well_formed_cf | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"Var",
"arity",
"is_sorted",
"term"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
build (f : symbol) l | :=
match l with
| t :: nil => t
| _ => Term f (quicksort l)
end. | Definition | build | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"quicksort",
"symbol"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
well_formed_cf_subst sigma | :=
forall v, match find X.eq_bool v sigma with
| None => True
| Some t => well_formed_cf t
end. | Definition | well_formed_cf_subst | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"eq_bool",
"find",
"well_formed_cf"
] | Definition well_formed_cf_subst | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb |
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))
| C => quicksort (map (apply_cf_subst sigma) l)
| ... | Fixpoint | apply_cf_subst | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"Var",
"arity",
"eq_bool",
"find",
"flatten",
"map",
"quicksort",
"substitution",
"term"
] | Definition apply_cf_subst | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb |
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 => (length l) - 1
... | Fixpoint | ac_size | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"Var",
"arity",
"lt",
"term"
] | Definition ac_size | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb |
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)). | Parameter | l_assoc | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"ac",
"arity",
"t1",
"t2",
"t3"
] | Theorem l_assoc | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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)). | Parameter | r_assoc | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"ac",
"arity",
"t1",
"t2",
"t3"
] | Theorem r_assoc | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
comm :
forall f t1 t2, arity f = C \/ arity f = AC ->
ac (Term f (t1 :: t2 :: nil)) (Term f (t2 :: t1 :: nil)). | Parameter | comm | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"ac",
"arity",
"t1",
"t2"
] | Theorem comm | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
ac_top_eq :
forall t1 t2, 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. | Parameter | ac_top_eq | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"Var",
"ac",
"f1",
"f2",
"t1",
"t2"
] | Theorem ac_top_eq | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 /\
... | Parameter | well_formed_cf_unfold | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"Var",
"arity",
"is_sorted",
"well_formed_cf"
] | Theorem well_formed_cf_unfold | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
well_formed_cf_subterms :
forall f l, well_formed_cf (Term f l) -> (forall t, In t l -> well_formed_cf t). | Parameter | well_formed_cf_subterms | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"well_formed_cf"
] | Theorem well_formed_cf_subterms | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
well_formed_cf_length :
forall f l, arity f = AC -> well_formed_cf (Term f l) -> 2 <= length l. | Parameter | well_formed_cf_length | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"arity",
"well_formed_cf"
] | Theorem well_formed_cf_length | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
well_formed_cf_sorted :
forall f l, arity f = AC -> well_formed_cf (Term f l) -> is_sorted l. | Parameter | well_formed_cf_sorted | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"arity",
"is_sorted",
"well_formed_cf"
] | Theorem well_formed_cf_sorted | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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). | Parameter | well_formed_cf_alien | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"Var",
"arity",
"well_formed_cf"
] | Theorem well_formed_cf_alien | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
flatten_app :
forall f l1 l2, flatten f (l1 ++ l2) = (flatten f l1) ++ (flatten f l2). | Parameter | flatten_app | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"flatten"
] | Theorem flatten_app | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
list_permut_flatten :
forall f l1 l2, permut l1 l2 -> permut (flatten f l1) (flatten f l2). | Parameter | list_permut_flatten | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"flatten",
"permut"
] | Theorem list_permut_flatten | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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). | Parameter | length_flatten_bis | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"arity",
"flatten",
"well_formed_cf"
] | Theorem length_flatten_bis | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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. | Parameter | flatten_cf | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"arity",
"flatten",
"permut",
"t1",
"t2",
"well_formed_cf"
] | Theorem flatten_cf | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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. | Parameter | flatten_cf_cf | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"arity",
"canonical_form",
"flatten",
"permut",
"t1",
"t2",
"well_formed"
] | Theorem flatten_cf_cf | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
build_eq_Term :
forall f l, 2 <= length l -> build f l = Term f (quicksort l). | Parameter | build_eq_Term | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"build",
"quicksort"
] | Theorem build_eq_Term | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | well_formed_cf_build | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"Var",
"arity",
"build",
"well_formed_cf"
] | Theorem well_formed_cf_build | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | well_formed_cf_build_cons | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"arity",
"build",
"well_formed_cf"
] | Theorem well_formed_cf_build_cons | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | well_formed_cf_build_inside | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"arity",
"build",
"well_formed_cf"
] | Theorem well_formed_cf_build_inside | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | flatten_build | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"Var",
"arity",
"build",
"flatten",
"permut"
] | Theorem flatten_build | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | flatten_build_cons | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"arity",
"build",
"flatten",
"permut",
"well_formed_cf"
] | Theorem flatten_build_cons | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | flatten_build_inside | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"arity",
"build",
"flatten",
"permut",
"well_formed_cf"
] | Theorem flatten_build_inside | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | flatten_apply_cf_subst | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"apply_cf_subst",
"arity",
"build",
"flatten",
"map",
"permut"
] | Theorem flatten_apply_cf_subst | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | well_formed_cf_apply_subst | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"apply_cf_subst",
"well_formed_cf",
"well_formed_cf_subst"
] | Theorem well_formed_cf_apply_subst | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | length_flatten_ter | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"apply_cf_subst",
"arity",
"flatten",
"map",
"well_formed_cf",
"well_formed_cf_subst"
] | Theorem length_flatten_ter | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
ac_cf_eq : forall t1 t2, ac t1 t2 -> canonical_form t1 = canonical_form t2. | Parameter | ac_cf_eq | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"ac",
"canonical_form",
"t1",
"t2"
] | Theorem ac_cf_eq | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
ac_size_eq : forall t1 t2, ac t1 t2 -> size t1 = size t2. | Parameter | ac_size_eq | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"ac",
"size",
"t1",
"t2"
] | Theorem ac_size_eq | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | ac_size_unfold | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"Var",
"ac_size",
"arity",
"list_size"
] | Theorem ac_size_unfold | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
size_size_aux3 :
forall f t, arity f = AC -> well_formed t ->
1 <= length (A:=term) (flatten f (canonical_form t :: nil)). | Parameter | size_size_aux3 | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"arity",
"canonical_form",
"flatten",
"term",
"well_formed"
] | Theorem size_size_aux3 | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
size_size :
forall t, well_formed t -> size t = ac_size (canonical_form t). | Parameter | size_size | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"ac_size",
"canonical_form",
"size",
"well_formed"
] | Theorem size_size | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
ac_size_ge_one : forall t, well_formed_cf t -> 1 <= ac_size t. | Parameter | ac_size_ge_one | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"ac_size",
"well_formed_cf"
] | Theorem ac_size_ge_one | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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; simpl; apply c_axiom; trivial.
inversion_clear H'.
right; left; simpl; apply a_axiom; trivial.
right; left; simpl; apply c_axiom; trivial.
righ... | Lemma | no_need_of_instance | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"ac_one_step_at_top",
"axiom",
"subst",
"sym_refl",
"t1",
"t2"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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_subst_is_id (Term f (t1 :: Term f (t2 :: t3 :: nil) :: nil))).
apply instance.
left; apply a_axiom; trivial.
Qed. | Lemma | l_assoc | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"ac",
"arity",
"empty_subst_is_id",
"rewrite",
"t1",
"t2",
"t3",
"th_eq"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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_subst_is_id (Term f (t1 :: Term f (t2 :: t3 :: nil) :: nil))).
apply instance.
right; left; apply a_axiom; trivial.
Qed. | Lemma | r_assoc | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"ac",
"arity",
"empty_subst_is_id",
"rewrite",
"t1",
"t2",
"t3",
"th_eq"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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_axiom; trivial.
Qed. | Lemma | comm | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"ac",
"arity",
"empty_subst_is_id",
"rewrite",
"t1",
"t2",
"th_eq"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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; simpl; trivial.
inversion_clear Ac; simpl; trivial.
subst t2; destruct t1; trivial.
Qed. | Lemma | ac_one_step_at_top_top_eq | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"Var",
"ac_one_step_at_top",
"f1",
"f2",
"subst",
"sym_refl",
"t1",
"t2"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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_top_top_eq;
apply no_need_of_instance; trivial.
Qed. | Lemma | ac_one_step_top_eq | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"Var",
"ac_one_step_at_top",
"ac_one_step_at_top_top_eq",
"f1",
"f2",
"no_need_of_instance",
"one_step",
"sym_refl",
"t1",
"t2",
"term"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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.
(* one step *)
inversion H as [ H1 H2 H' H4 H5 | f l1 l2 H' H1 H2]; subst; trivial.
apply ac_one_step_top_eq; assumption.
(* th_trans *)
generalize (ac_one_step_top_eq H).
destruct x as [ v1 | f1 l1 ];
destruct y as [ v2 | f2 l2 ];
destruct z as [ v3 | f3 l3 ]; trivial.
intro; ... | Lemma | ac_top_eq | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"H1",
"Term",
"Var",
"ac",
"ac_one_step_top_eq",
"f1",
"f2",
"subst",
"t1",
"t2",
"term"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 /\
... | Proof.
intro t; destruct t as [v | f l]; simpl; trivial; intros [Wl Ll]; split; trivial.
clear Ll; induction l as [ | t l].
contradiction.
intros u [u_eq_t | In_u]; subst; intuition.
Qed. | Lemma | well_formed_cf_unfold | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"Var",
"arity",
"is_sorted",
"split",
"subst",
"well_formed_cf"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | well_formed_cf_subterms | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"well_formed_cf",
"well_formed_cf_unfold"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | well_formed_cf_length | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"arity",
"rewrite",
"well_formed_cf"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | well_formed_cf_sorted | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"arity",
"is_sorted",
"rewrite",
"well_formed_cf"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | well_formed_cf_alien | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"Var",
"arity",
"rewrite",
"well_formed_cf"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 /\
(fo... | Proof.
intro t; destruct t as [v | f l]; trivial.
intros [Wl Hl]; split; trivial; clear Hl;
induction l as [ | t l]; intuition auto with *;
apply IHl; intros; apply Wl; right; trivial.
Qed. | Lemma | well_formed_cf_fold | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"Var",
"arity",
"is_sorted",
"split",
"well_formed_cf"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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].
rewrite app_ass; trivial.
simpl; trivial.
Qed. | Lemma | flatten_app | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"eq_bool",
"eq_bool_ok",
"flatten",
"rewrite"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 _ _ In_t1) as [t1' [l2' [l2'' [t1_eq_t1' [H _]]]]];
simpl in t1_eq_t1'; simpl in H; subst l2;
... | Lemma | list_permut_flatten | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"dummy",
"eq",
"eq_bool",
"eq_bool_ok",
"f1",
"flatten",
"flatten_app",
"list_permut_app_app",
"mem",
"mem_split_set",
"permut",
"permut_app1",
"permut_app2",
"permut_cons_inside",
"permut_nil",
"permut_refl",
"permut_sym",
"rewrite",
"subst",
"t1"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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];
assert (Wl' : forall u, In u l -> exists s, well_formed s /\ u = canonical_form s).
intros u In_u; apply Hrec; trivi... | Lemma | well_formed_cf_is_well_formed_cf | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"Var",
"canonical_form",
"destruct_arity",
"eq_bool",
"eq_bool_ok",
"ge",
"list_permut_app_app",
"map",
"permut_cons_inside",
"permut_refl",
"permut_sym",
"quick_permut",
"quick_permut_bis",
"quick_sorted",
"rewrite",
"sort_is_unique",
"sorted_tl_sorted",
"split",... | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 (F.Symb.eq_bool_ok f g); case (F.Symb.eq_bool f g); [intro f_eq_g | intro f_diff_g].
rewrite length_app; replace (S (length l)) with (1 ... | Lemma | length_flatten_bis | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"arity",
"eq_bool",
"eq_bool_ok",
"flatten",
"length_app",
"replace",
"rewrite",
"subst",
"well_formed_cf"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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;
apply Nat.le_trans with (size t + list_size size l); trivial.
apply Nat.le_trans with (2 := Nat.le_add_r _ _), size_ge_one.
simpl; trivial.
intros Sl A... | Lemma | length_flatten | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"arity",
"canonical_form",
"eq_bool",
"eq_bool_ok",
"flatten",
"flatten_app",
"le_trans",
"length_app",
"length_quicksort",
"list_rec3",
"list_size",
"map",
"map_app",
"replace",
"rewrite",
"size",
"size_ge_one",
"size_unfold",
"subst",
"well_formed",
"well_... | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 with (size t); trivial; apply size_ge_one.
apply well_formed_cf_fold; destruct t as [ v | f l ]; simpl; trivial.
generalize (we... | Lemma | well_formed_cf_is_well_formed_cf_conv | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"canonical_form",
"destruct_arity",
"eq_bool",
"eq_bool_ok",
"flatten_app",
"ge",
"in_quick_in",
"le_trans",
"length_flatten",
"length_quicksort",
"list_rec3",
"list_size",
"map",
"quick_sorted",
"rewrite",
"size",
"size_ge_one",
"size_unfold",
"split",
"subst",
"t1",... | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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].
(* t1 = Var v1; t2 = Var v2 *)
simpl; intros; apply permut_length_1; trivial.
(* t1 = Var v1; t2 = Term f2 l2 *)
simpl; generalize (F.Symb.eq_bool_ok f f2); case (F.Symb.eq_bool f f2); [intros f_eq_f2; subst f2 | intros f_diff_f... | Lemma | flatten_cf | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"arity",
"eq_bool",
"eq_bool_ok",
"f1",
"f2",
"flatten",
"permut",
"permut_length",
"permut_length_1",
"rewrite",
"sort_is_unique",
"subst",
"t1",
"t2",
"well_formed_cf",
"well_formed_cf_length",
"well_formed_cf_sorted"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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_cf_conv; exists t1; split; trivial.
apply well_formed_cf_is_well_formed_cf_conv; exists t2; split; trivial.
Qed. | Lemma | flatten_cf_cf | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"arity",
"canonical_form",
"flatten",
"flatten_cf",
"permut",
"split",
"t1",
"t2",
"well_formed",
"well_formed_cf_is_well_formed_cf_conv"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | build_eq_Term | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"build",
"quicksort"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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); trivial; auto with arith.
apply Wl; left; trivial.
rewrite build_eq_Term; [idtac | simpl; auto with arith].
apply well_formed_cf_fold; split.
intros u In_u; rewrite <- in_quick_in in In_u.
apply Wl; trivial.
rewrite Af; split;... | Lemma | well_formed_cf_build | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"Var",
"arity",
"build",
"build_eq_Term",
"in_quick_in",
"length_quicksort",
"quick_sorted",
"rewrite",
"split",
"t1",
"t2",
"well_formed_cf",
"well_formed_cf_fold"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 (well_formed_cf_subterms W); right; trivial.
intros; apply (well_formed_cf_alien Af W); right; trivial.
Qed. | Lemma | well_formed_cf_build_cons | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"arity",
"build",
"replace",
"well_formed_cf",
"well_formed_cf_alien",
"well_formed_cf_build",
"well_formed_cf_length",
"well_formed_cf_subterms"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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_app; [ left | right; right ]; trivial.
apply well_formed_cf_build; trivial.
apply le_S_n; replace (S (length (l1 ++ l2))) with (length (l1 ++ t ... | Lemma | well_formed_cf_build_inside | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"add_comm",
"arity",
"build",
"length_app",
"replace",
"rewrite",
"well_formed_cf",
"well_formed_cf_alien",
"well_formed_cf_build",
"well_formed_cf_length",
"well_formed_cf_subterms"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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; apply False_rect; apply f_diff_f; reflexivity].
assert (Al_t1 := Al _ (or_introl _ (eq_refl _))).
simpl; destruct t1 as [ | g]; [auto | idtac].
generalize (F.Symb.eq_boo... | Lemma | flatten_build | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"Term",
"Var",
"arity",
"build",
"eq_bool",
"eq_bool_ok",
"eq_refl",
"flatten",
"permut",
"quick_permut_bis",
"rewrite",
"t1",
"t2"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | flatten_build_cons | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"arity",
"build",
"flatten",
"flatten_build",
"permut",
"well_formed_cf",
"well_formed_cf_alien"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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;
intro In_u; apply in_or_app; [left | right; right]; trivial.
Qed. | Lemma | flatten_build_inside | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"arity",
"build",
"flatten",
"flatten_build",
"permut",
"well_formed_cf",
"well_formed_cf_alien"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
is_subst_canonical_form sigma 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 | is_subst_canonical_form | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"canonical_form",
"eq_bool",
"find"
] | ** Substitutions modulo AC | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb |
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 | is_subst_cf_is_subst_cf | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"canonical_form",
"eq_bool",
"find",
"is_subst_canonical_form",
"map_subst",
"rewrite",
"subst_comp_is_subst_comp_aux1"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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_sigma; induction sigma as [ | [v1 t1] sigma].
exists (nil : substitution); split; trivial; intro v; simpl; trivial.
elim IHsigma.
intros sigma' [Wsigma' Hsigma']; assert (Wt1 : well_formed_cf t1).
generalize (Wsigma v1); simpl;
ge... | Lemma | well_formed_cf_subst_is_well_formed_cf_subst_aux | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"eq_bool",
"eq_bool_ok",
"eq_refl",
"find",
"is_subst_canonical_form",
"nb_occ",
"some_nb_occ_Sn",
"split",
"subst",
"substitution",
"t1",
"well_formed_cf",
"well_formed_cf_is_well_formed_cf",
"well_formed_cf_subst",
"well_formed_subst"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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; subst; reflexivity.
intros sigma Wsigma;
elim (reduce_assoc_list _ X.eq_bool_ok E sigma);
intros sigma1 [Nb_occ H];
elim (well_formed_cf_subst_is_well_formed_cf_subst_aux (sigma := sigma1));
trivia... | Lemma | well_formed_cf_subst_is_well_formed_cf_subst | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"H1",
"eq",
"eq_bool_ok",
"is_subst_canonical_form",
"reduce_assoc_list",
"rewrite",
"split",
"subst",
"t1",
"t2",
"t3",
"variable",
"well_formed_cf_subst",
"well_formed_cf_subst_is_well_formed_cf_subst_aux",
"well_formed_subst"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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; apply False_rect; apply f_diff_f; reflexivity].
rewrite Af; repeat rewrite quicksort_equation; simpl; auto.
destruct l as [ | t2 l]; auto.
simpl; rewrite Af;
generaliz... | Lemma | flatten_apply_cf_subst | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"apply_cf_subst",
"arity",
"build",
"eq",
"eq_bool",
"eq_bool_ok",
"flatten",
"list_permut_flatten",
"map",
"permut",
"permut_map",
"permut_sym",
"quick_permut",
"quick_permut_bis",
"quicksort_equation",
"rewrite",
"subst",
"t1",
"t2",
"term"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 (find X.eq_bool v sigma) as [t | ];
intro H_v; rewrite H_v; trivial.
intros f l IH;
assert (IHl : map (apply_cf_subst sigma_cf) (map canonical_form l) =
map canonical_form (map (apply_subst sigma) l))... | Theorem | apply_cf_subst_is_sound | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"apply_cf_subst",
"apply_subst",
"canonical_form",
"destruct_arity",
"eq",
"eq_bool",
"eq_bool_ok",
"find",
"flatten",
"flatten_app",
"is_subst_canonical_form",
"list_permut_flatten",
"map",
"map_app",
"permut_app1",
"permut_app2",
"permut_map",
"permut_sym",
"quick_per... | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 tau [Wtau Htau];
rewrite apply_cf_subst_is_sound with tau sigma u; trivial;
apply well_formed_cf_is_well_formed_cf_conv;
exists (apply_subst tau u);... | Theorem | well_formed_cf_apply_subst | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"apply_cf_subst",
"apply_cf_subst_is_sound",
"apply_subst",
"rewrite",
"split",
"subst",
"tau",
"well_formed_apply_subst",
"well_formed_cf",
"well_formed_cf_is_well_formed_cf",
"well_formed_cf_is_well_formed_cf_conv",
"well_formed_cf_subst",
"well_formed_cf_subst_is_well_formed_cf_subst"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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;
rewrite map_app; rewrite flatten_app;
do 2 rewrite length_app; apply Nat.add_le_mono.
assert (Wtsigma : well_formed_cf (apply_cf_subst sigma t)).
apply well_formed_cf_apply_subst; trivial; apply Wl; le... | Lemma | length_flatten_ter | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"In",
"apply_cf_subst",
"arity",
"eq_bool",
"eq_bool_ok",
"flatten",
"flatten_app",
"le_trans",
"length_app",
"map",
"map_app",
"replace",
"rewrite",
"subst",
"well_formed_cf",
"well_formed_cf_apply_subst",
"well_formed_cf_length",
"well_formed_cf_subst"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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) ++ (t1 :: nil)); trivial;
apply list_permut_app_app.
assert (Ccase : forall f, arity f = C \/ arity f = AC -> ... | Lemma | ac_one_step_at_top_cf_eq | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"ac_one_step_at_top",
"arity",
"canonical_form",
"eq_bool",
"eq_bool_ok",
"f1",
"f2",
"flatten",
"flatten_app",
"list_permut_app_app",
"permut",
"permut_app1",
"permut_app2",
"permut_cons",
"permut_cons_inside",
"permut_refl",
"permut_sym",
"quick_permut",
"quick_permut... | ** Canonical forms and equality modulo AC | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb |
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 | sym_refl_ac_one_step_at_top_cf_eq | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"ac_one_step_at_top",
"ac_one_step_at_top_cf_eq",
"canonical_form",
"subst",
"sym_refl",
"t1",
"t2"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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.
intros f l1 IHl1 t2 H;
inversion_clear H as [ H1 H2 Hroot | H1 H2 l2 Hsub].
apply sym_refl_ac_one_step_at_top_cf_eq; apply... | Lemma | ac_one_step_cf_eq | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"H1",
"ac_one_step_at_top",
"canonical_form",
"map",
"no_need_of_instance",
"one_step",
"rewrite",
"sym_refl",
"sym_refl_ac_one_step_at_top_cf_eq",
"t1",
"t2",
"term_rec3"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | ac_cf_eq | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"ac",
"ac_one_step_cf_eq",
"canonical_form",
"rwr_inv",
"t1",
"t2",
"term",
"th_eq"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 t2) (size t3)); apply Nat.add_comm.
Qed. | Lemma | ac_one_step_at_top_size_eq | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"ac_one_step_at_top",
"add_comm",
"rewrite",
"size",
"t1",
"t2",
"t3"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | sym_refl_ac_one_step_at_top_size_eq | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"ac_one_step_at_top",
"ac_one_step_at_top_size_eq",
"size",
"subst",
"sym_refl",
"t1",
"t2"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 t2 H;
inversion_clear H as [ H1 H2 Hroot | H1 H2 l2 Hsub].
apply sym_refl_ac_one_step_at_top_size_eq; a... | Lemma | ac_one_step_size_eq | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"H1",
"ac_one_step_at_top",
"list_size",
"no_need_of_instance",
"one_step",
"rewrite",
"size",
"size_unfold",
"sym_refl",
"sym_refl_ac_one_step_at_top_size_eq",
"t1",
"t2",
"term_rec3"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | ac_size_eq | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"ac",
"ac_one_step_size_eq",
"rwr_inv",
"size",
"t1",
"t2"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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; destruct t as [v | f l]; trivial; simpl.
apply (f_equal (fun n => (match arity f with
| AC => length l - 1
| C => 1
| Free _ => 1
end) + n));
... | Lemma | ac_size_unfold | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Term",
"Var",
"ac_size",
"arity",
"list_size",
"rewrite"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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_conv; exists t; split; trivial.
generalize (canonical_form t) Wu; clear t Wt Wu; intros u Wu.
destruct u as [v | g l]; trivial; simpl.
simpl; generalize (F.Symb.eq_bool_ok f g); case (F.Symb.eq_bool f g); [i... | Lemma | size_size_aux2 | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"ac_size",
"add_comm",
"arity",
"canonical_form",
"eq_bool",
"eq_bool_ok",
"flatten",
"list_size",
"list_size_fold",
"rewrite",
"split",
"subst",
"well_formed",
"well_formed_cf",
"well_formed_cf_is_well_formed_cf_conv",
"well_formed_cf_length"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | size_size_aux3 | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"arity",
"canonical_form",
"flatten",
"length_flatten",
"subst",
"term",
"well_formed"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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; trivial.
clear H Wt;
assert (Hl' : list_size size l = list_size ac_size (map... | Lemma | size_size | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"Dummy",
"In",
"Term",
"ac_size",
"add_comm",
"canonical_form",
"destruct_arity",
"eq",
"eq_bool",
"eq_bool_ok",
"eq_refl",
"f1",
"f2",
"flatten",
"flatten_app",
"length_app",
"length_quicksort",
"list_size",
"list_size_app",
"list_size_fold",
"map",
"permut_size",
"plus"... | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | ac_size_ge_one | Coccinelle.ac_matching | Coccinelle/ac_matching/ac.v | [
"Stdlib",
"Relations",
"List",
"Arith",
"Morphisms",
"CoLoR",
"more_list",
"list_permut",
"list_sort",
"term_spec",
"term_o",
"equational_theory_spec",
"equational_theory",
"T",
"F",
"LPermut",
"EqTh",
"T1",
"T1.F"
] | [
"ac_size",
"rewrite",
"size_ge_one",
"size_size",
"subst",
"well_formed_cf",
"well_formed_cf_is_well_formed_cf"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
cf_eq_ac :
forall t1 t2, well_formed t1 -> well_formed t2 ->
canonical_form t1 = canonical_form t2 -> ac t1 t2. | Parameter | cf_eq_ac | Coccinelle.ac_matching | Coccinelle/ac_matching/cf_eq_ac.v | [
"Stdlib",
"Setoid",
"Arith",
"List",
"Morphisms",
"CoLoR",
"closure",
"more_list",
"weaved_relation",
"list_sort",
"term_spec",
"ac",
"Ac.EqTh.T",
"Ac1",
"EqTh",
"Sort",
"T",
"F",
"X",
"LPermut"
] | [
"ac",
"canonical_form",
"t1",
"t2",
"well_formed"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | ||
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 /\... | Proof.
intros f Af t; pattern t; apply term_rec3; clear t.
(* t = Var _ *)
intros v l1 l2 _ P; simpl in P;
destruct l1 as [ | t1 l1]; [left; trivial | idtac];
destruct l2 as [ | t2 l2]; [right; left; trivial | idtac];
generalize (list_permut.permut_length P); rewrite length_app; simpl;
rewrite Nat.add_comm; intro; dis... | Lemma | split_cf | Coccinelle.ac_matching | Coccinelle/ac_matching/cf_eq_ac.v | [
"Stdlib",
"Setoid",
"Arith",
"List",
"Morphisms",
"CoLoR",
"closure",
"more_list",
"weaved_relation",
"list_sort",
"term_spec",
"ac",
"Ac.EqTh.T",
"Ac1",
"EqTh",
"Sort",
"T",
"F",
"X",
"LPermut"
] | [
"H1",
"Term",
"ac",
"ac_syntactic",
"add_comm",
"arity",
"canonical_form",
"comm",
"context_in",
"eq",
"eq_bool",
"eq_bool_ok",
"eq_refl",
"flatten",
"flatten_app",
"l_assoc",
"length_app",
"list_permut_app_app",
"list_permut_flatten",
"map",
"permut",
"permut_length",
"p... | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 ->
... | Proof.
intros n IH f Af a1 a2 a3 a4 Sa1 Wa1 Sa2 Wa2 Wa3 Wa4 k1 k4 P1 P2 P3 P4.
apply trans_clos_is_trans with (Term f (a3 :: a2 :: nil)).
refine (context_in _ _ _ _ f nil (a2 :: nil)).
apply IH; trivial; apply flatten_cf_cf with f; trivial;
rewrite P1; rewrite P3; auto.
refine (context_in _ _ _ _ f (a3 :: nil) nil).
a... | Lemma | syntactic_dec | Coccinelle.ac_matching | Coccinelle/ac_matching/cf_eq_ac.v | [
"Stdlib",
"Setoid",
"Arith",
"List",
"Morphisms",
"CoLoR",
"closure",
"more_list",
"weaved_relation",
"list_sort",
"term_spec",
"ac",
"Ac.EqTh.T",
"Ac1",
"EqTh",
"Sort",
"T",
"F",
"X",
"LPermut"
] | [
"Term",
"ac",
"arity",
"canonical_form",
"context_in",
"flatten",
"flatten_cf_cf",
"permut",
"rewrite",
"size",
"t1",
"t2",
"trans_clos_is_trans",
"well_formed"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 ->
wel... | Proof.
intros n IH f Af a1 a2 a3 a4 Sa1 Wa1 Sa2 Wa2 Wa3 Wa4 k2 k3 P1 P2 P3 P4.
apply trans_clos_is_trans with (Term f (a2 :: a1 :: nil)).
apply comm; right; trivial.
apply trans_clos_is_trans with (Term f (a3 :: a1 :: nil)).
refine (context_in _ _ _ _ f nil (a1 :: nil)).
apply IH; trivial; apply flatten_cf_cf with f; ... | Lemma | commutativity | Coccinelle.ac_matching | Coccinelle/ac_matching/cf_eq_ac.v | [
"Stdlib",
"Setoid",
"Arith",
"List",
"Morphisms",
"CoLoR",
"closure",
"more_list",
"weaved_relation",
"list_sort",
"term_spec",
"ac",
"Ac.EqTh.T",
"Ac1",
"EqTh",
"Sort",
"T",
"F",
"X",
"LPermut"
] | [
"Term",
"ac",
"arity",
"canonical_form",
"comm",
"context_in",
"flatten",
"flatten_cf_cf",
"permut",
"rewrite",
"size",
"t1",
"t2",
"trans_clos_is_trans",
"well_formed"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 ->
si... | Proof.
intros n IH f Af a1 a2 a3 a4 Sa1 Wa1 Sa2 Wa2 Sa3 Wa3 Sa4 Wa4 k1 k2 k4.
destruct k1 as [ | h1 k1]; [left; trivial | right];
destruct k2 as [ | h2 k2]; [left; trivial | right];
destruct k4 as [ | h4 k4]; [left; trivial | right]; intros P1 P2 P3 P4;
generalize (split_cf Af _ _ Wa1 P1);
intros [Hk1 | [Hk2 | [t1 [t2 ... | Lemma | associativity | Coccinelle.ac_matching | Coccinelle/ac_matching/cf_eq_ac.v | [
"Stdlib",
"Setoid",
"Arith",
"List",
"Morphisms",
"CoLoR",
"closure",
"more_list",
"weaved_relation",
"list_sort",
"term_spec",
"ac",
"Ac.EqTh.T",
"Ac1",
"EqTh",
"Sort",
"T",
"F",
"X",
"LPermut"
] | [
"H1",
"Term",
"ac",
"arity",
"canonical_form",
"context_in",
"eq_bool",
"eq_bool_ok",
"flatten",
"flatten_app",
"flatten_cf_cf",
"h1",
"h2",
"l_assoc",
"permut",
"permut_refl",
"quick_permut",
"rewrite",
"size",
"split",
"split_cf",
"subst",
"t1",
"t2",
"th_sym",
"t... | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 a... | Proof.
intros n IH f Af a1 a2 a3 a4 Sa1 Wa1 Sa2 Wa2 Sa3 Wa3 Sa4 Wa4 k2 k3 k4.
destruct k2 as [ | h2 k2]; [left; trivial | right];
destruct k3 as [ | h3 k3]; [left; trivial | right];
destruct k4 as [ | h4 k4]; [left; trivial | right]; intros P1 P2 P3 P4;
generalize (split_cf Af _ _ Wa2 P2);
intros [Hk1 | [Hk2 | [t3 [t4 ... | Lemma | swap_left | Coccinelle.ac_matching | Coccinelle/ac_matching/cf_eq_ac.v | [
"Stdlib",
"Setoid",
"Arith",
"List",
"Morphisms",
"CoLoR",
"closure",
"more_list",
"weaved_relation",
"list_sort",
"term_spec",
"ac",
"Ac.EqTh.T",
"Ac1",
"EqTh",
"Sort",
"T",
"F",
"X",
"LPermut"
] | [
"Term",
"ac",
"arity",
"canonical_form",
"comm",
"context_in",
"eq_bool",
"eq_bool_ok",
"flatten",
"flatten_app",
"flatten_cf_cf",
"h2",
"l_assoc",
"permut",
"quick_permut",
"r_assoc",
"rewrite",
"size",
"split",
"split_cf",
"subst",
"t1",
"t2",
"t3",
"th_sym",
"tra... | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 ... | Proof.
intros n IH f Af a1 a2 a3 a4 Sa1 Wa1 Sa2 Wa2 Sa3 Wa3 Sa4 Wa4 k1 k2 k3.
destruct k1 as [ | h1 k1]; [left; trivial | right];
destruct k2 as [ | h2 k2]; [left; trivial | right];
destruct k3 as [ | h3 k3]; [left; trivial | right]; intros P1 P2 P3 P4;
generalize (split_cf Af _ _ Wa1 P1);
intros [Hk1 | [Hk2 | [t1 [t2... | Lemma | swap_right | Coccinelle.ac_matching | Coccinelle/ac_matching/cf_eq_ac.v | [
"Stdlib",
"Setoid",
"Arith",
"List",
"Morphisms",
"CoLoR",
"closure",
"more_list",
"weaved_relation",
"list_sort",
"term_spec",
"ac",
"Ac.EqTh.T",
"Ac1",
"EqTh",
"Sort",
"T",
"F",
"X",
"LPermut"
] | [
"H1",
"Term",
"ac",
"arity",
"canonical_form",
"comm",
"context_in",
"eq_bool",
"eq_bool_ok",
"flatten",
"flatten_app",
"flatten_cf_cf",
"h1",
"h2",
"l_assoc",
"permut",
"quick_permut",
"r_assoc",
"rewrite",
"size",
"split",
"split_cf",
"subst",
"t1",
"t2",
"t3",
... | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 ... | Proof.
intros n IH f Af a1 a2 a3 a4 Sa1 Wa1 Sa2 Wa2 Sa3 Wa3 Sa4 Wa4 k1 k2 k3 k4.
destruct k1 as [ | h1 k1]; [left; trivial | right];
destruct k2 as [ | h2 k2]; [left; trivial | right];
destruct k3 as [ | h3 k3]; [left; trivial | right];
destruct k4 as [ | h4 k4]; [left; trivial | right]; intros P1 P2 P3 P4;
generaliz... | Lemma | middle_commutativity | Coccinelle.ac_matching | Coccinelle/ac_matching/cf_eq_ac.v | [
"Stdlib",
"Setoid",
"Arith",
"List",
"Morphisms",
"CoLoR",
"closure",
"more_list",
"weaved_relation",
"list_sort",
"term_spec",
"ac",
"Ac.EqTh.T",
"Ac1",
"EqTh",
"Sort",
"T",
"F",
"X",
"LPermut"
] | [
"H1",
"Term",
"ac",
"arity",
"canonical_form",
"comm",
"context_in",
"eq_bool",
"eq_bool_ok",
"flatten",
"flatten_app",
"flatten_cf_cf",
"h1",
"h2",
"l_assoc",
"permut",
"quick_permut",
"r_assoc",
"rewrite",
"size",
"split",
"split_cf",
"subst",
"t1",
"t2",
"t3",
... | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
length_morph : Proper (permut ==> eq) (length (A:=term)). | Proof. intros a b ab. eapply list_permut.permut_length. apply ab. Qed. | Instance | length_morph | Coccinelle.ac_matching | Coccinelle/ac_matching/cf_eq_ac.v | [
"Stdlib",
"Setoid",
"Arith",
"List",
"Morphisms",
"CoLoR",
"closure",
"more_list",
"weaved_relation",
"list_sort",
"term_spec",
"ac",
"Ac.EqTh.T",
"Ac1",
"EqTh",
"Sort",
"T",
"F",
"X",
"LPermut"
] | [
"eq",
"permut",
"permut_length",
"term"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | f1 l1] St1 [v2 | f l2] Wt1 Wt2 H;
[simpl in H; rewrite H; unfold ac; apply th_refl | discriminate | discriminate | ... | Theorem | cf_eq_ac | Coccinelle.ac_matching | Coccinelle/ac_matching/cf_eq_ac.v | [
"Stdlib",
"Setoid",
"Arith",
"List",
"Morphisms",
"CoLoR",
"closure",
"more_list",
"weaved_relation",
"list_sort",
"term_spec",
"ac",
"Ac.EqTh.T",
"Ac1",
"EqTh",
"Sort",
"T",
"F",
"X",
"LPermut"
] | [
"H1",
"In",
"Term",
"ac",
"ac_one_step_at_top",
"ac_syntactic",
"associativity",
"canonical_form",
"comm",
"commutativity",
"context_in",
"destruct_arity",
"eq",
"eq_bool",
"eq_bool_ok",
"eq_refl",
"f1",
"flatten",
"flatten_app",
"general_context",
"h1",
"h2",
"le_trans",... | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
partly_solved_term : Type | :=
mk_pst
{
head_symb : symbol;
new_var : variable;
closed_term : term
}. | Record | partly_solved_term | Coccinelle.ac_matching | Coccinelle/ac_matching/matching.v | [
"Stdlib",
"Arith",
"List",
"CoLoR",
"more_list",
"list_sort",
"term_spec",
"ac",
"cf_eq_ac",
"Cf_eq_ac.Ac",
"Sort",
"EqTh",
"EqTh.T",
"F",
"LPermut",
"Cf_eq_ac1",
"Ac",
"T",
"X"
] | [
"symbol",
"term",
"variable"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb | |
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 | matching_problem | Coccinelle.ac_matching | Coccinelle/ac_matching/matching.v | [
"Stdlib",
"Arith",
"List",
"CoLoR",
"more_list",
"list_sort",
"term_spec",
"ac",
"cf_eq_ac",
"Cf_eq_ac.Ac",
"Sort",
"EqTh",
"EqTh.T",
"F",
"LPermut",
"Cf_eq_ac1",
"Ac",
"T",
"X"
] | [
"partly_solved_term",
"substitution",
"term",
"variable"
] | https://github.com/fblanqui/color | 9e82957ee5a398834098da7378735a7c94e2f2cb |
A library on rewriting theory, lambda-calculus and termination.
9e82957ee5a398834098da7378735a7c94e2f2cb| Column | Type | Description |
|---|---|---|
| statement | string | Declaration signature/claim with the leading keyword removed (verbatim slice); the full declaration minus its proof |
| proof | string | Verbatim proof/body, empty if the declaration has none |
| type | string | Declaration keyword |
| symbolic_name | string | Declaration identifier |
| library | string | Sub-library |
| filename | string | Repository-relative source path |
| imports | list[string] | File-level Require/Import modules |
| deps | list[string] | Intra-corpus identifiers referenced |
| docstring | string | Preceding documentation comment, empty if absent |
| source_url | string | Upstream repository |
| commit | string | Upstream commit extracted |
| Type | Count |
|---|---|
| Lemma | 5,854 |
| Definition | 1,597 |
| Instance | 593 |
| Notation | 553 |
| Parameter | 408 |
| Fixpoint | 364 |
| Ltac | 214 |
| Inductive | 171 |
| Hypothesis | 85 |
| Let | 59 |
| Function | 41 |
| Theorem | 39 |
| Record | 35 |
| Coercion | 15 |
| Axiom | 4 |
| Class | 4 |
| Parameters | 4 |
| Scheme | 3 |
| Hypotheses | 3 |
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.
flatten | Coccinelle/ac_matching/ac.vEach declaration is split into a statement (signature/claim) and a proof (body) that are disjoint
and together form the complete declaration, for proof modeling, autoformalization, retrieval, and
dependency analysis via deps.
@misc{coq_color_dataset,
title = {Coq-CoLoR},
author = {Norton, Charles},
year = {2026},
note = {Extracted from https://github.com/fblanqui/color, commit 9e82957ee5a3},
url = {https://huggingface.co/datasets/phanerozoic/Coq-CoLoR}
}