Skip to content

Commit d5cdcf6

Browse files
eponiergares
authored andcommitted
fix tests
1 parent c64752a commit d5cdcf6

File tree

3 files changed

+57
-57
lines changed

3 files changed

+57
-57
lines changed

apps/derive/examples/readme.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ peano.eqb_OK is opaque
2323
*)
2424

2525
#[verbose] derive Nat.add.
26-
Check add_is_add. (*
27-
: forall n : nat, nat_is_nat n ->
28-
forall m : nat, nat_is_nat m ->
29-
nat_is_nat (n + m)
26+
Check is_add. (*
27+
: forall n : nat, is_nat n ->
28+
forall m : nat, is_nat m ->
29+
is_nat (n + m)
3030
*)

apps/derive/tests/test_derive.v

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ Elpi derive bool.
3333
#[verbose] Elpi derive nat.
3434

3535
Check nat_eqb : nat -> nat -> bool.
36-
Check nat_is_nat : nat -> Type.
37-
Check nat_is_nat_witness : forall x, nat_is_nat x.
38-
Check nat_is_nat_functor : forall x, nat_is_nat x -> nat_is_nat x.
39-
Check nat_induction : forall P, P 0 -> (forall n, P n -> P (S n)) -> forall x, nat_is_nat x -> P x.
36+
Check is_nat : nat -> Type.
37+
Check is_nat_witness : forall x, is_nat x.
38+
Check is_nat_functor : forall x, is_nat x -> is_nat x.
39+
Check nat_induction : forall P, P 0 -> (forall n, P n -> P (S n)) -> forall x, is_nat x -> P x.
4040

4141
Check nat_tag : nat -> Numbers.BinNums.positive.
4242
Check nat_fields_t : Numbers.BinNums.positive -> Type.
@@ -53,10 +53,10 @@ Elpi derive.param1 andb.
5353
(* Prelude: Elpi derive list. *)
5454

5555
Check list_map : forall A B, (A -> B) -> list A -> list B.
56-
Check list_is_nil : forall A P, list_is_list A P (@nil A).
57-
Check list_is_cons : forall A P x (Px : P x) tl (Ptl : list_is_list A P tl), list_is_list A P (cons x tl).
58-
Check list_is_list_functor : forall A P Q, (forall x, P x -> Q x) -> forall l, list_is_list A P l -> list_is_list A Q l.
59-
Check list_induction : forall A PA P, P nil -> (forall x, PA x -> forall xs, P xs -> P (cons x xs)) -> forall l, list_is_list A PA l -> P l.
56+
Check is_nil : forall A P, is_list A P (@nil A).
57+
Check is_cons : forall A P x (Px : P x) tl (Ptl : is_list A P tl), is_list A P (cons x tl).
58+
Check is_list_functor : forall A P Q, (forall x, P x -> Q x) -> forall l, is_list A P l -> is_list A Q l.
59+
Check list_induction : forall A PA P, P nil -> (forall x, PA x -> forall xs, P xs -> P (cons x xs)) -> forall l, is_list A PA l -> P l.
6060
Check list_tag : forall A, list A -> Numbers.BinNums.positive.
6161
Check list_fields_t : (Type -> Numbers.BinNums.positive -> Type).
6262
Check list_fields : forall (A:Type) (l:list A), list_fields_t A (list_tag A l).
@@ -81,12 +81,12 @@ Check Vector.t_map : forall A B, (A -> B) -> forall n, Vector.t A n -> Vector.t
8181
Check Vector.t_getk_cons1 : forall A n, A -> forall m, Vector.t A m -> Vector.t A n -> A.
8282
Check Vector.t_getk_cons2 : forall A n, A -> forall m, Vector.t A m -> Vector.t A n -> nat.
8383
Check Vector.t_getk_cons3 : forall A n, A -> forall m, Vector.t A m -> Vector.t A n -> { k : nat & Vector.t A k}.
84-
Check Vector.t_is_t : forall A, (A -> Type) -> forall n, nat_is_nat n -> Vector.t A n -> Type.
85-
Check Vector.t_is_nil : forall A (PA : A -> Type), Vector.t_is_t A PA 0 nat_is_O (Vector.nil A).
86-
Check Vector.t_is_cons : forall A (PA : A -> Type) (a : A), PA a -> forall n (Pn : nat_is_nat n) (H : Vector.t A n),
87-
Vector.t_is_t A PA n Pn H -> Vector.t_is_t A PA (S n) (nat_is_S n Pn) (Vector.cons A a n H).
88-
Check Vector.t_is_t_functor : forall A PA QA (H : forall x, PA x -> QA x), forall n nR v, Vector.t_is_t A PA n nR v -> Vector.t_is_t A QA n nR v.
89-
Check Vector.t_induction : forall A PA (P : forall n, nat_is_nat n -> Vector.t A n -> Type), P 0 nat_is_O (Vector.nil A) -> (forall a, PA a -> forall m mR, forall (v : Vector.t A m), P m mR v -> P (S m) (nat_is_S m mR) (Vector.cons A a m v)) -> forall n nR v, Vector.t_is_t A PA n nR v -> P n nR v.
84+
Check Vector.is_t : forall A, (A -> Type) -> forall n, is_nat n -> Vector.t A n -> Type.
85+
Check Vector.is_nil : forall A (PA : A -> Type), Vector.is_t A PA 0 is_O (Vector.nil A).
86+
Check Vector.is_cons : forall A (PA : A -> Type) (a : A), PA a -> forall n (Pn : is_nat n) (H : Vector.t A n),
87+
Vector.is_t A PA n Pn H -> Vector.is_t A PA (S n) (is_S n Pn) (Vector.cons A a n H).
88+
Check Vector.is_t_functor : forall A PA QA (H : forall x, PA x -> QA x), forall n nR v, Vector.is_t A PA n nR v -> Vector.is_t A QA n nR v.
89+
Check Vector.t_induction : forall A PA (P : forall n, is_nat n -> Vector.t A n -> Type), P 0 is_O (Vector.nil A) -> (forall a, PA a -> forall m mR, forall (v : Vector.t A m), P m mR v -> P (S m) (is_S m mR) (Vector.cons A a m v)) -> forall n nR v, Vector.is_t A PA n nR v -> P n nR v.
9090
Check Vector.t_tag : forall A i, Vector.t A i -> Numbers.BinNums.positive.
9191
Fail Check Vector.t_fields_t : (Type -> Numbers.BinNums.positive -> Type).
9292
Fail Check Vector.t_fields : forall (A:Type) (n:nat) (l:Vector.t A n), Vector.t_fields_t A (Vector.t_tag A l).
@@ -138,22 +138,22 @@ Inductive triv : Coverage.unit -> Prop :=
138138
| one t : triv t | more x : triv x.
139139

140140
Check triv.induction :
141-
forall P : (forall H : Coverage.unit, unit_is_unit H -> triv H -> Prop),
142-
(forall t (Pt : unit_is_unit t), P t Pt (one t)) ->
143-
(forall x (Px : unit_is_unit x), P x Px (more x)) ->
144-
forall u (p : unit_is_unit u) (s : triv u), triv.is_triv u p s -> P u p s.
141+
forall P : (forall H : Coverage.unit, is_unit H -> triv H -> Prop),
142+
(forall t (Pt : is_unit t), P t Pt (one t)) ->
143+
(forall x (Px : is_unit x), P x Px (more x)) ->
144+
forall u (p : is_unit u) (s : triv u), triv.is_triv u p s -> P u p s.
145145

146146
(* #271 *)
147147
derive
148148
Inductive RoseTree : Type :=
149149
| RT_ctr (branches : list RoseTree).
150150

151-
Elpi derive.param1 list_is_list.
151+
Elpi derive.param1 is_list.
152152

153153
derive
154154
Inductive Pred : RoseTree -> Type :=
155155
| Pred_ctr branches :
156-
list_is_list _ Pred branches ->
156+
is_list _ Pred branches ->
157157
Pred (RT_ctr branches).
158158

159159
Check Pred.Pred_to_Predinv : forall T, Pred T -> Pred.Predinv T.

apps/derive/tests/test_param2.v

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ From elpi.apps Require Import derive.param2.
22

33
Set Uniform Inductive Parameters.
44

5-
Elpi derive.param2 unit R.
6-
Elpi derive.param2 nat R.
7-
Elpi derive.param2 list R.
5+
Elpi derive.param2 unit.
6+
Elpi derive.param2 nat.
7+
Elpi derive.param2 list.
88

99
(* The Parametricty plugin of K & L asks for an interactive proof here
1010
(the proof to be produced is the match over n in the nil branch) *)
@@ -15,73 +15,73 @@ Definition nth T (x0 : T) :=
1515
| cons x _, 0 => x
1616
| cons _ xs, S m => rec m xs
1717
end.
18-
Elpi derive.param2 nth R.
19-
Print nthR.
18+
Elpi derive.param2 nth.
19+
Print nth_R.
2020

2121
Inductive fin : nat -> Type :=
2222
FO : fin 0 | FS : forall n : nat, fin n -> fin (S n).
23-
Elpi derive.param2 fin R.
23+
Elpi derive.param2 fin.
2424

2525
Fixpoint fin_length n (v : fin n) :=
2626
match v with FO => 0 | FS _ w => S (fin_length _ w) end.
27-
Elpi derive.param2 fin_length R.
27+
Elpi derive.param2 fin_length.
2828

2929
Inductive vec (A : Type) : nat -> Type :=
3030
vnil : vec 0 | vcons : A -> forall n : nat, vec n -> vec (S n).
31-
Elpi derive.param2 vec R.
31+
Elpi derive.param2 vec.
3232

3333
Fixpoint vec_length (A : Type) n (v : vec A n) :=
3434
match v with vnil _ => 0 | vcons _ _ _ w => S (vec_length _ _ w) end.
35-
Elpi derive.param2 vec_length R.
36-
Elpi derive.param2 eq R.
37-
Elpi derive.param2 listR R.
35+
Elpi derive.param2 vec_length.
36+
Elpi derive.param2 eq.
37+
Elpi derive.param2 list_R.
3838

3939
Fixpoint plus' m n := match n with 0 => m | S n => S (plus' m n) end.
40-
Elpi derive.param2 plus' R.
41-
Elpi derive.param2 plus R.
42-
Elpi derive.param2 prod R.
43-
Elpi derive.param2 fst R.
44-
Elpi derive.param2 snd R.
45-
Elpi derive.param2 Nat.divmod R.
46-
Elpi derive.param2 Nat.div R.
40+
Elpi derive.param2 plus'.
41+
Elpi derive.param2 plus.
42+
Elpi derive.param2 prod.
43+
Elpi derive.param2 fst.
44+
Elpi derive.param2 snd.
45+
Elpi derive.param2 Nat.divmod.
46+
Elpi derive.param2 Nat.div.
4747

4848
Definition test m n p q r := m + n + p + q + r.
49-
Elpi derive.param2 test R.
49+
Elpi derive.param2 test.
5050

5151
Definition vec_length_type := forall (A : Type) (n : nat), vec A n -> nat.
5252

53-
Elpi derive.param2 vec_length_type R.
53+
Elpi derive.param2 vec_length_type.
5454

5555
Definition vec_length_rec (vec_length : vec_length_type)
5656
(A : Type) n (v : vec A n) :=
5757
match v with vnil _ => 0 | vcons _ _ _ w => S (vec_length _ _ w) end.
58-
Elpi derive.param2 vec_length_rec R.
58+
Elpi derive.param2 vec_length_rec.
5959

6060
Definition nat2nat := nat -> nat.
6161
Definition nat2nat2nat := nat -> nat -> nat.
62-
Elpi derive.param2 nat2nat R.
63-
Elpi derive.param2 nat2nat2nat R.
64-
Elpi derive.param2 pred R.
62+
Elpi derive.param2 nat2nat.
63+
Elpi derive.param2 nat2nat2nat.
64+
Elpi derive.param2 pred.
6565

66-
Print predR.
67-
Check (predR : nat2natR pred pred).
66+
Print pred_R.
67+
Check (pred_R : nat2nat_R pred pred).
6868

6969
Fixpoint predn n := match n with 0 => 0 | S n => S (predn n) end.
7070

71-
Elpi derive.param2 predn R.
71+
Elpi derive.param2 predn.
7272

73-
Check (prednR : nat2natR predn predn).
74-
Check (addR : nat2nat2natR plus plus).
73+
Check (predn_R : nat2nat_R predn predn).
74+
Check (add_R : nat2nat2nat_R plus plus).
7575

7676
Fixpoint quasidn n m := S (match n with 0 => m | S n => S (quasidn n m) end).
77-
Elpi derive.param2 quasidn R.
77+
Elpi derive.param2 quasidn.
7878

7979
Fixpoint weirdn n := match n with S (S n) => S (weirdn n) | _ => 0 end.
80-
Elpi derive.param2 weirdn R.
80+
Elpi derive.param2 weirdn.
8181

8282
Inductive bla : nat -> Type := Bla : nat -> bla 0 | Blu n : bla n -> bla 1.
83-
Elpi derive.param2 bla R.
83+
Elpi derive.param2 bla.
8484

8585
Fixpoint silly (n : nat) := n.
86-
Elpi derive.param2 silly R.
86+
Elpi derive.param2 silly.
8787

0 commit comments

Comments
 (0)