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

(* Specifications: *)
Lemma sym_inj : Injective sym.
Lemma state_not_sym A B q e l:
A++[state q] = B ++sym e::(List.map sym l) -> False.
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.
Lemma mk_srconf_inj (c1 c2: conf) :
mk_srconf c1 = mk_srconf c2 <-> c1 = c2.