Skip to content

Commit 1c087d0

Browse files
committed
TC: tcalgebra/TcPolySmokeTest.ec — exercise class lemmas at parametric carrier
Add [test_addrC_at_int_poly] / [test_addrA_at_int_poly] / [test_mulrC_at_int_poly] using [apply (addrC<:int poly>)] etc. With the [try_delta] flush fix (commit 5e04bf6), these now work directly — the TCIUni parked at [opentvi] gets resolved before [tc_reducible] is checked. [*] at carrier [int poly] still has a parser-level ambiguity (both the section-local abbrev [Top.TcPoly.*] and the comring class [Top.TcMonoid.*] match). Test uses [polyM] explicitly there. That ambiguity is orthogonal to TC inference — it'd want a disambiguation policy at the parser level.
1 parent 5e04bf6 commit 1c087d0

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

examples/tcalgebra/TcPolySmokeTest.ec

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,20 @@ qed.
7979
lemma test_polyLE (xs : int list) (k : int) :
8080
(polyL xs).[k] = nth 0 xs k.
8181
proof. by rewrite polyLE. qed.
82+
83+
(* -------------------------------------------------------------------- *)
84+
(* Class lemmas at carrier [int poly] — exercises the parametric Path B *)
85+
(* path through the unifier's flush + matcher's drain. *)
86+
(* -------------------------------------------------------------------- *)
87+
lemma test_addrC_at_int_poly (p q : int poly) : p + q = q + p.
88+
proof. by apply (addrC<:int poly>). qed.
89+
90+
lemma test_addrA_at_int_poly (p q r : int poly) :
91+
p + (q + r) = (p + q) + r.
92+
proof. by apply (addrA<:int poly>). qed.
93+
94+
(* [polyM] is the section-local abbrev; the comring's [( * )] is the
95+
class op. With both in scope at carrier [int poly], `p * q' is
96+
ambiguous at parse — use the structural lemma instead. *)
97+
lemma test_mulrC_at_int_poly (p q : int poly) : polyM p q = polyM q p.
98+
proof. by apply polyM_mulrC. qed.

0 commit comments

Comments
 (0)