| 1 |
Require Import Rewriter.Language.Language. |
| 2 |
Require Import Crypto.Language.API. |
| 3 |
Require Import Rewriter.Language.Wf. |
| 4 |
Require Import Crypto.Language.WfExtra. |
| 5 |
Require Import Crypto.Rewriter.AllTacticsExtra. |
| 6 |
Require Import Crypto.Rewriter.RulesProofs. |
| 7 |
|
| 8 |
Module Compilers. |
| 9 |
Import Language.Compilers. |
| 10 |
Import Language.API.Compilers. |
| 11 |
Import Language.Wf.Compilers. |
| 12 |
Import Language.WfExtra.Compilers. |
| 13 |
Import Rewriter.AllTacticsExtra.Compilers.RewriteRules.GoalType. |
| 14 |
Import Rewriter.AllTactics.Compilers.RewriteRules.Tactic. |
| 15 |
Import Compilers.Classes. |
| 16 |
|
| 17 |
Module Import RewriteRules. |
| 18 |
Section __. |
| 19 |
Context (adc_no_carry_to_add : bool). |
| 20 |
|
| 21 |
Definition VerifiedRewriterArithWithCasts : VerifiedRewriter_with_args false false true (arith_with_casts_rewrite_rules_proofs adc_no_carry_to_add). |
| 22 |
Proof using All. make_rewriter. Defined. |
| 23 |
|
| 24 |
Definition default_opts := Eval hnf in @default_opts VerifiedRewriterArithWithCasts. |
| 25 |
Let optsT := Eval hnf in optsT VerifiedRewriterArithWithCasts. |
| 26 |
|
| 27 |
Definition RewriteArithWithCasts (opts : optsT) {t : API.type} := Eval hnf in @Rewrite VerifiedRewriterArithWithCasts opts t. |
| 28 |
|
| 29 |
Lemma Wf_RewriteArithWithCasts opts {t} e (Hwf : Wf e) : Wf (@RewriteArithWithCasts opts t e). |
| 30 |
Proof. now apply VerifiedRewriterArithWithCasts. Qed. |
| 31 |
|
| 32 |
Lemma Interp_RewriteArithWithCasts opts {t} e (Hwf : Wf e) : API.Interp (@RewriteArithWithCasts opts t e) == API.Interp e. |
| 33 |
Proof. now apply VerifiedRewriterArithWithCasts. Qed. |
| 34 |
End __. |
| 35 |
End RewriteRules. |
| 36 |
|
| 37 |
Module Export Hints. |
| 38 |
#[global] |
| 39 |
Hint Resolve Wf_RewriteArithWithCasts : wf wf_extra. |
| 40 |
#[global] |
| 41 |
Hint Opaque RewriteArithWithCasts : wf wf_extra interp interp_extra rewrite. |
| 42 |
#[global] |
| 43 |
Hint Rewrite @Interp_RewriteArithWithCasts : interp interp_extra. |
| 44 |
End Hints. |
| 45 |
End Compilers. |