|
1 |
| - |
2 | 1 | (** * Addition Chains
|
3 | 2 | Pierre Casteran, LaBRI, University of Bordeaux
|
4 | 3 |
|
5 | 4 | *)
|
| 5 | +From elpi Require Import derive param2. |
6 | 6 |
|
7 | 7 | From additions Require Export Monoid_instances Pow.
|
8 | 8 | From Coq Require Import Relations RelationClasses Lia List.
|
9 |
| -From Param Require Import Param. |
10 |
| - |
| 9 | + |
11 | 10 | From additions Require Import More_on_positive.
|
12 | 11 | Generalizable Variables A op one Aeq.
|
13 | 12 | Infix "==" := Monoid_def.equiv (at level 70) : type_scope.
|
@@ -232,7 +231,7 @@ Abort.
|
232 | 231 | (** Binary trees of multiplications over A *)
|
233 | 232 |
|
234 | 233 | 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). |
236 | 235 |
|
237 | 236 | Arguments Mul_node {A} _ _.
|
238 | 237 | Arguments One_node {A} .
|
@@ -399,7 +398,7 @@ the corresponding variables of type A and B are always bound to related
|
399 | 398 |
|
400 | 399 |
|
401 | 400 | (* begin snippet paramDemo *)
|
402 |
| -Parametricity computation. |
| 401 | +Elpi derive.param2 computation. |
403 | 402 |
|
404 | 403 | Print computation_R.
|
405 | 404 | (* end snippet paramDemo *)
|
@@ -507,7 +506,7 @@ Lemma power_R_is_a_refinement (a:A) :
|
507 | 506 | (computation_eval (M:= Natplus) gamma_nat).
|
508 | 507 | (* end snippet powerRRef *)
|
509 | 508 | Proof.
|
510 |
| - induction 1;simpl;[auto | ]. |
| 509 | + induction 1 as [|x1 x2 x_R y1 y2 y_R];simpl;[auto | ]. |
511 | 510 | apply H; destruct x_R, y_R; split.
|
512 | 511 | unfold mult_op, nat_plus_op.
|
513 | 512 | + lia.
|
@@ -560,9 +559,9 @@ Proof.
|
560 | 559 | (fun n p => n = Pos.to_nat p) 1 xH
|
561 | 560 | (refl_equal 1)).
|
562 | 561 | 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]. |
564 | 563 | - 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; |
566 | 565 | now subst.
|
567 | 566 | Qed.
|
568 | 567 |
|
|
0 commit comments