(** * Semantics

  - [Sem e vl] is the evaluation of the expression [e] where the [i]th variable is
    instantiated with the [i]th value of [vl].
    If a variable is not assigned a value, then it is assumed to be the empty bitstring [nil].
    Values in [vl] that do not correspond to a variable are ignored.

  - [Cobham_ind_inf] is an induction principle that makes easier dealing with arity in inductive proofs.
*)

Fixpoint sem_Rec (sem_g sem_h0 sem_h1 : list bs -> bs) (v : bs) (vl : list bs) : bs :=
  match v with
    | nil => sem_g vl
    | b::v' => if b then 
      sem_h1 (v' :: (sem_Rec sem_g sem_h0 sem_h1 v' vl) :: vl)
      else sem_h0 (v' :: (sem_Rec sem_g sem_h0 sem_h1 v' vl) :: vl)
  end.Fixpoint smash' (x y : bs) :=
  match x with 
    | nil => y
    | _ :: x' => false :: smash' x' y
  end.

Lemma length_smash' x y : length (smash' x y) = length x + length y.