(*************************************************************************** * Core Generic Environments                                                * *                                                                          * * Emmanuel Polonowski, April 2011, Coq v8.3                                * *                                                                          * * (Inspired by the work of A. Chargueraud :                                * *  http://www.chargueraud.org/softs/ln/index.php)                          * ***************************************************************************)
Set Implicit Arguments.
(* ********************************************************************** *)
(** * Module Type of an implementation of environments                    *)
Module Type CoreGenericEnvironmentType (VarType : UsualDecidableType).
Definition TVar := VarType.t.
(* ---------------------------------------------------------------------- *)
(** ** Definitions and Notations *)
(** gen_env A is an environment that binds variables to values of type A. *)
Parameter gen_env : Type -> Type.
Section CoreDefinitions.
Variable A B : Type.
(** The decidability of equality on keys (variables) is imported from Var.*)
Definition eq_keys_dec := VarType.eq_dec.
(** Empty environment. *)
Parameter empty : gen_env A.
(** Environment build upon explicit associations. *)
Parameter single : TVar -> A -> gen_env A.
Parameter singles : list TVar -> list A -> gen_env A.
(** Concatenation of environment (the second one binds first). *)
Parameter concat : gen_env A -> gen_env A -> gen_env A.
(** The main operation on environment, get the type of a variable. *)
Parameter get : TVar -> gen_env A -> option A.
(** Domain and image of an environment. *)
Parameter dom : gen_env A -> list TVar.
Parameter img : gen_env A -> list A.

Axiom all_notin : list TVar -> gen_env A -> Prop.
Parameter map : (A -> B) -> gen_env A -> gen_env B.