Load loadpath.
veristar.list_denote veristar.model_type veristar.model
veristar.basic veristar.compare.
Module Type SPRED_LEMMAS.
Declare Module VSM : VERISTAR_MODEL.
End SPRED_LEMMAS.
Module SPredLemmas (VSM : VERISTAR_MODEL) <: SPRED_LEMMAS
with Module VSM := VSM.
Module VSM := VSM.
(* properties of spred operators *)
Module spred. Section spred.
Variables x y z : spred.
Local Open Scope pred.

(* Specifications: *)
Lemma andpN : x && TT = x.
Lemma orpS : x || y = y || x.
Lemma space_insert sa l :
space_denote (insert (rev_cmp compare_space_atom) sa l) =
space_denote (sa :: l).
Lemma eq_space_atomlist_sound (al bl : list space_atom) :
true = eq_space_atomlist al bl ->
space_denote al = space_denote bl.
Lemma expr_eq_eq' : forall e1 e2, true = expr_eq e1 e2 -> e1=e2.
Lemma pure_atom_denote_order_eqv_pure_atom : forall a,
pure_atom_denote a = pure_atom_denote (order_eqv_pure_atom a).
Lemma list_denote_normalize_pure_atoms:
forall Q (B:spred) (l:list pure_atom)
(Qassoc: forall x y z , Q x (Q y z) = Q (Q x y) z)
(Qsymm: forall x y, Q x y = Q y x)
(Hcmp: forall x y, Eq = pure_atom_cmp x y ->
(forall P, Q (pure_atom_denote x) (Q (pure_atom_denote y) P) = Q (pure_atom_denote y) P)),
list_denote pure_atom_denote Q B l =
list_denote pure_atom_denote Q B (normalize_atoms l).
Lemma union_contractive:
forall {A} x, (@orp A) x x = x.
Lemma list_denote_union_normalize_pure_atoms:
forall(B:spred) (l:list pure_atom),
list_denote pure_atom_denote (@orp state) B l =
list_denote pure_atom_denote (@orp state) B (normalize_atoms l).
Lemma intersection_contractive:
forall {A} x, (@andp A) x x = x.
Lemma list_denote_intersection_normalize_pure_atoms:
forall(B:spred) (l:list pure_atom),
list_denote pure_atom_denote (@andp state) B l =
list_denote pure_atom_denote (@andp state) B (normalize_atoms l).
Lemma expr_cmp_eq: forall e e',
expr_cmp e e' = Eq -> (e === e') = TT.
Lemma expr_cmp_eq': forall e e' s,
expr_cmp e e' = Eq -> (e === e') s.
Lemma list_denote_intersection_filter_nonreflex:
forall(B:spred) (l:list pure_atom),
list_denote pure_atom_denote (@andp state) B l =
list_denote pure_atom_denote (@andp state) B (filter nonreflex_atom l).
Lemma list_denote_normalize_filter_nonreflex_atom:
forall B l,
list_denote pure_atom_denote (@andp state) B
(normalize_atoms (filter nonreflex_atom l))
= list_denote pure_atom_denote (@andp state) B l.
Lemma list_denote_inter_app : forall {A} (f: A -> spred) cs1 cs2 s,
list_denote f (@andp state) TT (cs1 ++ cs2) s ->
(list_denote f (@andp state) TT cs1 s /\
list_denote f (@andp state) TT cs2 s).
Lemma list_denote_assoc_sym_id : forall {A T} (E: A -> T) Q B C l
(CID : forall x, Q x C = x)
(QSYM : forall x y, Q x y = Q y x)
(QASSOC : forall x y z, Q x (Q y z) = Q (Q x y) z),
list_denote E Q B l = Q B (list_denote E Q C l).
Lemma list_denote_union_left : forall {A} (f: A -> spred) cs1 cs2 s,
list_denote f (@orp state) FF cs1 s ->
list_denote f (@orp state) FF (cs1 ++ cs2) s.
Lemma list_denote_union_right : forall {A} (f: A -> spred) cs1 cs2 s,
list_denote f (@orp state) FF cs2 s ->
list_denote f (@orp state) FF (cs1 ++ cs2) s.
Lemma list_denote_sepcon_sort :
forall {A} (E:A -> spred) (B:spred) (l:list A) cmp s,
list_denote E sepcon B l s <->
list_denote E sepcon B (rsort cmp l) s.
Lemma empty_not_singleton: forall c, M.empty <> M.singleton c.
Lemma singleton_inv:
forall x y, M.singleton x = M.singleton y -> x=y.
Lemma elements_singleton: forall c, M.elements (M.singleton c) = [c].
Lemma var_eq_Next: forall e e' g g' s, (e === e') s -> (g === g') s ->
space_atom_denote (Next e g) s = space_atom_denote (Next e' g') s.
Lemma var_eq_Lseg1: forall e e' g s, (e === e') s ->
space_atom_denote (Lseg e g) s = space_atom_denote (Lseg e' g) s.
Lemma var_eq_Lseg2: forall g e e' s, (e === e') s ->
space_atom_denote (Lseg g e) s = space_atom_denote (Lseg g e') s.
Lemma var_eq_Lseg: forall e e' g g' s, (e === e') s -> (g === g') s ->
space_atom_denote (Lseg e g) s = space_atom_denote (Lseg e' g') s.
Lemma join_stacks_eq : forall s0 s1 s : state,
join s0 s1 s -> stk s0=stk s1 /\ stk s0=stk s.
Lemma expr_denote_join: forall e s r t,
join s r t -> expr_denote e t = expr_denote e s.
Lemma expr_denote_eq_dec_loc:
forall x y s,
nil_or_loc (expr_denote x s) ->
Decidable.decidable (expr_denote x s = expr_denote y s).
Lemma expr_denote_heap_ind : forall x s h h',
expr_denote x (State s h)=expr_denote x (State s h').
Lemma state_join_var_eq : forall (s0 s1 s : state) x y,
join s0 s1 s ->
(x === y) s0 ->
(x === y) s.
Lemma state_join_var_eq' : forall (s0 s1 s : state) x y,
join s0 s1 s ->
(x === y) s ->
(x === y) s0.
Lemma unXX {A:Type} (P: pred A) b : un P (un P b) = un P b.
Lemma lseg_appN: forall x y s r t,
lseg x y s -> lseg y nil_val r -> join s r t -> lseg x nil_val t.
Lemma pure_atom_denote_heap_ind: forall a s h h',
pure_atom_denote a (State s h) = pure_atom_denote a (State s h').
Lemma pure_atoms_denote_intersection_heap_ind: forall Delta s h h',
list_denote pure_atom_denote (@andp state) TT Delta (State s h) =
list_denote pure_atom_denote (@andp state) TT Delta (State s h').
Lemma pure_atoms_denote_union_heap_ind: forall Delta s h h',
list_denote pure_atom_denote (@orp state) FF Delta (State s h) =
list_denote pure_atom_denote (@orp state) FF Delta (State s h').
Lemma lseg_nil_or_loc:
forall x y h, lseg x y h -> nil_or_loc y.
Lemma lseg_end: forall x y h,
lseg x y h -> (x = y /\ emp h) \/ y = nil_val \/
(exists l, val2loc y = Some l /\ emp_at l h).
Lemma lseg_lseg_app: forall x y z h1 h2 h tz,
lseg x y h1 ->
lseg y z h2 ->
join h2 h1 h ->
val2loc z = Some tz ->
emp_at tz h ->
lseg x z h.
Lemma Space_denote_cons: forall a L,
space_denote (a::L) = sepcon (space_atom_denote a) (space_denote L).
Lemma Space_denote_app: forall M L,
space_denote (M ++ L) = sepcon (space_denote M) (space_denote L).
Lemma Space_denote_rev: forall L,
space_denote (rev L) = (space_denote L).