| 1 |
(** * Push-Button Synthesis of Bitcoin Multiplication: Reification Cache *) |
| 2 |
From Coq Require Import Derive. |
| 3 |
Require Import Crypto.PushButtonSynthesis.ReificationCache. |
| 4 |
Require Import Crypto.Arithmetic.DettmanMultiplication. |
| 5 |
|
| 6 |
Local Set Keyed Unification. (* needed for making [autorewrite] fast, c.f. COQBUG(https://github.com/coq/coq/issues/9283) *) |
| 7 |
|
| 8 |
Module Export DettmanMultiplication. |
| 9 |
Import dettman_multiplication_mod_ops. |
| 10 |
Derive reified_mul_gen |
| 11 |
SuchThat (is_reification_of reified_mul_gen mulmod) |
| 12 |
As reified_mul_gen_correct. |
| 13 |
Proof. Time cache_reify (). Time Qed. |
| 14 |
Local Definition reified_mul_gen_correct_proj1 := proj1 reified_mul_gen_correct. |
| 15 |
Local Definition reified_mul_gen_correct_proj2 := proj2 reified_mul_gen_correct. |
| 16 |
#[global] |
| 17 |
Hint Extern 1 (_ = _) => apply_cached_reification mulmod reified_mul_gen_correct_proj1 : reify_cache_gen. |
| 18 |
#[global] |
| 19 |
Hint Immediate reified_mul_gen_correct_proj2 : wf_gen_cache. |
| 20 |
#[global] |
| 21 |
Hint Rewrite reified_mul_gen_correct_proj1 : interp_gen_cache. |
| 22 |
Local Opaque reified_mul_gen. (* needed for making [autorewrite] not take a very long time *) |
| 23 |
|
| 24 |
Derive reified_square_gen |
| 25 |
SuchThat (is_reification_of reified_square_gen squaremod) |
| 26 |
As reified_square_gen_correct. |
| 27 |
Proof. Time cache_reify (). Time Qed. |
| 28 |
Local Definition reified_square_gen_correct_proj1 := proj1 reified_square_gen_correct. |
| 29 |
Local Definition reified_square_gen_correct_proj2 := proj2 reified_square_gen_correct. |
| 30 |
#[global] |
| 31 |
Hint Extern 1 (_ = _) => apply_cached_reification squaremod reified_square_gen_correct_proj1 : reify_cache_gen. |
| 32 |
#[global] |
| 33 |
Hint Immediate reified_square_gen_correct_proj2 : wf_gen_cache. |
| 34 |
#[global] |
| 35 |
Hint Rewrite reified_square_gen_correct_proj1 : interp_gen_cache. |
| 36 |
Local Opaque reified_square_gen. (* needed for making [autorewrite] not take a very long time *) |
| 37 |
End DettmanMultiplication. |