aboutsummaryrefslogtreecommitdiff
path: root/src/Reflection/InterpProofs.v
diff options
context:
space:
mode:
authorGravatar Jason Gross <jasongross9@gmail.com>2016-09-05 15:31:28 -0700
committerGravatar GitHub <noreply@github.com>2016-09-05 15:31:28 -0700
commit02c9314745f8105043833ef46c683b5ba7486e6a (patch)
tree58de40daa8765ca9a56d3b2f994f17830c7ebd59 /src/Reflection/InterpProofs.v
parentaa98370ba6165fb1f96b89645044ef13880bcf74 (diff)
parent03625062aadec037ef8738d9655ef69089a812f9 (diff)
Merge pull request #60 from JasonGross/common-phoas
Common PHOAS syntax
Diffstat (limited to 'src/Reflection/InterpProofs.v')
-rw-r--r--src/Reflection/InterpProofs.v29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Reflection/InterpProofs.v b/src/Reflection/InterpProofs.v
new file mode 100644
index 000000000..5790178e7
--- /dev/null
+++ b/src/Reflection/InterpProofs.v
@@ -0,0 +1,29 @@
+Require Import Crypto.Reflection.Syntax.
+Require Import Crypto.Util.Tactics.
+
+Local Open Scope ctype_scope.
+Section language.
+ Context (base_type_code : Type).
+
+ Local Notation flat_type := (flat_type base_type_code).
+ Local Notation type := (type base_type_code).
+ Let Tbase := @Tbase base_type_code.
+ Local Coercion Tbase : base_type_code >-> Syntax.flat_type.
+ Context (interp_base_type : base_type_code -> Type).
+ Context (op : flat_type (* input tuple *) -> flat_type (* output type *) -> Type).
+ Let interp_type := interp_type interp_base_type.
+ Let interp_flat_type := interp_flat_type_gen interp_base_type.
+ Context (interp_op : forall src dst, op src dst -> interp_flat_type src -> interp_flat_type dst).
+
+ Lemma interpf_SmartVar t v
+ : Syntax.interpf base_type_code interp_base_type op interp_op (SmartVar (t:=t) v) = v.
+ Proof.
+ unfold SmartVar; induction t;
+ repeat match goal with
+ | _ => reflexivity
+ | _ => progress simpl in *
+ | _ => progress rewrite_hyp *
+ | _ => rewrite <- surjective_pairing
+ end.
+ Qed.
+End language.