This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit b4ea4c4 committed Jan 28, 2025 · 10 / 52
1 parent a014af2 commit b4ea4c4 Copy full SHA for b4ea4c4
File tree 1 file changed +28
-0
lines changed
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 :=
120
120
| is_S : forall n : nat, is_nat n -> is_nat (S n) *)
121
121
```
122
122
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
+
123
151
### ` param1_functor `
124
152
125
153
``` coq
You can’t perform that action at this time.
0 commit comments