Definition force_valid_pointers m v1 v2 :=
match v1, v2 with
| Vptr b1 ofs1, Vptr b2 ofs2 =>
    (Mem.valid_pointer m b1 (Ptrofs.unsigned ofs1) &&
    Mem.valid_pointer m b2 (Ptrofs.unsigned ofs2))%bool
| _, _ => false
end.Definition blocks_match op v1 v2 :=
match op with Cop.Olt | Cop.Ogt | Cop.Ole | Cop.Oge =>
  match v1, v2 with
    Vptr b _, Vptr b2 _ => b=b2
    | _, _ => False
  end
| _ => True
end.

Lemma pointer_cmp_no_mem_bool_type: forall (Delta : tycontext) cmp (e1 e2 : expr) sh1 sh2 x1 x b1 o1 b2 o2 i3 s3, is_comparison cmp = true-> eqb_type (typeof e1) int_or_ptr_type = false -> eqb_type (typeof e2) int_or_ptr_type = false -> forall (rho : environ) phi, eval_expr e1 rho = Vptr b1 o1 -> eval_expr e2 rho = Vptr b2 o2 -> blocks_match cmp (eval_expr e1 rho) (eval_expr e2 rho) -> denote_tc_assert (typecheck_expr Delta e1) rho phi -> denote_tc_assert (typecheck_expr Delta e2) rho phi -> (mapsto_ sh1 (typeof e1) (eval_expr e1 rho)) x -> (mapsto_ sh2 (typeof e2) (eval_expr e2 rho)) x1 -> typecheck_environ Delta rho -> is_int i3 s3 (force_val (sem_binary_operation' cmp (typeof e1) (typeof e2) (eval_expr e1 rho) (eval_expr e2 rho))).