Debian Codegraph @

apps/derive/examples/readme.v

raw
1 (* README *)
2 From elpi.apps Require Import derive.std.
3
4 #[module] derive Inductive peano := Zero | Succ (p : peano).
5
6 Print peano.peano.
7 (* Inductive peano : Set := Zero : peano | Succ : peano -> peano. *)
8
9 Eval compute in peano.eqb Zero (Succ Zero).
10 (* = false : bool *)
11
12 About peano.eqb_OK.
13 (*
14 peano.eqb_OK : forall x1 x2 : peano, reflect (x1 = x2) (peano.eqb x1 x2)
15
16 peano.eqb_OK is not universe polymorphic
17 Arguments peano.eqb_OK x1 x2
18 peano.eqb_OK is opaque
19 Expands to: Constant elpi.apps.derive.examples.readme.peano.eqb_OK
20 *)
21
22 #[verbose] derive Nat.add.
23 Check is_add. (*
24 : forall n : nat, is_nat n ->
25 forall m : nat, is_nat m ->
26 is_nat (n + m)
27 *)