Section COMP_IMM.
Variable default: comparison -> int64 -> condition.
Variable intsem: comparison -> int64 -> int64 -> bool.
Variable sem: comparison -> val -> val -> option val.
Hypothesis sem_int: forall c x y,
sem c (Vlong x) (Vlong y) = Some (Val.of_bool (intsem c x y)).
Hypothesis sem_undef: forall c v,
sem c Vundef v = None.
Hypothesis sem_eq: forall x y,
sem Ceq (Vlong x) (Vlong y) = Some (Val.of_bool (Int64.eq x y)).
Hypothesis sem_ne: forall x y,
sem Cne (Vlong x) (Vlong y) = Some (Val.of_bool (negb (Int64.eq x y))).
Hypothesis sem_default: forall c v n,
sem c v (Vlong n) = option_map Val.of_bool (eval_condition (default c n) (v :: nil) m).
Hypothesis sem_swap:
forall c x y, sem (swap_comparison c) x y = sem c y x.

Lemma eval_complimm_swap:
forall le c a n2 x v,
eval_expr ge sp e m le a x ->
sem c (Vlong n2) x = Some v ->
eval_expr ge sp e m le (complimm default intsem (swap_comparison c) a n2) v.