File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,34 @@ Inductive is_nat : nat -> Type :=
120120| is_S : forall n : nat, is_nat n -> is_nat (S n) *)
121121```
122122
123+ ### ` param2 `
124+
125+ Binary parametricity translation.
126+
127+ Main command is ` derive.param2 `
128+ ``` coq
129+ Elpi derive.param2 nat.
130+ Print nat_R. (*
131+ Inductive nat_R : nat -> nat -> Set :=
132+ | O_R : nat_R 0 0
133+ | S_R : forall H H0 : nat, nat_R H H0 -> nat_R (S H) (S H0).
134+ ```
135+
136+ The command ` derive.param2.register ` can be used to register
137+ handcrafted parametricity rules, so that they can be used by further
138+ ` derive.param2 ` commands.
139+ ``` coq
140+ Definition fa := 0.
141+ Definition fb := fa.
142+
143+ Fail Elpi derive.param2 fb.
144+ (* derive.param2: No binary parametricity translation for fa *)
145+
146+ Definition fa_R := O_R.
147+ Elpi derive.param2.register fa fa_R.
148+ Elpi derive.param2 fb.
149+ ```
150+
123151### ` param1_functor `
124152
125153``` coq
You can’t perform that action at this time.
0 commit comments