Ltac simpl_compare := autorewrite with compare.Ltac simpl_compare_in H := autorewrite with compare in H.(** Relation between [compare] and [sub_mask] *)

Definition mask2cmp (p:mask) : comparison :=
 match p with
  | IsNul => Eq
  | IsPos _ => Gt
  | IsNeg => Lt
 end.

Lemma compare_le_iff p q : (p ?= q) <> Gt <-> p <= q.