@@ -33,7 +33,8 @@ main (indt I) Prefix CLs :- std.do! [
3333 %std.assert! (ground_term R) "ww",
3434 std.assert-ok! (coq.typecheck R Ty) "derive.eqbcorrect: common/correct generates ill typed term",
3535 Name is Prefix ^ "eqb_correct",
36- coq.env.add-const Name R Ty @opaque! Correct,
36+ coq.ensure-fresh-global-id Name FName,
37+ coq.env.add-const FName R Ty @opaque! Correct,
3738
3839 if (has-params? FI) (
3940
@@ -42,7 +43,8 @@ main (indt I) Prefix CLs :- std.do! [
4243
4344 std.assert-ok! (coq.typecheck Rx Tyx) "derive.eqbcorrect: common-aux/corect generates ill typed term",
4445 Namex is Prefix ^ "eqb_correct_aux",
45- coq.env.add-const Namex Rx Tyx @opaque! Correctx,
46+ coq.ensure-fresh-global-id Namex FNamex,
47+ coq.env.add-const FNamex Rx Tyx @opaque! Correctx,
4648 CL_CORRECT = [correct-lemma-for (global (indt I)) (global (const Correctx))]
4749
4850 ) (CL_CORRECT = [correct-lemma-for (global (indt I)) (global (const Correct))]),
@@ -54,7 +56,8 @@ main (indt I) Prefix CLs :- std.do! [
5456
5557 std.assert-ok! (coq.typecheck Rr Tyr) "derive.eqbcorrect: common/refl generates ill typed term",
5658 Namer is Prefix ^ "eqb_refl",
57- coq.env.add-const Namer Rr Tyr @opaque! Refl,
59+ coq.ensure-fresh-global-id Namer FNamer,
60+ coq.env.add-const FNamer Rr Tyr @opaque! Refl,
5861
5962 if (has-params? FI) (
6063
@@ -63,7 +66,8 @@ main (indt I) Prefix CLs :- std.do! [
6366
6467 std.assert-ok! (coq.typecheck Rrx Tyrx) "derive.eqbcorrect: common-aux/refl generates ill typed term",
6568 Namerx is Prefix ^ "eqb_refl_aux",
66- coq.env.add-const Namerx Rrx Tyrx @opaque! Reflx,
69+ coq.ensure-fresh-global-id Namerx FNamerx,
70+ coq.env.add-const FNamerx Rrx Tyrx @opaque! Reflx,
6771 CL_REFL = [refl-lemma-for (global (indt I)) (global (const Reflx))]
6872
6973 ) (CL_REFL = [refl-lemma-for (global (indt I)) (global (const Refl))]),
@@ -83,8 +87,10 @@ main (const C) Prefix [Clause] :- std.do! [
8387 NameR is Prefix ^ "eqb_refl",
8488 NameC is Prefix ^ "eqb_correct",
8589 X = global (const C),
86- coq.env.add-const NameC Correct {{ @eqb_correct lp:X lp:F }} @transparent! CC,
87- coq.env.add-const NameR Refl {{ @eqb_reflexive lp:X lp:F }} @transparent! CR,
90+ coq.ensure-fresh-global-id NameR FNameR,
91+ coq.ensure-fresh-global-id NameC FNameC,
92+ coq.env.add-const FNameC Correct {{ @eqb_correct lp:X lp:F }} @transparent! CC,
93+ coq.env.add-const FNameR Refl {{ @eqb_reflexive lp:X lp:F }} @transparent! CR,
8894 Clause = (eqcorrect-for (const C) CC CR),
8995 coq.elpi.accumulate _ "derive.eqbcorrect.db" (clause _ _ Clause),
9096].
0 commit comments