End PtrCmpF2B.
Module PtrCmpB2F
(Def: CLIGHT_SEPARATION_HOARE_LOGIC_DEF)
(Conseq: CLIGHT_SEPARATION_HOARE_LOGIC_CONSEQUENCE with Module CSHL_Def := Def)
(PtrCmpB: CLIGHT_SEPARATION_HOARE_LOGIC_PTR_CMP_BACKWARD with Module CSHL_Def := Def):
CLIGHT_SEPARATION_HOARE_LOGIC_PTR_CMP_FORWARD with Module CSHL_Def := Def.
Module CSHL_Def := Def.
Module ConseqFacts := GenConseqFacts (Def) (Conseq).

(* Specifications: *)
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)).