Debian Codegraph @

apps/coercion/tests/test.v

raw
1 From elpi.apps Require Import coercion.
2 #[warning="-deprecated-from-Coq"]
3
4 Elpi Accumulate coercion.db lp:{{
5
6 coercion _ {{ True }} {{ Prop }} {{ bool }} {{ true }}.
7 coercion _ {{ False }} {{ Prop }} {{ bool }} {{ false }}.
8
9 }}.
10
11 Check andb True False.
12
13 Parameter ringType : Type.
14 Parameter ringType_sort : ringType -> Type.
15 Parameter natmul : forall (R : ringType) (n : nat), (ringType_sort R).
16
17 Elpi Accumulate coercion.db lp:{{
18
19 coercion _ N {{ nat }} {{ ringType_sort lp:R }} {{ natmul lp:R lp:N }} :-
20 coq.typecheck R {{ ringType }} ok.
21
22 }}.
23
24 Section TestNatMul.
25
26 Variable R : ringType.
27 Variable n : nat.
28
29 Check natmul R n : ringType_sort R.
30 Check n : ringType_sort R.
31
32 End TestNatMul.
33
34
35 Axiom ord : nat -> Type.
36 Axiom bump : forall n, ord n -> ord (S n).
37
38 Elpi Accumulate coercion.db lp:{{
39
40 coercion _ X {{ ord lp:N }} {{ ord (S lp:N) }} {{ bump lp:N lp:X }}.
41
42 }}.
43
44
45
46 Check fun i : ord 1 => (i : ord 2).