(* ** Examples *)
Arguments mult : simpl never.
Arguments plus : simpl never.
(* Disable the warnings regarding [Undo]. This is a demonstration file. *)
Set Warnings "-undo-batch-mode,-non-interactive".
(* *** Copy.v *)
Definition CopyValue_sizefun {sigX X : Type} {cX : codable sigX X} (x : X) : Vector.t (nat->nat) 2 := [|id; CopyValue_size x|].
(* Same example, but using the specification language *)
(* Example using the specification language and lifting: Increment two numbers *)
Definition Incr2 : pTM sigNat^+ unit 2 :=
Constr_S@[|Fin0|];; Constr_S@[|Fin1|].
Definition Incr2_steps := 1 + Constr_S_steps + Constr_S_steps.
(* More increments *)
Definition Incr3 : pTM sigNat^+ unit 3 :=
Constr_S@[|Fin0|];; Constr_S@[|Fin1|];; IncrementTwice@[|Fin2|].
Definition Incr3_steps := 2 + Constr_S_steps + Constr_S_steps + IncrementTwice_steps.

(* The same with time! *)
Lemma Incr3_SpecT :
forall (x y z : nat), TripleT (≃≃([], [|Contains _ x; Contains _ y; Contains _ z|])) (Incr3_steps) Incr3 (fun _ => ≃≃([], [|Contains _ (S x); Contains _ (S y); Contains _ (S (S z))|])).