Debian Codegraph @

apps/tc/tests/test_unfold.v

raw
1 From elpi Require Import tc.
2
3 Module NAT.
4 (* Unfold on S vs Nat.succ *)
5 TC.Unfold Nat.succ.
6 Class nat2 (T : nat -> nat).
7
8 Elpi Accumulate TC.Solver lp:{{
9 % Just to print what is beeing normalized
10 :after "firstHook"
11 tc.normalize-ty T _ :- coq.say "Normalizing" T, fail, !.
12 }}.
13
14 (* The unfold is done in the goal *)
15 Module NAT1.
16 Instance i1 : nat2 S. Qed.
17 Goal nat2 Nat.succ. apply _. Qed.
18 End NAT1.
19
20 (* The unfold is done at instance compilation *)
21 Module NAT2.
22 Instance i1 : nat2 Nat.succ. Qed.
23 Goal nat2 S. apply _. Qed.
24 End NAT2.
25
26 (* The unfold is done on the instance and on the goal *)
27 Module NAT3.
28 Instance i1 : nat2 Nat.succ. Qed.
29 Goal nat2 Nat.succ. apply _. Qed.
30 End NAT3.
31 End NAT.