Module ConseqFacts := GenConseqFacts (Def) (Conseq).

Theorem semax_ptr_compare_forward: forall {CS: compspecs} {Espec: OracleKind} (Delta: tycontext),
forall P id cmp e1 e2 ty sh1 sh2,
sepalg.nonidentity sh1 -> sepalg.nonidentity sh2 ->
is_comparison cmp = true  ->
eqb_type (typeof e1) int_or_ptr_type = false ->
eqb_type (typeof e2) int_or_ptr_type = false ->
typecheck_tid_ptr_compare Delta id = true ->
@semax CS Espec Delta
( |> ( (tc_expr Delta e1) &&
(tc_expr Delta e2)  &&
local (`(blocks_match cmp) (eval_expr e1) (eval_expr e2)) &&
(`(mapsto_ sh1 (typeof e1)) (eval_expr e1) * TT) &&
(`(mapsto_ sh2 (typeof e2)) (eval_expr e2) * TT) &&
P))
(Sset id (Ebinop cmp e1 e2 ty))
(normal_ret_assert
(EX old:val,
local (`eq (eval_id id)  (subst id `(old)
(eval_expr (Ebinop cmp e1 e2 ty)))) &&
subst id `(old) P)).