Theory Untyped_Ordered_Resolution

theory Untyped_Ordered_Resolution
   imports 
    First_Order_Clause.Nonground_Order
    First_Order_Clause.Nonground_Selection_Function
    First_Order_Clause.Tiebreakers

    Fresh_Identifiers.Fresh
begin

locale untyped_ordered_resolution_calculus =
  nonground_order where
  lesst = lesst and id_subst = id_subst and term_from_ground = "term_from_ground :: 'tG  't" and
  term_vars = term_vars +

  nonground_selection_function where
  select = select and atom_subst = "(⋅t)" and atom_vars = term.vars and term_vars = term_vars and
  atom_from_ground = term.from_ground and atom_to_ground = term.to_ground and id_subst = id_subst +

  tiebreakers tiebreakers +
  "term": exists_imgu where vars = term_vars and subst = "(⋅t)" and id_subst = id_subst
for
  select :: "'t select" and
  lesst :: "'t  't  bool" and
  tiebreakers :: "('tG, 't) tiebreakers" and
  id_subst :: 'subst and
  term_vars :: "'t  ('v :: infinite) set"
begin

inductive factoring :: "'t clause  't clause  bool" where
  factoringI: 
  "D = add_mset l1 (add_mset l2 D') 
   l1 = Pos t1 
   l2 = Pos t2 
   C = (add_mset l1 D')  μ 
   factoring D C"
if
  "select D = {#}"
  "is_maximal (l1 ⋅l μ) (D  μ)"
  "term.is_imgu μ {{t1, t2}}"

inductive resolution :: "'t clause  't clause  't clause  bool" where
  resolutionI: 
  "E = add_mset l1 E' 
   D = add_mset l2 D' 
   l1 = Neg t1 
   l2 = Pos t2 
   C = (E'  ρ1 + D'  ρ2)  μ 
   resolution D E C"
 if
  "term.is_renaming ρ1"
  "term.is_renaming ρ2"
  "clause.vars (E  ρ1)  clause.vars (D  ρ2) = {}"
  "term.is_imgu μ {{t1 ⋅t ρ1, t2 ⋅t ρ2}}"
  "¬ (E  ρ1  μ c D  ρ2  μ)"
  "select E = {#}  is_maximal (l1 ⋅l ρ1  μ) (E  ρ1  μ)"
  "select E  {#}  is_maximal (l1 ⋅l ρ1  μ) (select E  ρ1  μ)"
  "select D = {#}"
  "is_strictly_maximal (l2 ⋅l ρ2  μ) (D  ρ2  μ)"

abbreviation factoring_inferences where
 "factoring_inferences  { Infer [D] C | D C. factoring D C }"

abbreviation resolution_inferences where
 "resolution_inferences  { Infer [D, E] C | D E C. resolution D E C }"

definition inferences :: "'t clause inference set" where
"inferences  resolution_inferences  factoring_inferences"

abbreviation bottom :: "'t clause set" where
  "bottom  {{#}}"

end

end