Skip to content

Commit 84b2e4d

Browse files
committed
Port from paramcoq to coq-elpi derive
1 parent 1c30f04 commit 84b2e4d

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

coq-addition-chains.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ build: ["dune" "build" "-p" name "-j" jobs]
1818
depends: [
1919
"dune" {>= "2.5"}
2020
"coq" {>= "8.14"}
21-
"coq-paramcoq" {>= "1.1.3"}
21+
"coq-elpi" {>= "1.11"}
2222
"coq-mathcomp-ssreflect" {>= "1.13.0" & < "1.19"}
2323
"coq-mathcomp-algebra"
2424
]

meta.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ dependencies:
138138
description: |-
139139
[Equations](https://github.com/mattam82/Coq-Equations) 1.2 or later
140140
- opam:
141-
name: coq-paramcoq
142-
version: '{>= "1.1.3"}'
141+
name: coq-elpi
142+
version: '{>= "1.11"}'
143143
description: |-
144-
[Paramcoq](https://github.com/coq-community/paramcoq) 1.1.3 or later
144+
[Coq-elpi](https://github.com/LPCIC/coq-elpi) 1.11 or later
145145
- opam:
146146
name: coq-mathcomp-ssreflect
147147
version: '{>= "1.13.0" & < "1.19"}'

theories/additions/Addition_Chains.v

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
21
(** * Addition Chains
32
Pierre Casteran, LaBRI, University of Bordeaux
43
54
*)
5+
From elpi Require Import derive param2.
66

77
From additions Require Export Monoid_instances Pow.
88
From Coq Require Import Relations RelationClasses Lia List.
9-
From Param Require Import Param.
10-
9+
1110
From additions Require Import More_on_positive.
1211
Generalizable Variables A op one Aeq.
1312
Infix "==" := Monoid_def.equiv (at level 70) : type_scope.
@@ -232,7 +231,7 @@ Abort.
232231
(** Binary trees of multiplications over A *)
233232

234233
Inductive Monoid_Exp (A:Type) : Type :=
235-
Mul_node (t t' : Monoid_Exp A) | One_node | A_node (a:A).
234+
Mul_node (t t' : Monoid_Exp) | One_node | A_node (a:A).
236235

237236
Arguments Mul_node {A} _ _.
238237
Arguments One_node {A} .
@@ -399,7 +398,7 @@ the corresponding variables of type A and B are always bound to related
399398

400399

401400
(* begin snippet paramDemo *)
402-
Parametricity computation.
401+
Elpi derive.param2 computation.
403402

404403
Print computation_R.
405404
(* end snippet paramDemo *)
@@ -507,7 +506,7 @@ Lemma power_R_is_a_refinement (a:A) :
507506
(computation_eval (M:= Natplus) gamma_nat).
508507
(* end snippet powerRRef *)
509508
Proof.
510-
induction 1;simpl;[auto | ].
509+
induction 1 as [|x1 x2 x_R y1 y2 y_R];simpl;[auto | ].
511510
apply H; destruct x_R, y_R; split.
512511
unfold mult_op, nat_plus_op.
513512
+ lia.
@@ -560,9 +559,9 @@ Proof.
560559
(fun n p => n = Pos.to_nat p) 1 xH
561560
(refl_equal 1)).
562561
unfold the_exponent, the_exponent_nat, chain_execute, chain_apply.
563-
generalize (c nat 1), (c _ 1%positive); induction 1.
562+
generalize (c nat 1), (c _ 1%positive); induction 1 as [|x1 x2 x_R y1 y2 y_R].
564563
- cbn; assumption.
565-
- apply (H (x₁ + y₁)%nat (x₂ + y₂)%positive); rewrite Pos2Nat.inj_add;
564+
- apply (H (x1 + y1)%nat (x2 + y2)%positive); rewrite Pos2Nat.inj_add;
566565
now subst.
567566
Qed.
568567

0 commit comments

Comments
 (0)