Module EnvSL.
Definition env_mapsto: forall {key A}{KE: EqDec key} (id: key) (sh: Share.t) (v: A) , pred (env key A) := @_env_mapsto.
Arguments env_mapsto [key] [A] [KE] _ _ _ _.
Hint Resolve @emp_empty_env' : core.
Definition own_var {key: Type}{A: Type}{KE: EqDec key} (sh: pshare) (id: key) : pred (env key A) :=
exp (env_mapsto id (pshare_sh sh)).
Definition see_var {key: Type}{A: Type}{KE: EqDec key} (id: key) : pred (env key A) :=
exp (fun sh: pshare => own_var sh id).
Definition own_all {key: Type}{A: Type}{KE: EqDec key} (l: list key) : pred (env key A) :=
list_sepcon (map (own_var pfullshare) l).
Definition restrict_env {key: Type}{A: Type}{KE: EqDec key} (ids: list key) (rho:env key A) : env key A :=
mk_env _ (restrict_env'_finite ids rho).
Definition restrict_env_comp' {key: Type}{A: Type}{KE: EqDec key} (ids: list key) (rho: env key A) (id: key) : option (pshare * A) :=
if  In_dec eq_dec id ids
then None
else env_get rho id.

Lemma restrict_env_comp'_finite {key: Type}{A: Type}{KE: EqDec key}:
forall ids (rho: env key A), finite_idfun (restrict_env_comp' ids rho).