Inductive localdef : Type :=
 | temp: ident -> val -> localdef
 | lvar: ident -> type -> val -> localdef   (* local variable *)
 | gvars: globals -> localdef.Inductive localdef : Type :=
 | temp: ident -> val -> localdef
 | lvar: ident -> type -> val -> localdef   (* local variable *)
 | gvars: globals -> localdef.Inductive localdef : Type :=
 | temp: ident -> val -> localdef
 | lvar: ident -> type -> val -> localdef   (* local variable *)
 | gvars: globals -> localdef.Inductive localdef : Type :=
 | temp: ident -> val -> localdef
 | lvar: ident -> type -> val -> localdef   (* local variable *)
 | gvars: globals -> localdef.Definition lvar_denote (i: ident) (t: type) (v: val) rho :=
     match Map.get (ve_of rho) i with
         | Some (b, ty') => t=ty' /\ v = Vptr b Ptrofs.zero
         | None => False
         end.Definition gvars_denote (gv: globals) rho :=
   gv = (fun i => match Map.get (ge_of rho) i with Some b => Vptr b Ptrofs.zero | None => Vundef end).Fixpoint fold_right_andp rho (l: list (environ -> Prop)) : Prop :=
 match l with
 | nil => True
 | b::nil => b rho
 | b::r => b rho /\ fold_right_andp rho r
 end.Definition PROPx (P: list Prop): forall (Q: environ->mpred), environ->mpred :=
     andp (prop (fold_right and True P)).Notation " 'ENTAIL' d ',' P '|--' Q " :=
  (@derives (environ->mpred) _ (andp (local (tc_environ d)) P%assert) Q%assert) (at level 80, P at level 79, Q at level 79).Definition SEPx (R: list mpred) : environ->mpred :=
    fun _ => (fold_right_sepcon R).

(* Specifications: *)
Lemma PROPx_Permutation: forall P Q, Permutation P Q -> PROPx P = PROPx Q.
Lemma LOCALx_Permutation: forall P Q, Permutation P Q -> LOCALx P = LOCALx Q.
Lemma SEPx_Permutation: forall P Q, Permutation P Q -> SEPx P = SEPx Q.
Lemma approx_sepcon: forall (P Q: mpred) n, compcert_rmaps.RML.R.approx n (P * Q) = compcert_rmaps.RML.R.approx n P * compcert_rmaps.RML.R.approx n Q.
Lemma approx_andp: forall (P Q: mpred) n, compcert_rmaps.RML.R.approx n (P && Q) = compcert_rmaps.RML.R.approx n P && compcert_rmaps.RML.R.approx n Q.
Lemma approx_jam {B: Type} {S': B -> Prop} (S: forall l, {S' l}+{~ S' l}) (P Q: B -> mpred) n (b : B) : compcert_rmaps.RML.R.approx n (res_predicates.jam S P Q b) = res_predicates.jam S (base.compose (compcert_rmaps.RML.R.approx n) P) (base.compose (compcert_rmaps.RML.R.approx n) Q) b.
Lemma SEPx_super_non_expansive: forall A R , Forall (fun R0 => @super_non_expansive A (fun ts a _ => R0 ts a)) R -> @super_non_expansive A (fun ts a rho => SEPx (map (fun R0 => R0 ts a) R) rho).
Lemma LOCALx_super_non_expansive: forall A Q R, super_non_expansive R -> Forall (fun Q0 => @super_non_expansive A (fun ts a rho => prop (locald_denote (Q0 ts a) rho))) Q -> @super_non_expansive A (fun ts a rho => LOCALx (map (fun Q0 => Q0 ts a) Q) (R ts a) rho).
Lemma PROPx_super_non_expansive: forall A P Q, super_non_expansive Q -> Forall (fun P0 => @super_non_expansive A (fun ts a (rho: environ) => prop (P0 ts a))) P -> @super_non_expansive A (fun ts a rho => PROPx (map (fun P0 => P0 ts a) P) (Q ts a) rho).
Lemma PROP_LOCAL_SEP_super_non_expansive: forall A P Q R, Forall (fun P0 => @super_non_expansive A (fun ts a _ => prop (P0 ts a))) P -> Forall (fun Q0 => @super_non_expansive A (fun ts a rho => prop (locald_denote (Q0 ts a) rho))) Q -> Forall (fun R0 => @super_non_expansive A (fun ts a _ => R0 ts a)) R -> @super_non_expansive A (fun ts a rho => PROPx (map (fun P0 => P0 ts a) P) (LOCALx (map (fun Q0 => Q0 ts a) Q) (SEPx (map (fun R0 => R0 ts a) R))) rho).
Lemma SEPx_nonexpansive: forall R rho, Forall (fun R0 => predicates_rec.nonexpansive R0) R -> nonexpansive (fun S => SEPx (map (fun R0 => R0 S) R) rho).
Lemma LOCALx_nonexpansive: forall Q R rho, nonexpansive (fun S => R S rho) -> nonexpansive (fun S => LOCALx Q (R S) rho).
Lemma PROPx_nonexpansive: forall P Q rho, Forall (fun P0 => nonexpansive (fun S => prop (P0 S))) P -> nonexpansive (fun S => Q S rho) -> nonexpansive (fun S => PROPx (map (fun P0 => P0 S) P) (Q S) rho).
Lemma PROP_LOCAL_SEP_nonexpansive: forall P Q R rho, Forall (fun P0 => nonexpansive (fun S => prop (P0 S))) P -> Forall (fun R0 => nonexpansive R0) R -> nonexpansive (fun S => PROPx (map (fun P0 => P0 S) P) (LOCALx Q (SEPx (map (fun R0 => R0 S) R))) rho).
Lemma insert_prop : forall (P: Prop) PP QR, prop P && (PROPx PP QR) = PROPx (P::PP) QR.
Lemma insert_local': forall (Q1: localdef) P Q R, local (locald_denote Q1) && (PROPx P (LOCALx Q R)) = (PROPx P (LOCALx (Q1 :: Q) R)).
Lemma insert_local: forall Q1 P Q R, local (locald_denote Q1) && (PROPx P (LOCALx Q (SEPx R))) = (PROPx P (LOCALx (Q1 :: Q) (SEPx R))).