proposition: Lemma lseg_unroll_nonempty1 (ls: listspec list_structid list_link list_token): forall p P sh h (tail: list (elemtype ls)) v1 v2, ~ ptr_eq v1 v2 -> is_pointer_or_null p -> P |-- list_token sh v1 * list_cell ls sh h v1 * (field_at sh list_struct (StructField list_link :: nil) (valinject (nested_field_type list_struct (StructField list_link :: nil)) p) v1 * lseg ls sh tail p v2) -> P |-- lseg ls sh (h::tail) v1 v2.
proof: Proof. intros. rewrite lseg_unroll. apply orp_right2. unfold lseg_cons. rewrite prop_true_andp by auto. apply exp_right with h. apply exp_right with tail. apply exp_right with p. rewrite prop_true_andp by auto. rewrite sepcon_assoc. eapply derives_trans; [ apply H1 | ]. apply sepcon_derives; auto. Qed.
imports: VST.floyd.base2 VST.floyd.client_lemmas VST.floyd.closed_lemmas VST.floyd.nested_pred_lemmas VST.floyd.nested_field_lemmas VST.floyd.efield_lemmas VST.floyd.mapsto_memory_block VST.floyd.reptype_lemmas VST.floyd.data_at_rec_lemmas VST.floyd.field_at VST.floyd.nested_loadstore VST.floyd.entailer