Section RegSpec.
Variable sig : Type.
(* Notation without EqType stuff *)
Local Notation "sig '^+'" := ((boundary + sig) % type) (at level 0) : type_scope.
Inductive RegSpec : Type :=
| Contains {sigX X : Type} {cX : codable sigX X} (r : Retract sigX sig) : X -> RegSpec
| Contains_size {sigX X : Type} {cX : codable sigX X} (r : Retract sigX sig) : X -> nat -> RegSpec
| Void : RegSpec
| Void_size : nat -> RegSpec
| Custom : (tape sig^+ -> Prop) -> RegSpec. (* Allows the user to specify the tape manually *)
(* Semantics *)
Definition tspec_single (spec : RegSpec) (t : tape sig^+) : Prop :=
match spec with
| Contains r x => t ≃(r) x
| Contains_size r x s => t ≃(r; s) x
| Void => isVoid t
| Void_size s => isVoid_size t s
| Custom p => p t
end.

Lemma tspec_single_Contains_size_Contains {sigX X : Type} {cX : codable sigX X} (r : Retract sigX sig) (x : X) (s : nat) (t : tape sig^+) :
tspec_single (Contains_size r x s) t -> tspec_single (Contains r x) t.