aboutsummaryrefslogtreecommitdiff
path: root/src/RewriterRulesGood.v
blob: 2d3ed96e24ebf2e418e7dce06685ca0971ddc2d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Require Import Coq.ZArith.ZArith.
Require Import Crypto.RewriterFull.
Require Import Crypto.RewriterWf1.
Local Open Scope Z_scope.

Module Compilers.
  Import RewriterFull.Compilers.
  Import RewriterWf1.Compilers.

  Module Import RewriteRules.
    Import RewriterFull.Compilers.RewriteRules.
    Import RewriterWf1.Compilers.RewriteRules.WfTactics.GoalType.
    Import RewriterWf1.Compilers.RewriteRules.WfTactics.Tactic.

    Lemma RewriterRulesNBEWf : Wf_GoalT RewriterNBE.
    Proof. prove_good (). Qed.

    Lemma RewriterRulesArithWf max_const : Wf_GoalT (RewriterArith max_const).
    Proof. prove_good (). Qed.

    Lemma RewriterRulesArithWithCastsWf : Wf_GoalT RewriterArithWithCasts.
    Proof. prove_good (). Qed.

    Lemma RewriterRulesStripLiteralCastsWf : Wf_GoalT RewriterStripLiteralCasts.
    Proof. prove_good (). Qed.

    Lemma RewriterRulesToFancyWf
            (invert_low invert_high : Z -> Z -> option Z)
            (Hlow : forall s v v', invert_low s v = Some v' -> v = Z.land v' (2^(s/2)-1))
            (Hhigh : forall s v v', invert_high s v = Some v' -> v = Z.shiftr v' (s/2))
      : Wf_GoalT (RewriterToFancy invert_low invert_high).
    Proof. prove_good (). Qed.

    Lemma RewriterRulesToFancyWithCastsWf
          (invert_low invert_high : Z -> Z -> option Z)
          (value_range flag_range : ZRange.zrange)
          (Hlow : forall s v v', invert_low s v = Some v' -> v = Z.land v' (2^(s/2)-1))
          (Hhigh : forall s v v', invert_high s v = Some v' -> v = Z.shiftr v' (s/2))
      : Wf_GoalT (RewriterToFancyWithCasts invert_low invert_high value_range flag_range).
    Proof. prove_good (). Qed.
  End RewriteRules.
End Compilers.