Module VSM := VSM.Module CCS := CCSound VSM.Local Notation "'inter'" := (@andp _).Definition reflexivity_resolution (d : clause) l0 : list clause :=
  match d with
  | PureClause (Eqv u v :: neg) pos _ _ =>
    if expr_eq u v then mkPureClause neg pos :: l0 else l0
  | _ => l0
  end.Definition ordered_factoring (c : clause) l0 : list clause :=
  match c with
  | PureClause nil (Eqv s t :: Eqv u v :: pos) _ _ =>
    if pure_atom_eq (Eqv s t) (Eqv u v)
    then mkPureClause nil (insert_uniq pure_atom_cmp
              (norm_pure_atom (Eqv s t)) pos)
                     :: l0
    else l0
  | _ => l0
  end.Definition positive_superposition (c d : clause) l0 : list clause :=
  match c, d with
  (* positive (right) superposition *)
  | PureClause neg (Eqv (Var s0 as s) t :: pos) _ _,
           PureClause neg' (Eqv (Var s'0 as s') v :: pos') _ _ =>
    if expr_eq s s' && expr_lt t s && expr_lt v s' &&
       pure_atom_gt1 (Eqv s t) pos && pure_atom_gt1 (Eqv s' v) pos' &&
       pure_atom_gt (Eqv s t) (Eqv s' v) &&
       greater_than_all s0 neg && greater_than_all s'0 neg'
    then mkPureClause
      (merge pure_atom_cmp neg neg')
      (insu_atm (norm_pure_atom (Eqv t v)) (merge pure_atom_cmp pos pos')) :: l0
    else l0
  | _, _ => l0
  end.Definition negative_superposition (c d : clause) l0 : list clause :=
  match c, d with
  (* negative (left) superposition *)
  | PureClause (Eqv s' v :: neg') pos' _ _,
        PureClause neg (Eqv (Var s0 as s) t :: pos) _ _ =>
    if expr_eq s s' && expr_lt t s && expr_lt v s' &&
       pure_atom_gt1 (Eqv s t) pos && greater_than_all s0 neg
    then mkPureClause
      (insu_atm (norm_pure_atom (Eqv t v)) (merge pure_atom_cmp neg neg'))
      (merge pure_atom_cmp pos pos') :: l0
    else l0
  | _, _ => l0
  end.

(* Specifications: *)
Lemma positive_superposition_sound c d l0 s : clause_denote c s -> clause_denote d s -> listd clause_denote inter TT l0 s -> listd clause_denote inter TT (positive_superposition c d l0) s.
Lemma negative_superposition_sound c d l0 s : clause_denote c s -> clause_denote d s -> listd clause_denote inter TT l0 s -> listd clause_denote inter TT (negative_superposition c d l0) s.
Lemma reflexivity_resolution_sound c l0 s : clause_denote c s -> listd clause_denote inter TT l0 s -> listd clause_denote inter TT (reflexivity_resolution c l0) s.
Lemma ordered_factoring_sound c l0 s : clause_denote c s -> listd clause_denote inter TT l0 s -> listd clause_denote inter TT (ordered_factoring c l0) s.
Lemma sp_sound ce c d l0 s : clause_denote c s -> clause_denote d s -> listd clause_denote inter TT l0 s -> listd clause_denote inter TT (sp ce c d l0) s.
Lemma ef_sound ce c l0 s : clause_denote c s -> listd clause_denote inter TT l0 s -> listd clause_denote inter TT (ef ce c l0) s.
Lemma remove_trivial_atoms_sound b atms s : listd pure_atom_denote inter b atms s -> listd pure_atom_denote inter b (remove_trivial_atoms atms) s.
Lemma remove_trivial_atoms_equiv b atms s : listd pure_atom_denote inter b (remove_trivial_atoms atms) s <-> listd pure_atom_denote inter b atms s.
Lemma delete_resolved_sound c s : clause_denote c s -> clause_denote (delete_resolved c) s.
Lemma clause_denote_foldl (f: clause -> clause -> clause) l c0 s : listd clause_denote inter TT l s -> clause_denote c0 s -> (forall c d, clause_denote c s -> clause_denote d s -> clause_denote (f c d) s) -> clause_denote (fold_left f l c0) s.
Lemma demodulate_sound c d s : clause_denote c s -> clause_denote d s -> clause_denote (demodulate c d) s.
Lemma simplify_sound l c s : listd clause_denote inter TT l s -> clause_denote c s -> clause_denote (simplify l c) s.
Lemma space_denote_foldl (f: list space_atom -> clause -> list space_atom) l sigma0 s : listd clause_denote inter TT l s -> space_denote sigma0 s -> (forall c sigma, clause_denote c s -> space_denote sigma s -> space_denote (f sigma c) s) -> space_denote (fold_left f l sigma0) s.
Lemma space_denote_map_id sigma0 st : space_denote sigma0 st -> space_denote (map (fun atm : space_atom => atm) sigma0) st.
Lemma simplify_atoms_sound l sigma st : listd clause_denote inter TT l st -> space_denote sigma st -> space_denote (simplify_atoms l sigma) st.
Lemma infer_list_sound ce c l s : clause_denote c s -> listd clause_denote inter TT l s -> listd clause_denote inter TT (infer ce c l) s.
Lemma clause_generate_sound R c c' v e s : clause_denote c s -> clause_generate R c = inl _ (v, e, c') -> clause_denote c' s.
Lemma partial_mod_sound1 R R' acc l l' s : listd clause_denote inter TT l s -> listd clause_denote inter TT acc s -> partial_mod R acc l = inl _ (R', l') -> listd clause_denote inter TT l' s.
Lemma partial_mod_sound2 R R' acc l c ce s : listd clause_denote inter TT l s -> listd clause_denote inter TT acc s -> partial_mod R acc l = inr _ (R', c, ce) -> clause_denote c s.
Lemma main_sound n l r units0 units given unselected s : listd clause_denote inter TT l s -> listd clause_denote inter TT units0 s -> main n units0 l = (r, units, given, unselected) -> setd clause_denote inter TT given s /\ listd clause_denote inter TT units s.
Lemma main_Cexample_sound n l R sel units given unselected s : listd clause_denote inter TT l s -> main n nil l = (C_example R sel, units, given, unselected) -> setd clause_denote inter TT sel s.
Lemma empty_clause_False c s : is_empty_clause c = true -> ~(clause_denote c s).
Lemma main_Valid_empty_clause n l units final empty s : listd clause_denote inter TT l s -> ~(main n nil l = (Valid, units, final, empty)).