(* ** 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 *)

(* Equally weak version with the same bound for the number of steps of [pM2] and [pM3]. *)
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 : nat) :
TripleT P k1 pM1 Q ->
TripleT (Q true)  k2 pM2 R ->
TripleT (Q false) k2 pM3 R ->
(1 + k1 + k2 <= k) ->
TripleT P k (If pM1 pM2 pM3) R.