(*****************************************************************************)
(*                    Case where E is an identifier                          *)
(* This case is special in the sens that we cannot use the predicate         *)
(*compilation because the variables of the formulation must be introduced    *)
(* in a very precise order.                                                  *)
(* Of course we could avoid a new definition using a the Cut tactic          *)
(* The point is that in this case only we must first do an induction on the  *)
(* ML environment in which we evaluate our expression (an identifier!)       *)
(*****************************************************************************)


Inductive compilation_id (E : MLexp) : Prop :=
    preuve_compilation_id :
      (forall (e : MLenv) (s : Squelette),
       Habite e s ->
       forall V : MLval,
       ML_DS e E V ->
       forall C : Commande,
       Traduction s E C ->
       forall CV : CSem_val,
       Equiv_env e CV ->
       exists CV1 : CSem_val,
         Equiv_val V CV1 /\
         (forall s : Etat, CAM_DS (ETcons CV s) C (ETcons CV1 s))) ->
      compilation_id E.(*****************************************************************************)
(*                    Case where E is an identifier                          *)
(* This case is special in the sens that we cannot use the predicate         *)
(*compilation because the variables of the formulation must be introduced    *)
(* in a very precise order.                                                  *)
(* Of course we could avoid a new definition using a the Cut tactic          *)
(* The point is that in this case only we must first do an induction on the  *)
(* ML environment in which we evaluate our expression (an identifier!)       *)
(*****************************************************************************)


Inductive compilation_id (E : MLexp) : Prop :=
    preuve_compilation_id :
      (forall (e : MLenv) (s : Squelette),
       Habite e s ->
       forall V : MLval,
       ML_DS e E V ->
       forall C : Commande,
       Traduction s E C ->
       forall CV : CSem_val,
       Equiv_env e CV ->
       exists CV1 : CSem_val,
         Equiv_val V CV1 /\
         (forall s : Etat, CAM_DS (ETcons CV s) C (ETcons CV1 s))) ->
      compilation_id E.

Lemma Proof_abstraction : forall (E : MLexp) (p : Pat), compilation (lambda p E).