(* general functions that should be moved elsewhere *)

Definition ocons {A : Type} (o : option A) l :=
  match o with Some a => a :: l | None => l end.Fixpoint omapl {A B : Type} (f : A -> option B) (l : list A) : list B :=
  match l with
  | a :: l' => ocons (f a) (omapl f l')
  | nil => nil
  end.Notation sortu_atms := (rsort_uniq pure_atom_cmp).Notation insu_atm := (insert_uniq pure_atom_cmp).Notation sortu_clauses := (rsort_uniq compare_clause).

Lemma remove_decreases: forall giv unselected, M.In giv unselected -> M.cardinal (M.remove giv unselected) < M.cardinal unselected.