Skip to content

Commit 46fbee7

Browse files
committed
eqbOK: fresh names
1 parent 7356cf6 commit 46fbee7

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

apps/derive/elpi/eqbOK.elpi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ main (indt I) Prefix [CL] :- std.do! [
3636
add-reflect FI (global (const Correct)) (global (const Refl)) Breflect,
3737

3838
std.assert-ok! (coq.typecheck Breflect Treflect) "eqbOK generates illtyped term",
39-
Namerf is Prefix ^ "eqb_OK",
39+
coq.ensure-fresh-global-id (Prefix ^ "eqb_OK") Namerf,
4040
coq.env.add-const Namerf Breflect Treflect @opaque! Reflect,
4141

4242
CL = eqbok-for (indt I) Reflect,
@@ -50,7 +50,7 @@ main (const C) Prefix [CL] :- std.do! [
5050
add-reflect (inductive _ _) (global (const Correct)) (global (const Refl)) Breflect,
5151

5252
std.assert-ok! (coq.typecheck Breflect _) "eqbOK generates illtyped term",
53-
Namerf is Prefix ^ "eqb_OK",
53+
coq.ensure-fresh-global-id (Prefix ^ "eqb_OK") Namerf,
5454
X = global (const C),
5555
coq.env.add-const Namerf Breflect {{ forall a b : lp:X, Bool.reflect (@eq lp:X a b) (lp:F a b) }} @opaque! Reflect,
5656
CL = eqbok-for (const C) Reflect,

apps/derive/theories/derive/eqbOK.v

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,15 @@ Elpi Accumulate Db derive.eqbOK.db.
2626
Elpi Accumulate File eqbOK.
2727
Elpi Accumulate File eqType.
2828
Elpi Accumulate lp:{{
29-
main [str I, str O] :- !,
30-
coq.locate I GR,
31-
Prefix is O ^ "_",
32-
derive.eqbOK.main GR Prefix _.
33-
3429
main [str I] :- !,
3530
coq.locate I GR,
3631
coq.gref->id GR Tname,
3732
Prefix is Tname ^ "_",
3833
derive.eqbOK.main GR Prefix _.
3934

4035
main _ :- usage.
41-
42-
usage :- coq.error "Usage: derive.eqbOK <inductive name/alias> [<prefix>]".
36+
37+
usage :- coq.error "Usage: derive.eqbOK <inductive name/alias>".
4338

4439
}}.
4540
Elpi Typecheck.

0 commit comments

Comments
 (0)