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

Lemma Switch_SpecTReg (sig : finType) (n : nat) (F1 F2 : finType) (pM1 : pTM _ F1 n) (pM2 : F1 -> pTM _ F2 n)
(P : Spec sig n) Q R
(k k1 : nat) (f : F1 -> nat) :
TripleT ≃≃(P) k pM1 (fun y => ≃≃(Q y)) ->
(forall (y : F1), TripleT ≃≃(Q y) (f y) (pM2 y) (fun y => ≃≃(R y))) ->
(implList (fst P) (forall y, implList (fst (Q y)) (1 + k + f y <= k1))) ->
TripleT ≃≃(P) k1 (Switch pM1 pM2) (fun y => ≃≃(R y)).