aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2019-04-10 13:59:59 -0400
committerGravatar Jason Gross <jgross@mit.edu>2019-04-10 13:59:59 -0400
commit7b6cc09fa0273b1eed867bd11583f7b46be5b4e2 (patch)
tree40203e08ebc4835ca558f1b906d959b66136e7b4 /src
parentf77357842ea3bfeb1f6cd7520e3dc9f31440c845 (diff)
Add base.reflect_{base,type}_beq and type.reflect_type_beq
Diffstat (limited to 'src')
-rw-r--r--src/Language.v13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Language.v b/src/Language.v
index eb400d704..966cd3118 100644
--- a/src/Language.v
+++ b/src/Language.v
@@ -80,6 +80,11 @@ Module Compilers.
Inductive type {base_type : Type} := base (t : base_type) | arrow (s d : type).
Global Arguments type : clear implicits.
+ Global Instance reflect_type_beq {base_type} {base_beq} {reflect_base_beq : reflect_rel (@eq base_type) base_beq} : reflect_rel (@eq (type base_type)) (@type_beq base_type base_beq) | 10.
+ Proof.
+ apply reflect_of_beq; (apply internal_type_dec_bl + apply internal_type_dec_lb); apply reflect_to_beq; assumption.
+ Defined.
+
Fixpoint final_codomain {base_type} (t : type base_type) : base_type
:= match t with
| base t
@@ -301,6 +306,13 @@ Module Compilers.
End type.
Global Coercion type.type_base : type.base >-> type.type.
Notation type := type.type.
+
+ Global Instance reflect_base_beq : reflect_rel (@eq type.base) type.base_beq | 10
+ := reflect_of_beq type.internal_base_dec_bl type.internal_base_dec_lb.
+
+ Global Instance reflect_type_beq : reflect_rel (@eq type) type.type_beq | 10
+ := reflect_of_beq type.internal_type_dec_bl type.internal_type_dec_lb.
+
Definition base_interp (ty : type.base)
:= match ty with
| type.unit => Datatypes.unit
@@ -309,6 +321,7 @@ Module Compilers.
| type.nat => Datatypes.nat
| type.zrange => zrange
end.
+
Fixpoint interp (ty : type)
:= match ty with
| type.type_base t => base_interp t