(** ** Interpretations *)
Section Semantics.
Notation const := nat.
Variable domain : Type.
Definition env := var -> domain.
Variable (eta : env).
Context {I : interp eta}.
Fixpoint eval (rho : env) (t : term) : domain :=
match t with
| V s => rho s
| P p => eta p
| t_f b t => i_f b (eval rho t)
| t_e => i_e
end.
Definition update {X} (rho : var -> X) (v : var) (d : X) :=
(fun v' => if (Dec (v = v')) then d else rho v').
Notation "rho [[ v := d ]]" := (update rho v d) (at level 20).
Fixpoint sat {b} (rho : env) (phi : form b) : Prop :=
match phi with
| Pr t1 t2 =>  i_P (eval rho t1) (eval rho t2)
| Q => i_Q
| Fal => False
| Impl phi psi => sat rho phi -> sat rho psi
| All v phi => forall d : domain, sat (rho [[ v := d ]]) phi
end.
Notation "rho ⊫ A" := (forall psi, psi el A -> sat rho psi) (at level 20).
Notation "rho ⊨ phi" := (sat rho phi) (at level 20).
Context {b : logic}.

Lemma impl_sat A rho phi :
sat rho (A ==> phi) <-> ((forall psi, psi el A -> sat rho psi) -> sat rho phi).