Theory First_Order_Superposition_Example

theory First_Order_Superposition_Example
  imports
    IsaFoR_Term_Copy
    First_Order_Superposition
begin

abbreviation trivial_select :: "('f, 'v) select" where
  "trivial_select _  {#}"

abbreviation trivial_tiebreakers where
  "trivial_tiebreakers _ _ _  False"

context
  assumes ground_critical_pair_theorem:
    "(R :: ('f :: weighted) gterm rel). ground_critical_pair_theorem R"
begin

interpretation first_order_superposition_calculus 
  "trivial_select :: ('f :: weighted, 'v :: infinite) select" 
  less_kbo
  trivial_tiebreakers
  "λ_. ([], ())"
proof(unfold_locales)
  fix clause :: "('f, 'v) atom clause"

  show "trivial_select clause ⊆# clause"
    by simp
next
  fix clause :: "('f, 'v) atom clause" and literal

  assume "literal ∈# trivial_select clause"

  then show "is_neg literal"
    by simp
next
  show "transp less_kbo"
    using KBO.S_trans 
    unfolding transp_def less_kbo_def
    by blast
next
  show "asymp less_kbo"
    using wfp_imp_asymp wfP_less_kbo 
    by blast
next
  show "Wellfounded.wfp_on {term. term.is_ground term} less_kbo"
    using Wellfounded.wfp_on_subset[OF wfP_less_kbo subset_UNIV] .
next
  show "totalp_on {term. term.is_ground term} less_kbo"
    using less_kbo_gtotal
    unfolding totalp_on_def Term.ground_vars_term_empty
    by blast
next
  fix 
    contextG :: "('f, 'v) context" and
    termG1 termG2 :: "('f, 'v) term" 

  assume "less_kbo termG1 termG2" 

  then show "less_kbo contextGtermG1 contextGtermG2"
    using KBO.S_ctxt less_kbo_def by blast
next
  fix 
    term1 term2 :: "('f, 'v) term" and 
    γ :: "('f, 'v) subst"

  assume "less_kbo term1 term2"

  then show "less_kbo (term1 ⋅t γ) (term2 ⋅t γ)"
    using less_kbo_subst by blast
next
  fix
    termG :: "('f, 'v) term" and
    contextG :: "('f, 'v) context"
  assume 
    "term.is_ground termG" 
    "context.is_ground contextG" 
    "contextG  "
  
  then show "less_kbo termG contextGtermG"
    by (simp add: KBO.S_supt less_kbo_def nectxt_imp_supt_ctxt)
next
  show "(R :: ('f gterm × 'f gterm) set). ground_critical_pair_theorem R"
    using ground_critical_pair_theorem .
next
  show "clauseG. wfP (λ_ _. False)  transp (λ_ _. False)  asymp (λ_ _. False)"
    by (simp add: asympI)
next
  show "τ. f. ([], ()) = ([], τ)"
    by simp
next
  show "|UNIV :: unit set| ≤o |UNIV|"
    unfolding UNIV_unit
    by simp
qed

end

end