(************************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
(*   \VV/  **************************************************************)
(*    //   *      This file is distributed under the terms of the       *)
(*         *       GNU Lesser General Public License Version 2.1        *)
(************************************************************************)
(*i 	$Id$	 i*)
Section MapLists.
Fixpoint ad_in_list (a:ad) (l:list ad) {struct l} : bool :=
match l with
| nil => false
| a' :: l' => orb (Neqb a a') (ad_in_list a l')
end.
Fixpoint ad_list_stutters (l:list ad) : bool :=
match l with
| nil => false
| a :: l' => orb (ad_in_list a l') (ad_list_stutters l')
end.

(* Specifications: *)
Lemma ad_in_list_forms_circuit :
forall (x:ad) (l:list ad),
ad_in_list x l = true ->
{l1 : list ad &  {l2 : list ad | l = l1 ++ x :: l2}}.
Lemma ad_list_stutters_has_circuit :
forall l:list ad,
ad_list_stutters l = true ->
{x : ad &
{l0 : list ad &
{l1 : list ad &  {l2 : list ad | l = l0 ++ x :: l1 ++ x :: l2}}}}.