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