(*Require Import VST.floyd.unfold_data_at.*)
Local Open Scope logic.
Fixpoint fold_right_sepcon' (l: list(environ->mpred)) : environ -> mpred :=
match l with
| nil => emp
| b::nil => b
| b::r => b * fold_right_sepcon' r
end.

(* Specifications: *)
Lemma fold_right_sepcon'_eq:
fold_right_sepcon' = @fold_right (environ->mpred) _ sepcon emp.
Lemma orp_dup {A}{ND: NatDed A}: forall P: A, P || P = P.
Lemma unsigned_repr_range: forall i, 0 <= i -> 0 <= Ptrofs.unsigned (Ptrofs.repr i) <= i.
Lemma tc_globalvar_sound:
forall Delta i t gz idata rho,
(var_types Delta) ! i = None ->
(glob_types Delta) ! i = Some t ->
gvar_volatile gz = false ->
gvar_init gz = idata ->
tc_environ Delta rho ->
globvar2pred (globals_of_env rho) (i, gz) rho |-- init_data_list2pred idata (readonly2share (gvar_readonly gz)) (eval_var i t rho) rho.
Lemma tc_globalvar_sound':
forall Delta i t gv idata rho,
(var_types Delta) ! i = None ->
(glob_types Delta) ! i = Some t ->
gvar_volatile gv = false ->
gvar_init gv = idata ->
tc_environ Delta rho ->
globvar2pred (globals_of_env rho)  (i, gv) rho |--
init_data_list2pred idata (readonly2share (gvar_readonly gv)) (globals_of_env rho i) rho.