(*  ** Encoding of Configurations **)
Definition mk_srconf (c: conf): list rsig :=
match (ctape c) with
| niltape _ => [state (cstate c);#;$]
| leftof s r => [state(cstate c); #]++ (List.map sym (s::r))++[$]
| rightof s l => [#]++(List.map sym (List.rev (s::l)))++[state(cstate c);$]
| midtape l s r => [#]++(List.map sym (List.rev l))++ [(state(cstate c))]
++ (List.map sym (s::r))++[$]
end.

Lemma midtape_state A B q1 q2 l r:
A ++ (state q1)::B = List.map sym l++(state q2)::(List.map sym r)
-> A = List.map sym l /\ B = (List.map sym r) /\ q1 = q2.