(*****************)
(* Boolean words *)
(*****************)

Inductive word : Set :=
  | empty : word
  | bit : bool -> word -> word.(*****************)
(* Boolean words *)
(*****************)

Inductive word : Set :=
  | empty : word
  | bit : bool -> word -> word.(*****************)
(* Boolean words *)
(*****************)

Inductive word : Set :=
  | empty : word
  | bit : bool -> word -> word.(* Remark : word ~ bool list *)

(* word concatenation : logical definition *)
Inductive conc : word -> word -> word -> Prop :=
  | conc_empty : forall v : word, conc empty v v
  | conc_bit :
      forall (u v w : word) (b : bool),
      conc u v w -> conc (bit b u) v (bit b w).(* Remark : word ~ bool list *)

(* word concatenation : logical definition *)
Inductive conc : word -> word -> word -> Prop :=
  | conc_empty : forall v : word, conc empty v v
  | conc_bit :
      forall (u v w : word) (b : bool),
      conc u v w -> conc (bit b u) v (bit b w).(* Remark : word ~ bool list *)

(* word concatenation : logical definition *)
Inductive conc : word -> word -> word -> Prop :=
  | conc_empty : forall v : word, conc empty v v
  | conc_bit :
      forall (u v w : word) (b : bool),
      conc u v w -> conc (bit b u) v (bit b w).(* word concatenation : functional definition *)

Fixpoint append (u : word) : word -> word :=
  fun v : word =>
  match u with
  | empty => v
  | bit b w => bit b (append w v)
  end.

(* Specifications: *)
Lemma conc_append : forall u v w : word, conc u v w -> w = append u v.
Lemma assoc_append : forall u v w : word, append u (append v w) = append (append u v) w.