(* Higher Order *)

Definition bassn b : Assertion :=
  fun st => (beval st b = true).

(* Specifications: *)
Lemma bexp_eval_true : forall b st, beval st b = true -> (bassn b) st.
Lemma bexp_eval_false : forall b st, beval st b = false -> ~ ((bassn b) st).
Theorem hoare_if : forall P Q b c1 c2, {{fun st => P st /\ bassn b st}} c1 {{Q}} -> {{fun st => P st /\ ~(bassn b st)}} c2 {{Q}} -> {{P}} (IFB b THEN c1 ELSE c2 FI) {{Q}}.
Lemma hoare_while : forall P b c, {{fun st => P st /\ bassn b st}} c {{P}} -> {{P}} WHILE b DO c END {{fun st => P st /\ ~ (bassn b st)}}.
Theorem always_loop_hoare : forall P Q, {{P}} WHILE BTrue DO SKIP END {{Q}}.