Section SemanticTyping.
Variable (X: Const).
Definition SemType := exp X -> Prop.
(* ** Logical Relations *)
Definition active (s: exp X) :=
match s with lambda s => True | _ => False end.
Definition C (T: SemType) (s: exp X) :=
exists t, s ▷ t /\ (active t -> T t).
Fixpoint V (A: type) (s: exp X) :=
match A with
| typevar beta => False
| A → B => match s with
| lambda s => normal s /\
forall t delta, C (V A) t -> C (V B) ((ren delta (lambda s)) t)
| _ => False
end
end.
Definition E A := C (V A).
Definition G Gamma gamma := forall i A, nth Gamma i = Some A -> E A (gamma i).

Lemma closure_under_reduction s t A:
s >* t -> E A t -> E A s.