Skip to content

Commit 69952aa

Browse files
proux01gares
authored andcommitted
Don't Require PrimInt63 and PrimFloat by default
1 parent 0451f1b commit 69952aa

File tree

7 files changed

+16
-15
lines changed

7 files changed

+16
-15
lines changed

apps/derive/theories/derive/eq.v

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ From Coq Require Import Bool.
99
From elpi Require Import elpi.
1010
From elpi.apps Require Import derive.
1111

12+
From Coq Require Import PrimInt63 PrimFloat.
13+
1214
Register Coq.Numbers.Cyclic.Int63.PrimInt63.eqb as elpi.derive.eq_unit63.
1315
Register Coq.Floats.PrimFloat.eqb as elpi.derive.eq_float64.
1416

1517
Elpi Db derive.eq.db lp:{{
1618

1719
% full resolution (composes with eq functions for parameters)
1820
type eq-db term -> term -> term -> prop.
19-
eq-db {{ lib:elpi.uint63 }} {{ lib:elpi.uint63 }} {{ lib:elpi.derive.eq_unit63 }} :- !.
20-
eq-db {{ lib:elpi.float64 }} {{ lib:elpi.float64 }} {{ lib:elpi.derive.eq_float64 }} :- !.
21+
eq-db {{ lib:num.int63.type }} {{ lib:num.int63.type }} {{ lib:elpi.derive.eq_unit63 }} :- !.
22+
eq-db {{ lib:num.float.type }} {{ lib:num.float.type }} {{ lib:elpi.derive.eq_float64 }} :- !.
2123

2224
:name "eq-db:fail"
2325
eq-db A B F :-

apps/derive/theories/derive/eqType_ast.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
From elpi Require Import elpi.
2+
From Coq Require Import PrimInt63 PrimFloat.
23
From elpi.apps Require Import derive.
34

45
From elpi.apps.derive Extra Dependency "eqType.elpi" as eqType.

apps/derive/theories/derive/eqcorrect.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Register uint63_eq_correct as elpi.derive.uint63_eq_correct.
2222
Elpi Db derive.eqcorrect.db lp:{{
2323
type eqcorrect-db gref -> term -> prop.
2424

25-
eqcorrect-db X {{ lib:elpi.derive.uint63_eq_correct }} :- {{ lib:elpi.uint63 }} = global X, !.
26-
eqcorrect-db X _ :- {{ lib:elpi.float64 }} = global X, !, stop "float64 comparison is not syntactic".
25+
eqcorrect-db X {{ lib:elpi.derive.uint63_eq_correct }} :- {{ lib:num.int63.type }} = global X, !.
26+
eqcorrect-db X _ :- {{ lib:num.float.type }} = global X, !, stop "float64 comparison is not syntactic".
2727

2828
:name "eqcorrect-db:fail"
2929
eqcorrect-db T _ :-

apps/derive/theories/derive/param1.v

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Class reali {X : Type} {XR : X -> Type} (x : X) (xR : XR x) := Reali {}.
4040

4141
Register store_reali as param1.store_reali.
4242

43+
From Coq Require Import PrimInt63 PrimFloat.
44+
4345
Inductive is_uint63 : PrimInt63.int -> Type := uint63 (i : PrimInt63.int) : is_uint63 i.
4446
Register is_uint63 as elpi.derive.is_uint63.
4547

@@ -55,8 +57,8 @@ pred reali-done i:gref.
5557
:index(3)
5658
pred reali i:term, o:term.
5759

58-
reali {{ lib:elpi.uint63 }} {{ lib:elpi.derive.is_uint63 }} :- !.
59-
reali {{ lib:elpi.float64 }} {{ lib:elpi.derive.is_float64 }} :- !.
60+
reali {{ lib:num.int63.type }} {{ lib:elpi.derive.is_uint63 }} :- !.
61+
reali {{ lib:num.float.type }} {{ lib:elpi.derive.is_float64 }} :- !.
6062

6163
:name "reali:fail"
6264
reali X _ :-
@@ -66,8 +68,8 @@ reali X _ :-
6668

6769
type realiR term -> term -> prop.
6870

69-
realiR {{ lib:elpi.uint63 }} {{ lib:elpi.derive.is_uint63 }} :- !.
70-
realiR {{ lib:elpi.float64 }} {{ lib:elpi.derive.is_float64 }} :- !.
71+
realiR {{ lib:num.int63.type }} {{ lib:elpi.derive.is_uint63 }} :- !.
72+
realiR {{ lib:num.float.type }} {{ lib:elpi.derive.is_float64 }} :- !.
7173

7274
:name "realiR:fail"
7375
realiR T TR :-

elpi/elpi_elaborator.elpi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ of (global GR as X) T X :- coq.env.typeof GR T1, unify-leq T1 T.
308308
of (pglobal GR I as X) T X :-
309309
@uinstance! I => coq.env.typeof GR T1, unify-leq T1 T.
310310

311-
of (primitive (uint63 _) as X) T X :- unify-leq {{ lib:elpi.uint63 }} T.
312-
of (primitive (float64 _) as X) T X :- unify-leq {{ lib:elpi.float64 }} T.
311+
of (primitive (uint63 _) as X) T X :- unify-leq {{ lib:num.int63.type }} T.
312+
of (primitive (float64 _) as X) T X :- unify-leq {{ lib:num.float.type }} T.
313313

314314
of (uvar as X) T Y :- !, evar X T Y.
315315

tests/test_elaborator.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
From unreleased Extra Dependency "elpi_elaborator.elpi" as elab.
22

3+
From Coq Require Import PrimInt63 PrimFloat.
34
From elpi Require Import elpi.
45

56
Elpi Command test.refiner.

theories/elpi.v

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,3 @@ From Coq Require Bool.
4545
Register Coq.Bool.Bool.reflect as elpi.reflect.
4646
Register Coq.Bool.Bool.ReflectF as elpi.ReflectF.
4747
Register Coq.Bool.Bool.ReflectT as elpi.ReflectT.
48-
49-
From Coq Require PrimFloat PrimInt63.
50-
51-
Register Coq.Floats.PrimFloat.float as elpi.float64.
52-
Register Coq.Numbers.Cyclic.Int63.PrimInt63.int as elpi.uint63.

0 commit comments

Comments
 (0)