(* ** Some Hoare Rules *)
From Undecidability Require Export TM.Compound.Multi TM.Combinators.Combinators.
From Undecidability.TM.Hoare Require Import HoareLogic HoareRegister.
(* *** Nop *)
(* A classic example for Hoare logic *)
(* *** [Relabel] *)
(* *** [Return] *)
(* *** Sequential Composition *)

(* Version were we don't care about the output label of [M1] *)
Lemma If_SpecT_weak (sig : finType) (n : nat) (F : finType) (pM1 : pTM sig bool n) (pM2 pM3 : pTM sig F n)
(P : Assert sig n) (Q : bool -> Assert sig n) (R : F -> Assert sig n)
(k k1 k2 k3 : nat) :
TripleT P k1 pM1 Q ->
TripleT (Q true)  k2 pM2 R ->
TripleT (Q false) k3 pM3 R ->
(1 + k1 + max k2 k3 <= k) ->
TripleT P k (If pM1 pM2 pM3) R.