# Proofs

proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand finseq_appl)
   (skeep)
   (lemma subterm_joinability)
   (expand finseq_appl)
   (inst -1 E fsp fsp1 fsp2 t t1 t2)
   (assert)
   (lemma seq_construct[term])
   (inst -1 "parallel_reduction?(E)" "fsp`length" "subtermsOF(t1, fsp)"
    "subtermsOF(t2, fsp)")
   (("1"
     (expand subtermsOF -1)
     (expand finseq_appl)
     (prop)
     (skosimp)
     (inst 1 seq!1)
     (assert))
    ("2"
     (hide -1 2)
     (hide -1 -4)
     (expand parallel_reduction_fix?)
     (skosimp)
     (lemma replace_par_pos_preservs_PP)
     (inst -1 fsp2 "sigma_rhs(fss!1, fse!1)" t)
     (expand sigma_rhs -1 1)
     (expand* SPP? empty_seq finseq_appl)
     (lift-if)
     (assert)
     (flatten)
     (replace -10 1)
     (expand o 1)
     (expand SP? 1)
     (expand finseq_appl)
     (skeep)
     (prop)
     (("1"
       (lemma Pos_Over_character)
       (inst -1 fsp1 fsp2)
       (assert)
       (inst -1 i)
       (name-replace "A" "Pos_Over(fsp1, fsp2)`seq(i)")
       (split)
       (("1"
         (replace -12 1)
         (rewrite replace_par_pos_preservs_pos)
         (("1"
           (expand SPP?)
           (rewrite add_first_parallel_pos_to_SP_is_SP)
           (lemma Pos_Over_is_sub_seq)
           (inst -1 fsp1 fsp2)
           (assert)
           (expand* subseq finseq_appl)
           (inst -1 i)
           (expand* member_seq finseq_appl)
           (skosimp)
           (expand SP? -7)
           (expand finseq_appl)
           (inst -7 i!1)
           (expand A 1)
           (assert))
          ("2"
           (expand sigma_rhs 1)
           (expand empty_seq)
           (lift-if)
           (assert))))
        ("2"
         (skosimp)
         (inst -4 j!1)
         (lemma closed_positions)
         (inst -1 A "fsp2`seq(j!1)" t2)
         (assert))))
      ("2"
       (lemma Pos_Over_is_sub_seq)
       (inst -1 fsp2 fsp1)
       (assert)
       (expand* subseq member_seq finseq_appl)
       (inst -1 "i - Pos_Over(fsp1, fsp2)`length")
       (skosimp)
       (replaces -1)
       (inst -2 i!1)
       (assert))
      ("3"
       (lemma Pos_Equal_character)
       (inst -1 fsp1 fsp2)
       (assert)
       (inst -1
        "-1 * Pos_Over(fsp1, fsp2)`length -
                                      Pos_Over(fsp2, fsp1)`length
                                      + i")
       (skosimp)
       (replaces -1)
       (inst -1 j!1)
       (assert))))
    ("3"
     (hide -1 -2 -6 2)
     (expand parallel_reduction_fix?)
     (skosimp)
     (lemma replace_par_pos_preservs_PP)
     (inst -1 fsp1 "sigma_rhs(fss!1, fse!1)" t)
     (expand sigma_rhs -1 1)
     (expand* SPP? empty_seq finseq_appl)
     (lift-if)
     (assert)
     (flatten)
     (replace -10 1)
     (expand o 1)
     (expand SP? 1)
     (expand finseq_appl)
     (skeep)
     (prop)
     (("1"
       (lemma Pos_Over_is_sub_seq)
       (inst -1 fsp1 fsp2)
       (assert)
       (expand* subseq member_seq finseq_appl)
       (inst -1 i)
       (name-replace "A" "Pos_Over(fsp1, fsp2)`seq(i)")
       (skosimp)
       (replaces -1)
       (inst -3 i!1)
       (assert))
      ("2"
       (lemma Pos_Over_character)
       (inst -1 fsp2 fsp1)
       (assert)
       (inst -1 "i - Pos_Over(fsp1, fsp2)`length")
       (name-replace "A"
        "Pos_Over(fsp2, fsp1)`seq(i - Pos_Over(fsp1, fsp2)`length)")
       (split)
       (("1"
         (replace -11 2)
         (rewrite replace_par_pos_preservs_pos)
         (("1"
           (expand SPP?)
           (rewrite add_first_parallel_pos_to_SP_is_SP)
           (lemma Pos_Over_is_sub_seq)
           (inst -1 fsp2 fsp1)
           (assert)
           (expand* subseq member_seq finseq_appl)
           (inst -1 "i - Pos_Over(fsp1, fsp2)`length")
           (skosimp)
           (expand SP? -8)
           (expand finseq_appl)
           (inst -8 i!1)
           (expand A 1)
           (assert))
          ("2"
           (expand sigma_rhs 1)
           (expand empty_seq)
           (lift-if)
           (assert))))
        ("2"
         (skosimp)
         (inst -3 j!1)
         (lemma closed_positions)
         (inst -1 A "fsp1`seq(j!1)" t1)
         (assert))))
      ("3"
       (lemma Pos_Equal_is_sub_seq)
       (inst -1 fsp1 fsp2)
       (assert)
       (expand* subseq member_seq finseq_appl)
       (inst -1
        "-1 * Pos_Over(fsp1, fsp2)`length -
                                            Pos_Over(fsp2, fsp1)`length
                                            + i")
       (skosimp)
       (replaces -1)
       (inst -1 i!1)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (auto-rewrite (finseq_appl member))
   (skosimp)
   (expand diamond_property?)
   (skeep)
   (expand parallel_reduction? (-2 -3))
   (skosimp*)
   (assert)
   (lemma Pos_Over_and_Pos_Equal_dominance)
   (inst-cp -1 fsp!1 fsp!2 x)
   (inst -1 fsp!2 fsp!1 x)
   (assert)
   (name-replace "A"
    "Pos_Over(fsp!1, fsp!2) o
                                               Pos_Over(fsp!2, fsp!1)
                                               o Pos_Equal(fsp!1, fsp!2)")
   (("1"
     (case "SPP?(x)(A)")
     (("1"
       (lemma replace_par_pos_dominance)
       (inst -1 E!1 A fsp!1 y x)
       (assert)
       (prop)
       (("1"
         (lemma replace_par_pos_dominance)
         (inst -1 E!1 A fsp!2 z x)
         (assert)
         (prop)
         (("1"
           (hide -4 -5)
           (expand* parallel_reduction_fix? finseq_appl)
           (skosimp*)
           (lemma subterms_joinability)
           (expand finseq_appl)
           (inst -1 E!1 A fsp!1 fsp!2 x y z)
           (assert)
           (expand A -1 1)
           (skosimp)
           (lemma parallel_reduction_context)
           (expand finseq_appl)
           (inst 1 "replace_par_pos(x, A, fst!1)")
           (("1"
             (split)
             (("1"
               (inst -1 E!1 A "subtermsOF(y, A)" fst!1 x)
               (assert)
               (expand subtermsOF 2)
               (assert)
               (skeep 2)
               (inst -2 i)
               (flatten))
              ("2"
               (inst -1 E!1 A "subtermsOF(z, A)" fst!1 x)
               (assert)
               (expand subtermsOF 2)
               (expand finseq_appl)
               (skeep 2)
               (inst -2 i)
               (flatten))))
            ("2" (assert))))
          ("2"
           (skeep)
           (inst -3 i)
           (skosimp)
           (expand o -3)
           (lift-if)
           (assert)
           (prop)
           (("1"
             (inst 1 "j!1 + Pos_Over(fsp!1, fsp!2)`length")
             (("1" (expand A 1) (expand o 1) (assert))
              ("2" (expand A 1) (expand o 1) (assert))))
            ("2"
             (inst 2 "j!1 - Pos_Over(fsp!2, fsp!1)`length")
             (("1" (expand A 2) (expand o 2) (assert))
              ("2" (assert) (expand A 1) (expand o 1) (assert))))
            ("3"
             (hide -2 -4 -5 -6 -7 3)
             (lemma Pos_Equal_is_sub_seq)
             (inst -1 fsp!2 fsp!1)
             (typepred (fsp!1 fsp!2))
             (expand* SPP?)
             (flatten)
             (assert)
             (lemma Pos_Equal_character)
             (inst -1 fsp!2 fsp!1)
             (assert)
             (expand* subseq finseq_appl)
             (inst -1
              "-1 * Pos_Over(fsp!1, fsp!2)`length - Pos_Over(fsp!2, fsp!1)`length + j!1")
             (("1"
               (inst -6
                "-1 * Pos_Over(fsp!1, fsp!2)`length - Pos_Over(fsp!2, fsp!1)`length + j!1")
               (("1"
                 (lemma same_pos_in_Pos_Equal)
                 (inst -1 fsp!1 fsp!2
                  "Pos_Equal(fsp!2, fsp!1)`seq
                                       (-1 * Pos_Over(fsp!1, fsp!2)`length - Pos_Over(fsp!2, fsp!1)`length + j!1)")
                 (assert)
                 (hide -7)
                 (expand* member_seq finseq_appl)
                 (prop)
                 (skosimp)
                 (inst 2
                  "i!1 + Pos_Over(fsp!1, fsp!2)`length + Pos_Over(fsp!2, fsp!1)`length")
                 (("1" (expand A 2) (expand o 2) (assert))
                  ("2" (expand A 1) (expand o 1) (assert))))
                ("2" (typepred j!1) (expand o -1) (assert))))
              ("2" (typepred j!1) (expand o -1) (assert))))))))
        ("2"
         (skeep)
         (inst -3 i)
         (skosimp)
         (inst 1 j!1)
         (expand A 1)
         (assert))))
      ("2"
       (hide-all-but 1)
       (expand A 1)
       (typepred (fsp!1 fsp!2))
       (expand SPP?)
       (flatten)
       (rewrite Pos_Over_and_Pos_Equal_is_PP)
       (expand o 1)
       (expand* SP? finseq_appl)
       (skeep)
       (prop)
       (("1"
         (lemma Pos_Over_is_sub_seq)
         (inst -1 fsp!1 fsp!2)
         (assert)
         (expand* subseq finseq_appl)
         (inst -1 i)
         (expand* member_seq finseq_appl)
         (skosimp)
         (inst -5 i!1)
         (assert))
        ("2"
         (lemma Pos_Over_is_sub_seq)
         (inst -1 fsp!2 fsp!1)
         (assert)
         (expand* subseq finseq_appl)
         (inst -1 "i - Pos_Over(fsp!1, fsp!2)`length")
         (expand* member_seq finseq_appl)
         (skosimp)
         (inst -6 i!1)
         (assert))
        ("3"
         (lemma Pos_Equal_is_sub_seq)
         (inst -1 fsp!1 fsp!2)
         (assert)
         (expand* subseq member_seq finseq_appl)
         (inst -1
          "-1 * Pos_Over(fsp!1, fsp!2)`length - Pos_Over(fsp!2, fsp!1)`length + i")
         (skosimp)
         (inst -3 i!1)
         (assert))))))
    ("2" (typepred fsp!2) (expand SPP?) (flatten))
    ("3" (typepred fsp!1) (expand SPP?) (flatten))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (assert)
   (expand confluent?)
   (skeep)
   (lemma parallel_reduction_RTC)
   (inst -1 E!1)
   (expand joinable?)
   (lemma parallel_reduction_has_DP)
   (inst -1 E!1)
   (lemma DP_implies_StC)
   (inst -1 "parallel_reduction?(E!1)")
   (assert)
   (lemma Strong_Confl_implies_Confl)
   (inst -1 "parallel_reduction?(E!1)")
   (assert)
   (expand confluent?)
   (inst -1 x y z)
   (assert)
   (expand joinable?)
   (skosimp)
   (inst 1 z!1)
   (assert))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma seq_first_rest_1[posnat])
   (inst -1 p!1)
   (assert)
   (lemma pos_ax)
   (inst -1 "#(first(p!1))" "rest(p!1)" s!1)
   (assert))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma Pos_var_is_finite)
   (inst -1 "subtermOF(s!1,  #(first(p!1)))" "x!1")
   (assert))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma SigmaP_Subs)
   (inst -1 p2!1 sigma!1 t!1 x!1)
   (assert)
   (typepred x!1)
   (expand* V ext)
   (assert))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (lemma "subterm_ext_commute")
   (inst -1 "p1!1" "s!1" "sigma!1")
   (assert)
   (replace -3 -1 rl)
   (replace -1 -4 rl)
   (rewrite pos_o_term)
   (lemma positions_of_ext)
   (inst -1 sigma!1 s!1)
   (decompose-equality -1)
   (inst -1 p1!1)
   (iff)
   (flatten)
   (hide -1)
   (expand* union member)
   (inst 1 p1!1 empty_seq)
   (rewrite seq_o_empty)
   (assert)
   (hide-all-but 1)
   (expand* positionsOF only_empty_seq empty_seq)
   (lift-if)
   (assert)
   (prop)
   (expand* union member))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand finseq_appl)
   (expand* rest ^ min empty_seq)
   (assert)
   (prop)
   (("1" (expand* SPP? SP? PP? finseq_appl) (skeep))
    ("2" (expand* SPP? SP? PP? finseq_appl) (skeep))
    ("3"
     (expand* SPP? SP? PP? finseq_appl)
     (assert)
     (prop)
     (("1"
       (typepred fsp!1)
       (expand* SPP? PP? finseq_appl)
       (flatten)
       (skeep 2)
       (inst -1 "1+i" "1+j")
       (assert))
      ("2"
       (typepred fsp!1)
       (expand* SPP? SP? finseq_appl)
       (flatten)
       (skeep)
       (inst-cp -2 "1+i")
       (inst -2 0)
       (rewrite replace_preserv_parallel_pos)
       (expand* PP? finseq_appl)
       (inst -1 0 "1+i")
       (assert))))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand sigma_rhs)
   (expand empty_seq)
   (lift-if)
   (prop)
   (("1" (assert)) ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "SPP?")
   (flatten)
   (lemma "rest_of_PP_is_PP")
   (inst -1 "add_first(p!1, fsp!1)")
   (rewrite "rest_add_first")
   (lemma "rest_of_SP_is_SP")
   (inst -1 "t!1" "add_first(p!1, fsp!1)")
   (rewrite "rest_add_first")
   (assert))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (skosimp)
   (expand* o SPP? SP? PP? finseq_appl)
   (assert)
   (lift-if)
   (assert)
   (prop)
   (("1" (skeep) (typepred i) (assert))
    ("2" (skeep) (typepred i) (assert))
    ("3" (skeep) (typepred i) (assert))
    ("4" (skeep) (inst -3 i) (assert))
    ("5" (skeep) (inst -1 i j) (assert))
    ("6" (skeep) (inst -2 i) (assert))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand finseq_appl)
   (expand SPP?)
   (flatten)
   (rewrite rest_of_PP_is_PP)
   (expand* rest ^ min empty_seq)
   (assert)
   (prop)
   (("1" (expand SP? 1) (skeep)) ("2" (expand SP? 1) (skeep))
    ("3"
     (expand* SP? finseq_appl)
     (skosimp)
     (inst-cp -3 1+i!1)
     (inst -3 0)
     (rewrite replace_preserv_parallel_pos)
     (expand* PP? finseq_appl)
     (inst -2 0 1+i!1)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand finseq_appl)
   (skosimp)
   (rewrite replace_par_pos_preservs_pos)
   (("1"
     (lemma seq_first_rest[position])
     (inst -1 fsp!1)
     (expand* first finseq_appl)
     (assert))
    ("2" (hide-all-but (-1 1)) (grind))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand finseq_appl)
   (expand SPP?)
   (flatten)
   (rewrite delete_of_PP_is_PP)
   (expand* delete finseq_appl)
   (assert)
   (expand* SP? finseq_appl)
   (skosimp)
   (prop)
   (("1"
     (inst-cp -5 i!1)
     (inst -5 n!1)
     (rewrite replace_preserv_parallel_pos)
     (expand* PP? finseq_appl)
     (inst -4 n!1 i!1)
     (assert))
    ("2"
     (inst-cp -4 1+i!1)
     (inst -4 n!1)
     (rewrite replace_preserv_parallel_pos)
     (expand* PP? finseq_appl)
     (inst -3 n!1 1+i!1)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand* add_first insert? SPP? SP? finseq_appl)
   (flatten)
   (inst -3 0)
   (assert))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand* o SPP? SP? PP? finseq_appl)
   (flatten)
   (lift-if)
   (split 1)
   (("1"
     (flatten)
     (split 1)
     (("1" (propax))
      ("2"
       (assert)
       (prop)
       (("1" (skeep) (inst -5 i) (assert))
        ("2" (skeep 2) (inst -5 i) (assert))))))
    ("2"
     (flatten)
     (split)
     (("1"
       (skeep)
       (prop)
       (("1" (assert))
        ("2"
         (inst -1 i j)
         (("1" (assert)) ("2" (assert)) ("3" (assert))))))
      ("2" (skeep) (inst -4 i) (("1" (assert)) ("2" (assert))))))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "SPP?")
   (flatten)
   (prop)
   (("1"
     (hide -4)
     (expand "PP?")
     (prop)
     (("1" (hide-all-but (-1 1)) (grind))
      ("2"
       (expand "finseq_appl")
       (skosimp*)
       (inst -1 "fsp1!1`length + i!1" "fsp1!1`length + j!1")
       (("1" (assert) (expand o) (propax)) ("2" (expand o) (assert))
        ("3" (expand o) (assert))))))
    ("2"
     (lemma replace_par_pos_preservs_PP_o_PP)
     (inst -1 fsp1!1 fsp2!1 fst1!1 t!1)
     (expand SPP?)
     (assert)
     (expand SP? 1)
     (propax))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma rest_of_PP_is_PP)
   (inst -1 "add_first(p!1, fsp!1)")
   (rewrite rest_add_first))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand SPP?)
   (flatten)
   (rewrite comp_pos_is_PP)
   (expand* SP? finseq_appl)
   (skeep)
   (expand comp_pos)
   (expand finseq_appl)
   (inst -3 i)
   (rewrite replace_compose_pos))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (skosimp)
   (lemma replace_par_pos_preservs_PP)
   (inst -1 fsp!1 fst!1 s!1)
   (assert)
   (expand* member_seq finseq_appl)
   (skosimp)
   (inst -1 i!1)
   (lemma closed_positions)
   (inst -1 p!1 p1!1 "replace_par_pos(s!1, fsp!1, fst!1)")
   (assert))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (skosimp)
   (expand* member_seq SPP? SP? finseq_appl)
   (flatten)
   (skosimp)
   (inst -5 i!1)
   (lemma closed_positions)
   (inst -1 p!1 p1!1 s!1)
   (assert))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (skosimp)
   (expand* SPP? SP? finseq_appl)
   (flatten)
   (rewrite complement_pos_is_PP)
   (skosimp)
   (lemma complement_pos_character)
   (inst -1 fsp!1 p!1 "complement_pos(p!1, fsp!1)`seq(i!1)")
   (prop)
   (("1"
     (skosimp)
     (inst -6 i!2)
     (lemma pos_subterm_ax)
     (inst -1 p!1 "complement_pos(p!1, fsp!1)`seq(i!1)" s!1)
     (assert))
    ("2" (expand* member_seq finseq_appl) (inst 1 i!1))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (skosimp)
   (typepred fsp!1)
   (expand* SPP? SP? finseq_appl)
   (flatten)
   (inst -2 i!1)
   (inst -4 i!1)
   (assert))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred fsp!1)
   (expand* SPP? SP? finseq_appl)
   (flatten)
   (inst -2 i!1)
   (inst -4 i!1)
   (assert))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand SPP? -4)
   (flatten)
   (expand* SP? finseq_appl)
   (skosimp)
   (expand parallel_reduction_fix? -2)
   (skosimp)
   (lemma replace_par_pos_preservs_pos)
   (inst -1 fsp1!1 "sigma_rhs(fss!1, fse!1)" "fsp!1`seq(i!1)" t!1)
   (assert)
   (split)
   (("1"
     (expand SPP? 1)
     (split)
     (("1"
       (rewrite add_first_parallel_pos_to_PP_is_PP)
       (("1"
         (expand finseq_appl)
         (hide 2)
         (skosimp)
         (expand parallel)
         (split)
         (("1"
           (inst -2 i!2)
           (skosimp -2)
           (case "j!1 = i!1")
           (("1"
             (replaces -1)
             (case "fsp!1`seq(i!1) = fsp1!1`seq(i!2)")
             (("1"
               (replaces -1)
               (lemma replace_par_pos_preservs_PP)
               (inst -1 fsp1!1 "sigma_rhs(fss!1, fse!1)" t!1)
               (assert)
               (prop)
               (("1" (inst -1 i!2) (expand finseq_appl) (assert))
                ("2" (expand sigma_rhs 1) (assert))))
              ("2"
               (expand <=)
               (skosimp*)
               (replaces -1)
               (case "p1!1`length=0")
               (("1"
                 (rewrite empty_0 -1)
                 (replace -1)
                 (rewrite seq_o_empty 1))
                ("2" (expand o -1) (decompose-equality -1) (assert))))))
            ("2"
             (expand* PP? finseq_appl)
             (assert)
             (inst -8 i!1 j!1)
             (assert)
             (expand parallel -8)
             (flatten)
             (expand <=)
             (skosimp*)
             (inst 3 "p1!2 o p1!1")
             (replace -2 -1)
             (rewrite o_assoc))))
          ("2"
           (lemma replace_par_pos_preservs_PP)
           (inst -1 fsp1!1 "sigma_rhs(fss!1, fse!1)" t!1)
           (assert)
           (prop)
           (("1"
             (expand finseq_appl)
             (inst -1 i!2)
             (replace -7 -1 rl)
             (expand <= -2)
             (skosimp)
             (replace -2 -1)
             (lemma pos_ax)
             (inst -1 "fsp!1`seq(i!1)" p1!1 s!1)
             (assert))
            ("2" (expand sigma_rhs 1) (assert))))))
        ("2" (expand SPP?) (propax))))
      ("2"
       (expand* add_first insert? SP? finseq_appl)
       (skeep)
       (prop)
       (("1" (inst -9 i!1))
        ("2"
         (expand* SPP? SP? finseq_appl)
         (flatten)
         (inst -7 "i_1 -1")
         (assert))))))
    ("2" (expand sigma_rhs 1) (expand empty_seq) (lift-if) (assert))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand parallel_reduction_fix?)
   (skosimp)
   (expand* member_seq finseq_appl)
   (skosimp)
   (lemma Pos_Over_character)
   (inst -1 "#(p!1)" fsp2!1)
   (expand "#" -1 1)
   (expand SPP?)
   (flatten)
   (expand PP? -1 1)
   (assert)
   (inst -1 i!1)
   (split)
   (("1"
     (replace -2 -1 rl)
     (hide -2)
     (lemma replace_par_pos_preservs_pos)
     (inst -1 fsp2!1 "sigma_rhs(fss!1, fse!1)" p!1 t!1)
     (expand SPP?)
     (expand sigma_rhs 1)
     (expand empty_seq)
     (prop)
     (("1" (rewrite add_first_parallel_pos_to_SP_is_SP))
      ("2" (lift-if) (assert))))
    ("2"
     (replace -2 -1 rl)
     (hide -2)
     (skosimp)
     (lemma replace_par_pos_preservs_PP)
     (inst -1 fsp2!1 "sigma_rhs(fss!1, fse!1)" t!1)
     (expand sigma_rhs -1 1)
     (expand* SPP? finseq_appl)
     (inst -1 j!1)
     (replace -7 -1 rl)
     (lemma closed_positions)
     (inst -1 p!1 "fsp2!1`seq(j!1)" t2!1)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand SPP?)
   (rewrite complement_pos_is_PP)
   (flatten)
   (expand* SP? finseq_appl)
   (skosimp)
   (lemma complement_pos_character)
   (inst -1 fsp2!1 p!1 "complement_pos(p!1, fsp2!1)`seq(i!1)")
   (assert)
   (prop)
   (("1" (skosimp) (inst -6 i!2) (rewrite pos_subterm_ax))
    ("2" (expand member_seq 1) (expand finseq_appl) (inst 1 i!1))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (skosimp)
   (hide -2)
   (expand* member_seq finseq_appl)
   (skosimp)
   (lemma Pos_Over_is_sub_seq)
   (inst -1 fsp1!1 fsp2!1)
   (expand SPP?)
   (flatten)
   (assert)
   (expand* subseq finseq_appl)
   (inst -1 i!1)
   (expand* member_seq finseq_appl)
   (skosimp)
   (expand SP? -7)
   (expand finseq_appl)
   (inst -7 i!2)
   (assert))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (skeep)
   (lemma Pos_Over_is_sub_seq)
   (inst -1 fsp1!1 fsp2!1)
   (expand SPP?)
   (flatten)
   (assert)
   (expand* subseq member_seq finseq_appl)
   (skosimp)
   (inst -1 i!1)
   (skosimp)
   (expand parallel_reduction_fix? -4)
   (skosimp)
   (replace -7 1)
   (lemma replace_par_pos_preservs_PP)
   (inst -1 fsp1!1 "sigma_rhs(fss!1, fse!1)" t!1)
   (expand SPP?)
   (expand sigma_rhs -1 1)
   (expand empty_seq)
   (expand finseq_appl)
   (lift-if)
   (assert)
   (inst -1 i!2)
   (assert))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (skeep)
   (expand parallel_reduction_fix? -2)
   (skosimp)
   (expand* member_seq finseq_appl)
   (skosimp)
   (lemma Pos_Over_character)
   (inst -1 fsp1!1 fsp2!1)
   (expand SPP?)
   (flatten)
   (assert)
   (inst -1 i!1)
   (replace -2 -1 rl)
   (hide -2)
   (split)
   (("1"
     (replace -5 1)
     (rewrite replace_par_pos_preservs_pos)
     (("1" (expand SPP?) (rewrite add_first_parallel_pos_to_SP_is_SP))
      ("2" (expand sigma_rhs 1) (expand empty_seq) (lift-if) (assert))))
    ("2"
     (skosimp)
     (lemma replace_par_pos_preservs_PP)
     (inst -1 fsp2!1 "sigma_rhs(fss!1, fse!1)" t!1)
     (expand sigma_rhs -1 1)
     (expand SPP?)
     (expand finseq_appl)
     (inst -1 j!1)
     (replace -6 -1 rl)
     (lemma closed_positions)
     (inst -1 p!1 "fsp2!1`seq(j!1)" t2!1)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand finseq_appl)
   (skosimp)
   (skosimp)
   (hide -2)
   (expand parallel_reduction_fix?)
   (skosimp)
   (lemma replace_par_pos_preservs_PP)
   (inst -1 fsp1!1 "sigma_rhs(fss!1, fse!1)" t!1)
   (expand sigma_rhs -1 1)
   (expand* SPP? empty_seq finseq_appl)
   (flatten)
   (assert)
   (lift-if)
   (assert)
   (replace -2 1)
   (expand o 1)
   (prop)
   (("1"
     (lemma Pos_Over_is_sub_seq)
     (inst -1 fsp1!1 fsp2!1)
     (assert)
     (expand* subseq member_seq finseq_appl)
     (inst -1 i!1)
     (name-replace "A" "Pos_Over(fsp1!1, fsp2!1)`seq(i!1)")
     (skosimp)
     (replaces -1)
     (inst -3 i!2)
     (assert))
    ("2"
     (lemma Pos_Over_character)
     (inst -1 fsp2!1 fsp1!1)
     (assert)
     (inst -1 "i!1 - Pos_Over(fsp1!1, fsp2!1)`length")
     (name-replace "A"
      "Pos_Over(fsp2!1, fsp1!1)`seq(i!1 - Pos_Over(fsp1!1, fsp2!1)`length)")
     (split)
     (("1"
       (replace -8 2)
       (rewrite replace_par_pos_preservs_pos)
       (("1"
         (expand SPP?)
         (rewrite add_first_parallel_pos_to_SP_is_SP)
         (lemma Pos_Over_is_sub_seq)
         (inst -1 fsp2!1 fsp1!1)
         (assert)
         (expand* subseq member_seq finseq_appl)
         (inst -1 "i!1 - Pos_Over(fsp1!1, fsp2!1)`length")
         (skosimp)
         (expand SP? -11)
         (expand finseq_appl)
         (inst -11 i!2)
         (expand A 1)
         (assert))
        ("2"
         (expand sigma_rhs 1)
         (expand empty_seq)
         (lift-if)
         (assert))))
      ("2"
       (skosimp)
       (inst -3 j!1)
       (lemma closed_positions)
       (inst -1 A "fsp1!1`seq(j!1)" t1!1)
       (assert))))
    ("3"
     (lemma Pos_Equal_is_sub_seq)
     (inst -1 fsp1!1 fsp2!1)
     (assert)
     (expand* subseq member_seq finseq_appl)
     (inst -1
      "-1 * Pos_Over(fsp1!1, fsp2!1)`length -
                                                Pos_Over(fsp2!1, fsp1!1)`length
                                                + i!1")
     (("1" (skosimp) (replaces -1) (inst -1 i!2) (assert))
      ("2" (typepred i!1) (replace -3 -1) (expand o -1) (assert))))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand finseq_appl)
   (skosimp)
   (skosimp)
   (hide -3)
   (expand parallel_reduction_fix?)
   (skosimp)
   (lemma replace_par_pos_preservs_PP)
   (inst -1 fsp2!1 "sigma_rhs(fss!1, fse!1)" t!1)
   (expand sigma_rhs -1 1)
   (expand* SPP? empty_seq finseq_appl)
   (flatten)
   (assert)
   (lift-if)
   (assert)
   (replace -2 1)
   (expand o 1)
   (prop)
   (("1"
     (lemma Pos_Over_character)
     (inst -1 fsp1!1 fsp2!1)
     (assert)
     (inst -1 i!1)
     (name-replace "A" "Pos_Over(fsp1!1, fsp2!1)`seq(i!1)")
     (split)
     (("1"
       (replace -9 1)
       (rewrite replace_par_pos_preservs_pos)
       (("1"
         (expand SPP?)
         (rewrite add_first_parallel_pos_to_SP_is_SP)
         (lemma Pos_Over_is_sub_seq)
         (inst -1 fsp1!1 fsp2!1)
         (assert)
         (expand* subseq member_seq finseq_appl)
         (inst -1 i!1)
         (skosimp)
         (expand SP? -14)
         (expand finseq_appl)
         (inst -14 i!2)
         (expand A 1)
         (assert))
        ("2"
         (expand sigma_rhs 1)
         (expand empty_seq)
         (lift-if)
         (assert))))
      ("2"
       (skosimp)
       (inst -4 j!1)
       (lemma closed_positions)
       (inst -1 A "fsp2!1`seq(j!1)" t2!1)
       (assert))))
    ("2"
     (lemma Pos_Over_is_sub_seq)
     (inst -1 fsp2!1 fsp1!1)
     (assert)
     (expand* subseq member_seq finseq_appl)
     (inst -1 "i!1 - Pos_Over(fsp1!1, fsp2!1)`length")
     (name-replace "A"
      "Pos_Over(fsp2!1, fsp1!1)`seq(i!1 - Pos_Over(fsp1!1, fsp2!1)`length)")
     (skosimp)
     (replaces -1)
     (inst -2 i!2)
     (assert))
    ("3"
     (lemma Pos_Equal_character)
     (inst -1 fsp1!1 fsp2!1)
     (assert)
     (inst -1
      "-1 * Pos_Over(fsp1!1, fsp2!1)`length -
                                                    Pos_Over(fsp2!1, fsp1!1)`length
                                                    + i!1")
     (("1" (skosimp) (replaces -1) (inst -1 j!1) (assert))
      ("2" (typepred i!1) (replace -3 -1) (expand o -1) (assert))))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma subterm_joinability_TCC2)
   (skosimp)
   (skosimp)
   (skosimp)
   (expand finseq_appl)
   (inst -1 E!1 fsp!1 fsp1!1 fsp2!1 t!1 t1!1 t2!1)
   (assert)
   (inst -1 i!1 "fst!1`seq(i!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "length(p)" "p")
   (skosimp)
   (expand "first_diff" -2)
   (lift-if)
   (assert)
   (name-replace "k!11"
    "min({kk: below[length(args(t!1))] | NOT
                        subtermOF(s!1,  #(1 + kk)) = subtermOF (t!1,  #(1 + kk))})"
    :hide? nil)
   (("1"
     (name-replace "k!1" "1 + k!11")
     (prop)
     (("1"
       (hide -3 -4)
       (expand "first_diff" 1)
       (assert)
       (lift-if)
       (prop))
      ("2"
       (hide -3 -4)
       (expand "first_diff")
       (assert)
       (lift-if)
       (prop)
       (reveal -1)
       (assert))
      ("3" (assert) (hide -4) (expand "first_diff" 3) (propax))
      ("4"
       (inst -4
        "first_diff(subtermOF(s!1,  #(k!1)),
                                                      subtermOF(t!1,  #(k!1)))")
       (inst -4 "subtermOF(s!1,  #(k!1))" "subtermOF(t!1,  #(k!1))")
       (prop)
       (("1"
         (expand "first_diff" 4)
         (assert)
         (name-replace "k!22"
          "min({kk: below[length(args(s!1))] | NOT
                                               subtermOF(t!1,  #(1 + kk)) = subtermOF(s!1,  #(1 + kk))})"
          :hide? nil)
         (("1"
           (name-replace "k!2" "1 + k!22")
           (reveal -4 -1)
           (replace -3 -1 rl)
           (replace -7 -2 rl)
           (hide (-3 -7))
           (case "k!1 = k!2")
           (("1" (replaces -1) (assert))
            ("2"
             (case "length(args(s!1))=length(args(t!1))")
             (("1"
               (replace -1)
               (assert)
               (replace -2 1 rl)
               (replace -3 1 rl)
               (assert)
               (name-replace "myset"
                " min({kk: below[length(args(s!1))] |
                                                                        NOT subtermOF(t!1,  #(1 + kk)) = subtermOF(s!1,  #(1 + kk))})"
                :hide? nil)
               (("1"
                 (rewrite min_def)
                 (("1"
                   (rewrite min_def)
                   (("1"
                     (hide-all-but (-1 1))
                     (expand minimum?)
                     (skosimp*)
                     (inst -1 x!2)
                     (assert))
                    ("2"
                     (hide-all-but (1 3 4 5))
                     (lemma first_diff_TCC7)
                     (inst -1 "s!1" "t!1" "f(s!1)" "args(s!1)")
                     (case "s!1 = app(f(s!1), args(s!1))")
                     (("1"
                       (assert)
                       (hide -1)
                       (inst -1 "f(t!1)" "args(t!1)")
                       (case "t!1 = app(f(t!1), args(t!1))")
                       (("1" (assert))
                        ("2" (hide-all-but (1 3)) (decompose-equality))))
                      ("2" (hide-all-but (1 5)) (decompose-equality))))
                    ("3"
                     (hide-all-but (-6 1 3 4 5))
                     (skosimp*)
                     (lemma "positions_of_arg")
                     (inst -1 "t!1" "kk!1")
                     (assert))
                    ("4"
                     (hide - 6)
                     (skosimp*)
                     (lemma "positions_of_arg")
                     (inst -1 "s!1" "kk!1")
                     (assert))))
                  ("2"
                   (hide-all-but (-6 1 3 4 5))
                   (lemma first_diff_TCC7)
                   (inst -1 "t!1" "s!1" "f(t!1)" "args(t!1)")
                   (case "t!1 = app(f(t!1), args(t!1))")
                   (("1"
                     (assert)
                     (hide -1)
                     (inst -1 "f(s!1)" "args(s!1)")
                     (case "s!1 = app(f(s!1), args(s!1))")
                     (("1" (assert))
                      ("2" (hide-all-but (1 5)) (decompose-equality))))
                    ("2" (hide-all-but (1 3)) (decompose-equality))))
                  ("3"
                   (hide-all-but (-6 1 3 4 5))
                   (skosimp*)
                   (lemma "positions_of_arg")
                   (inst -1 "s!1" "kk!1")
                   (assert))
                  ("4"
                   (hide - 6)
                   (skosimp*)
                   (lemma "positions_of_arg")
                   (inst -1 "t!1" "kk!1")
                   (assert))))
                ("2"
                 (hide-all-but (-5 1 3 4 5))
                 (lemma first_diff_TCC7)
                 (inst -1 "t!1" "s!1" "f(t!1)" "args(t!1)")
                 (case "t!1 = app(f(t!1), args(t!1))")
                 (("1"
                   (assert)
                   (hide -1)
                   (inst -1 "f(s!1)" "args(s!1)")
                   (case "s!1 = app(f(s!1), args(s!1))")
                   (("1" (assert))
                    ("2" (hide-all-but (1 5)) (decompose-equality))))
                  ("2" (hide-all-but (1 3)) (decompose-equality))))
                ("3"
                 (hide - (2 6))
                 (skosimp*)
                 (lemma "positions_of_arg")
                 (inst -1 "s!1" "kk!1")
                 (assert))
                ("4"
                 (hide - (2 6))
                 (skosimp*)
                 (lemma "positions_of_arg")
                 (inst -1 "t!1" "kk!1")
                 (assert))))
              ("2" (hide-all-but (-4 1)) (assert))))))
          ("2"
           (hide-all-but (-2 1 2 3 4))
           (lemma first_diff_TCC7)
           (inst -1 "t!1" "s!1" "f(t!1)" "args(t!1)")
           (case "t!1 = app(f(t!1), args(t!1))")
           (("1"
             (assert)
             (hide -1)
             (inst -1 "f(s!1)" "args(s!1)")
             (case "s!1 = app(f(s!1), args(s!1))")
             (("1" (assert))
              ("2" (hide-all-but (1 5)) (decompose-equality))))
            ("2" (hide-all-but (1 3)) (decompose-equality))))
          ("3"
           (hide-all-but (-2 1 2 3 4))
           (skosimp*)
           (lemma "positions_of_arg")
           (inst -1 "s!1" "kk!1")
           (assert))
          ("4"
           (hide - 5)
           (skosimp*)
           (lemma "positions_of_arg")
           (inst -1 "t!1" "kk!1")
           (assert))))
        ("2"
         (hide-all-but (-2 1))
         (expand* "add_first" "insert?")
         (assert))))
      ("5" (hide -2 -3) (expand "first_diff") (assert))))
    ("2"
     (prop)
     (("1" (hide -3 1) (expand "first_diff") (assert) (lift-if) (prop))
      ("2"
       (hide -3 2)
       (expand "first_diff")
       (assert)
       (lift-if)
       (prop)
       (assert))
      ("3" (hide -3 3) (expand "first_diff") (assert))
      ("4"
       (hide - 5)
       (lemma "first_diff_TCC7")
       (inst -1 "s!1" "t!1" "f(s!1)" "args(s!1)")
       (case "s!1 = app(f(s!1), args(s!1))")
       (("1"
         (assert)
         (hide -1)
         (inst -1 "f(t!1)" "args(t!1)")
         (case "t!1 = app(f(t!1), args(t!1))")
         (("1" (assert) (reveal -4) (propax))
          ("2" (hide-all-but (1 2)) (decompose-equality))))
        ("2" (hide-all-but (1 4)) (decompose-equality))))
      ("5" (hide -2 5) (expand "first_diff") (assert))))
    ("3"
     (prop)
     (("1" (hide -3 1) (expand "first_diff") (assert) (lift-if) (prop))
      ("2" (hide -3 2) (expand "first_diff") (lift-if) (prop) (assert))
      ("3" (hide -3 3) (expand "first_diff") (assert))
      ("4"
       (hide -2 -3 5)
       (skosimp*)
       (lemma "positions_of_arg")
       (inst -1 "t!1" "kk!1")
       (assert))
      ("5"
       (hide -)
       (skosimp*)
       (lemma "positions_of_arg")
       (inst -1 "t!1" "kk!1")
       (assert))))
    ("4"
     (hide -1)
     (prop)
     (("1" (hide 1) (expand "first_diff") (lift-if) (prop))
      ("2" (hide 2) (expand "first_diff") (lift-if) (prop) (assert))
      ("3" (hide 3) (expand "first_diff") (assert))
      ("4"
       (hide -2 5)
       (skosimp*)
       (lemma "positions_of_arg")
       (inst -1 "s!1" "kk!1")
       (("1" (assert))
        ("2"
         (hide 5)
         (typepred "kk!1")
         (lemma "equal_symbol_equal_length_arg")
         (inst -1 "s!1" "t!1" "f(s!1)" "f(t!1)" "args(s!1)" "args(t!1)")
         (assert))))
      ("5" (hide 5) (expand "first_diff") (assert))))
    ("5"
     (prop)
     (("1" (hide -3) (expand "first_diff") (assert))
      ("2" (hide -3) (expand "first_diff") (assert))
      ("3" (hide -3) (expand "first_diff") (assert)) ("4" (assert))
      ("5" (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "length(p)" "p")
   (skosimp)
   (expand "first_diff" -2)
   (lift-if)
   (prop)
   (("1"
     (hide -3)
     (replaces -2)
     (expand "positionsOF")
     (assert)
     (expand "only_empty_seq")
     (propax))
    ("2"
     (hide -3)
     (replaces -2)
     (expand "positionsOF")
     (assert)
     (expand "only_empty_seq")
     (propax))
    ("3"
     (hide -3)
     (replaces -2)
     (expand "positionsOF")
     (assert)
     (expand* "union" "only_empty_seq" "IUnion" "member"))
    ("4"
     (assert)
     (name-replace "k!11"
      "min({kk: below[length(args(t!1))] | NOT
                              subtermOF(s!1,  #(1 + kk)) = subtermOF (t!1,  #(1 + kk))})")
     (("1"
       (name-replace "k!1" "1 + k!11")
       (inst -3
        "first_diff(subtermOF(s!1, #(k!1)), subtermOF(t!1, #(k!1)))"
        "subtermOF(s!1, #(k!1))" "subtermOF(t!1, #(k!1))")
       (assert)
       (hide -1)
       (replace -1 -2)
       (expand "add_first" -2)
       (expand "insert?" -2)
       (rewrite "add_first_is_o")
       (lemma "pos_o_term")
       (inst?)
       (assert)
       (hide (-1 -2 5))
       (reveal -7)
       (replace -1 1 rl)
       (hide -1)
       (lemma "positions_of_arg")
       (inst -1 "s!1" "k!11")
       (("1" (assert)) ("2" (typepred "k!11") (hide (-2 1 3)) (assert))))
      ("2"
       (hide - 5)
       (lemma first_diff_TCC7)
       (inst -1 "s!1" "t!1" "f(s!1)" "args(s!1)")
       (case "s!1 = app(f(s!1), args(s!1))")
       (("1"
         (assert)
         (hide -1)
         (inst -1 "f(t!1)" "args(t!1)")
         (case "t!1 = app(f(t!1), args(t!1))")
         (("1" (assert))
          ("2" (hide-all-but (1 3)) (decompose-equality))))
        ("2" (hide-all-but (1 5)) (decompose-equality))))
      ("3"
       (hide - 5)
       (skosimp*)
       (lemma "positions_of_arg")
       (inst -1 "t!1" "kk!1")
       (assert))
      ("4"
       (hide - 5)
       (skosimp*)
       (lemma "positions_of_arg")
       (inst -1 "s!1" "kk!1")
       (("1" (assert)) ("2" (typepred "kk!1") (assert))))))
    ("5"
     (replaces -1)
     (hide -1 1 2)
     (expand "positionsOF")
     (assert)
     (expand* "union" "IUnion" "member" "only_empty_seq"))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma comutative_first_diff)
   (lemma position_s_first_diff)
   (skosimp*)
   (inst -1 t!1 s!1 p!1)
   (inst -2 s!1 t!1 p!1)
   (assert))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "length(p)" "p")
   (("1"
     (skosimp)
     (expand first_diff -2)
     (lift-if)
     (prop)
     (("1"
       (replaces -2)
       (hide -1 -2)
       (expand subtermOF)
       (rewrite empty_0)
       (typepred t!1)
       (assert))
      ("2"
       (replaces -2)
       (hide -1 -2 1)
       (expand subtermOF)
       (rewrite empty_0)
       (typepred t!1)
       (assert))
      ("3"
       (replaces -2)
       (hide -1 -2 1 2)
       (expand subtermOF)
       (rewrite empty_0)
       (typepred t!1)
       (assert))
      ("4"
       (assert)
       (name-replace "k!11"
        "min({kk: below[length(args(t!1))] |
                                   NOT subtermOF(s!1,  #(1 + kk)) = subtermOF(t!1,  #(1 + kk))})")
       (("1"
         (name-replace "k!1" "1+k!11")
         (inst -3
          "first_diff(subtermOF(s!1,  #(k!1)),
                                                      subtermOF(t!1,  #(k!1)))")
         (inst -3 "subtermOF(s!1,  #(k!1))" "subtermOF(t!1,  #(k!1))")
         (replace -2 -3)
         (expand add_first -3)
         (expand insert? -3)
         (flatten)
         (name-replace "p!1"
          "first_diff(subtermOF(s!1,  #(k!1)),
                                                      subtermOF(t!1,  #(k!1)))"
          :hide? nil)
         (lemma subt_of_subt_is_subt_of_term)
         (inst -1 s!1 k!1 p!1 x!1)
         (("1"
           (assert)
           (lemma subt_of_subt_is_subt_of_term)
           (inst -1 t!1 k!1 p!1 x!1)
           (("1" (assert))
            ("2"
             (hide -1 -2 -3 -5 -6 5)
             (reveal -8)
             (replace -1 1 rl)
             (hide -1)
             (lemma first_diff_TCC2)
             (inst -1 s!1 t!1 "f(s!1)" "args(s!1)")
             (case "s!1 = app(f(s!1), args(s!1))")
             (("1"
               (assert)
               (hide -1)
               (inst -1 "f(t!1)" "args(t!1)")
               (case "t!1 = app(f(t!1), args(t!1))")
               (("1"
                 (assert)
                 (hide -1)
                 (inst -1 "k!11")
                 (reveal -14)
                 (assert))
                ("2" (hide-all-but (1 3)) (decompose-equality))))
              ("2" (hide-all-but (1 5)) (decompose-equality))))))
          ("2"
           (hide - 5)
           (reveal -8)
           (reveal -9)
           (lemma first_diff_TCC1)
           (inst -1 s!1 t!1 "f(s!1)" "args(s!1)")
           (case "s!1 = app(f(s!1), args(s!1))")
           (("1"
             (assert)
             (hide -1)
             (inst -1 "f(t!1)" "args(t!1)")
             (case "t!1 = app(f(t!1), args(t!1))")
             (("1" (assert) (hide -1) (inst -1 "k!11") (assert))
              ("2" (hide-all-but (1 3)) (decompose-equality))))
            ("2" (hide-all-but (1 5)) (decompose-equality))))))
        ("2"
         (hide -)
         (lemma first_diff_TCC7)
         (inst -1 "s!1" "t!1" "f(s!1)" "args(s!1)")
         (case "s!1 = app(f(s!1), args(s!1))")
         (("1"
           (assert)
           (hide -1)
           (inst -1 "f(t!1)" "args(t!1)")
           (case "t!1 = app(f(t!1), args(t!1))")
           (("1" (assert))
            ("2" (hide-all-but (1 3)) (decompose-equality))))
          ("2" (hide-all-but (1 5)) (decompose-equality))))
        ("3"
         (hide -)
         (skosimp*)
         (lemma "positions_of_arg")
         (inst -1 "t!1" "kk!1")
         (assert))
        ("4"
         (hide -)
         (skosimp*)
         (lemma "positions_of_arg")
         (inst -1 "s!1" "kk!1")
         (("1" (assert)) ("2" (typepred "kk!1") (assert))))))
      ("5"
       (hide -2 +)
       (replaces -1)
       (expand subtermOF)
       (rewrite empty_0)
       (typepred t!1)
       (assert))))
    ("2" (hide-all-but (-1 1)) (rewrite position_t_first_diff))
    ("3"
     (hide-all-but (-1 1))
     (lemma position_s_first_diff)
     (inst -1 s!1 t!1 y!1)
     (assert))
    ("4" (hide 2) (rewrite position_t_first_diff))
    ("5"
     (hide 2)
     (lemma position_s_first_diff)
     (inst -1 s!1 t!1 p!1)
     (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "length(p)" "p")
   (("1"
     (skosimp)
     (expand first_diff -2)
     (lift-if)
     (prop)
     (("1"
       (hide -3 -4 2)
       (replaces -2)
       (expand subtermOF)
       (rewrite empty_0))
      ("2"
       (hide -3)
       (expand unifiable)
       (skeep -3)
       (expand unifier)
       (expand ext -3 1)
       (assert)
       (replaces -2)
       (expand subtermOF)
       (rewrite empty_0)
       (hide 1)
       (typepred t!1)
       (flatten)
       (expand ext -2)
       (assert)
       (lift-if)
       (prop)
       (hide 2 3 4)
       (decompose-equality)
       (decompose-equality)
       (hide -2 -3)
       (assert))
      ("3"
       (hide -3 -4 1 2 3)
       (replaces -2)
       (expand subtermOF)
       (rewrite empty_0))
      ("4"
       (assert)
       (name-replace "k!11"
        "min({kk: below[length(args(t!1))] |
                                         NOT subtermOF(s!1,  #(1 + kk)) = subtermOF(t!1,  #(1 + kk))})")
       (("1"
         (name-replace "k!1" "1+k!11")
         (inst -3
          " first_diff(subtermOF(s!1,  #(k!1)),
                                                      subtermOF(t!1,  #(k!1)))")
         (inst -3 "subtermOF(s!1,  #(k!1))" "subtermOF(t!1,  #(k!1))")
         (replace -2 -3)
         (expand add_first -3)
         (expand insert? -3)
         (prop)
         (("1"
           (lemma subt_of_subt_is_subt_of_term)
           (inst -1 s!1 k!1
            "first_diff(subtermOF(s!1,  #(k!1)),
                                                            subtermOF(t!1,  #(k!1)))"
            x!1)
           (("1" (assert))
            ("2"
             (hide -1 -3 -4 5 6)
             (reveal -8)
             (reveal -7)
             (lemma first_diff_TCC1)
             (inst -1 "s!1" "t!1" "f(s!1)" "args(s!1)")
             (case "s!1 = app(f(s!1), args(s!1))")
             (("1"
               (assert)
               (hide -1)
               (inst -1 "f(t!1)" "args(t!1)")
               (case "t!1 = app(f(t!1), args(t!1))")
               (("1" (assert) (hide -1) (inst -1 "k!11") (assert))
                ("2" (hide-all-but (1 3)) (decompose-equality))))
              ("2" (hide-all-but (1 5)) (decompose-equality))))))
          ("2"
           (lemma subt_of_subt_is_subt_of_term)
           (inst -1 t!1 k!1
            "first_diff(subtermOF(s!1,  #(k!1)),
                                                            subtermOF(t!1,  #(k!1)))"
            x!1)
           (("1" (assert))
            ("2"
             (hide -1 -3 -4 5 6)
             (reveal -8)
             (reveal -7)
             (lemma first_diff_TCC2)
             (inst -1 "s!1" "t!1" "f(s!1)" "args(s!1)")
             (case "s!1 = app(f(s!1), args(s!1))")
             (("1"
               (assert)
               (hide -1)
               (inst -1 "f(t!1)" "args(t!1)")
               (case "t!1 = app(f(t!1), args(t!1))")
               (("1" (assert) (hide -1) (inst -1 "k!11") (assert))
                ("2" (hide-all-but (1 3)) (decompose-equality))))
              ("2" (hide-all-but (1 5)) (decompose-equality))))))
          ("3"
           (hide -2 5 6)
           (lemma unifiable_terms_unifiable_args)
           (expand unifiable)
           (skosimp)
           (inst 1 sigma!1)
           (inst -1 sigma!1 s!1 t!1 "#(k!1)")
           (("1" (expand* member U) (assert))
            ("2"
             (reveal -5)
             (reveal -6)
             (lemma first_diff_TCC1)
             (inst -1 "s!1" "t!1" "f(s!1)" "args(s!1)")
             (case "s!1 = app(f(s!1), args(s!1))")
             (("1"
               (assert)
               (hide -1)
               (inst -1 "f(t!1)" "args(t!1)")
               (case "t!1 = app(f(t!1), args(t!1))")
               (("1"
                 (assert)
                 (hide -1)
                 (inst -1 "k!11")
                 (assert)
                 (lemma first_diff_TCC2)
                 (inst -1 "s!1" "t!1" "f(s!1)" "args(s!1)")
                 (case "s!1 = app(f(s!1), args(s!1))")
                 (("1"
                   (assert)
                   (hide -1)
                   (inst -1 "f(t!1)" "args(t!1)")
                   (case "t!1 = app(f(t!1), args(t!1))")
                   (("1" (assert) (hide -1) (inst -1 "k!11") (assert))
                    ("2" (hide-all-but (1 4)) (decompose-equality))))
                  ("2" (hide-all-but (1 6)) (decompose-equality))))
                ("2" (hide-all-but (1 4)) (decompose-equality))))
              ("2" (hide-all-but (1 6)) (decompose-equality))))))))
        ("2"
         (hide -2 -3 -4 5 6)
         (lemma first_diff_TCC7)
         (inst -1 "s!1" "t!1" "f(s!1)" "args(s!1)")
         (case "s!1 = app(f(s!1), args(s!1))")
         (("1"
           (assert)
           (hide -1)
           (inst -1 "f(t!1)" "args(t!1)")
           (case "t!1 = app(f(t!1), args(t!1))")
           (("1" (assert))
            ("2" (hide-all-but (1 3)) (decompose-equality))))
          ("2" (hide-all-but (1 5)) (decompose-equality))))
        ("3"
         (hide - (5 6))
         (skosimp*)
         (lemma "positions_of_arg")
         (inst -1 "t!1" "kk!1")
         (assert))
        ("4"
         (hide - (5 6))
         (skosimp*)
         (lemma "positions_of_arg")
         (inst -1 "s!1" "kk!1")
         (("1" (assert)) ("2" (typepred "kk!1") (assert))))))
      ("5"
       (hide -1 -2 5 6)
       (expand unifiable)
       (skeep -1)
       (expand unifier)
       (expand ext)
       (assert)
       (lift-if)
       (prop)
       (("1" (decompose-equality -2)) ("2" (decompose-equality -1))))))
    ("2" (hide-all-but (-1 2)) (rewrite position_t_first_diff))
    ("3"
     (hide-all-but (-1 1))
     (lemma position_s_first_diff)
     (inst -1 s!1 t!1 y!1)
     (assert))
    ("4" (hide-all-but (-1 2)) (rewrite position_t_first_diff))
    ("5"
     (hide-all-but (-1 1))
     (lemma position_s_first_diff)
     (inst -1 s!1 t!1 p!1)
     (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "length(first_diff(s, t))" ("s" "t"))
   (("1"
     (skosimp)
     (name-replace "fd" "first_diff(x!1, x!2)" :hide? nil)
     (expand first_diff -1)
     (lift-if)
     (prop)
     (("1"
       (hide-all-but (-2 -4))
       (replace -1 -2 rl)
       (hide -1)
       (expand child)
       (skosimp)
       (lemma seq_empty[posnat])
       (inst -1 p!1 p1!1)
       (assert)
       (flatten)
       (rewrite empty_0 -2))
      ("2"
       (hide-all-but (-2 -4))
       (replace -1 -2 rl)
       (hide -1)
       (expand child)
       (skosimp)
       (lemma seq_empty[posnat])
       (inst -1 p!1 p1!1)
       (assert)
       (flatten)
       (rewrite empty_0 -2))
      ("3"
       (hide-all-but (-2 -4))
       (replace -1 -2 rl)
       (hide -1)
       (expand child)
       (skosimp)
       (lemma seq_empty[posnat])
       (inst -1 p!1 p1!1)
       (assert)
       (flatten)
       (rewrite empty_0 -2))
      ("4"
       (case "p!1 = empty_seq")
       (("1"
         (hide-all-but (-1 -2 4))
         (replaces -1)
         (rewrite subterm_empty_seq)
         (rewrite subterm_empty_seq))
        ("2"
         (name-replace "kk"
          "min({kk: below[length(args(x!2))] |
                                                            subtermOF(x!1,  #(kk + 1)) /=
                                                             subtermOF(x!2,  #(kk + 1))})"
          :hide? nil)
         (("1"
           (assert)
           (inst -4 "subtermOF(x!1,  #(1 + kk))"
            "subtermOF(x!2,  #(1 + kk))")
           (replace -3 -4 rl)
           (expand add_first -4)
           (expand insert? -4)
           (inst -4 "rest(p!1)")
           (("1"
             (split)
             (("1"
               (lemma pos_subterm)
               (inst-cp -1 "#(1 + kk)" "rest(p!1)" "x!1")
               (inst -1 "#(1 + kk)" "rest(p!1)" "x!2")
               (split)
               (("1"
                 (split)
                 (("1"
                   (replace -1 -3 rl)
                   (replace -2 -3 rl)
                   (case "#(1 + kk) o rest(p!1) = p!1")
                   (("1" (assert))
                    ("2"
                     (hide -1 -2 -3 -5 3 4 5 6)
                     (expand child)
                     (skosimp)
                     (case "first(p!1) = first(fd)")
                     (("1"
                       (case "first(fd) = 1 + kk")
                       (("1"
                         (hide-all-but (-1 -2 1 2))
                         (replaces -1)
                         (lemma seq_first_rest_1[posnat])
                         (inst -1 p!1)
                         (assert)
                         (hide -1 2)
                         (flatten)
                         (rewrite empty_0))
                        ("2"
                         (hide-all-but (-3 1))
                         (replace -1 1 rl)
                         (hide -1)
                         (rewrite first_add))))
                      ("2"
                       (hide-all-but (-3 1 3))
                       (replaces -1)
                       (rewrite first_compo)
                       (hide 2)
                       (flatten)
                       (rewrite empty_0))
                      ("3"
                       (hide-all-but (-2 1))
                       (flatten)
                       (rewrite empty_0)
                       (replaces -1)
                       (grind))
                      ("4"
                       (hide-all-but (1 3))
                       (flatten)
                       (rewrite empty_0))))))
                  ("2"
                   (typepred p!1)
                   (hide-all-but (-1 -7 -8 1 2))
                   (expand child)
                   (skosimp)
                   (case "first(p!1) = 1 + kk")
                   (("1"
                     (lemma seq_first_rest_1[posnat])
                     (inst -1 p!1)
                     (assert)
                     (hide-all-but (1 3))
                     (flatten)
                     (rewrite empty_0))
                    ("2"
                     (hide-all-but (-2 -3 1 3))
                     (lemma first_compo[posnat])
                     (inst -1 p!1 p1!1)
                     (lemma empty_0[posnat])
                     (inst -1 p!1)
                     (assert)
                     (replace -1 2 rl)
                     (replace -3 2 rl)
                     (replace -2 2 rl)
                     (hide-all-but 2)
                     (rewrite first_add))
                    ("3"
                     (hide-all-but (1 3))
                     (flatten)
                     (rewrite empty_0))))))
                ("2"
                 (typepred p!1)
                 (hide-all-but (-1 -7 -8 1 2))
                 (expand child)
                 (skosimp)
                 (case "first(p!1) = 1 + kk")
                 (("1"
                   (lemma seq_first_rest_1[posnat])
                   (inst -1 p!1)
                   (assert)
                   (hide-all-but (1 3))
                   (flatten)
                   (rewrite empty_0))
                  ("2"
                   (hide-all-but (-2 -3 1 3))
                   (lemma first_compo[posnat])
                   (inst -1 p!1 p1!1)
                   (lemma empty_0[posnat])
                   (inst -1 p!1)
                   (assert)
                   (replace -1 2 rl)
                   (replace -3 2 rl)
                   (replace -2 2 rl)
                   (hide-all-but 2)
                   (rewrite first_add))
                  ("3"
                   (hide-all-but (1 3))
                   (flatten)
                   (rewrite empty_0))))))
              ("2"
               (hide-all-but (-3 -4 1 2))
               (expand child)
               (skosimp)
               (inst 1 p1!1)
               (assert)
               (lemma rest_compo[posnat])
               (inst -1 p!1 p1!1)
               (lemma empty_0[posnat])
               (inst -1 p!1)
               (assert)
               (replace -1 2 rl)
               (lemma rest_add_first[posnat])
               (inst -1
                "first_diff(subtermOF(x!1,  #(1 + kk)), subtermOF(x!2,  #(1 + kk)))"
                "1 + kk")
               (assert))))
            ("2"
             (case "p!1 = #(1 + kk) o rest(p!1)")
             (("1"
               (typepred p!1)
               (hide-all-but (-1 -2 -3 1 2))
               (rewrite pos_subterm_ax)
               (rewrite pos_subterm_ax))
              ("2"
               (hide-all-but (-3 -4 1 3))
               (lemma seq_first_rest_1[posnat])
               (inst -1 p!1)
               (lemma empty_0[posnat])
               (inst -1 p!1)
               (assert)
               (expand child)
               (skosimp)
               (replace -2 -3 rl)
               (hide -2)
               (lemma first_add[posnat])
               (inst -1
                "first_diff(subtermOF(x!1,  #(1 + kk)),
                                                         subtermOF(x!2,  #(1 + kk)))"
                "1 + kk")
               (replace -3 -1)
               (hide -3)
               (rewrite first_compo)
               (replaces -1))))))
          ("2"
           (hide-all-but (-1 1 3 4 5))
           (lemma first_diff_TCC7)
           (inst -1 x!1 x!2 "f(x!1)" "args(x!1)")
           (assert)
           (case "x!1 = app(f(x!1), args(x!1))")
           (("1"
             (assert)
             (inst -2 "f(x!2)" "args(x!2)")
             (case "x!2 = app(f(x!2), args(x!2))")
             (("1" (assert))
              ("2" (hide-all-but (1 3)) (decompose-equality))))
            ("2" (hide-all-but (1 5)) (decompose-equality))))
          ("3" (skosimp) (rewrite positions_of_arg))
          ("4"
           (hide -2 -3 -4 2 6)
           (skosimp)
           (rewrite positions_of_arg)
           (typepred kk!1)
           (typepred "args(x!2)")
           (assert))))))
      ("5"
       (hide-all-but (-1 -3))
       (replace -1 -2 rl)
       (hide -1)
       (expand child)
       (skosimp)
       (lemma seq_empty[posnat])
       (inst -1 p!1 p1!1)
       (assert)
       (flatten)
       (rewrite empty_0 -2))))
    ("2"
     (hide-all-but (-1 1))
     (lemma position_t_first_diff)
     (inst -1 y!1 y!2 "first_diff(y!1, y!2)")
     (name-replace "fd" "first_diff(y!1, y!2)")
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst -1 p!1 p1!1 y!2)
     (assert)
     (lemma not_var)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!1)
     (lemma empty_0[posnat])
     (inst -1 p1!1)
     (assert)
     (inst -2 "first(p1!1)" "p1!1" "rest(p1!1)" "subtermOF(y!2, p!1)")
     (assert))
    ("3"
     (hide-all-but (-1 1))
     (lemma position_s_first_diff)
     (inst -1 y!1 y!2 "first_diff(y!1, y!2)")
     (name-replace "fd" "first_diff(y!1, y!2)")
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst -1 p!1 p1!1 y!1)
     (assert)
     (lemma not_var)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!1)
     (lemma empty_0[posnat])
     (inst -1 p1!1)
     (assert)
     (inst -2 "first(p1!1)" "p1!1" "rest(p1!1)" "subtermOF(y!1, p!1)")
     (assert))
    ("4"
     (hide-all-but 1)
     (skosimp)
     (lemma position_t_first_diff)
     (inst -1 y!1 y!2 "first_diff(y!1, y!2)")
     (name-replace "fd" "first_diff(y!1, y!2)")
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst -1 p!1 p1!1 y!2)
     (assert)
     (lemma not_var)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!1)
     (lemma empty_0[posnat])
     (inst -1 p1!1)
     (assert)
     (inst -2 "first(p1!1)" "p1!1" "rest(p1!1)" "subtermOF(y!2, p!1)")
     (assert))
    ("5"
     (hide-all-but 1)
     (skosimp)
     (lemma position_s_first_diff)
     (inst -1 y!1 y!2 "first_diff(y!1, y!2)")
     (name-replace "fd" "first_diff(y!1, y!2)")
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst -1 p!1 p1!1 y!1)
     (assert)
     (lemma not_var)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!1)
     (lemma empty_0[posnat])
     (inst -1 p1!1)
     (assert)
     (inst -2 "first(p1!1)" "p1!1" "rest(p1!1)" "subtermOF(y!1, p!1)")
     (assert))
    ("6"
     (hide-all-but 1)
     (skosimp)
     (lemma position_t_first_diff)
     (inst?)
     (inst?)
     (name-replace "fd" "first_diff(x!1`1, x!1`2)")
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst?)
     (inst?)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!2)
     (lemma empty_0[posnat])
     (inst -1 p1!2)
     (assert)
     (lemma not_var)
     (inst?)
     (inst?)
     (assert))
    ("7"
     (hide-all-but (-1 1))
     (lemma position_t_first_diff)
     (inst?)
     (inst?)
     (name-replace "fd" "first_diff(y!1`1, y!1`2)")
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst?)
     (inst?)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!1)
     (lemma empty_0[posnat])
     (inst -1 p1!1)
     (assert)
     (lemma not_var)
     (inst?)
     (inst?)
     (assert))
    ("8"
     (hide-all-but (-1 1))
     (lemma position_s_first_diff)
     (inst?)
     (inst?)
     (name-replace "fd" "first_diff(y!1`1, y!1`2)")
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst?)
     (inst?)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!1)
     (lemma empty_0[posnat])
     (inst -1 p1!1)
     (assert)
     (lemma not_var)
     (inst?)
     (inst?)
     (assert))
    ("9"
     (hide-all-but 1)
     (skosimp)
     (lemma position_s_first_diff)
     (inst?)
     (inst?)
     (name-replace "fd" "first_diff(x!1`1, x!1`2)")
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst?)
     (inst?)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!2)
     (lemma empty_0[posnat])
     (inst -1 p1!2)
     (assert)
     (lemma not_var)
     (inst?)
     (inst?)
     (assert))
    ("10"
     (hide-all-but (-1 1))
     (lemma position_t_first_diff)
     (inst?)
     (inst?)
     (name-replace "fd" "first_diff(y!1`1, y!1`2)")
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst?)
     (inst?)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!1)
     (lemma empty_0[posnat])
     (inst -1 p1!1)
     (assert)
     (lemma not_var)
     (inst?)
     (inst?)
     (assert))
    ("11"
     (hide-all-but (-1 1))
     (lemma position_s_first_diff)
     (inst?)
     (inst?)
     (name-replace "fd" "first_diff(y!1`1, y!1`2)")
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst?)
     (inst?)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!1)
     (lemma empty_0[posnat])
     (inst -1 p1!1)
     (assert)
     (lemma not_var)
     (inst?)
     (inst?)
     (assert))
    ("12"
     (hide-all-but 1)
     (skosimp)
     (lemma position_t_first_diff)
     (inst?)
     (inst?)
     (name-replace "fd" "first_diff(y!1`1, y!1`2)")
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst?)
     (inst?)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!1)
     (lemma empty_0[posnat])
     (inst -1 p1!1)
     (assert)
     (lemma not_var)
     (inst?)
     (inst?)
     (assert))
    ("13"
     (hide-all-but 1)
     (skosimp)
     (lemma position_s_first_diff)
     (inst?)
     (inst?)
     (name-replace "fd" "first_diff(y!1`1, y!1`2)")
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst?)
     (inst?)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!1)
     (lemma empty_0[posnat])
     (inst -1 p1!1)
     (assert)
     (lemma not_var)
     (inst?)
     (inst?)
     (assert))
    ("14"
     (hide 2)
     (skosimp)
     (lemma position_t_first_diff)
     (inst?)
     (assert)
     (hide -2)
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst?)
     (inst?)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!1)
     (lemma empty_0[posnat])
     (inst -1 p1!1)
     (assert)
     (lemma not_var)
     (inst?)
     (inst?)
     (assert))
    ("15"
     (hide 2)
     (skosimp)
     (lemma position_s_first_diff)
     (inst?)
     (assert)
     (hide -2)
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst?)
     (inst?)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!1)
     (lemma empty_0[posnat])
     (inst -1 p1!1)
     (assert)
     (lemma not_var)
     (inst?)
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (assert)
   (name-replace "sig!1" "link_of_frst_diff(s!1, t!1)" :hide? nil)
   (prop)
   (("1"
     (expand* "restrict" "singleton")
     (decompose-equality 1)
     (iff)
     (prop)
     (("1"
       (copy -3)
       (decompose-equality -1)
       (inst -1 "x!1")
       (expand "Dom")
       (expand "link_of_frst_diff" -1)
       (assert)
       (lift-if)
       (prop)
       (("1" (assert)) ("2" (expand "link_of_frst_diff" -4) (assert))))
      ("2"
       (replace -3 1 rl)
       (expand "link_of_frst_diff" 1)
       (assert)
       (prop)
       (("1"
         (expand "Dom")
         (replace -5 1 rl)
         (replace -2 1 rl)
         (hide-all-but (-1 1))
         (expand* "member" "subtermOF")
         (lift-if)
         (prop)
         (("1"
           (expand "Vars")
           (inst 1 "empty_seq")
           (("1"
             (expand "subtermOF")
             (lift-if)
             (prop)
             (hide-all-but 1)
             (rewrite "empty_0"))
            ("2"
             (hide -)
             (expand "positionsOF")
             (lift-if)
             (prop)
             (("1" (expand "only_empty_seq") (propax))
              ("2" (expand "only_empty_seq") (propax))
              ("3"
               (expand* "union" "IUnion" "member" "only_empty_seq"))))))
          ("2" (expand "finseq_appl") (reveal -4) (assert))
          ("3" (reveal -4) (assert))
          ("4"
           (expand "Vars")
           (expand "finseq_appl")
           (inst 3 "empty_seq")
           (("1"
             (reveal -4)
             (replace -1 -2 rl)
             (expand "subtermOF" 3 1)
             (rewrite "empty_0" 3))
            ("2"
             (hide-all-but 1)
             (expand "finseq_appl")
             (expand "positionsOF")
             (lift-if)
             (prop)
             (("1" (expand "only_empty_seq") (propax))
              ("2" (expand "only_empty_seq") (propax))
              ("3"
               (hide 1 3)
               (expand* "union" "IUnion" "member"
                "only_empty_seq"))))))))
        ("2" (expand "link_of_frst_diff" -4) (assert))))))
    ("2"
     (expand* "restrict" "singleton")
     (decompose-equality 2)
     (("1"
       (iff)
       (prop)
       (("1"
         (copy -2)
         (decompose-equality -1)
         (inst -1 "x!1")
         (expand "Dom")
         (replace -1 -2 rl)
         (expand "link_of_frst_diff" -2)
         (assert)
         (case "vars?(subtermOF(t!1, first_diff(s!1, t!1)))")
         (("1"
           (assert)
           (lift-if)
           (prop)
           (expand "link_of_frst_diff" -4)
           (assert))
          ("2"
           (assert)
           (replace -3 1 rl)
           (expand "link_of_frst_diff" -2)
           (assert))
          ("3"
           (hide-all-but 1)
           (lemma "position_s_first_diff")
           (lemma "comutative_first_diff")
           (inst -2 "t!1" "s!1" "first_diff(s!1,t!1)")
           (assert)
           (inst -1 s!1 t!1 p!1)
           (assert))))
        ("2"
         (copy -2)
         (decompose-equality -1)
         (inst -1 "x!1")
         (expand "link_of_frst_diff" -1)
         (assert)
         (lift-if)
         (prop)
         (("1" (expand "Dom") (assert))
          ("2" (expand "link_of_frst_diff" -5) (assert))
          ("3" (assert) (expand "link_of_frst_diff" -3) (assert))))))
      ("2"
       (hide -1 2 3)
       (skosimp)
       (lemma "position_s_first_diff")
       (inst -1 "t!1" "s!1" "p!1")
       (lemma "comutative_first_diff")
       (assert)
       (inst -1 s!1 t!1 p!1)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (assert)
   (skosimp*)
   (name-replace "sig!1" "link_of_frst_diff(s!1, t!1)" :hide? nil)
   (typepred "x!1")
   (typepred "r!1")
   (hide -2)
   (expand "member")
   (replace -3 -1)
   (replace -3 -2)
   (expand "Dom")
   (expand "Ran")
   (skosimp)
   (expand* "member" "Dom")
   (lemma "dom_link_of_frst_diff_is")
   (inst -1 "first_diff(s!1, t!1)" "s!1" "t!1")
   (assert)
   (replace -4 -1)
   (assert)
   (name-replace "p!1" "first_diff(s!1, t!1)" :hide? nil)
   (expand* "restrict" "singleton")
   (prop)
   (("1"
     (copy -2)
     (decompose-equality -1)
     (inst -1 "x!1")
     (iff)
     (assert)
     (typepred "x!1")
     (expand "member")
     (assert)
     (hide -1 -2)
     (replace -6 -5 rl)
     (decompose-equality -3)
     (inst -1 "x!2")
     (expand "Dom")
     (expand "link_of_frst_diff" -5)
     (assert)
     (lift-if)
     (prop)
     (("1"
       (replace -5 1)
       (replace -5 -1)
       (replace -3 1 rl)
       (replace -1 1 rl)
       (hide-all-but (-7 1))
       (expand "member")
       (propax))
      ("2"
       (replace -6 -1)
       (hide -2 -3 -4 -8 1 2)
       (expand "link_of_frst_diff")
       (assert))))
    ("2"
     (case "vars?(subtermOF(t!1, p!1))")
     (("1"
       (copy -2)
       (decompose-equality -1)
       (inst -1 "x!1")
       (expand "Dom" -1)
       (decompose-equality -3)
       (inst -1 "x!2")
       (expand "Dom" -1)
       (replace -6 -5 rl)
       (expand "link_of_frst_diff" -5)
       (assert)
       (lift-if)
       (prop)
       (("1"
         (replace -5 1)
         (replace -5 -1)
         (replace -3 1 rl)
         (replace -1 1 rl)
         (hide-all-but (-7 1))
         (expand "member")
         (propax))
        ("2"
         (replace -6 -1)
         (hide-all-but (-1 -6 -7 4))
         (expand "link_of_frst_diff")
         (assert))))
      ("2"
       (hide-all-but (-2 -4 1 2 5))
       (expand "link_of_frst_diff")
       (assert))
      ("3"
       (hide-all-but (-2 1))
       (lemma "position_s_first_diff")
       (inst -1 "t!1" "s!1" "p!1")
       (assert)
       (hide 2)
       (lemma "comutative_first_diff")
       (inst -1 "s!1" "t!1" "p!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (assert)
   (flatten)
   (name-replace "sig!1" "link_of_frst_diff(s!1, t!1)" :hide? nil)
   (prop)
   (("1"
     (lemma "vars_subst_not_in")
     (inst -1 "s!1" "sig!1" "x!1")
     (assert)
     (skosimp)
     (lemma "dom_ran_link_disjoint")
     (inst -1 "s!1" "t!1")
     (assert)
     (inst -1 "x!1" "r!1")
     (("1" (replaces -4) (hide -2 -3 -4 2) (expand "member") (propax))
      ("2" (replaces -4) (hide -1 -2 -3 2) (expand "member") (propax))))
    ("2"
     (lemma "vars_subst_not_in")
     (inst -1 "t!1" "sig!1" "x!1")
     (assert)
     (skosimp)
     (lemma "dom_ran_link_disjoint")
     (inst -1 "s!1" "t!1")
     (assert)
     (inst -1 "x!1" "r!1")
     (("1" (replaces -4) (hide -2 -3 -4 2) (expand "member") (propax))
      ("2" (replaces -4) (hide -1 -2 -3 2) (expand "member") (propax))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (assert)
   (flatten)
   (name-replace "sig!1" "link_of_frst_diff(s!1,t!1)" :hide? nil)
   (expand* "subset?")
   (skosimp)
   (expand* "union" "member")
   (flatten)
   (case "member(x!1, VRan(sig!1))")
   (("1"
     (expand* "member" "VRan")
     (expand "IUnion")
     (skosimp)
     (lemma "dom_link_of_frst_diff_is")
     (inst -1 "first_diff(s!1, t!1)" "s!1" "t!1")
     (assert)
     (replace -3 -1)
     (assert)
     (expand* "restrict" "singleton")
     (prop)
     (("1"
       (decompose-equality -2)
       (typepred "i!1")
       (inst -3 "i!1")
       (assert)
       (replaces -3)
       (hide -1)
       (replace -4 -3 rl)
       (expand "link_of_frst_diff" -3)
       (name-replace "p!1" "first_diff(s!1, t!1)" :hide? nil)
       (prop)
       (("1"
         (hide-all-but (-1 4))
         (expand "Vars")
         (skosimp)
         (typepred "p!2")
         (lemma "pos_o_term")
         (inst -1 "p!1" "p!2" "t!1")
         (assert)
         (prop)
         (("1" (inst 1 "p!1 o p!2") (rewrite "pos_subterm"))
          ("2"
           (hide-all-but 1)
           (reveal -4)
           (lemma "position_s_first_diff")
           (inst -1 "t!1" "s!1" "p!1")
           (assert)
           (hide 2)
           (rewrite "comutative_first_diff"))))
        ("2"
         (hide-all-but (-1 -3 -5 -6 1))
         (expand "link_of_frst_diff")
         (assert))))
      ("2"
       (decompose-equality -1)
       (("1"
         (typepred "i!1")
         (inst -3 "i!1")
         (assert)
         (replaces -3)
         (expand "V")
         (replace -4 -3 rl)
         (expand "link_of_frst_diff" -3)
         (name-replace "p!1" "first_diff(s!1, t!1)" :hide? nil)
         (prop)
         (("1"
           (hide-all-but (-1 4))
           (expand "Vars")
           (skosimp)
           (typepred "p!2")
           (lemma "pos_o_term")
           (inst -1 "p!1" "p!2" "s!1")
           (assert)
           (prop)
           (("1" (inst 1 "p!1 o p!2") (rewrite "pos_subterm"))
            ("2"
             (hide-all-but 1)
             (reveal -4)
             (lemma "position_s_first_diff")
             (inst -1 "s!1" "t!1" "p!1")
             (assert))))
          ("2"
           (hide-all-but (-1 -3 -4 -7 1 2))
           (expand "link_of_frst_diff")
           (assert))))
        ("2" (hide-all-but 1) (rewrite position_t_first_diff))))))
    ("2"
     (expand "member")
     (name "p!1" "first_diff(s!1,t!1)")
     (case "vars?(subtermOF(s!1,p!1))")
     (("1"
       (case "VRan(sig!1) = Vars(subtermOF(t!1,p!1))")
       (("1"
         (replaces -1)
         (lemma "link_remove_x")
         (inst -1 "x!1" "s!1" "t!1")
         (assert)
         (replace -4 -1)
         (assert)
         (expand "member")
         (lemma "positions_of_ext")
         (inst -1 "sig!1" "s!1")
         (decompose-equality -1)
         (expand "Vars" -5)
         (skosimp)
         (inst -1 "p!2")
         (assert)
         (expand "union")
         (prop)
         (("1"
           (expand "member")
           (flatten)
           (rewrite "subterm_ext_commute")
           (decompose-equality -5)
           (prop)
           (("1"
             (hide-all-but (-1 1))
             (expand "ext")
             (assert)
             (lift-if)
             (prop)
             (assert))
            ("2"
             (hide-all-but -2)
             (typepred "x!1")
             (expand "V")
             (assert))))
          ("2"
           (expand "member")
           (skosimp)
           (replace -1 -8)
           (rewrite "pos_subterm")
           (rewrite "subterm_ext_commute")
           (expand "ext" -8)
           (assert)
           (case "subtermOF(s!1, p1!1) = subtermOF(s!1, p!1)")
           (("1"
             (replace -8 -9 rl)
             (expand "link_of_frst_diff" -9)
             (assert)
             (lift-if)
             (prop)
             (("1"
               (replace -8 -1)
               (hide-all-but (-1 3))
               (expand "Vars")
               (inst 1 "p2!1"))
              ("2" (expand "link_of_frst_diff" -10) (assert))))
            ("2"
             (replace -7 -8 rl)
             (expand "link_of_frst_diff" -8)
             (assert)
             (lift-if)
             (prop)
             (("1"
               (replace -8 -5 rl)
               (expand "ext" -5)
               (expand "link_of_frst_diff" -5)
               (assert)
               (lemma "pos_o_term")
               (inst -1 "p1!1" "p2!1" "s!1")
               (assert)
               (lemma "pos_subterm")
               (inst -1 "p1!1" "p2!1" "s!1")
               (assert)
               (replace -1 -3 rl)
               (hide-all-but (-3 6))
               (expand "Vars")
               (inst 1 "p1!1 o p2!1"))
              ("2" (expand "link_of_frst_diff" -9) (assert))))))))
        ("2"
         (decompose-equality 1)
         (iff)
         (prop)
         (("1"
           (expand "VRan" -1)
           (expand "IUnion")
           (skosimp)
           (lemma "dom_link_of_frst_diff_is")
           (inst -1 "p!1" "s!1" "t!1")
           (assert)
           (expand* "restrict" "singleton")
           (replace -5 -1)
           (decompose-equality -1)
           (inst -1 "i!1")
           (assert)
           (replaces -1)
           (replace -4 -1 rl)
           (expand "link_of_frst_diff" -1)
           (prop)
           (("1" (hide-all-but (-1 -3 2)) (assert))
            ("2" (expand "link_of_frst_diff" -5) (assert))))
          ("2"
           (expand "VRan" 1)
           (expand "IUnion")
           (inst 1 "subtermOF(s!1, p!1)")
           (("1"
             (replace -4 1 rl)
             (expand "link_of_frst_diff" 1)
             (prop)
             (("1" (hide-all-but (-1 -3 2)) (assert))
              ("2" (expand "link_of_frst_diff" -5) (assert))))
            ("2"
             (expand V)
             (expand "Dom")
             (decompose-equality -4)
             (inst -1 "subtermOF(s!1, p!1)")
             (expand "link_of_frst_diff" -1)
             (assert)
             (lift-if)
             (prop)
             (("1"
               (assert)
               (replace -2 -1)
               (replace -5 -1)
               (hide-all-but (-1 -5))
               (lemma first_diff_has_diff_argument)
               (inst -1 s!1 t!1 p!1)
               (assert))
              ("2"
               (case "sig!1 = link_of_frst_diff(s!1,t!1)")
               (("1" (expand link_of_frst_diff -1) (assert))
                ("2" (assert))))))))))
        ("3" (hide-all-but (-2 1)) (rewrite position_t_first_diff))))
      ("2"
       (case "vars?(subtermOF(t!1,p!1))")
       (("1"
         (case "VRan(sig!1) = Vars(subtermOF(s!1,p!1))")
         (("1"
           (replaces -1)
           (lemma "link_remove_x")
           (inst -1 "x!1" "s!1" "t!1")
           (assert)
           (replace -4 -1)
           (assert)
           (expand "member")
           (lemma "positions_of_ext")
           (inst -1 "sig!1" "s!1")
           (decompose-equality -1)
           (expand "Vars" -5)
           (skosimp)
           (inst -1 "p!2")
           (assert)
           (expand "union")
           (prop)
           (("1"
             (expand "member")
             (flatten)
             (rewrite "subterm_ext_commute")
             (decompose-equality -5)
             (prop)
             (("1"
               (hide-all-but (-1 1))
               (expand "ext")
               (assert)
               (lift-if)
               (prop)
               (assert))
              ("2"
               (hide-all-but -2)
               (typepred "x!1")
               (expand "V")
               (assert))))
            ("2"
             (expand "member")
             (skosimp)
             (replace -1 -8)
             (rewrite "pos_subterm")
             (rewrite "subterm_ext_commute")
             (expand "ext" -8)
             (assert)
             (case "subtermOF(s!1, p1!1) = subtermOF(t!1, p!1)")
             (("1"
               (replace -8 -9 rl)
               (expand "link_of_frst_diff" -9)
               (assert)
               (lift-if)
               (prop)
               (("1"
                 (replace -8 -1)
                 (hide-all-but (-1 4))
                 (expand "Vars")
                 (inst 1 "p2!1"))
                ("2" (expand "link_of_frst_diff" -10) (assert))))
              ("2"
               (replace -7 -8 rl)
               (expand "link_of_frst_diff" -8)
               (assert)
               (lift-if)
               (prop)
               (("1"
                 (replace -8 -5 rl)
                 (expand "ext" -5)
                 (expand "link_of_frst_diff" -5)
                 (assert)
                 (lemma "pos_o_term")
                 (inst -1 "p1!1" "p2!1" "s!1")
                 (assert)
                 (lemma "pos_subterm")
                 (inst -1 "p1!1" "p2!1" "s!1")
                 (assert)
                 (replace -1 -3 rl)
                 (hide-all-but (-3 7))
                 (expand "Vars")
                 (inst 1 "p1!1 o p2!1"))
                ("2" (expand "link_of_frst_diff" -9) (assert))))))))
          ("2"
           (decompose-equality 1)
           (iff)
           (prop)
           (("1"
             (expand "VRan" -1)
             (expand "IUnion")
             (skosimp)
             (lemma "dom_link_of_frst_diff_is")
             (inst -1 "p!1" "s!1" "t!1")
             (assert)
             (expand* "restrict" "singleton")
             (replace -5 -1)
             (decompose-equality -1)
             (inst -1 "i!1")
             (assert)
             (replaces -1)
             (replace -4 -1 rl)
             (expand "link_of_frst_diff" -1)
             (prop)
             (("1" (assert))
              ("2" (expand "link_of_frst_diff" -5) (assert))))
            ("2"
             (expand "VRan" 1)
             (expand "IUnion")
             (inst 1 "subtermOF(t!1, p!1)")
             (("1"
               (replace -4 1 rl)
               (expand "link_of_frst_diff" 1)
               (prop)
               (("1" (assert))
                ("2" (expand "link_of_frst_diff" -5) (assert))))
              ("2"
               (expand V)
               (expand "Dom")
               (decompose-equality -4)
               (inst -1 "subtermOF(t!1, p!1)")
               (expand "link_of_frst_diff" -1)
               (assert)
               (lift-if)
               (prop)
               (("1" (assert))
                ("2"
                 (case "sig!1 = link_of_frst_diff(s!1,t!1)")
                 (("1" (expand link_of_frst_diff -1) (assert))
                  ("2" (assert))))))))))))
        ("2" (expand link_of_frst_diff) (assert))
        ("3" (hide-all-but (-1 1)) (rewrite position_t_first_diff))))
      ("3"
       (hide-all-but (-1 1))
       (lemma position_s_first_diff)
       (inst -1 s!1 t!1 p!1)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma comutative_first_diff)
   (inst?)
   (assert)
   (prop)
   (inst -1 "first_diff(t!1, s!1)")
   (expand link_of_frst_diff)
   (lift-if)
   (assert)
   (name-replace position "first_diff(s!1, t!1)")
   (replace -1)
   (case " vars?(subtermOF(t!1, position))")
   (("1" (assert)) ("2" (assert))
    ("3"
     (hide 2 3)
     (replace -1 1 rl)
     (hide -)
     (lemma position_s_first_diff)
     (inst -1 t!1 s!1 "first_diff(t!1, s!1)"))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma comutative_link_fd)
   (lemma link_of_frst_diff_s_is_subset_union)
   (skosimp*)
   (assert)
   (case "NOT vars?(subtermOF(s!1, first_diff(s!1, t!1)))")
   (("1"
     (inst -1 t!1 s!1)
     (inst -2 s!1 t!1)
     (assert)
     (prop)
     (("1"
       (replace -2)
       (hide -2 1 2)
       (expand subset?)
       (skosimp*)
       (inst -1 x!1)
       (assert)
       (hide -2)
       (expand* member union)
       (prop))
      ("2" (assert))))
    ("2"
     (hide -3 -2)
     (prop)
     (name-replace "sig!1" "link_of_frst_diff(s!1,t!1)" :hide? nil)
     (name-replace "p!1" "first_diff(s!1, t!1)" :hide? nil)
     (expand* "subset?")
     (skosimp)
     (expand* "union" "member")
     (flatten)
     (case "member(x!1, VRan(sig!1))")
     (("1"
       (expand* "member" "VRan")
       (expand "IUnion")
       (skosimp)
       (lemma "dom_link_of_frst_diff_is")
       (inst -1 "first_diff(s!1, t!1)" "s!1" "t!1")
       (assert)
       (replace -3 -1)
       (assert)
       (expand* "restrict" "singleton")
       (replace -4 -1)
       (decompose-equality -1)
       (typepred "i!1")
       (inst -3 "i!1")
       (assert)
       (replaces -3)
       (hide -1)
       (replace -4 -2 rl)
       (expand "link_of_frst_diff" -2)
       (prop)
       (("1"
         (hide-all-but (-1 -3 4))
         (expand "Vars")
         (skosimp)
         (typepred "p!2")
         (lemma "pos_o_term")
         (inst -1 "p!1" "p!2" "t!1")
         (assert)
         (prop)
         (("1" (inst 1 "p!1 o p!2") (rewrite "pos_subterm") (assert))
          ("2" (hide-all-but (-3 1)) (rewrite position_t_first_diff))))
        ("2"
         (hide-all-but (-1 -4 -5 -6 1))
         (expand "link_of_frst_diff")
         (assert))))
      ("2"
       (expand "member")
       (case "VRan(sig!1) = Vars(subtermOF(t!1,p!1))")
       (("1"
         (replaces -1)
         (lemma "link_remove_x")
         (inst -1 "x!1" "s!1" "t!1")
         (assert)
         (replace -3 -1)
         (assert)
         (expand "member")
         (lemma "positions_of_ext")
         (inst -1 "sig!1" "t!1")
         (decompose-equality -1)
         (expand "Vars" -5)
         (skosimp)
         (inst -1 "p!2")
         (assert)
         (expand "union")
         (prop)
         (("1"
           (expand "member")
           (flatten)
           (rewrite "subterm_ext_commute")
           (decompose-equality -5)
           (prop)
           (("1"
             (hide-all-but (-1 1))
             (expand "ext")
             (assert)
             (lift-if)
             (prop)
             (assert))
            ("2"
             (hide-all-but -2)
             (typepred "x!1")
             (expand "V")
             (assert))))
          ("2"
           (expand "member")
           (skosimp)
           (replace -1 -8)
           (rewrite "pos_subterm")
           (rewrite "subterm_ext_commute")
           (expand "ext" -8)
           (assert)
           (case "subtermOF(t!1, p1!1) = subtermOF(t!1, p!1)")
           (("1"
             (replace -7 -9 rl)
             (expand "link_of_frst_diff" -9)
             (assert)
             (lift-if)
             (prop)
             (("1"
               (replace -8 -2)
               (hide-all-but (-2 3))
               (expand "Vars")
               (inst 1 "p2!1"))
              ("2"
               (replace -2 -1)
               (hide-all-but (-1 4))
               (expand "Vars")
               (inst 1 "p2!1"))
              ("3" (expand "link_of_frst_diff" -9) (assert))))
            ("2"
             (replace -6 -8 rl)
             (expand "link_of_frst_diff" -8)
             (assert)
             (lift-if)
             (prop)
             (("1"
               (replace -8 -6 rl)
               (expand "ext" -6)
               (expand "link_of_frst_diff" -6)
               (assert)
               (lemma "pos_o_term")
               (inst -1 "p!1" "p2!1" "t!1")
               (assert)
               (lemma "pos_subterm")
               (inst -1 "p!1" "p2!1" "t!1")
               (case "positionsOF(t!1)(p!1)")
               (("1"
                 (assert)
                 (assert)
                 (replace -10 -5)
                 (replace -2 -5 rl)
                 (hide-all-but (-5 7))
                 (expand "Vars")
                 (inst 1 "p!1 o p2!1"))
                ("2"
                 (hide-all-but (-9 1))
                 (rewrite position_t_first_diff))))
              ("2"
               (expand ext -5)
               (replace -7 -5 rl)
               (expand link_of_frst_diff -5)
               (assert)
               (lemma pos_o_term)
               (inst -1 "p1!1" "p2!1" "t!1")
               (assert)
               (lemma "pos_subterm")
               (inst -1 "p1!1" "p2!1" "t!1")
               (assert)
               (replace -1 -3 rl)
               (hide-all-but (-3 8))
               (expand "Vars")
               (inst 1 "p1!1 o p2!1"))
              ("3" (expand link_of_frst_diff -8) (assert))))))))
        ("2"
         (decompose-equality 1)
         (iff)
         (prop)
         (("1"
           (expand "VRan" -1)
           (expand "IUnion")
           (skosimp)
           (lemma "dom_link_of_frst_diff_is")
           (inst -1 "p!1" "s!1" "t!1")
           (assert)
           (expand* "restrict" "singleton")
           (replace -4 -1)
           (decompose-equality -1)
           (inst -1 "i!1")
           (assert)
           (replaces -1)
           (replace -3 -1 rl)
           (expand "link_of_frst_diff" -1)
           (prop)
           (("1" (assert))
            ("2" (expand "link_of_frst_diff" -4) (assert))))
          ("2"
           (expand "VRan" 1)
           (expand "IUnion")
           (inst 1 "subtermOF(s!1, p!1)")
           (("1"
             (replace -3 1 rl)
             (expand "link_of_frst_diff" 1)
             (prop)
             (("1" (assert))
              ("2" (expand "link_of_frst_diff" -4) (assert))))
            ("2"
             (expand V)
             (expand "Dom")
             (lemma dom_link_of_frst_diff_is)
             (inst -1 p!1 s!1 t!1)
             (assert)
             (replace -4 -1)
             (expand* restrict singleton)
             (decompose-equality -1)
             (inst -1 "subtermOF(s!1, p!1)")
             (assert)
             (expand Dom)
             (assert))))))
        ("3" (hide-all-but (-1 1)) (rewrite position_t_first_diff))))))
    ("3" (hide-all-but 1) (lemma position_s_first_diff) (inst?) (inst?))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (flatten)
   (name-replace "sig!1" "link_of_frst_diff(s!1, t!1)" :hide? nil)
   (decompose-equality 2)
   (iff)
   (prop)
   (("1"
     (expand "difference")
     (expand "union")
     (expand "member")
     (prop)
     (("1"
       (lemma "link_of_frst_diff_s_is_subset_union")
       (inst -1 "s!1" "t!1")
       (assert)
       (expand "subset?")
       (inst -1 "x!1")
       (expand* "union" "member"))
      ("2"
       (lemma "link_remove_x")
       (inst -1 "x!1" "s!1" "t!1")
       (assert)
       (assert)
       (prop)
       (expand "member")
       (assert))
      ("3"
       (lemma "link_of_frst_diff_t_is_subset_union")
       (inst -1 "s!1" "t!1")
       (assert)
       (expand "subset?")
       (inst -1 "x!1")
       (expand* "union" "member"))
      ("4"
       (lemma "link_remove_x")
       (inst -1 "x!1" "s!1" "t!1")
       (assert)
       (assert)
       (prop)
       (assert)
       (expand member)
       (assert))))
    ("2"
     (expand* "difference" "union" "member")
     (prop)
     (("1"
       (hide 3)
       (expand "Vars")
       (skosimp)
       (inst 2 "p!1")
       (("1"
         (rewrite "subterm_ext_commute")
         (replaces -1)
         (typepred "x!1")
         (expand* "V" "Dom" "ext")
         (assert))
        ("2" (hide -1 2) (rewrite "ext_preserv_pos"))))
      ("2"
       (hide 2)
       (expand "Vars")
       (skosimp)
       (inst 2 "p!1")
       (("1"
         (rewrite "subterm_ext_commute")
         (replaces -1)
         (typepred "x!1")
         (expand* "V" "Dom" "ext")
         (assert))
        ("2" (hide -1 2) (rewrite "ext_preserv_pos"))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (prop)
   (name-replace "sig1" "link_of_frst_diff(s!1, t!1)" :hide? nil)
   (lemma "card_diff_subset[(V)]")
   (lemma "union_vars_ext_link")
   (inst -1 "s!1" "t!1")
   (assert)
   (replace -3 -1)
   (assert)
   (replaces -1)
   (inst -1 "Dom(sig1)" "union(Vars(s!1), Vars(t!1))")
   (("1"
     (prop)
     (("1"
       (case-replace "card(Dom(sig1)) = 1")
       (("1" (assert))
        ("2"
         (hide-all-but 1)
         (rewrite "card_one")
         (lemma "dom_link_of_frst_diff_is")
         (inst -1 "first_diff(s!1, t!1)" "s!1" "t!1")
         (assert)
         (prop)
         (("1"
           (expand "restrict")
           (decompose-equality -2)
           (inst 1 "subtermOF(s!1, first_diff(s!1, t!1))")
           (("1"
             (decompose-equality 1)
             (inst -1 "x!1")
             (reveal -5)
             (replace -1 -2)
             (assert)
             (hide -1 -3)
             (grind))
            ("2" (expand "V") (propax))))
          ("2"
           (expand "restrict")
           (case "vars?(subtermOF(t!1, first_diff(s!1, t!1)))")
           (("1"
             (inst 2 "subtermOF(t!1, first_diff(s!1, t!1))")
             (("1"
               (decompose-equality -2)
               (decompose-equality 2)
               (inst -1 "x!1")
               (reveal -5)
               (assert)
               (replace -1 -2)
               (hide -1 -3 2)
               (grind))
              ("2" (expand "V") (propax))))
            ("2"
             (reveal 1)
             (reveal -3)
             (hide -2 4)
             (expand "link_of_frst_diff")
             (assert))
            ("3"
             (hide-all-but 1)
             (lemma "position_s_first_diff")
             (inst -1 "t!1" "s!1" "first_diff(s!1,t!1)")
             (prop)
             (hide 2)
             (lemma "comutative_first_diff")
             (inst -1 "s!1" "t!1" "first_diff(s!1, t!1)"))))))))
      ("2"
       (lemma "dom_link_of_frst_diff_is")
       (inst -1 "first_diff(s!1,t!1)" "s!1" "t!1")
       (assert)
       (replace -2 -1)
       (name-replace "p!1" "first_diff(s!1, t!1)" :hide? nil)
       (expand "restrict")
       (prop)
       (("1"
         (decompose-equality -2)
         (hide 2 3)
         (expand "subset?")
         (skosimp)
         (inst -1 "x!1")
         (expand "member")
         (iff)
         (assert)
         (expand "singleton")
         (expand "union")
         (flatten)
         (hide-all-but (-1 1))
         (expand* "member" "Vars")
         (inst 1 "p!1")
         (assert))
        ("2"
         (case "vars?(subtermOF(t!1, p!1))")
         (("1"
           (hide 1 3 4 -3 -4)
           (expand "subset?")
           (skosimp)
           (decompose-equality -2)
           (inst -1 "x!1")
           (expand "member")
           (iff)
           (assert)
           (hide -2 -3)
           (expand* "union" "member")
           (flatten)
           (hide 1)
           (expand "Vars")
           (inst 1 "p!1")
           (expand "singleton")
           (assert))
          ("2"
           (hide-all-but (-2 -3 1 2 4))
           (expand "link_of_frst_diff")
           (replaces -1)
           (assert))
          ("3"
           (hide-all-but (-2 1))
           (lemma "position_s_first_diff")
           (inst -1 "t!1" "s!1" "p!1")
           (assert)
           (hide 2)
           (lemma "comutative_first_diff")
           (inst -1 "s!1" "t!1" "p!1")
           (assert))))))))
    ("2" (typepred "sig1") (hide -2 2 3) (expand "Sub?") (propax))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (assert)
   (name "sig!1" "link_of_frst_diff(s!1, t!1)")
   (prop)
   (expand link_of_frst_diff -3)
   (lift-if)
   (prop)
   (("1"
     (name "p!1" "first_diff(s!1, t!1)")
     (replace -1)
     (decompose-equality -2)
     (case "xx = subtermOF(s!1, p!1)")
     (("1"
       (inst -2 "xx")
       (assert)
       (expand fail -2)
       (replace -1 1 rl)
       (replace -2 1)
       (hide-all-but 1)
       (expand* member Vars)
       (inst 1 "#(1)")
       (("1"
         (expand subtermOF 1)
         (rewrite empty_0)
         (lift-if)
         (prop)
         (("1" (hide-all-but -1) (grind))
          ("2"
           (expand finseq_appl)
           (case "#(xx)`seq(first( #(1)) - 1) = xx")
           (("1"
             (replace -1 2)
             (case "rest( #(1)) = empty_seq")
             (("1"
               (replace -1 2)
               (hide-all-but 2)
               (expand subtermOF)
               (rewrite empty_0))
              ("2"
               (hide-all-but 1)
               (lemma length_rest_0[posnat])
               (inst -1 "#(1)")
               (prop)
               (("1" (hide-all-but (-1 2)) (rewrite empty_0))
                ("2" (expand "#" -1) (assert))
                ("3" (expand "#" 1) (propax))))))
            ("2" (hide-all-but 1) (expand "#") (propax))
            ("3" (assert))))))
        ("2"
         (expand positionsOF)
         (assert)
         (expand* union IUnion member)
         (prop)
         (("1" (expand "#") (assert))
          ("2"
           (hide 1 2)
           (inst 1 1)
           (("1"
             (expand catenate)
             (expand finseq_appl)
             (inst 1 empty_seq)
             (split)
             (("1"
               (expand member)
               (expand positionsOF)
               (lift-if)
               (prop)
               (("1" (expand only_empty_seq) (propax))
                ("2" (expand only_empty_seq) (propax))
                ("3" (expand* union IUnion member only_empty_seq))))
              ("2" (grind))))
            ("2" (grind))))))))
      ("2"
       (inst -1 "subtermOF(s!1, p!1)")
       (expand fail)
       (assert)
       (expand id)
       (hide 1 2)
       (lemma first_diff_has_diff_argument)
       (inst -1 s!1 t!1 p!1)
       (assert))))
    ("2"
     (lemma var_term_unifiable_not_var_in_term)
     (inst -1 "subtermOF(s!1, first_diff(s!1, t!1))"
      "subtermOF(t!1, first_diff(s!1, t!1))")
     (assert)
     (hide -1 -2)
     (split)
     (("1"
       (lemma unifiable_terms_unifiable_args)
       (expand unifiable)
       (skosimp)
       (inst 1 sigma!1)
       (inst -1 sigma!1 s!1 t!1 "first_diff(s!1, t!1)")
       (("1" (expand* member U) (assert))
        ("2"
         (hide-all-but 1)
         (rewrite position_t_first_diff)
         (lemma position_s_first_diff)
         (inst?)
         (inst?))))
      ("2" (lemma first_diff_has_diff_argument) (inst?))))
    ("3"
     (decompose-equality -1)
     (name "p!1" "first_diff(s!1, t!1)")
     (replace -1)
     (case "xx = subtermOF(t!1, p!1)")
     (("1"
       (inst -3 "subtermOF(t!1, p!1)")
       (expand fail)
       (assert)
       (replace -1 1 rl)
       (replace -3 1)
       (hide-all-but 1)
       (expand* member Vars)
       (inst 1 "#(1)")
       (("1"
         (expand subtermOF 1)
         (rewrite empty_0)
         (lift-if)
         (prop)
         (("1" (hide-all-but -1) (grind))
          ("2"
           (expand finseq_appl)
           (case "#(xx)`seq(first( #(1)) - 1) = xx")
           (("1"
             (replace -1 2)
             (case "rest( #(1)) = empty_seq")
             (("1"
               (replace -1 2)
               (hide-all-but 2)
               (expand subtermOF)
               (rewrite empty_0))
              ("2"
               (hide-all-but 1)
               (lemma length_rest_0[posnat])
               (inst -1 "#(1)")
               (prop)
               (("1" (hide-all-but (-1 2)) (rewrite empty_0))
                ("2" (expand "#" -1) (assert))
                ("3" (expand "#" 1) (propax))))))
            ("2" (hide-all-but 1) (expand "#") (propax))
            ("3" (assert))))))
        ("2"
         (expand positionsOF)
         (assert)
         (expand* union IUnion member)
         (prop)
         (("1" (hide 1) (grind))
          ("2"
           (hide 1 2)
           (inst 1 1)
           (("1"
             (expand catenate)
             (expand finseq_appl)
             (inst 1 empty_seq)
             (split)
             (("1"
               (expand member)
               (expand positionsOF)
               (lift-if)
               (prop)
               (("1" (expand only_empty_seq) (propax))
                ("2" (expand only_empty_seq) (propax))
                ("3" (expand* union IUnion member only_empty_seq))))
              ("2" (grind))))
            ("2" (grind))))))))
      ("2"
       (inst -2 "subtermOF(t!1, p!1)")
       (expand fail)
       (assert)
       (expand id)
       (hide 1 2 3 -3 -4)
       (lemma first_diff_has_diff_argument)
       (inst -1 s!1 t!1 p!1)
       (assert))))
    ("4"
     (lemma var_term_unifiable_not_var_in_term)
     (inst -1 "subtermOF(t!1, first_diff(s!1, t!1))"
      "subtermOF(s!1, first_diff(s!1, t!1))")
     (assert)
     (hide -1 -2 -3 2)
     (lemma unifiable_terms_unifiable_args)
     (expand unifiable)
     (skosimp)
     (inst 1 sigma!1)
     (inst -1 sigma!1 s!1 t!1 "first_diff(s!1, t!1)")
     (("1"
       (expand* member U)
       (assert)
       (hide -2)
       (expand unifier)
       (assert))
      ("2"
       (hide-all-but 1)
       (rewrite position_t_first_diff)
       (lemma position_s_first_diff)
       (inst -1 s!1 t!1 "first_diff(s!1, t!1)"))))
    ("5"
     (lemma first_diff_unifiable_vars)
     (inst -1 s!1 t!1 "first_diff(s!1, t!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (assert)
   (inst 1 rho!1)
   (name-replace "sig!1" "link_of_frst_diff(s!1, t!1)" :hide? nil)
   (decompose-equality 1)
   (copy -1)
   (expand link_of_frst_diff -1)
   (lift-if)
   (prop)
   (("1"
     (name-replace "p!1" "first_diff(s!1, t!1)" :hide? nil)
     (decompose-equality -2)
     (inst -1 x!1)
     (lift-if)
     (prop)
     (("1"
       (expand comp 2)
       (replace -2 2 rl)
       (replace -1 2)
       (lemma unifiable_terms_unifiable_args)
       (inst -1 rho!1 s!1 t!1 p!1)
       (("1"
         (assert)
         (hide-all-but (-1 -5 2))
         (expand* member U unifier)
         (expand ext -1 1)
         (propax))
        ("2"
         (hide-all-but (-3 1))
         (rewrite position_t_first_diff)
         (lemma position_s_first_diff)
         (inst -1 s!1 t!1 p!1)
         (assert))))
      ("2"
       (expand comp 3)
       (replace -1 3 rl)
       (hide-all-but 3)
       (expand ext)
       (typepred x!1)
       (expand V)
       (assert))))
    ("2"
     (hide -1 -3 1)
     (lemma unifiable_implies_not_fail)
     (inst -1 s!1 t!1)
     (assert)
     (replaces -3)
     (expand unifiable)
     (hide -1)
     (inst 1 rho!1)
     (expand* member U))
    ("3"
     (name-replace "p!1" "first_diff(s!1, t!1)" :hide? nil)
     (decompose-equality -2)
     (inst -1 x!1)
     (lift-if)
     (prop)
     (("1"
       (expand comp 3)
       (replace -2 3 rl)
       (replace -1 3)
       (lemma unifiable_terms_unifiable_args)
       (inst -1 rho!1 s!1 t!1 p!1)
       (("1"
         (assert)
         (hide-all-but (-1 -5 3))
         (expand* member U unifier)
         (expand ext -1 2)
         (assert))
        ("2"
         (hide-all-but (-3 1))
         (rewrite position_t_first_diff)
         (lemma position_s_first_diff)
         (inst -1 s!1 t!1 p!1)
         (assert))))
      ("2"
       (expand comp 4)
       (replace -1 4 rl)
       (hide-all-but 4)
       (typepred x!1)
       (expand V)
       (expand ext)
       (assert))))
    ("4"
     (hide -1 -3 1 2)
     (lemma unifiable_implies_not_fail)
     (inst -1 s!1 t!1)
     (assert)
     (replaces -3)
     (expand unifiable)
     (hide -1)
     (inst 1 rho!1)
     (expand* member U))
    ("5"
     (hide-all-but (-3 1 2))
     (lemma first_diff_unifiable_vars)
     (inst -1 s!1 t!1 "first_diff(s!1, t!1)")
     (prop)
     (hide 2 3)
     (expand* member U unifiable)
     (inst 1 rho!1))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (assert)
   (prop)
   (lemma preserving_generality)
   (expand unifiable -2)
   (skosimp)
   (inst -1 sigma!1 s!1 t!1)
   (expand* member U)
   (assert)
   (skosimp)
   (expand unifiable)
   (inst 1 theta!1)
   (expand unifier)
   (replaces -1)
   (rewrite ext_o)
   (expand o)
   (propax))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct r)
   (("1"
     (skosimp*)
     (name-replace "y!1" "vars(vars1_var!1)" :hide? nil)
     (inst 1 y!1)
     (("1"
       (expand member)
       (split)
       (("1"
         (hide -)
         (expand Vars 1)
         (inst 1 empty_seq)
         (("1" (expand subtermOF) (rewrite empty_0))
          ("2"
           (reveal -1)
           (expand positionsOF)
           (assert)
           (expand only_empty_seq)
           (propax))))
        ("2" (expand ext) (assert))))
      ("2" (expand V) (assert))))
    ("2"
     (skosimp*)
     (name-replace "r!1" "app(app1_var!1, app2_var!1)" :hide? nil)
     (expand member)
     (case "length(app2_var!1) = 0")
     (("1"
       (hide -3)
       (expand ext)
       (assert)
       (decompose-equality -2)
       (assert)
       (expand Vars -4)
       (skosimp)
       (case "p!1 = empty_seq")
       (("1"
         (replace -1)
         (expand subtermOF)
         (rewrite empty_0 -5)
         (typepred x!1)
         (expand V)
         (assert))
        ("2"
         (typepred p!1)
         (case "positionsOF(r!1) = only_empty_seq")
         (("1" (replace -1) (expand only_empty_seq) (propax))
          ("2" (expand positionsOF 1) (propax))))))
      ("2"
       (case "EXISTS (i :  below[length(app2_var!1)]):
                                      Vars(ext(sigma!1)(app2_var!1`seq(i)))(x!1)")
       (("1"
         (skosimp)
         (inst -3 i!1)
         (inst -3 sigma!1 x!1)
         (assert)
         (skosimp)
         (inst 2 y!1)
         (assert)
         (hide -1 -4 -5)
         (expand Vars)
         (skosimp)
         (inst 2 "add_first(i!1+1, p!1)")
         (("1"
           (expand subtermOF 2)
           (lift-if)
           (prop)
           (("1" (expand* add_first insert?) (assert))
            ("2"
             (expand finseq_appl)
             (rewrite rest_add_first)
             (rewrite first_add)
             (assert)
             (decompose-equality -1))))
          ("2"
           (typepred i!1)
           (typepred p!1)
           (expand positionsOF 1)
           (assert)
           (decompose-equality -3)
           (assert)
           (expand* union IUnion member)
           (flatten)
           (expand finseq_appl)
           (inst 2 "i!1 + 1")
           (assert)
           (expand catenate)
           (inst 2 p!1)
           (expand member)
           (assert))))
        ("2"
         (hide -2 3)
         (expand ext -2)
         (assert)
         (decompose-equality -1)
         (assert)
         (expand finseq_appl)
         (expand Vars -3)
         (skosimp)
         (expand subtermOF)
         (lift-if)
         (prop)
         (("1" (typepred x!1) (expand V) (assert))
          ("2"
           (expand finseq_appl)
           (inst 2 "first(p!1) - 1")
           (("1"
             (expand Vars 2)
             (inst 2 "rest(p!1)")
             (("1" (assert))
              ("2"
               (typepred p!1)
               (hide -2)
               (grind)
               (("1"
                 (case "(# length := 0,
                                                          seq := (LAMBDA (x: below[0]): epsilon! (t: posnat): TRUE) #) = empty_seq")
                 (("1"
                   (replaces -1)
                   (hide-all-but 1)
                   (expand positionsOF)
                   (lift-if)
                   (prop)
                   (("1" (expand only_empty_seq) (propax))
                    ("2" (expand* union IUnion member only_empty_seq))
                    ("3" (expand* union IUnion member only_empty_seq))))
                  ("2"
                   (hide-all-but 1)
                   (lemma empty_0[posnat])
                   (inst -1
                    "(# length := 0,
                                                    seq := (LAMBDA (x: below[0]): epsilon! (t: posnat): TRUE) #)")
                   (assert))))
                ("2"
                 (case "(# length := 0,
                                                          seq := (LAMBDA (x: below[0]): epsilon! (t: posnat): TRUE) #) = empty_seq")
                 (("1"
                   (replaces -1)
                   (hide-all-but 1)
                   (expand positionsOF)
                   (lift-if)
                   (prop)
                   (("1" (expand only_empty_seq) (propax))
                    ("2" (expand only_empty_seq) (propax))
                    ("3" (expand* union IUnion member only_empty_seq))))
                  ("2"
                   (hide-all-but 1)
                   (lemma empty_0[posnat])
                   (inst -1
                    "(# length := 0,
                                                    seq := (LAMBDA (x: below[0]): epsilon! (t: posnat): TRUE) #)")
                   (assert))))
                ("3"
                 (case "x!2 = (# length := x!2`length,
                                                          seq := LAMBDA (x: below[p!1`length - 1]): x!2`seq(x) #)")
                 (("1" (replace -1 3 rl) (propax))
                  ("2"
                   (decompose-equality)
                   (("1"
                     (decompose-equality)
                     (skosimp)
                     (prop)
                     (("1" (assert)) ("2" (assert))))
                    ("2"
                     (skosimp)
                     (prop)
                     (("1" (assert)) ("2" (assert))))))
                  ("3"
                   (skosimp)
                   (prop)
                   (("1" (assert)) ("2" (assert))))))))))
            ("2" (assert) (hide -1) (typepred p!1) (grind))))))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "Card(union(Vars(s), Vars(t)))" ("s" "t"))
   (("1"
     (case "x!1 = x!2")
     (("1"
       (hide -2)
       (expand robinson_unification_algorithm)
       (assert)
       (expand* subset? union member)
       (skosimp)
       (hide-all-but -3)
       (expand Dom)
       (flatten)
       (expand identity)
       (propax))
      ("2"
       (name "p!1" "first_diff(x!1, x!2)")
       (("1"
         (name "sig!1" "link_of_frst_diff(x!1, x!2)")
         (name "sig!2"
               "robinson_unification_algorithm(ext(sig!1)(x!1), ext(sig!1)(x!2))")
         (inst -4 "ext(sig!1)(x!1)" "ext(sig!1)(x!2)")
         (lemma termination_lemma)
         (inst -1 x!1 x!2)
         (replace -3)
         (assert)
         (lemma unifiable_implies_not_fail)
         (inst -1 x!1 x!2)
         (replace -4)
         (assert)
         (hide -1)
         (lemma unifiable_preserves_unifiability)
         (inst -1 x!1 x!2)
         (replace -3)
         (assert)
         (replace -2)
         (expand robinson_unification_algorithm 3)
         (replace -3)
         (replace -2)
         (lift-if)
         (prop)
         (("1"
           (case "subset?(union(Vars(ext(sig!1)(x!1)), Vars(ext(sig!1)(x!2))),
                                              union(Vars(x!1), Vars(x!2)))")
           (("1"
             (replaces -2)
             (hide-all-but (-1 -6 1))
             (expand subset?)
             (skosimp)
             (inst -1 x!3)
             (inst -3 x!3)
             (assert))
            ("2"
             (lemma link_of_frst_diff_s_is_subset_union)
             (inst -1 x!1 x!2)
             (replace -5)
             (assert)
             (lemma link_of_frst_diff_t_is_subset_union)
             (inst -1 x!1 x!2)
             (replace -6)
             (assert)
             (hide-all-but (-1 -2 1))
             (expand subset?)
             (skosimp)
             (inst -1 x!3)
             (inst -2 x!3)
             (assert)
             (hide 3)
             (expand* union member)
             (assert))))
          ("2"
           (case "subset?(union(Vars(ext(sig!1)(x!1)), Vars(ext(sig!1)(x!2))),
                                              union(Vars(x!1), Vars(x!2)))")
           (("1"
             (expand subset? 2)
             (skosimp)
             (lemma dom_o)
             (inst -1 sig!2 sig!1)
             (expand subset? -1)
             (inst -1 x!3)
             (assert)
             (expand member -1)
             (expand union -1)
             (split -1)
             (("1"
               (hide-all-but (-1 -2 -8 2))
               (expand subset?)
               (inst -2 x!3)
               (inst -3 x!3)
               (assert))
              ("2"
               (hide -2 -3 -4 -5 -8 1 4)
               (lemma dom_link_of_frst_diff_is)
               (inst -1 p!1 x!1 x!2)
               (replace -3)
               (replace -4)
               (assert)
               (expand* restrict singleton)
               (prop)
               (("1"
                 (decompose-equality -2)
                 (inst -1 x!3)
                 (expand member)
                 (iff)
                 (assert)
                 (expand* union member)
                 (flatten)
                 (expand Vars 1)
                 (inst 1 p!1)
                 (assert))
                ("2"
                 (decompose-equality -1)
                 (("1"
                   (inst -1 x!3)
                   (iff)
                   (expand member)
                   (assert)
                   (expand* union member)
                   (flatten)
                   (expand Vars 3)
                   (inst 3 p!1)
                   (assert))
                  ("2"
                   (hide-all-but (-6 1))
                   (lemma position_t_first_diff)
                   (inst -1 x!1 x!2 p!1)
                   (assert))))))))
            ("2"
             (lemma link_of_frst_diff_s_is_subset_union)
             (lemma link_of_frst_diff_t_is_subset_union)
             (inst -2 x!1 x!2)
             (inst -1 x!1 x!2)
             (replace -5)
             (assert)
             (hide-all-but (-1 -2 1))
             (expand subset?)
             (skosimp)
             (inst -2 x!3)
             (inst -1 x!3)
             (assert)
             (hide 3)
             (expand* union member)
             (assert))))))
        ("2" (assert))))))
    ("2"
     (hide 2)
     (rewrite finite_union)
     (("1" (rewrite vars_of_term_finite))
      ("2" (rewrite vars_of_term_finite))))
    ("3"
     (hide 2)
     (rewrite finite_union)
     (("1" (rewrite vars_of_term_finite))
      ("2" (rewrite vars_of_term_finite))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (name-replace "sig!1" "link_of_frst_diff(s!1, t!1)" :hide? nil)
   (name-replace "sig!2"
    "robinson_unification_algorithm(ext(sig!1)(s!1), ext(sig!1)(t!1))"
    :hide? nil)
   (assert)
   (replace -1)
   (prop)
   (expand* subset? union difference member)
   (skosimp)
   (split)
   (("1"
     (expand* VRan IUnion)
     (skosimp)
     (expand comp)
     (lemma dom_o)
     (inst -1 sig!2 sig!1)
     (expand* subset? union member)
     (inst -1 i!1)
     (assert)
     (split)
     (("1"
       (case "Dom(sig!1)(i!1)")
       (("1"
         (lemma rob_uni_alg_dom_subset_union_vars)
         (inst -1 "ext(sig!1)(s!1)" "ext(sig!1)(t!1)")
         (assert)
         (replace -4)
         (lemma unifiable_preserves_unifiability)
         (inst -1 s!1 t!1)
         (replace -6)
         (assert)
         (expand subset?)
         (inst -2 i!1)
         (expand* union member)
         (split)
         (("1"
           (lemma link_remove_x)
           (inst -1 i!1 s!1 t!1)
           (replace -7)
           (assert)
           (lemma unifiable_implies_not_fail)
           (inst -1 s!1 t!1)
           (replace -8)
           (assert)
           (expand member)
           (propax))
          ("2"
           (lemma link_remove_x)
           (inst -1 i!1 s!1 t!1)
           (replace -7)
           (assert)
           (lemma unifiable_implies_not_fail)
           (inst -1 s!1 t!1)
           (replace -8)
           (assert)
           (expand member)
           (propax))))
        ("2"
         (expand Dom 1)
         (flatten)
         (replace -1)
         (typepred i!1)
         (expand V)
         (expand ext -8)
         (assert)
         (hide-all-but (-4 -8 2))
         (inst 1 i!1))))
      ("2"
       (case "NOT member(x!1, Vars(sig!1(i!1)))")
       (("1"
         (lemma var_ext_term_exists_var_term)
         (inst -1 "sig!1(i!1)" "sig!2" "x!1")
         (expand member)
         (skosimp)
         (typepred y!1)
         (case "Dom(sig!2)(y!1)")
         (("1" (inst 3 y!1))
          ("2"
           (expand Dom 1)
           (flatten)
           (replace -1)
           (expand Vars -4)
           (skosimp)
           (case "p!1 = empty_seq")
           (("1"
             (replace -1)
             (expand subtermOF)
             (rewrite empty_0 -5)
             (replace -5 -4)
             (propax))
            ("2"
             (typepred p!1)
             (case "positionsOF(y!1) = only_empty_seq")
             (("1" (replace -1 -2) (expand only_empty_seq) (propax))
              ("2"
               (hide-all-but (-3 1))
               (expand* V positionsOF)
               (assert))))))))
        ("2" (inst 1 i!1) (expand member) (propax))))))
    ("2"
     (expand* VRan IUnion)
     (skosimp)
     (lemma dom_o)
     (inst -1 sig!2 sig!1)
     (expand* subset? union member)
     (inst -1 i!1)
     (assert)
     (split)
     (("1"
       (case "NOT Dom(sig!1)(i!1)")
       (("1"
         (expand Dom 1)
         (flatten)
         (expand comp)
         (replace -1)
         (hide-all-but (-2 -7 1))
         (typepred i!1)
         (hide -2)
         (expand* V ext)
         (assert)
         (inst 1 i!1))
        ("2"
         (lemma rob_uni_alg_dom_subset_union_vars)
         (inst -1 "ext(sig!1)(s!1)" "ext(sig!1)(t!1)")
         (assert)
         (replace -5)
         (lemma unifiable_preserves_unifiability)
         (inst -1 s!1 t!1)
         (replace -7)
         (assert)
         (expand* subset? union member)
         (inst -2 i!1)
         (assert)
         (lemma link_remove_x)
         (inst -1 i!1 s!1 t!1)
         (replace -8)
         (assert)
         (lemma unifiable_implies_not_fail)
         (inst -1 s!1 t!1)
         (replace -9)
         (assert)
         (expand member)
         (prop))))
      ("2"
       (lemma var_ext_term_exists_var_term)
       (expand comp -7)
       (inst -1 "sig!1(i!1)" sig!2 x!1)
       (expand member)
       (assert)
       (skosimp)
       (case "Dom(sig!2)(y!1)")
       (("1" (inst 1 y!1))
        ("2"
         (expand Dom 1)
         (flatten)
         (replace -1 -3)
         (expand Vars -3)
         (skosimp)
         (case "p!1 = empty_seq")
         (("1"
           (replace -1 -4)
           (expand subtermOF)
           (rewrite empty_0 -4)
           (expand Dom -6)
           (assert))
          ("2"
           (typepred p!1)
           (case "positionsOF(y!1) = only_empty_seq")
           (("1" (replace -1) (expand only_empty_seq) (propax))
            ("2"
             (hide-all-but 1)
             (typepred y!1)
             (expand* V positionsOF)
             (assert))))))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "Card(union(Vars(s), Vars(t)))" ("s" "t"))
   (("1"
     (case "x!1 = x!2")
     (("1"
       (hide -2)
       (expand subset?)
       (skosimp)
       (expand robinson_unification_algorithm)
       (assert)
       (hide-all-but -3)
       (expand* member VRan IUnion)
       (skosimp)
       (typepred i!1)
       (hide -1 -3)
       (expand* Dom identity))
      ("2"
       (name "sig!1" "link_of_frst_diff(x!1, x!2)")
       (("1"
         (name "p!1" "first_diff(x!1, x!2)")
         (inst -3 "ext(sig!1)(x!1)" "ext(sig!1)(x!2)")
         (lemma termination_lemma)
         (inst -1 x!1 x!2)
         (replace -3)
         (assert)
         (lemma unifiable_implies_not_fail)
         (inst -1 x!1 x!2)
         (replace -4)
         (assert)
         (hide -1)
         (lemma unifiable_preserves_unifiability)
         (inst -1 x!1 x!2)
         (replace -3)
         (assert)
         (name-replace "sig!2"
          "robinson_unification_algorithm(ext(sig!1)(x!1), ext(sig!1)(x!2))"
          :hide? nil)
         (expand robinson_unification_algorithm 3)
         (replace -4)
         (replace -1)
         (lift-if)
         (prop)
         (("1"
           (expand* subset? difference union member)
           (skosimp)
           (inst -7 x!3)
           (assert)
           (prop)
           (("1"
             (lemma link_of_frst_diff_s_is_subset_union)
             (inst -1 x!1 x!2)
             (assert)
             (replace -3)
             (expand* subset? union member)
             (inst -1 x!3)
             (assert))
            ("2"
             (lemma link_of_frst_diff_t_is_subset_union)
             (inst -1 x!1 x!2)
             (assert)
             (replace -3)
             (expand* subset? union member)
             (inst -1 x!3)
             (assert))
            ("3" (assert)) ("4" (assert))))
          ("2"
           (expand* subset? difference union member)
           (skosimp)
           (lemma "rob_uni_alg_vran_subset_union")
           (inst -1 x!1 x!2)
           (replace -6)
           (assert)
           (replace -3)
           (expand subset?)
           (inst -1 x!3)
           (expand member)
           (expand* difference union member)
           (prop)
           (("1"
             (inst -7 x!3)
             (assert)
             (prop)
             (("1"
               (hide-all-but (-1 -7 1 4))
               (lemma link_of_frst_diff_s_is_subset_union)
               (inst -1 x!1 x!2)
               (assert)
               (replace -3)
               (expand subset?)
               (inst -1 x!3)
               (expand* union member))
              ("2"
               (hide-all-but (-1 -7 2 4))
               (lemma link_of_frst_diff_t_is_subset_union)
               (inst -1 x!1 x!2)
               (assert)
               (replace -3)
               (expand subset?)
               (inst -1 x!3)
               (expand* union member))))
            ("2"
             (inst -8 x!3)
             (assert)
             (prop)
             (("1"
               (lemma dom_o)
               (inst -1 sig!2 sig!1)
               (expand subset?)
               (inst -1 x!3)
               (expand member)
               (expand union)
               (expand member)
               (assert)
               (hide-all-but (-1 -2 -9 2 3))
               (lemma link_remove_x)
               (inst -1 x!3 x!1 x!2)
               (replace -4)
               (assert)
               (expand member)
               (propax))
              ("2"
               (lemma dom_o)
               (inst -1 sig!2 sig!1)
               (expand subset?)
               (inst -1 x!3)
               (expand* union member)
               (assert)
               (lemma link_remove_x)
               (inst -1 x!3 x!1 x!2)
               (replace -10)
               (assert)
               (expand member)
               (propax))))
            ("3"
             (lemma dom_link_of_frst_diff_is)
             (inst -1 p!1 x!1 x!2)
             (assert)
             (replace -7)
             (expand* restrict singleton)
             (expand VRan -2)
             (expand IUnion)
             (skosimp)
             (prop)
             (("1"
               (decompose-equality -2)
               (inst -1 i!1)
               (assert)
               (replace -8 -3 rl)
               (expand link_of_frst_diff -3)
               (replace -7)
               (prop)
               (("1"
                 (expand Vars (-1 3))
                 (skosimp)
                 (typepred p!2)
                 (lemma pos_o_term)
                 (inst -1 p!1 p!2 x!2)
                 (assert)
                 (lemma position_t_first_diff)
                 (inst -1 x!1 x!2 p!1)
                 (assert)
                 (lemma pos_subterm)
                 (inst -1 p!1 p!2 x!2)
                 (assert)
                 (replace -1 -5 rl)
                 (hide-all-but (-5 3))
                 (inst 1 "p!1 o p!2"))
                ("2" (expand link_of_frst_diff -9) (assert))))
              ("2"
               (decompose-equality -1)
               (("1"
                 (inst -1 i!1)
                 (assert)
                 (replace -7 -2 rl)
                 (expand link_of_frst_diff -2)
                 (replace -6)
                 (case "vars?(subtermOF(x!2, p!1))")
                 (("1"
                   (assert)
                   (prop)
                   (("1"
                     (expand Vars (-1 3))
                     (skosimp)
                     (typepred p!2)
                     (lemma pos_o_term)
                     (inst -1 p!1 p!2 x!1)
                     (assert)
                     (lemma position_s_first_diff)
                     (inst -1 x!1 x!2 p!1)
                     (assert)
                     (lemma pos_subterm)
                     (inst -1 p!1 p!2 x!1)
                     (assert)
                     (replace -1 -5 rl)
                     (hide-all-but (-5 3))
                     (inst 1 "p!1 o p!2"))
                    ("2" (expand link_of_frst_diff -9) (assert))))
                  ("2"
                   (hide-all-but (-6 -9 1 2))
                   (lemma first_diff_unifiable_vars)
                   (inst -1 x!1 x!2 p!1)
                   (assert))))
                ("2"
                 (hide-all-but (-8 1))
                 (lemma position_t_first_diff)
                 (inst -1 x!1 x!2 p!1)
                 (assert))))))
            ("4"
             (lemma dom_o)
             (inst -1 sig!2 sig!1)
             (expand subset?)
             (inst -1 x!3)
             (expand member)
             (assert)
             (expand* union member)
             (hide-all-but (-1 -3 -8 3 4))
             (lemma dom_ran_link_disjoint)
             (inst -1 x!1 x!2)
             (replace -4)
             (assert)
             (expand* VRan IUnion)
             (skosimp)
             (inst -1 "x!3" "sig!1(i!1)")
             (("1" (hide-all-but (-2 1)) (expand member) (propax))
              ("2"
               (expand member)
               (expand Ran)
               (inst 1 i!1)
               (typepred i!1)
               (expand member)
               (propax))
              ("3" (expand member) (propax))))))))
        ("2" (assert))))))
    ("2"
     (hide 2)
     (rewrite finite_union)
     (("1" (rewrite vars_of_term_finite))
      ("2" (rewrite vars_of_term_finite))))
    ("3"
     (hide 2)
     (rewrite finite_union)
     (("1" (rewrite vars_of_term_finite))
      ("2" (rewrite vars_of_term_finite))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "Card(union(Vars(s), Vars(t)))" ("s" "t"))
   (("1"
     (prop)
     (("1"
       (expand robinson_unification_algorithm 2)
       (name-replace "sig!1" "link_of_frst_diff(x!1, x!2)" :hide? nil)
       (("1"
         (name-replace "sig!2"
          "robinson_unification_algorithm(ext(sig!1)(x!1),ext(sig!1)(x!2))"
          :hide? nil)
         (lift-if)
         (prop)
         (("1"
           (hide-all-but (-1 2))
           (expand unifiable)
           (inst 1 identity)
           (("1" (expand unifier) (grind))
            ("2"
             (expand Sub?)
             (case-replace "Dom(identity) = emptyset")
             (("1" (hide -) (grind))
              ("2" (hide -1 2) (expand* Dom emptyset) (grind))))))
          ("2"
           (inst -3 "ext(sig!1)(x!1)" "ext(sig!1)(x!2)")
           (lemma termination_lemma)
           (inst -1 x!1 x!2)
           (replace -3)
           (assert)
           (assert)
           (hide-all-but (-4 5))
           (expand* unifiable unifier)
           (skosimp)
           (inst 1 "comp(sigma!1, sig!1)")
           (("1" (rewrite ext_o) (expand o) (propax))
            ("2" (rewrite subs_o))))))
        ("2"
         (hide -1 3)
         (flatten)
         (expand unifiable)
         (inst 1 identity)
         (("1" (expand unifier) (grind))
          ("2"
           (hide -1)
           (expand Sub?)
           (case-replace "Dom(identity) = emptyset")
           (("1" (hide -1) (grind))
            ("2" (hide 2) (expand* Dom emptyset) (grind))))))))
      ("2"
       (hide -3)
       (lemma rob_uni_alg_dom_ran_disjoint)
       (inst -1 x!1 x!2)
       (assert)
       (name-replace "sig!1" "robinson_unification_algorithm(x!1, x!2)")
       (decompose-equality -2)
       (expand* subset? difference union member)
       (inst -2 xx)
       (inst -1 xx)
       (prop)
       (("1"
         (expand fail)
         (expand Dom)
         (flatten)
         (hide -1 -4)
         (replaces -1)
         (typepred xx)
         (expand V)
         (assert))
        ("2"
         (expand fail)
         (expand Dom)
         (flatten)
         (hide -1 -4)
         (replaces -1)
         (typepred xx)
         (expand V)
         (assert))
        ("3"
         (expand VRan)
         (expand IUnion)
         (inst 1 xx)
         (("1"
           (expand fail)
           (hide -2)
           (expand Vars)
           (inst 1 "#(1)")
           (("1"
             (expand subtermOF)
             (lift-if)
             (prop)
             (("1" (hide -2 1) (grind))
              ("2"
               (expand finseq_appl)
               (replaces -1)
               (hide 1)
               (case "args(app(ff,  #(xx)))`seq(first( #(1)) - 1) = xx")
               (("1"
                 (replaces -1)
                 (case "rest( #(1)) = empty_seq")
                 (("1"
                   (replaces -1)
                   (expand subtermOF)
                   (rewrite empty_0))
                  ("2" (hide 2) (grind))))
                ("2" (hide 2) (grind))
                ("3"
                 (hide 2)
                 (expand first)
                 (expand finseq_appl)
                 (prop)
                 (("1" (assert)) ("2" (expand "#") (assert))))))))
            ("2"
             (expand positionsOF)
             (lift-if)
             (prop)
             (("1" (assert))
              ("2"
               (decompose-equality -2)
               (hide -1 -2 -5 +)
               (expand "#")
               (assert))
              ("3"
               (hide -1 1)
               (expand* union IUnion member only_empty_seq)
               (flatten)
               (hide 1)
               (inst 1 1)
               (("1"
                 (expand catenate)
                 (inst 1 empty_seq)
                 (expand member)
                 (prop)
                 (("1"
                   (expand finseq_appl)
                   (expand positionsOF)
                   (lift-if)
                   (expand* union IUnion member only_empty_seq))
                  ("2" (grind))))
                ("2"
                 (reveal -1)
                 (decompose-equality -1)
                 (hide -1 -2)
                 (expand "#")
                 (decompose-equality -1)
                 (assert))))))))
          ("2"
           (hide -2)
           (expand Dom)
           (expand fail)
           (flatten)
           (replaces -1)
           (typepred xx)
           (expand V)
           (assert))))))))
    ("2"
     (hide 2)
     (rewrite finite_union)
     (("1" (rewrite vars_of_term_finite))
      ("2" (rewrite vars_of_term_finite))))
    ("3"
     (hide 2)
     (rewrite finite_union)
     (("1" (rewrite vars_of_term_finite))
      ("2" (rewrite vars_of_term_finite))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "Card(union(Vars(s), Vars(t)))" ("s" "t"))
   (("1"
     (case "x!1 = x!2")
     (("1"
       (hide -2)
       (expand "robinson_unification_algorithm")
       (assert)
       (prop)
       (("1" (expand* "member" "U" "unifier") (assert))
        ("2"
         (hide -1)
         (expand unifiable)
         (inst 1 identity)
         (("1" (expand unifier) (assert)) ("2" (rewrite iden_subs))))))
      ("2"
       (prop)
       (("1"
         (inst -2 "ext(link_of_frst_diff(x!1, x!2))(x!1)"
          "ext(link_of_frst_diff(x!1, x!2))(x!2)")
         (("1"
           (lemma termination_lemma)
           (inst -1 x!1 x!2)
           (("1"
             (assert)
             (lemma unifiable_implies_not_fail)
             (inst -1 x!1 x!2)
             (assert)
             (hide -1)
             (lemma unifiable_preserves_unifiability)
             (inst -1 x!1 x!2)
             (assert)
             (hide -1)
             (hide -1)
             (lemma "unifier_o")
             (inst -1 "x!1"
              "robinson_unification_algorithm(ext(link_of_frst_diff(x!1, x!2))(x!1),
                                                                                                            ext(link_of_frst_diff(x!1, x!2))(x!2))"
              "x!2" "link_of_frst_diff(x!1, x!2)")
             (assert)
             (hide -2)
             (expand "robinson_unification_algorithm" 2)
             (lift-if)
             (prop)
             (hide-all-but -1)
             (reveal -5)
             (lemma
              robinson_unification_algorithm_fails_iff_non_unifiable)
             (inst?)
             (assert))
            ("2" (assert))))
          ("2" (assert))))
        ("2" (hide -2 2) (expand* member U unifiable) (inst?))))))
    ("2"
     (hide 2)
     (rewrite finite_union)
     (("1" (rewrite vars_of_term_finite))
      ("2" (rewrite vars_of_term_finite))))
    ("3"
     (rewrite finite_union)
     (("1" (rewrite vars_of_term_finite))
      ("2" (rewrite vars_of_term_finite))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "Card(union(Vars(s), Vars(t)))" ("s" "t"))
   (("1"
     (case "x!1 = x!2")
     (("1"
       (hide -2)
       (skosimp)
       (expand "robinson_unification_algorithm")
       (assert)
       (expand <=)
       (inst?)
       (rewrite subs_o_identity))
      ("2"
       (skosimp)
       (inst -1 "ext(link_of_frst_diff(x!1, x!2))(x!1)"
        "ext(link_of_frst_diff(x!1, x!2))(x!2)")
       (("1"
         (lemma preserving_generality)
         (inst -1 rho!1 x!1 x!2)
         (("1"
           (assert)
           (skosimp)
           (name-replace "sig!1" "link_of_frst_diff(x!1, x!2)" :hide?
            nil)
           (inst -3 theta!1)
           (lemma termination_lemma)
           (inst -1 x!1 x!2)
           (assert)
           (split -1)
           (("1"
             (assert)
             (hide -1)
             (prop)
             (("1"
               (expand <=)
               (skosimp)
               (inst 2 tau!1)
               (expand robinson_unification_algorithm 2)
               (assert)
               (lift-if)
               (prop)
               (("1"
                 (lemma unifiable_implies_not_fail)
                 (inst?)
                 (assert)
                 (prop)
                 (hide-all-but (-5 1))
                 (expand* member U)
                 (expand unifiable)
                 (inst?))
                ("2"
                 (lemma
                  robinson_unification_algorithm_fails_iff_non_unifiable)
                 (inst?)
                 (prop)
                 (replace -4 1)
                 (hide-all-but (-5 -6 1))
                 (replaces -1)
                 (expand* member U)
                 (expand unifiable)
                 (inst 1 theta!1)
                 (expand unifier)
                 (rewrite ext_o)
                 (expand o)
                 (propax))
                ("3"
                 (replace -2 2)
                 (hide-all-but (-1 -3 2))
                 (replaces -1)
                 (rewrite o_ass))))
              ("2"
               (hide -1 2 3)
               (replaces -1)
               (expand* member U)
               (expand unifier)
               (rewrite ext_o)
               (expand o)
               (propax))))
            ("2"
             (lemma unifiable_implies_not_fail)
             (inst?)
             (assert)
             (split -1)
             (("1" (propax))
              ("2"
               (hide-all-but (-5 1))
               (expand* member U unifiable)
               (inst?))))))
          ("2" (assert))))
        ("2" (assert))))))
    ("2"
     (hide -1 2)
     (rewrite finite_union)
     (("1" (rewrite vars_of_term_finite))
      ("2" (rewrite vars_of_term_finite))))
    ("3"
     (hide 2)
     (rewrite finite_union)
     (("1" (rewrite vars_of_term_finite))
      ("2" (rewrite vars_of_term_finite))))
    ("4"
     (hide 2)
     (rewrite finite_union)
     (("1" (rewrite vars_of_term_finite))
      ("2" (rewrite vars_of_term_finite))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (ground)
   (("1"
     (expand mgu)
     (rewrite robinson_unification_algorithm_gives_unifier)
     (assert)
     (skeep)
     (rewrite robinson_unification_algorithm_gives_mg_subs))
    ("2"
     (lemma robinson_unification_algorithm_fails_iff_non_unifiable)
     (inst -1 s t)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma var_nonempty)
   (expand* nonempty? empty?)
   (skosimp*)
   (inst 1 x!1)
   (assert)
   (expand member)
   (propax))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma symbol_nonempty)
   (expand* nonempty? empty?)
   (skosimp)
   (expand member)
   (inst 1 x!1))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand Sub?)
   (case-replace
    "Dom((id[(V)]
                           WITH [xx
                                   := app[variable, symbol, arity]
                                          (ff,
                                            #[term[variable, symbol, arity]]
                                           (xx))])) = singleton(xx)")
   (("1" (hide -1) (rewrite finite_singleton))
    ("2"
     (hide 2)
     (decompose-equality)
     (iff)
     (prop)
     (("1" (expand singleton) (expand Dom) (flatten) (expand id) (grind))
      ("2"
       (expand* singleton Dom)
       (flatten)
       (grind)
       (replaces -1)
       (typepred xx)
       (expand V)
       (propax))))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "positions_of_arg")
   (inst -1 "s!1" "k!1")
   (("1"
     (typepred "k!1")
     (typepred st!1)
     (typepred stp!1)
     (replace -4 1)
     (assert))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "positions_of_arg")
   (inst -1 "t!1" "k!1")
   (("1" (typepred st!1) (typepred stp!1) (replace -5 1) (assert))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "<<")
   (lift-if)
   (prop)
   (("1" (hide-all-but (-1 -2)) (assert))
    ("2"
     (inst 2 k!1)
     (("1" (assert) (grind)) ("2" (replace -1 1) (assert))))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "positions_of_arg")
   (inst -1 "s!1" "kk!1")
   (("1" (replace -1 1) (assert)) ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "positions_of_arg")
   (inst -1 "t!1" "kk!1")
   (("1" (typepred "kk!1") (replace -4 1) (assert)) ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "st!1 = stp!1")
   (("1" (hide +) (grind))
    ("2"
     (decompose-equality 1)
     (decompose-equality 1)
     (typepred x!1)
     (expand* "nonempty?" "empty?")
     (inst -5 "x!1")
     (expand "member")
     (replace -2 -5)
     (replace -4 -5)
     (assert)
     (expand subtermOF)
     (lift-if)
     (assert)
     (grind))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma position_s_first_diff)
   (inst -1 s!1 t!1 fd!1)
   (assert)
   (typepred p!1)
   (hide -2)
   (hide -3)
   (lemma app_term)
   (inst -1 fd!1 p!1 s!1)
   (assert))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma position_t_first_diff)
   (inst -1 s!1 t!1 fd!1)
   (assert)
   (typepred p!1)
   (hide -1 -4)
   (lemma app_term)
   (inst -1 fd!1 p!1 t!1)
   (assert))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "Vars_is_var")
   (lemma "vars_of_term_finite")
   (inst -1 "sp!1")
   (inst -2 "sp!1")
   (assert)
   (expand* "Sub?" "Dom")
   (replaces -2)
   (expand "is_finite")
   (skosimp)
   (inst 2 "N!1" "f!1")
   (("1"
     (hide-all-but (-1 2))
     (expand "injective?")
     (skeep)
     (inst -1 "x1" "x2")
     (assert))
    ("2"
     (skeep)
     (prop)
     (("1"
       (assert)
       (replaces -1)
       (hide -2 -5 1)
       (lemma "first_diff_has_diff_argument")
       (inst -1 "s!1" "t!1" "k!1")
       (assert))
      ("2" (assert))))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "Vars_is_var")
   (lemma "vars_of_term_finite")
   (inst -1 "tp!1")
   (inst -2 "tp!1")
   (assert)
   (expand* "Sub?" "Dom")
   (replaces -2)
   (expand "is_finite")
   (skosimp)
   (inst 3 "N!1" "f!1")
   (("1"
     (hide-all-but (-1 3))
     (expand "injective?")
     (skeep)
     (inst -1 "x1" "x2")
     (assert))
    ("2" (skeep) (prop) (("1" (assert)) ("2" (assert))))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (rewrite "finite_union")
   (("1" (hide -1 2) (rewrite "vars_of_term_finite"))
    ("2" (hide -1 2) (rewrite "vars_of_term_finite"))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (hide -)
   (rewrite "finite_union")
   (("1" (hide 2) (rewrite "vars_of_term_finite"))
    ("2" (hide 2) (rewrite "vars_of_term_finite"))))


proof_type: t_proof
decl_type: tcc
library: TRS
theory: robinsonunification
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (rewrite "finite_union")
   (("1" (hide 2) (rewrite "vars_of_term_finite"))
    ("2" (hide 2) (rewrite "vars_of_term_finite"))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "length(p)" ("s" "p"))
   (expand* subset? member)
   (skosimp)
   (expand right_pos -2)
   (expand* union IUnion member)
   (prop)
   (("1"
     (hide -1 -3)
     (expand only_empty_seq)
     (replaces -1)
     (expand positionsOF)
     (lift-if)
     (expand only_empty_seq)
     (prop)
     (expand union)
     (flatten)
     (hide 3)
     (expand member)
     (propax))
    ("2" (hide -2) (expand singleton) (assert))
    ("3"
     (inst -2 "x!1" "delete(x!2, length(x!2) - 1)")
     (("1"
       (expand delete -2 1)
       (lemma empty_0[posnat])
       (inst -1 x!2)
       (assert)
       (inst -2 x!3)
       (assert))
      ("2" (rewrite delete_is_position) (flatten) (rewrite empty_0))
      ("3" (lemma empty_0[posnat]) (inst -1 x!2) (assert))))
    ("4"
     (skosimp*)
     (hide -3)
     (name-replace "pi"
      "add_last(delete(x!2, length(x!2) - 1), 1 + i!1 + last(x!2))"
      :hide? nil)
     (("1"
       (case "pi = delete(x!2, length(x!2) - 1) o  #(1 + i!1 + last(x!2))")
       (("1"
         (replace -1 -4 rl)
         (hide -2)
         (lemma pos_o_term)
         (inst -1 pi q1!1 x!1)
         (assert)
         (lemma right_pos_TCC5)
         (inst -1 x!1 x!2)
         (assert)
         (inst -1 "delete(x!2, length(x!2) - 1)")
         (("1"
           (inst -1 "last(x!2)")
           (inst -1
            "arity(f(subtermOF(x!1, delete(x!2, length(x!2) - 1))))")
           (("1" (inst -1 i!1) (assert) (reveal -7) (assert))
            ("2"
             (lemma right_pos_TCC3)
             (inst -1 x!1 x!2)
             (assert)
             (inst -1 "delete(x!2, length(x!2) - 1)")
             (("1" (inst -1 "last(x!2)"))
              ("2"
               (hide-all-but (1 4))
               (lemma empty_0[posnat])
               (inst -1 x!2)
               (assert))))
            ("3"
             (rewrite delete_is_position)
             (hide-all-but (1 4))
             (flatten)
             (rewrite empty_0))
            ("4"
             (hide-all-but (1 3))
             (lemma empty_0[posnat])
             (inst -1 x!2)
             (assert))))
          ("2"
           (hide-all-but (1 3))
           (lemma empty_0[posnat])
           (inst -1 x!2)
           (assert))))
        ("2"
         (replace -1 1 rl)
         (hide - 2 3)
         (grind)
         (decompose-equality)
         (("1"
           (reveal 1)
           (lemma empty_0[posnat])
           (inst -1 x!2)
           (assert)
           (assert)
           (lift-if)
           (prop)
           (grind)
           (typepred x!4)
           (assert))
          ("2" (skosimp) (grind))
          ("3"
           (skosimp)
           (reveal 1)
           (hide 2)
           (lemma empty_0[posnat])
           (inst -1 x!2)
           (assert))
          ("4"
           (skosimp)
           (reveal 1)
           (lemma empty_0[posnat])
           (inst -1 x!2)
           (assert))
          ("5" (reveal 1) (lemma empty_0[posnat]) (inst -1 x!2) (assert))
          ("6"
           (skosimp)
           (typepred i!2)
           (lemma empty_0[posnat])
           (reveal 1)
           (inst -1 x!2)
           (assert))
          ("7"
           (skosimp)
           (reveal 1)
           (lemma empty_0[posnat])
           (inst -1 x!2)
           (assert))
          ("8"
           (skosimp)
           (reveal 1)
           (lemma empty_0[posnat])
           (inst -1 x!2)
           (assert))
          ("9"
           (reveal 1)
           (lemma empty_0[posnat])
           (inst -1 x!2)
           (assert))))
        ("3"
         (hide-all-but (1 2))
         (lemma empty_0[posnat])
         (inst -1 x!2)
         (assert))))
      ("2"
       (hide-all-but (1 2))
       (lemma empty_0[posnat])
       (inst -1 x!2)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+
    "IF p = empty_seq
                      THEN lex2(0,0)
                      ELSE  lex2(length(p),
                                 arity(f(subtermOF(s,delete(p,length(p) - 1)))) - last(p))
                      ENDIF"
    ("s" "t" "p"))
   (("1"
     (case "x!3 = empty_seq")
     (("1" (hide -2) (expand next_position) (assert))
      ("2"
       (expand next_position 2 1)
       (assert)
       (lift-if)
       (prop)
       (("1" (expand next_position 2) (assert))
        ("2"
         (hide -3)
         (expand next_position 2)
         (assert)
         (case "positionsOF(x!2)
                                                 (add_last(delete(x!3, length(x!3) - 1),
                                                           1 + last(x!3)))")
         (("1" (assert))
          ("2"
           (hide 3)
           (lemma next_position_TCC15)
           (inst -1 x!1 x!2 x!3)
           (assert)
           (inst -1 "delete(x!3, length(x!3) - 1)")
           (("1"
             (assert)
             (inst -1
              "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
             (("1" (assert))
              ("2"
               (hide-all-but (1 4))
               (lemma empty_0[posnat])
               (inst -1 x!3)
               (assert))))
            ("2"
             (hide-all-but (1 4))
             (lemma empty_0[posnat])
             (inst -1 x!3)
             (assert))))
          ("3"
           (hide-all-but (1 4))
           (lemma empty_0[posnat])
           (inst -1 x!3)
           (assert))))
        ("3"
         (inst -4 x!1 x!2
          " add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
         (("1"
           (assert)
           (case "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3)) = empty_seq")
           (("1" (hide-all-but -1) (grind))
            ("2"
             (assert)
             (lemma next_position_TCC17)
             (inst -1 x!1 x!2 x!3)
             (assert)
             (inst -1 "delete(x!3, length(x!3) - 1)")
             (("1"
               (assert)
               (inst -1
                "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
               (("1"
                 (assert)
                 (expand next_position 2 2)
                 (case "positionsOF(x!2)
                                                                 (add_last(delete(x!3, length(x!3) - 1),
                                                                           1 + last(x!3)))")
                 (("1" (assert))
                  ("2"
                   (hide -1 -2 -5 2 3)
                   (lemma next_position_TCC15)
                   (inst -1 x!1 x!2 x!3)
                   (assert)
                   (inst -1 "delete(x!3, length(x!3) - 1)")
                   (("1"
                     (assert)
                     (inst -1
                      "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
                     (("1" (assert))
                      ("2"
                       (hide-all-but (1 3))
                       (lemma empty_0[posnat])
                       (inst -1 x!3)
                       (assert))))
                    ("2"
                     (hide-all-but (1 3))
                     (lemma empty_0[posnat])
                     (inst -1 x!3)
                     (assert))))))
                ("2"
                 (hide-all-but (1 4))
                 (lemma empty_0[posnat])
                 (inst -1 x!3)
                 (assert))))
              ("2"
               (hide-all-but (1 4))
               (lemma empty_0[posnat])
               (inst -1 x!3)
               (assert))))
            ("3"
             (hide-all-but (1 3))
             (lemma empty_0[posnat])
             (inst -1 x!3)
             (assert))))
          ("2"
           (hide-all-but (1 3))
           (lemma empty_0[posnat])
           (inst -1 x!3)
           (assert))))
        ("4"
         (inst -2 x!1 x!2 "delete(x!3, length(x!3) - 1)")
         (("1"
           (assert)
           (split)
           (("1"
             (expand next_position 2 2)
             (assert)
             (case "positionsOF(x!2)
                                                         (add_last(delete(x!3, length(x!3) - 1),
                                                                   1 + last(x!3)))")
             (("1"
               (hide -2 1 2)
               (lemma next_position_TCC15)
               (inst -1 x!2 x!1 x!3)
               (assert)
               (inst -1 "delete(x!3, length(x!3) - 1)")
               (("1"
                 (assert)
                 (inst -1
                  "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
                 (("1" (assert))
                  ("2"
                   (hide-all-but (1 3))
                   (lemma empty_0[posnat])
                   (inst -1 x!3)
                   (assert))))
                ("2"
                 (hide-all-but (1 3))
                 (lemma empty_0[posnat])
                 (inst -1 x!3)
                 (assert))))
              ("2" (assert))
              ("3"
               (hide-all-but (1 5))
               (lemma empty_0[posnat])
               (inst -1 x!3)
               (assert))))
            ("2"
             (rewrite lex2_lt)
             (("1"
               (flatten)
               (hide-all-but (1 6))
               (expand delete)
               (rewrite empty_0)
               (assert))
              ("2"
               (hide -1 2 4 5)
               (lemma next_position_TCC5)
               (inst -1 x!1 x!2 x!3)
               (assert))
              ("3"
               (hide -1 2 4 5)
               (lemma next_position_TCC5)
               (inst -1 x!1 x!2 "delete(x!3, length(x!3) - 1)")
               (("1" (assert))
                ("2"
                 (hide 2)
                 (rewrite delete_is_position)
                 (("1"
                   (rewrite delete_is_position)
                   (flatten)
                   (rewrite empty_0))
                  ("2" (flatten) (rewrite empty_0))))
                ("3"
                 (hide 2 3)
                 (lemma empty_0[posnat])
                 (inst -1 x!3)
                 (assert))))
              ("4"
               (hide -1 2 4 5)
               (lemma empty_0[posnat])
               (inst -1 "delete(x!3, length(x!3) - 1)")
               (("1" (assert))
                ("2"
                 (hide 2 3)
                 (lemma empty_0[posnat])
                 (inst -1 x!3)
                 (assert))))
              ("5"
               (hide-all-but (1 6))
               (lemma empty_0[posnat])
               (inst -1 x!3)
               (assert))))))
          ("2"
           (hide-all-but (1 5))
           (lemma empty_0[posnat])
           (inst -1 x!3)
           (assert))))
        ("5"
         (expand next_position 1)
         (assert)
         (case "positionsOF(x!2)
                                                 (add_last(delete(x!3, length(x!3) - 1),
                                                           1 + last(x!3)))")
         (("1"
           (hide -2 -4 1)
           (lemma next_position_TCC15)
           (inst -1 x!2 x!1 x!3)
           (assert)
           (inst -1 "delete(x!3, length(x!3) - 1)")
           (("1"
             (assert)
             (inst -1
              "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
             (("1" (assert))
              ("2"
               (hide-all-but (1 3))
               (lemma empty_0[posnat])
               (inst -1 x!3)
               (assert))))
            ("2"
             (hide-all-but (1 3))
             (lemma empty_0[posnat])
             (inst -1 x!3)
             (assert))))
          ("2" (assert))
          ("3"
           (hide-all-but (1 4))
           (lemma empty_0[posnat])
           (inst -1 x!3)
           (assert))))))))
    ("2"
     (hide 3)
     (lemma next_position_TCC5)
     (inst -1 x!1 x!2 x!3)
     (assert))
    ("3" (hide 2) (rewrite empty_0))
    ("4"
     (hide 3)
     (lemma next_position_TCC3)
     (inst -1 x!1 x!2 x!3)
     (assert))
    ("5"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("6" (hide 3) (lemma empty_0[posnat]) (inst -1 x!3) (assert))
    ("7"
     (hide 3)
     (lemma next_position_TCC5)
     (inst -1 y!1 y!2 y!3)
     (assert))
    ("8" (hide 2) (rewrite empty_0))
    ("9"
     (hide 3)
     (lemma next_position_TCC3)
     (inst -1 y!1 y!2 y!3)
     (assert))
    ("10"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("11" (hide 3) (lemma empty_0[posnat]) (inst -1 y!3) (assert))
    ("12"
     (hide 3)
     (lemma next_position_TCC5)
     (inst -1 "x!1`1" "x!1`2" "x!1`3")
     (assert))
    ("13" (hide 2) (rewrite empty_0))
    ("14"
     (hide 3)
     (lemma next_position_TCC3)
     (inst -1 "x!1`1" "x!1`2" "x!1`3")
     (assert))
    ("15"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("16" (hide 3) (lemma empty_0[posnat]) (inst -1 "x!1`3") (assert))
    ("17"
     (hide 3)
     (lemma next_position_TCC5)
     (inst -1 "y!1`1" "y!1`2" "y!1`3")
     (assert))
    ("18" (hide 2) (rewrite empty_0))
    ("19"
     (hide 3)
     (lemma next_position_TCC3)
     (inst -1 "y!1`1" "y!1`2" "y!1`3")
     (assert))
    ("20"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("21" (hide 3) (lemma empty_0[posnat]) (inst -1 "y!1`3") (assert))
    ("22"
     (hide 3)
     (lemma next_position_TCC5)
     (inst -1 "s!1" "t!1" "p!1")
     (assert))
    ("23" (hide 2) (rewrite empty_0))
    ("24"
     (hide 3)
     (lemma next_position_TCC3)
     (inst -1 "s!1" "t!1" "p!1")
     (assert))
    ("25"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("26" (hide 3) (lemma empty_0[posnat]) (inst -1 "p!1") (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+
    "IF p = empty_seq
                    THEN lex2(0,0)
                    ELSE  lex2(length(p),
                               arity(f(subtermOF(s,delete(p,length(p) - 1)))) - last(p))
                    ENDIF"
    ("s" "t" "p"))
   (("1"
     (case "x!3 = empty_seq")
     (("1" (hide -2 -4) (expand next_position) (assert))
      ("2"
       (expand next_position 2)
       (assert)
       (prop)
       (("1"
         (hide -1)
         (rewrite delete_is_position)
         (flatten)
         (rewrite empty_0))
        ("2"
         (inst -4 x!1 x!2
          " add_last(delete(x!3, length(x!3) - 1),
                                                                   1 + last(x!3))")
         (("1"
           (assert)
           (lift-if)
           (prop)
           (("1" (hide -2 -3 -4 -5 -6 1 2 3) (grind))
            ("2"
             (lemma next_position_TCC17)
             (inst -1 x!1 x!2 x!3)
             (assert)
             (inst -1 "delete(x!3, length(x!3) - 1)")
             (("1"
               (assert)
               (inst -1
                "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
               (("1" (assert))
                ("2"
                 (hide-all-but (1 5))
                 (lemma empty_0[posnat])
                 (inst -1 x!3)
                 (assert))))
              ("2"
               (hide-all-but (1 5))
               (lemma empty_0[posnat])
               (inst -1 x!3)
               (assert))))))
          ("2"
           (hide-all-but (1 3))
           (lemma empty_0[posnat])
           (inst -1 x!3)
           (assert))))
        ("3"
         (hide 3)
         (inst -2 x!1 x!2 "delete(x!3, length(x!3) - 1)")
         (("1"
           (assert)
           (hide -1 2)
           (rewrite lex2_lt)
           (("1"
             (flatten)
             (hide 1 4)
             (expand delete)
             (lemma empty_0[posnat])
             (inst -1 x!3)
             (assert))
            ("2"
             (hide 4)
             (lemma next_position_TCC5)
             (inst -1 x!1 x!2 x!3)
             (assert))
            ("3"
             (hide 4)
             (lemma next_position_TCC5)
             (inst -1 x!1 x!2 "delete(x!3, length(x!3) - 1)")
             (("1" (assert))
              ("2"
               (hide 2)
               (rewrite delete_is_position)
               (("1"
                 (rewrite delete_is_position)
                 (flatten)
                 (rewrite empty_0))
                ("2" (flatten) (rewrite empty_0))))
              ("3"
               (hide 2 3)
               (lemma empty_0[posnat])
               (inst -1 x!3)
               (assert))))
            ("4"
             (hide 4)
             (lemma empty_0[posnat])
             (inst -1 "delete(x!3, length(x!3) - 1)")
             (("1" (assert))
              ("2"
               (hide 2 3)
               (lemma empty_0[posnat])
               (inst -1 x!3)
               (assert))))
            ("5"
             (hide 2 4)
             (lemma empty_0[posnat])
             (inst -1 x!3)
             (assert))))
          ("2"
           (hide-all-but (1 4))
           (lemma empty_0[posnat])
           (inst -1 x!3)
           (assert))))
        ("4"
         (hide-all-but 1)
         (expand positionsOF)
         (lift-if)
         (expand* union IUnion member only_empty_seq))))))
    ("2"
     (hide 3)
     (lemma next_position_TCC5)
     (inst -1 x!1 x!2 x!3)
     (assert))
    ("3" (hide 2) (rewrite empty_0))
    ("4"
     (hide 3)
     (lemma next_position_TCC3)
     (inst -1 x!1 x!2 x!3)
     (assert))
    ("5"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("6" (hide 3) (lemma empty_0[posnat]) (inst -1 x!3) (assert))
    ("7"
     (hide 3)
     (lemma next_position_TCC5)
     (inst -1 y!1 y!2 y!3)
     (assert))
    ("8" (hide 2) (rewrite empty_0))
    ("9"
     (hide 3)
     (lemma next_position_TCC3)
     (inst -1 y!1 y!2 y!3)
     (assert))
    ("10"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("11" (hide 3) (lemma empty_0[posnat]) (inst -1 y!3) (assert))
    ("12"
     (hide 3)
     (lemma next_position_TCC5)
     (inst -1 "x!1`1" "x!1`2" "x!1`3")
     (assert))
    ("13" (hide 2) (rewrite empty_0))
    ("14"
     (hide 3)
     (lemma next_position_TCC3)
     (inst -1 "x!1`1" "x!1`2" "x!1`3")
     (assert))
    ("15"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("16" (hide 3) (lemma empty_0[posnat]) (inst -1 "x!1`3") (assert))
    ("17"
     (hide 3)
     (lemma next_position_TCC5)
     (inst -1 "y!1`1" "y!1`2" "y!1`3")
     (assert))
    ("18" (hide 2) (rewrite empty_0))
    ("19"
     (hide 3)
     (lemma next_position_TCC3)
     (inst -1 "y!1`1" "y!1`2" "y!1`3")
     (assert))
    ("20"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("21" (hide 3) (lemma empty_0[posnat]) (inst -1 "y!1`3") (assert))
    ("22"
     (hide 3)
     (lemma next_position_TCC5)
     (inst -1 "s!1" "t!1" "p!1")
     (assert))
    ("23" (hide 2) (rewrite empty_0))
    ("24"
     (hide 3)
     (lemma next_position_TCC3)
     (inst -1 "s!1" "t!1" "p!1")
     (assert))
    ("25"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("26" (hide 3) (lemma empty_0[posnat]) (inst -1 "p!1") (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma empty_0[posnat])
   (measure-induct+
    "lex2(length(p),  arity(f(subtermOF(s,delete(p,length(p) - 1)))) - last(p))"
    ("s" "t" "p"))
   (("1"
     (name-replace "p!1" "next_position(x!1, x!2, x!3)" :hide? nil)
     (inst -3 x!3)
     (assert)
     (ground)
     (("1"
       (expand next_position -1)
       (lift-if)
       (ground)
       (("1"
         (hide -2 1 2)
         (replace -1 1 rl)
         (hide -1)
         (expand delete)
         (assert))
        ("2"
         (hide -2 -3 -4 1 3)
         (replace -1 1 rl)
         (hide -1)
         (expand* add_last delete insert? finseq_appl))
        ("3"
         (inst -5 "x!1" "x!2"
          "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
         (("1"
           (replace -2 -5)
           (split -5)
           (("1"
             (case "length(add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))) = length(x!3)")
             (("1" (assert))
              ("2"
               (hide - 2 3)
               (expand* add_last delete insert? finseq_appl))))
            ("2"
             (flatten)
             (case "length(add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))) = length(x!3)")
             (("1" (assert))
              ("2"
               (hide - 2 3)
               (expand* add_last delete insert? finseq_appl))))
            ("3"
             (hide -2 2 3)
             (lemma next_position_TCC17)
             (inst -1 x!1 x!2 x!3)
             (assert)
             (inst -1 "delete(x!3, length(x!3) - 1)")
             (assert)
             (inst -1
              "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
             (assert)
             (lift-if)
             (prop)
             (hide-all-but (-1 2))
             (expand* add_last insert? finseq_appl)
             (decompose-equality)
             (hide -2)
             (lemma empty_0[posnat])
             (inst -1 empty_seq)
             (assert))))
          ("2"
           (lemma next_position_TCC15)
           (inst -1 x!1 x!2 x!3)
           (assert)
           (inst -1 "delete(x!3, length(x!3) - 1)")
           (assert)
           (inst -1
            "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
           (assert)
           (hide - 2 3)
           (expand* add_last delete insert? finseq_appl)
           (decompose-equality)
           (hide -2)
           (lemma empty_0[posnat])
           (inst -1 empty_seq)
           (assert))))
        ("4"
         (inst -3 x!1 x!2 "delete(x!3, length(x!3) - 1)")
         (("1"
           (replace -1 -3)
           (split -3)
           (("1" (expand delete -1) (assert))
            ("2" (flatten) (expand delete -1) (assert))
            ("3"
             (assert)
             (hide -1 4 5)
             (lemma next_position_TCC19)
             (inst -1 x!1 x!2 x!3)
             (assert)
             (inst -1 "delete(x!3, length(x!3) - 1)")
             (assert)
             (inst -1
              "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))"))))
          ("2"
           (rewrite delete_is_position)
           (rewrite delete_is_position))))
        ("5"
         (hide -1 -3 -4 1)
         (lemma empty_0[posnat])
         (inst -1 p!1)
         (assert))))
      ("2"
       (expand next_position -1)
       (lift-if)
       (ground)
       (("1"
         (hide -2 1 2)
         (replace -1 1 rl)
         (hide -1)
         (expand delete)
         (assert))
        ("2"
         (hide -2 -3 -4 1 3)
         (replace -1 1 rl)
         (hide -1)
         (expand* add_last delete insert? finseq_appl)
         (grind))
        ("3"
         (inst -5 x!1 x!2
          "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
         (("1"
           (replace -2 -5)
           (split -5)
           (("1"
             (hide-all-but (-1 2 3))
             (expand* add_last delete insert? finseq_appl))
            ("2"
             (flatten)
             (hide -1 -3 -4 -5 -6 2)
             (case "last(add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))) = 1 + last(x!3)")
             (("1" (replaces -1) (assert))
              ("2"
               (hide-all-but 1)
               (expand* add_last delete insert? finseq_appl)
               (assert)
               (grind))))
            ("3"
             (lemma next_position_TCC17)
             (inst -1 x!1 x!2 x!3)
             (assert)
             (inst -1 "delete(x!3, length(x!3) - 1)")
             (assert)
             (inst -1
              "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
             (assert)
             (lift-if)
             (prop)
             (hide -2 -3 -4 -5 -6 1 2 4)
             (expand* add_last delete insert? finseq_appl)
             (decompose-equality)
             (hide -2)
             (lemma empty_0[posnat])
             (inst -1 empty_seq)
             (assert))))
          ("2"
           (lemma next_position_TCC15)
           (inst -1 x!1 x!2 x!3)
           (assert)
           (inst -1 "delete(x!3, length(x!3) - 1)")
           (assert)
           (inst -1
            "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
           (assert)
           (hide - 2 3)
           (expand* add_last delete insert? finseq_appl)
           (decompose-equality)
           (hide -2)
           (lemma empty_0[posnat])
           (inst -1 empty_seq)
           (assert))))
        ("4"
         (inst -3 "x!1" "x!2" "delete(x!3, length(x!3) - 1)")
         (("1"
           (lemma next_position_TCC19)
           (inst -1 x!1 x!2 x!3)
           (assert)
           (inst -1 "delete(x!3, length(x!3) - 1)")
           (assert)
           (inst -1
            "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
           (assert)
           (hide -1)
           (replace -1 -3)
           (prop)
           (("1"
             (case "length(delete(x!3, length(x!3) - 1)) < length(x!3)")
             (("1" (assert))
              ("2" (hide-all-but (1 6)) (expand delete) (assert))))
            ("2"
             (case "length(delete(x!3, length(x!3) - 1)) < length(x!3)")
             (("1" (assert))
              ("2" (hide-all-but (1 6)) (expand delete) (assert))))))
          ("2"
           (rewrite delete_is_position)
           (rewrite delete_is_position))))
        ("5"
         (hide-all-but (-2 3 4))
         (lemma empty_0[posnat])
         (inst -1 p!1)
         (assert))))))
    ("2" (hide -2 1 2) (inst -3 y!3) (assert))
    ("3" (hide-all-but (-3 -4)) (inst -2 y!3) (assert))
    ("4"
     (hide -1 2)
     (lemma next_position_TCC5)
     (inst -1 x!1 x!2 x!3)
     (assert))
    ("5" (hide 1) (inst -2 x!3) (assert))
    ("6"
     (hide 2)
     (lemma next_position_TCC12)
     (inst -1 x!1 x!2 x!3)
     (assert)
     (inst -1 "delete(x!3, length(x!3) - 1)")
     (inst -1 x!3)
     (assert))
    ("7" (hide 2) (rewrite delete_is_position) (inst -1 x!3) (assert))
    ("8" (hide 2) (inst -1 x!3) (assert))
    ("9"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 y!1 y!2 y!3)
     (assert))
    ("10" (hide 1) (inst -2 y!3) (assert))
    ("11"
     (hide 2)
     (lemma next_position_TCC12)
     (inst -1 y!1 y!2 y!3)
     (assert)
     (inst -1 "delete(y!3, length(y!3) - 1)")
     (inst -1 y!3)
     (assert))
    ("12" (hide 2) (rewrite delete_is_position) (inst -1 y!3) (assert))
    ("13" (hide 2) (inst -1 y!3) (assert))
    ("14" (hide -2 2) (inst -3 "x!1`3") (assert))
    ("15" (hide-all-but (-3 -4)) (inst -2 "x!1`3") (assert))
    ("16" (hide-all-but (-1 -3 -4)) (inst -3 "y!1`3") (assert))
    ("17" (hide-all-but (-3 -4)) (inst -2 "y!1`3") (assert))
    ("18"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 "x!1`1" "x!1`2" "x!1`3")
     (assert))
    ("19" (hide 1) (inst -2 "x!1`3") (assert))
    ("20"
     (hide 2)
     (lemma next_position_TCC12)
     (inst -1 "x!1`1" "x!1`2" "x!1`3")
     (assert)
     (inst -1 "delete(x!1`3, length(x!1`3) - 1)")
     (inst -1 "x!1`3")
     (assert))
    ("21"
     (hide 2)
     (rewrite delete_is_position)
     (inst -1 "x!1`3")
     (assert))
    ("22" (hide 2) (inst -1 "x!1`3") (assert))
    ("23"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 "y!1`1" "y!1`2" "y!1`3")
     (assert))
    ("24" (hide 1) (inst -2 "y!1`3") (assert))
    ("25"
     (hide 2)
     (lemma next_position_TCC12)
     (inst -1 "y!1`1" "y!1`2" "y!1`3")
     (assert)
     (inst -1 "delete(y!1`3, length(y!1`3) - 1)")
     (inst -1 "y!1`3")
     (assert))
    ("26"
     (hide 2)
     (rewrite delete_is_position)
     (inst -1 "y!1`3")
     (assert))
    ("27" (hide 2) (inst -1 "y!1`3") (assert))
    ("28" (hide +) (inst -3 p!1) (assert))
    ("29" (hide -1 +) (inst -2 p!1) (assert))
    ("30"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 s!1 t!1 p!1)
     (assert))
    ("31" (hide 1) (inst -2 p!1) (assert))
    ("32"
     (hide 2)
     (lemma next_position_TCC12)
     (inst -1 s!1 t!1 p!1)
     (assert)
     (inst -1 "delete(p!1, length(p!1) - 1)")
     (inst -1 p!1)
     (assert))
    ("33" (hide 2) (rewrite delete_is_position) (inst -1 p!1) (assert))
    ("34" (inst -1 p!1) (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "next_pos_length_and_last")
   (inst -1 s!1 t!1 p!1)
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "length(p)" ("s" "p"))
   (skosimp)
   (expand member)
   (prop)
   (("1"
     (expand right_pos -1)
     (prop)
     (("1" (hide 2 -3) (expand only_empty_seq) (assert))
      ("2"
       (expand union)
       (prop)
       (("1"
         (expand member)
         (prop)
         (("1" (hide -2 1 3) (expand singleton) (assert))
          ("2"
           (inst -2 x!1 "delete(x!2, length(x!2) - 1)")
           (("1"
             (inst -2 q!1)
             (expand delete -2 1)
             (rewrite empty_0)
             (assert)
             (prop)
             (("1"
               (hide -2)
               (expand left_pos)
               (skosimp)
               (prop)
               (("1"
                 (inst 5 r!1 "p1!1 o #(last(x!2))" q1!1)
                 (("1"
                   (flatten)
                   (hide 6)
                   (assert)
                   (prop)
                   (("1" (hide-all-but -1) (grind))
                    ("2"
                     (rewrite o_assoc)
                     (replace -2 1 rl)
                     (hide - 2 3 5)
                     (expand delete)
                     (rewrite empty_0)
                     (expand finseq_appl)
                     (decompose-equality)
                     (("1" (grind))
                      ("2"
                       (decompose-equality)
                       (("1" (grind))
                        ("2"
                         (lemma empty_0[posnat])
                         (inst -1 x!2)
                         (assert))))
                      ("3"
                       (lemma empty_0[posnat])
                       (inst -1 x!2)
                       (assert))))))
                  ("2"
                   (hide-all-but (1 4))
                   (flatten)
                   (rewrite empty_0))))
                ("2"
                 (inst 6 r!1 "p1!1 o #(last(x!2))" q1!1)
                 (("1"
                   (flatten)
                   (hide 6)
                   (assert)
                   (prop)
                   (("1"
                     (rewrite o_assoc)
                     (replace -2 1 rl)
                     (hide - 2 3 4 6)
                     (expand delete)
                     (rewrite empty_0)
                     (expand finseq_appl)
                     (decompose-equality)
                     (("1" (grind))
                      ("2"
                       (decompose-equality)
                       (("1" (grind))
                        ("2"
                         (lemma empty_0[posnat])
                         (inst -1 x!2)
                         (assert))))
                      ("3"
                       (lemma empty_0[posnat])
                       (inst -1 x!2)
                       (assert))))
                    ("2" (hide-all-but -1) (grind))
                    ("3"
                     (rewrite first_compo)
                     (hide-all-but (1 4))
                     (flatten)
                     (rewrite empty_0))))
                  ("2"
                   (hide-all-but (1 5))
                   (flatten)
                   (rewrite empty_0))))))
              ("2"
               (hide -2 1)
               (expand left_pos)
               (inst 3 "delete(x!2, length(x!2) - 1)" "#(last(x!2))"
                empty_seq)
               (("1"
                 (assert)
                 (prop)
                 (("1" (hide-all-but -1) (grind))
                  ("2"
                   (hide -1 3)
                   (expand delete)
                   (rewrite empty_0)
                   (decompose-equality)
                   (("1" (grind))
                    ("2"
                     (decompose-equality)
                     (("1" (grind))
                      ("2"
                       (lemma empty_0[posnat])
                       (inst -1 x!2)
                       (assert))))
                    ("3"
                     (lemma empty_0[posnat])
                     (inst -1 x!2)
                     (assert))))))
                ("2" (hide -1 3) (flatten) (rewrite empty_0))
                ("3"
                 (hide -1 3)
                 (lemma empty_0[posnat])
                 (inst -1 x!2)
                 (assert))))))
            ("2"
             (rewrite delete_is_position)
             (hide-all-but (1 3))
             (flatten)
             (rewrite empty_0))
            ("3"
             (hide-all-but (1 2))
             (lemma empty_0[posnat])
             (inst -1 x!2)
             (assert))))))
        ("2"
         (hide -2)
         (expand* member IUnion)
         (skosimp*)
         (expand left_pos)
         (inst 3 "delete(x!2, length(x!2) - 1)" "#(last(x!2))"
          "#(1 + i!1 + last(x!2)) o q1!1")
         (("1"
           (flatten)
           (hide 3)
           (prop)
           (("1"
             (hide -1 3)
             (replaces -1)
             (expand delete)
             (rewrite empty_0)
             (assert)
             (decompose-equality)
             (("1" (grind))
              ("2"
               (decompose-equality)
               (("1" (grind))
                ("2" (lemma empty_0[posnat]) (inst -1 x!2) (assert))))
              ("3" (lemma empty_0[posnat]) (inst -1 x!2) (assert))))
            ("2"
             (hide - 3)
             (expand delete)
             (rewrite empty_0)
             (assert)
             (decompose-equality)
             (("1" (grind))
              ("2"
               (decompose-equality)
               (("1" (grind))
                ("2" (lemma empty_0[posnat]) (inst -1 x!2) (assert))))
              ("3" (lemma empty_0[posnat]) (inst -1 x!2) (assert))))
            ("3" (hide-all-but -1) (grind))
            ("4" (hide-all-but -1) (grind))
            ("5"
             (rewrite first_compo)
             (("1" (hide-all-but 1) (grind))
              ("2" (hide-all-but -1) (grind))))))
          ("2"
           (hide-all-but (1 2))
           (lemma empty_0[posnat])
           (inst -1 x!2)
           (assert))))))))
    ("2"
     (case "x!2 = empty_seq")
     (("1"
       (hide -3)
       (expand* left_pos right_pos only_empty_seq)
       (assert)
       (skosimp)
       (prop)
       (("1"
         (replaces -3)
         (lemma seq_empty[posnat])
         (inst -1 r!1 p1!1)
         (assert)
         (lemma empty_0[posnat])
         (inst -1 r!1)
         (assert))
        ("2"
         (replaces -4)
         (hide -1 -3)
         (lemma seq_empty[posnat])
         (inst -1 r!1 p1!1)
         (assert)
         (lemma empty_0[posnat])
         (inst -1 p1!1)
         (assert))))
      ("2"
       (case "q!1 = delete(x!2, length(x!2) - 1)")
       (("1"
         (hide -2 -3)
         (expand right_pos)
         (assert)
         (expand* union member)
         (flatten)
         (hide 4)
         (replace -1 3 rl)
         (expand* right_pos only_empty_seq)
         (prop)
         (expand* union member)
         (flatten)
         (hide-all-but 2)
         (expand singleton)
         (propax))
        ("2"
         (inst -2 x!1 "delete(x!2, length(x!2) - 1)")
         (("1"
           (inst -2 q!1)
           (expand delete -2 1)
           (rewrite empty_0)
           (assert)
           (expand right_pos 3)
           (expand* union member)
           (flatten 3)
           (assert)
           (hide 4 5)
           (expand* singleton left_pos)
           (skosimp)
           (prop)
           (("1"
             (inst 5 r!1 "delete(p1!1, length(p1!1) - 1)" empty_seq)
             (("1"
               (assert)
               (prop)
               (("1"
                 (expand o)
                 (decompose-equality -3)
                 (expand* delete finseq_appl)
                 (expand empty_seq -3)
                 (decompose-equality -3)
                 (lemma empty_0[posnat])
                 (inst -1 p1!1)
                 (assert)
                 (replaces -5)
                 (decompose-equality 3)
                 (decompose-equality 1)
                 (("1" (decompose-equality -4) (inst -1 x!3) (assert))
                  ("2"
                   (skosimp)
                   (prop)
                   (("1" (assert)) ("2" (assert))))))
                ("2"
                 (expand delete 1)
                 (rewrite empty_0)
                 (rewrite empty_0)
                 (expand o)
                 (expand finseq_appl)
                 (decompose-equality -2)
                 (assert)
                 (decompose-equality 1)
                 (("1" (decompose-equality -2) (inst -1 x!3))
                  ("2" (skosimp) (prop) (("1" (assert)) ("2" (assert))))
                  ("3" (skosimp) (assert))
                  ("4"
                   (hide-all-but (1 2))
                   (lemma empty_0[posnat])
                   (inst -1 p1!1)
                   (assert))
                  ("5"
                   (hide-all-but (1 4))
                   (lemma empty_0[posnat])
                   (inst -1 x!2)
                   (assert))))))
              ("2"
               (hide-all-but (1 2))
               (lemma empty_0[posnat])
               (inst -1 p1!1)
               (assert))))
            ("2"
             (inst 6 r!1 "delete(p1!1, length(p1!1) - 1)" q1!1)
             (("1"
               (flatten)
               (hide 6)
               (prop)
               (("1"
                 (hide -1 -3 4)
                 (expand* delete finseq_appl)
                 (rewrite empty_0)
                 (rewrite empty_0)
                 (assert)
                 (expand o)
                 (decompose-equality -1)
                 (assert)
                 (decompose-equality -2)
                 (decompose-equality 1)
                 (("1" (inst -1 x!3))
                  ("2" (skosimp) (prop) (("1" (assert)) ("2" (assert))))
                  ("3" (skosimp) (assert))
                  ("4"
                   (hide-all-but (1 3))
                   (lemma empty_0[posnat])
                   (inst -1 p1!1)
                   (assert))
                  ("5"
                   (hide-all-but (1 4))
                   (lemma empty_0[posnat])
                   (inst -1 x!2)
                   (assert))))
                ("2"
                 (reveal 4)
                 (expand IUnion)
                 (inst 1 "first(q1!1) - 1 - last(x!2)")
                 (("1"
                   (assert)
                   (inst 1 "rest(q1!1)")
                   (prop)
                   (("1"
                     (case "add_last(delete(x!2, length(x!2) - 1),
                                                                first(q1!1)) o rest(q1!1)
                                        = r!1 o q1!1")
                     (("1"
                       (typepred q!1)
                       (lemma pos_subterm_ax)
                       (inst -1
                        "add_last(delete(x!2, length(x!2) - 1), first(q1!1))"
                        "rest(q1!1)" x!1)
                       (("1" (replace -3 -1) (assert))
                        ("2"
                         (hide-all-but (1 6))
                         (lemma empty_0[posnat])
                         (inst -1 x!2)
                         (assert))))
                      ("2"
                       (hide 2)
                       (case "r!1 = delete(x!2, length(x!2) - 1)")
                       (("1"
                         (replace -1 1 rl)
                         (lemma seq_first_rest_1[posnat])
                         (inst -1 q1!1)
                         (lemma empty_0[posnat])
                         (inst -1 q1!1)
                         (assert)
                         (case "add_last(r!1, first(q1!1)) o rest(q1!1) = r!1 o ( #(first(q1!1)) o rest(q1!1))")
                         (("1" (replaces -1) (assert))
                          ("2"
                           (hide-all-but (1 4))
                           (expand* add_last insert? finseq_appl)
                           (expand o)
                           (prop)
                           (("1" (grind))
                            ("2"
                             (decompose-equality 1)
                             (("1" (grind)) ("2" (skosimp) (grind))
                              ("3" (skosimp) (assert))
                              ("4" (skosimp) (assert))
                              ("5" (skosimp) (assert))))))))
                        ("2"
                         (hide -2 -4 2 3 5 7)
                         (expand* delete finseq_appl)
                         (rewrite empty_0)
                         (rewrite empty_0)
                         (decompose-equality)
                         (("1"
                           (expand empty_seq -1)
                           (flatten)
                           (hide -2)
                           (expand o)
                           (decompose-equality -2)
                           (assert))
                          ("2"
                           (expand empty_seq -1)
                           (flatten)
                           (hide -2)
                           (expand o)
                           (decompose-equality -2)
                           (decompose-equality -2)
                           (decompose-equality 1)
                           (("1" (inst -1 x!3) (assert))
                            ("2"
                             (hide -1)
                             (skosimp)
                             (prop)
                             (("1" (assert)) ("2" (assert))))))
                          ("3"
                           (lemma empty_0[posnat])
                           (inst -1 x!2)
                           (assert))))))))
                    ("2"
                     (case "r!1 = delete(x!2, length(x!2) - 1)")
                     (("1"
                       (replace -1 1 rl)
                       (hide -1 -2 -4 -5 3 4 5 6)
                       (expand o)
                       (decompose-equality -1)
                       (decompose-equality -2)
                       (decompose-equality 1)
                       (("1"
                         (lemma seq_first_rest_1[posnat])
                         (inst -1 q1!1)
                         (lemma empty_0[posnat])
                         (inst -1 q1!1)
                         (assert)
                         (expand o)
                         (decompose-equality -1))
                        ("2"
                         (decompose-equality 1)
                         (("1" (inst -1 x!3) (assert) (grind))
                          ("2"
                           (skosimp)
                           (hide -1)
                           (lemma seq_first_rest_1[posnat])
                           (inst -1 q1!1)
                           (lemma empty_0[posnat])
                           (inst -1 q1!1)
                           (assert)
                           (expand o)
                           (decompose-equality -1)
                           (prop)
                           (("1" (assert)) ("2" (assert))))
                          ("3" (skosimp) (assert))
                          ("4" (skosimp) (rewrite empty_0))
                          ("5" (skosimp) (rewrite empty_0))
                          ("6" (skosimp) (assert))
                          ("7" (skosimp) (rewrite empty_0))
                          ("8" (hide -) (flatten) (rewrite empty_0))))
                        ("3" (skosimp) (assert))
                        ("4" (skosimp) (assert))))
                      ("2"
                       (hide -2 -4 2 3 5 7)
                       (expand* delete finseq_appl)
                       (rewrite empty_0)
                       (rewrite empty_0)
                       (expand empty_seq -1)
                       (flatten)
                       (hide -2)
                       (expand o)
                       (decompose-equality -2)
                       (decompose-equality -2)
                       (decompose-equality 1)
                       (decompose-equality 1)
                       (("1" (inst -1 x!3) (assert))
                        ("2" (skosimp) (ground))))))))
                  ("2"
                   (prop)
                   (("1"
                     (case "last(x!2) = first(p1!1)")
                     (("1" (replace -1) (assert))
                      ("2"
                       (hide-all-but (-1 -3 1 4 6))
                       (expand* last first finseq_appl)
                       (expand o)
                       (decompose-equality -2)
                       (decompose-equality -2)
                       (inst -1 "x!2`length - 1")
                       (("1"
                         (expand delete -3)
                         (rewrite empty_0)
                         (assert)
                         (expand empty_seq -3)
                         (flatten)
                         (hide -4)
                         (assert))
                        ("2"
                         (lemma empty_0[posnat])
                         (inst -1 x!2)
                         (assert))))))
                    ("2"
                     (name "pi" "r!1 o #(first(q1!1))")
                     (case "delete(x!2, length(x!2) - 1) = r!1")
                     (("1"
                       (replaces -1)
                       (case "first(q1!1) =  last(pi)")
                       (("1"
                         (replaces -1)
                         (lemma next_position_TCC5)
                         (inst -1 x!1 x!1 pi)
                         (("1"
                           (prop)
                           (("1"
                             (case "delete(pi, length(pi) - 1) = r!1")
                             (("1" (replaces -1) (assert))
                              ("2"
                               (hide-all-but (-2 1))
                               (expand* delete finseq_appl)
                               (lift-if)
                               (prop)
                               (("1" (grind))
                                ("2"
                                 (decompose-equality 2)
                                 (("1"
                                   (expand o)
                                   (decompose-equality -1)
                                   (hide -2)
                                   (grind)
                                   (replace -1 1 rl)
                                   (assert))
                                  ("2"
                                   (decompose-equality 1)
                                   (expand o)
                                   (decompose-equality -1)
                                   (decompose-equality -2)
                                   (inst -1 x!3)
                                   (("1" (typepred x!3) (grind))
                                    ("2" (grind))))
                                  ("3" (grind))))))
                              ("3" (hide-all-but (-2 1)) (grind))))
                            ("2" (hide-all-but (-1 -2)) (grind))))
                          ("2"
                           (reveal -2)
                           (lemma seq_first_rest_1[posnat])
                           (inst -1 q1!1)
                           (lemma empty_0[posnat])
                           (inst -1 q1!1)
                           (assert)
                           (replace -1 -5)
                           (lemma pos_ax)
                           (rewrite o_assoc)
                           (inst -1 "r!1 o  #(first(q1!1))" "rest(q1!1)"
                            x!1)
                           (assert))))
                        ("2"
                         (hide-all-but (-1 1 3))
                         (expand* first last finseq_appl)
                         (expand o)
                         (decompose-equality -1)
                         (decompose-equality -2)
                         (inst -1 "pi`length - 1")
                         (("1"
                           (expand "#" -2)
                           (assert)
                           (replace -2 -1 rl)
                           (assert)
                           (expand "#")
                           (assert))
                          ("2" (grind))))
                        ("3" (hide-all-but (-1 1)) (grind))))
                      ("2"
                       (hide -1 -3 -5 2 3 5 7)
                       (expand delete)
                       (rewrite empty_0)
                       (rewrite empty_0)
                       (assert)
                       (expand finseq_appl)
                       (expand empty_seq -1)
                       (flatten)
                       (hide -2)
                       (decompose-equality 1)
                       (("1"
                         (expand o)
                         (decompose-equality -2)
                         (hide -2)
                         (replaces -1)
                         (assert))
                        ("2"
                         (decompose-equality 1)
                         (("1"
                           (expand o)
                           (decompose-equality -2)
                           (decompose-equality -2)
                           (inst -1 x!3)
                           (assert))
                          ("2"
                           (hide - 2)
                           (lemma empty_0[posnat])
                           (inst -1 x!2)
                           (assert))))
                        ("3"
                         (skosimp)
                         (expand o)
                         (decompose-equality -2)
                         (hide -2)
                         (ground))
                        ("4"
                         (hide - 2)
                         (lemma empty_0[posnat])
                         (inst -1 x!2)
                         (assert))))))))
                  ("3"
                   (hide-all-but (1 5))
                   (flatten)
                   (rewrite empty_0))))
                ("3"
                 (hide-all-but (-3 1 2 3))
                 (expand* delete finseq_appl)
                 (rewrite empty_0)
                 (assert)
                 (expand first)
                 (expand finseq_appl)
                 (propax))))
              ("2"
               (hide-all-but (1 3))
               (lemma empty_0[posnat])
               (inst -1 p1!1)
               (assert))))))
          ("2" (rewrite delete_is_position) (flatten) (rewrite empty_0))
          ("3" (lemma empty_0[posnat]) (inst -1 x!2) (assert))))
        ("3" (lemma empty_0[posnat]) (inst -1 x!2) (assert))))))
    ("3"
     (hide -3)
     (expand left_pos)
     (skosimp)
     (prop)
     (("1"
       (replaces -1)
       (replaces -2)
       (expand o)
       (decompose-equality -1)
       (hide -2)
       (lemma empty_0[posnat])
       (inst -1 p1!1)
       (assert))
      ("2"
       (replaces -4)
       (replaces -1)
       (expand o)
       (flatten)
       (decompose-equality -2)
       (inst -1 "length(r!1)")
       (("1" (assert) (expand first) (expand finseq_appl) (assert))
        ("2"
         (hide - 3)
         (lemma empty_0[posnat])
         (inst -1 q1!1)
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma empty_0[posnat])
   (measure-induct+
    "lex2(length(p), arity(f(subtermOF(s,delete(p,length(p) - 1)))) - last(p))"
    ("s" "t" "p"))
   (("1"
     (case "x!3 = empty_seq")
     (("1"
       (hide -2 -3)
       (replaces -1)
       (expand* member right_pos next_position emptyset only_empty_seq)
       (prop)
       (expand positionsOF)
       (lift-if)
       (expand only_empty_seq)
       (prop)
       (expand union)
       (flatten)
       (hide 3)
       (expand member)
       (propax))
      ("2"
       (lemma member_right_pos)
       (inst -1 x!1 x!3 "next_position(x!1, x!2, x!3)")
       (("1"
         (assert)
         (name-replace "q!1" "next_position(x!1, x!2, x!3)" :hide? nil)
         (hide 3)
         (expand next_position -1)
         (lift-if)
         (prop)
         (("1"
           (hide -2 1)
           (expand left_pos)
           (inst 1 "delete(x!3, length(x!3) - 1)" "#(last(x!3))"
            empty_seq)
           (("1"
             (assert)
             (prop)
             (("1"
               (hide -2 -3 1)
               (expand empty_seq)
               (expand "#")
               (propax))
              ("2"
               (hide -1)
               (expand* delete finseq_appl)
               (rewrite empty_0)
               (decompose-equality)
               (("1" (expand o) (expand "#") (propax))
                ("2"
                 (decompose-equality)
                 (("1" (expand o) (grind)) ("2" (inst -1 x!3) (assert))))
                ("3" (inst -1 x!3) (assert))))))
            ("2" (hide -) (flatten) (rewrite empty_0))
            ("3" (hide -1) (inst -1 x!3) (assert))))
          ("2"
           (hide -2 -3 -4 1)
           (expand left_pos)
           (inst 1 "delete(x!3, length(x!3) - 1)" "#(last(x!3))"
            "#(1 + last(x!3))")
           (("1"
             (flatten)
             (hide 1)
             (prop)
             (("1"
               (replace -1 1 rl)
               (hide -1)
               (expand* add_last insert? delete finseq_appl)
               (inst -1 x!3)
               (assert)
               (assert)
               (decompose-equality)
               (("1" (grind))
                ("2"
                 (decompose-equality)
                 (("1" (grind)) ("2" (skosimp) (assert))))
                ("3" (grind)) ("4" (grind))))
              ("2"
               (hide -1)
               (expand delete)
               (inst -1 x!3)
               (assert)
               (assert)
               (decompose-equality)
               (("1" (grind)) ("2" (decompose-equality) (grind))))
              ("3" (hide-all-but -1) (grind))
              ("4" (hide-all-but -1) (grind))
              ("5"
               (hide-all-but 1)
               (expand* first finseq_appl "#")
               (assert))))
            ("2" (hide -1) (inst -1 x!3) (assert))))
          ("3"
           (inst -5 x!1 x!2
            "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
           (("1"
             (lemma next_position_TCC17)
             (inst -1 x!1 x!2 x!3)
             (assert)
             (inst -1 "delete(x!3, length(x!3) - 1)")
             (("1"
               (assert)
               (inst -1
                "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
               (("1"
                 (assert)
                 (case "NOT add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3)) =
                                                      empty_seq")
                 (("1"
                   (assert)
                   (hide -1 -2 -4 -5 1)
                   (replace -1)
                   (name-replace "pi"
                    "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))"
                    :hide? nil)
                   (lemma member_right_pos)
                   (inst -1 x!1 pi q!1)
                   (("1"
                     (assert)
                     (lemma next_pos_is_a_diff_pos)
                     (inst -1 x!1 x!2 pi)
                     (assert)
                     (hide -1 -4 -5)
                     (expand left_pos)
                     (skosimp)
                     (prop)
                     (("1"
                       (inst 2 r!1
                        "add_last(delete(p1!1, length(p1!1) - 1), last(p1!1) - 1)"
                        empty_seq)
                       (("1"
                         (assert)
                         (prop)
                         (("1" (hide-all-but -1) (grind))
                          ("2"
                           (replaces -2)
                           (expand* add_last insert? delete finseq_appl
                            o)
                           (flatten)
                           (inst-cp -4 p1!1)
                           (inst -4 x!3)
                           (assert)
                           (assert)
                           (decompose-equality -3)
                           (("1"
                             (decompose-equality 1)
                             (("1"
                               (decompose-equality 1)
                               (("1"
                                 (lift-if)
                                 (prop)
                                 (("1"
                                   (inst -2 x!4)
                                   (("1" (assert))
                                    ("2" (expand delete) (assert))))
                                  ("2"
                                   (inst -2 x!4)
                                   (("1" (assert))
                                    ("2" (expand delete) (assert))))
                                  ("3"
                                   (inst -1 x!4)
                                   (("1"
                                     (assert)
                                     (typepred x!4)
                                     (expand* last finseq_appl)
                                     (assert))
                                    ("2" (expand delete) (assert))))))
                                ("2" (skosimp) (ground)) ("3" (grind))
                                ("4" (skosimp) (assert))))
                              ("2" (grind)) ("3" (skosimp) (assert))))
                            ("2" (expand delete -1) (assert))))))
                        ("2"
                         (case "last(p1!1) = 1 + last(x!3)")
                         (("1" (assert))
                          ("2"
                           (hide 2)
                           (replaces -2)
                           (expand* add_last insert? delete last
                            finseq_appl o)
                           (flatten)
                           (rewrite empty_0)
                           (assert)
                           (decompose-equality -3)
                           (("1"
                             (inst -1 "x!3`length - 1")
                             (("1"
                               (assert)
                               (lift-if)
                               (ground)
                               (replace -4 -1)
                               (inst -5 p1!1)
                               (assert))
                              ("2"
                               (expand delete 1)
                               (inst -3 x!3)
                               (ground))))
                            ("2"
                             (expand delete -1)
                             (inst -5 x!3)
                             (assert)
                             (assert))
                            ("3" (inst -6 p1!1) (assert))
                            ("4" (inst -5 p1!1) (assert))))
                          ("3" (inst -4 p1!1) (assert))))
                        ("3" (inst -4 p1!1) (assert))
                        ("4" (inst -4 p1!1) (assert))))
                      ("2"
                       (inst 3 r!1
                        "add_last(delete(p1!1, length(p1!1) - 1), last(p1!1) - 1)"
                        q1!1)
                       (("1"
                         (flatten)
                         (hide 3)
                         (assert)
                         (prop)
                         (("1"
                           (replace -2)
                           (hide -1 -2 -3 2)
                           (inst-cp -2 x!3)
                           (inst -2 p1!1)
                           (assert)
                           (expand* add_last insert? delete last
                            finseq_appl o)
                           (flatten)
                           (decompose-equality -2)
                           (("1"
                             (decompose-equality 1)
                             (("1"
                               (decompose-equality 1)
                               (("1"
                                 (lift-if)
                                 (ground)
                                 (("1"
                                   (inst -2 x!4)
                                   (("1" (assert))
                                    ("2" (expand delete 1) (assert))))
                                  ("2"
                                   (inst -2 x!4)
                                   (("1" (assert))
                                    ("2" (expand delete 1) (assert))))
                                  ("3"
                                   (inst -1 x!4)
                                   (("1" (assert))
                                    ("2" (expand delete 1) (assert))))))
                                ("2" (grind)) ("3" (grind))
                                ("4" (grind))))
                              ("2" (grind)) ("3" (grind))))
                            ("2" (expand delete -1) (assert))))
                          ("2" (hide-all-but -1) (grind))
                          ("3"
                           (hide -1 -2 -4)
                           (expand* add_last insert? delete first
                            finseq_appl)
                           (inst -2 p1!1)
                           (assert)
                           (assert)
                           (lift-if)
                           (ground)
                           (grind))))
                        ("2"
                         (case "last(p1!1) - 1 = last(x!3)")
                         (("1" (assert))
                          ("2"
                           (replace -2)
                           (hide -1 -2 -3 2 3)
                           (inst-cp -2 x!3)
                           (inst -2 p1!1)
                           (assert)
                           (expand* add_last insert? delete last
                            finseq_appl o)
                           (flatten)
                           (decompose-equality -2)
                           (("1"
                             (inst -1 "x!3`length - 1")
                             (("1" (assert))
                              ("2" (expand delete) (assert))))
                            ("2" (expand delete -1) (assert))))))
                        ("3" (inst -5 p1!1) (assert))))))
                    ("2"
                     (lemma next_position_is_position)
                     (inst -1 x!1 x!2 pi)
                     (assert))
                    ("3" (reveal -3) (assert))))
                  ("2" (hide-all-but -1) (grind))
                  ("3" (hide-all-but (-7 1 3)) (inst -1 x!3) (assert))))
                ("2" (hide-all-but (-6 1 3)) (inst -1 x!3) (assert))))
              ("2" (hide-all-but (-6 1 3)) (inst -1 x!3) (assert))))
            ("2"
             (assert)
             (prop)
             (("1"
               (lemma next_position_TCC15)
               (inst -1 x!1 x!2 x!3)
               (assert)
               (inst -1 "delete(x!3, length(x!3) - 1)")
               (("1"
                 (assert)
                 (inst -1
                  "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
                 (("1" (assert))
                  ("2" (hide-all-but (-5 1 4)) (inst -1 x!3) (assert))))
                ("2" (hide-all-but (-5 1 4)) (inst -1 x!3) (assert))))
              ("2" (hide-all-but -1) (grind))))
            ("3" (hide-all-but (-5 1 3)) (inst -1 x!3) (assert))))
          ("4"
           (inst -3 x!1 x!2 "delete(x!3, length(x!3) - 1)")
           (("1"
             (lemma next_position_TCC19)
             (inst -1 x!1 x!2 x!3)
             (assert)
             (inst -1 "delete(x!3, length(x!3) - 1)")
             (("1"
               (assert)
               (inst -1
                "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))")
               (("1"
                 (assert)
                 (hide -1 -3 1 2)
                 (replace -1)
                 (lemma member_right_pos)
                 (inst -1 x!1 "delete(x!3, length(x!3) - 1)" q!1)
                 (("1"
                   (assert)
                   (lemma next_pos_is_a_diff_pos)
                   (inst -1 x!1 x!2 "delete(x!3, length(x!3) - 1)")
                   (("1"
                     (assert)
                     (hide -1 -3 -4)
                     (name-replace "pi" "delete(x!3, length(x!3) - 1)"
                      :hide? nil)
                     (("1"
                       (expand left_pos)
                       (skosimp)
                       (prop)
                       (("1"
                         (inst 2 r!1 "add_last(p1!1, last(x!3))"
                          empty_seq)
                         (("1"
                           (assert)
                           (prop)
                           (("1" (hide-all-but -1) (grind))
                            ("2"
                             (replaces -2)
                             (hide -1)
                             (inst-cp -2 p1!1)
                             (inst -2 x!3)
                             (assert)
                             (expand* delete add_last insert? last
                              finseq_appl o)
                             (flatten)
                             (decompose-equality -2)
                             (decompose-equality 1)
                             (("1"
                               (decompose-equality 1)
                               (("1"
                                 (inst -1 x!4)
                                 (("1" (lift-if) (ground))
                                  ("2" (assert))))
                                ("2" (grind)) ("3" (grind))))
                              ("2" (grind))))))
                          ("2" (inst -4 x!3) (assert))))
                        ("2"
                         (inst 3 r!1 "add_last(p1!1, last(x!3))" q1!1)
                         (("1"
                           (assert)
                           (flatten)
                           (hide 3)
                           (prop)
                           (("1"
                             (replaces -2)
                             (hide -1 -2 2)
                             (inst-cp -2 x!3)
                             (inst -2 p1!1)
                             (assert)
                             (expand* delete add_last insert? last o
                              finseq_appl)
                             (flatten)
                             (decompose-equality -2)
                             (decompose-equality 1)
                             (("1"
                               (decompose-equality 1)
                               (("1"
                                 (case "x!4 = x!3`length - 1")
                                 (("1" (assert))
                                  ("2"
                                   (inst -1 x!4)
                                   (("1" (assert)) ("2" (assert))))))
                                ("2" (grind)) ("3" (grind))))
                              ("2" (grind))))
                            ("2" (hide-all-but -1) (grind))
                            ("3"
                             (rewrite first_add_last)
                             (inst -5 p1!1)
                             (assert))))
                          ("2" (inst -5 x!3) (assert))))))
                      ("2" (inst -2 x!3) (assert))))
                    ("2" (inst -4 x!3) (assert))))
                  ("2"
                   (lemma next_position_is_position)
                   (inst -1 x!1 x!2 "delete(x!3, length(x!3) - 1)")
                   (("1" (assert)) ("2" (inst -3 x!3) (assert))))
                  ("3"
                   (rewrite delete_is_position)
                   (inst -3 x!3)
                   (assert))
                  ("4" (inst -3 x!3) (assert))))
                ("2" (inst -4 x!3) (assert))))
              ("2" (inst -4 x!3) (assert))))
            ("2"
             (assert)
             (rewrite delete_is_position)
             (("1" (rewrite delete_is_position) (inst -3 x!3) (assert))
              ("2" (inst -3 x!3) (assert))))
            ("3" (inst -3 x!3) (assert))))
          ("5"
           (hide -1 -3 -4 1)
           (expand left_pos)
           (inst 1 empty_seq x!3 empty_seq)
           (assert)
           (rewrite empty_o_seq))))
        ("2" (rewrite next_position_is_position))))))
    ("2"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 x!1 x!2 x!3)
     (assert))
    ("3" (hide 1) (inst -2 x!3) (assert))
    ("4"
     (hide 2)
     (lemma next_position_TCC3)
     (inst -1 x!1 x!2 x!3)
     (assert))
    ("5" (hide 2) (rewrite delete_is_position) (inst -1 x!3) (assert))
    ("6" (hide 2) (inst -1 x!3) (assert))
    ("7"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 y!1 y!2 y!3)
     (assert))
    ("8" (hide 1) (inst -2 y!3) (assert))
    ("9"
     (hide 2)
     (lemma next_position_TCC3)
     (inst -1 y!1 y!2 y!3)
     (assert))
    ("10" (hide 2) (rewrite delete_is_position) (inst -1 y!3) (assert))
    ("11" (hide 2) (inst -1 y!3) (assert))
    ("12"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 "x!1`1" "x!1`2" "x!1`3")
     (assert))
    ("13" (hide 1) (inst -2 "x!1`3") (assert))
    ("14"
     (hide 2)
     (lemma next_position_TCC3)
     (inst -1 "x!1`1" "x!1`2" "x!1`3")
     (assert))
    ("15"
     (hide 2)
     (rewrite delete_is_position)
     (inst -1 "x!1`3")
     (assert))
    ("16" (hide 2) (inst -1 "x!1`3") (assert))
    ("17"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 "y!1`1" "y!1`2" "y!1`3")
     (assert))
    ("18" (hide 1) (inst -2 "y!1`3") (assert))
    ("19"
     (hide 2)
     (lemma next_position_TCC3)
     (inst -1 "y!1`1" "y!1`2" "y!1`3")
     (assert))
    ("20"
     (hide 2)
     (rewrite delete_is_position)
     (inst -1 "y!1`3")
     (assert))
    ("21" (hide 2) (inst -1 "y!1`3") (assert))
    ("22"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 s!1 t!1 p!1)
     (assert))
    ("23" (hide 1) (inst -2 p!1) (assert))
    ("24"
     (hide 2)
     (lemma next_position_TCC3)
     (inst -1 s!1 t!1 p!1)
     (assert))
    ("25" (hide 2) (rewrite delete_is_position) (inst -1 p!1) (assert))
    ("26" (hide 2) (inst -1 p!1) (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case "subset?(right_pos(s!1, p!1), right_pos(s!1, q!1)) AND
                      subset?(right_pos(s!1, q!1), right_pos(s!1, p!1))")
   (("1"
     (hide -2)
     (flatten)
     (expand subset?)
     (inst -1 p!1)
     (inst -2 q!1)
     (case "p!1 = empty_seq")
     (("1"
       (hide -2)
       (expand right_pos -2 2)
       (assert)
       (case "member(q!1, right_pos(s!1, q!1))")
       (("1" (assert) (hide -1) (expand* member only_empty_seq) (assert))
        ("2"
         (hide-all-but 1)
         (expand* right_pos member)
         (expand* union member)
         (flatten)
         (hide 2 3)
         (expand singleton)
         (propax))))
      ("2"
       (case "q!1 = empty_seq")
       (("1"
         (hide -3)
         (expand right_pos -2 2)
         (assert)
         (case "member(p!1, right_pos(s!1, p!1))")
         (("1" (assert) (hide -1) (expand* member only_empty_seq))
          ("2"
           (hide-all-but 1)
           (expand* right_pos union member)
           (flatten)
           (hide 2 3)
           (expand singleton)
           (propax))))
        ("2"
         (case "member(p!1, right_pos(s!1, p!1)) AND member(q!1, right_pos(s!1, q!1))")
         (("1"
           (flatten)
           (assert)
           (hide -1 -2)
           (lemma member_right_pos)
           (inst-cp -1 s!1 p!1 q!1)
           (inst -1 s!1 q!1 p!1)
           (assert)
           (hide -3 -4)
           (expand left_pos)
           (skosimp*)
           (ground)
           (("1"
             (replace -1 -4)
             (replace -4 -2)
             (replace -3 -2)
             (expand o -2)
             (decompose-equality -2)
             (hide -2 -3 -4 -5 3 4 5)
             (lemma empty_0[posnat])
             (inst-cp -1 p1!2)
             (inst -1 p1!1)
             (assert))
            ("2"
             (replace -5 -1)
             (replace -4 -2)
             (replace -2 -1)
             (case "p1!2 o p1!1 = q1!2")
             (("1"
               (replace -1 -4 rl)
               (rewrite first_compo)
               (("1" (assert))
                ("2" (hide-all-but (1 3)) (flatten) (rewrite empty_0))))
              ("2"
               (hide -2 -3 -4 -5 5 6 7)
               (expand o)
               (flatten)
               (decompose-equality -2)
               (decompose-equality 1)
               (("1"
                 (decompose-equality 1)
                 (("1"
                   (lift-if)
                   (prop)
                   (("1" (inst -2 "x!1 + r!2`length") (assert))
                    ("2" (inst -1 "x!1 + r!2`length") (assert))))
                  ("2" (skosimp) (assert))))
                ("2" (skosimp) (ground)) ("3" (skosimp) (assert))))))
            ("3"
             (replace -4 -1)
             (replace -3 -2)
             (replace -1 -2 rl)
             (case "q1!1 = p1!1 o p1!2")
             (("1"
               (replace -1 -6)
               (rewrite first_compo)
               (("1" (assert))
                ("2" (hide-all-but (1 4)) (flatten) (rewrite empty_0))))
              ("2"
               (hide -1 -3 -4 -5 5 6 7)
               (expand o)
               (flatten)
               (decompose-equality -2)
               (decompose-equality 1)
               (("1"
                 (decompose-equality 1)
                 (("1"
                   (lift-if)
                   (prop)
                   (("1" (inst -2 "x!1 + r!1`length") (assert))
                    ("2" (inst -1 "x!1 + r!1`length") (assert))))
                  ("2" (skosimp) (ground)) ("3" (skosimp) (assert))))
                ("2" (skosimp) (assert))))))
            ("4"
             (replace -5 -1)
             (replace -4 -2)
             (hide -4 -5)
             (expand o)
             (flatten)
             (decompose-equality -2)
             (decompose-equality -4)
             (hide -3 -4)
             (case "r!1`length = r!2`length")
             (("1"
               (inst -2 "r!1`length")
               (("1"
                 (inst -3 "r!1`length")
                 (("1"
                   (assert)
                   (replaces -1)
                   (assert)
                   (expand* first finseq_appl)
                   (assert))
                  ("2"
                   (hide-all-but (1 5))
                   (lemma empty_0[posnat])
                   (inst -1 p1!1)
                   (assert))))
                ("2"
                 (hide-all-but (1 4))
                 (lemma empty_0[posnat])
                 (inst -1 q1!1)
                 (assert))))
              ("2"
               (case "r!1`length < r!2`length")
               (("1"
                 (inst -2 "r!1`length")
                 (("1"
                   (inst -3 "r!1`length")
                   (("1"
                     (assert)
                     (replace -2 -3 rl)
                     (hide-all-but (-3 -5))
                     (expand* first finseq_appl)
                     (assert))
                    ("2"
                     (hide-all-but (1 6))
                     (lemma empty_0[posnat])
                     (inst -1 p1!1)
                     (assert))))
                  ("2"
                   (hide-all-but (1 5))
                   (lemma empty_0[posnat])
                   (inst -1 q1!1)
                   (assert))))
                ("2"
                 (inst -1 "r!2`length")
                 (("1"
                   (inst -2 "r!2`length")
                   (("1"
                     (assert)
                     (replace -1 -2)
                     (hide-all-but (-2 -3))
                     (expand* first finseq_appl)
                     (assert))
                    ("2"
                     (hide-all-but (1 2 3 7))
                     (lemma empty_0[posnat])
                     (inst -1 p1!1)
                     (assert))))
                  ("2"
                   (hide-all-but (1 2 3 6))
                   (lemma empty_0[posnat])
                   (inst -1 q1!1)
                   (assert))))))))))
          ("2"
           (hide - 4)
           (prop)
           (("1"
             (expand* right_pos union member)
             (assert)
             (flatten)
             (hide-all-but 1)
             (expand singleton)
             (propax))
            ("2"
             (expand* right_pos union member)
             (assert)
             (flatten)
             (hide-all-but 1)
             (expand singleton)
             (propax))))))))))
    ("2"
     (prop)
     (("1"
       (expand subset?)
       (skosimp)
       (decompose-equality -2)
       (expand member)
       (inst -1 x!1)
       (assert))
      ("2"
       (expand* subset? member)
       (decompose-equality -1)
       (skosimp)
       (inst -1 x!1)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand* strict_subset? subset?)
   (prop)
   (("1"
     (skosimp)
     (lemma member_right_pos)
     (inst-cp -1 s!1 q!1 x!1)
     (("1"
       (inst-cp -1 s!1 p!1 q!1)
       (inst -1 s!1 p!1 x!1)
       (("1"
         (assert)
         (hide -3 -4 2)
         (expand left_pos -1)
         (skosimp)
         (prop)
         (("1"
           (expand left_pos -3)
           (skosimp)
           (prop)
           (("1"
             (replaces -3)
             (replaces -2)
             (expand left_pos)
             (inst 3 r!2 "p1!2 o p1!1" empty_seq)
             (assert)
             (prop)
             (("1"
               (lemma seq_empty[posnat])
               (inst -1 p1!2 p1!1)
               (lemma empty_0[posnat])
               (inst -1 p1!1)
               (assert))
              ("2"
               (hide -1 4)
               (expand o)
               (decompose-equality -1)
               (decompose-equality 1)
               (("1"
                 (decompose-equality -2)
                 (decompose-equality 1)
                 (("1" (inst -1 x!2) (assert) (grind)) ("2" (grind))
                  ("3" (grind)) ("4" (grind))))
                ("2" (grind)) ("3" (grind))))))
            ("2"
             (replaces -4)
             (replaces -2)
             (expand left_pos)
             (inst 4 r!2 "p1!2 o p1!1" q1!2)
             (flatten)
             (hide 4)
             (assert)
             (prop)
             (("1"
               (hide -1 -2 2 5)
               (expand o)
               (decompose-equality -1)
               (decompose-equality -2)
               (decompose-equality 1)
               (("1"
                 (decompose-equality 1)
                 (("1" (inst -1 x!2) (assert) (grind)) ("2" (grind))
                  ("3" (grind)) ("4" (grind))))
                ("2" (grind)) ("3" (grind))))
              ("2"
               (lemma seq_empty[posnat])
               (inst -1 p1!2 p1!1)
               (lemma empty_0[posnat])
               (inst -1 p1!1)
               (assert))
              ("3" (rewrite first_compo) (flatten) (rewrite empty_0))))))
          ("2"
           (expand left_pos -4)
           (skosimp)
           (prop)
           (("1"
             (case "r!1 = r!2")
             (("1"
               (replaces -1)
               (expand left_pos)
               (inst 4 r!2 p1!1 empty_seq)
               (assert))
              ("2"
               (case "<=(r!1, r!2) OR <=(r!2, r!1)")
               (("1"
                 (prop)
                 (("1"
                   (expand <=)
                   (skosimp)
                   (replaces -1)
                   (expand left_pos)
                   (inst 5 r!1 p1!1 p1!3)
                   (assert)
                   (prop)
                   (("1"
                     (hide-all-but (-1 1))
                     (replaces -1)
                     (rewrite seq_o_empty))
                    ("2"
                     (case "p1!3 o p1!2 = q1!1")
                     (("1"
                       (replace -1 -6 rl)
                       (rewrite first_compo)
                       (hide-all-but (1 3))
                       (flatten)
                       (rewrite empty_0)
                       (replaces -1)
                       (rewrite seq_o_empty))
                      ("2"
                       (hide-all-but (-2 -3 1 4 5))
                       (replaces -2)
                       (expand o)
                       (flatten)
                       (decompose-equality -2)
                       (decompose-equality 1)
                       (("1"
                         (decompose-equality 1)
                         (("1"
                           (inst -1 "x!2 + r!1`length")
                           (assert)
                           (grind))
                          ("2" (grind))))
                        ("2" (grind)) ("3" (grind))))))))
                  ("2"
                   (expand <=)
                   (skosimp)
                   (replaces -1)
                   (expand left_pos)
                   (inst 5 r!2 "p1!3 o p1!1" empty_seq)
                   (assert)
                   (prop)
                   (("1"
                     (hide-all-but (-1 4))
                     (lemma seq_empty[posnat])
                     (inst -1 p1!3 p1!1)
                     (lemma empty_0[posnat])
                     (inst -1 p1!1)
                     (assert))
                    ("2"
                     (hide-all-but (-4 1))
                     (expand o)
                     (decompose-equality -1)
                     (decompose-equality -2)
                     (decompose-equality 1)
                     (("1"
                       (decompose-equality 1)
                       (("1" (inst -1 x!2) (assert) (grind))
                        ("2" (grind)) ("3" (grind)) ("4" (grind))))
                      ("2" (grind)) ("3" (grind))))))))
                ("2"
                 (flatten)
                 (hide-all-but (-2 -3 1 2 3 4 5))
                 (replaces -1)
                 (case "length(r!2) > length(r!1)")
                 (("1"
                   (hide 2)
                   (expand <=)
                   (name "pi"
                         "(# length := length(r!2) - length(r!1),
                                                                                                                      seq := (LAMBDA (j: below[length(r!2) - length(r!1)]): q1!1`seq(j)) #)")
                   (("1"
                     (inst 1 pi)
                     (("1"
                       (decompose-equality -1)
                       (("1"
                         (decompose-equality -2)
                         (("1"
                           (expand o 1)
                           (decompose-equality 1)
                           (("1"
                             (decompose-equality 1)
                             (("1"
                               (lift-if)
                               (prop)
                               (("1"
                                 (expand o -5)
                                 (flatten)
                                 (decompose-equality -6)
                                 (inst -1 x!2)
                                 (("1" (assert)) ("2" (assert))))
                                ("2"
                                 (typepred x!2)
                                 (expand o -5)
                                 (flatten)
                                 (decompose-equality -6)
                                 (inst -1 x!2)
                                 (("1"
                                   (assert)
                                   (inst -3 "x!2 - r!1`length")
                                   (assert))
                                  ("2" (assert))))))
                              ("2"
                               (skosimp)
                               (prop)
                               (("1" (replace -3 -1 rl) (assert))
                                ("2" (replace -3 1 rl) (assert))))
                              ("3" (skosimp) (assert))))
                            ("2" (skosimp) (assert))))
                          ("2"
                           (hide-all-but (-1 -3 -6 1))
                           (expand o)
                           (flatten)
                           (decompose-equality)
                           (hide -1)
                           (assert))))
                        ("2"
                         (hide-all-but (-1 -2 -5 1))
                         (expand o)
                         (flatten)
                         (hide -4)
                         (assert))))
                      ("2" (assert) (skosimp) (grind))))
                    ("2"
                     (skosimp)
                     (typepred j!1)
                     (hide -2 2 3 4 5)
                     (expand o)
                     (flatten)
                     (hide -3)
                     (assert))
                    ("3" (assert))))
                  ("2"
                   (case "length(r!2) = length(r!1)")
                   (("1"
                     (decompose-equality 4)
                     (decompose-equality 1)
                     (expand o)
                     (flatten)
                     (decompose-equality -3)
                     (inst -1 x!2)
                     (("1" (assert)) ("2" (assert))))
                    ("2"
                     (hide 3)
                     (expand <=)
                     (name "pi"
                           "(# length := length(r!1) - length(r!2),
                                                                                                                                                    seq := (LAMBDA (j: below[length(r!1) - length(r!2)]): p1!2`seq(j)) #)")
                     (("1"
                       (inst 3 pi)
                       (("1"
                         (decompose-equality -1)
                         (("1"
                           (decompose-equality -2)
                           (("1"
                             (expand o 3)
                             (decompose-equality 3)
                             (("1"
                               (decompose-equality 1)
                               (("1"
                                 (lift-if)
                                 (prop)
                                 (("1"
                                   (expand o -4)
                                   (flatten)
                                   (decompose-equality -5)
                                   (inst -1 x!2)
                                   (("1" (assert)) ("2" (assert))))
                                  ("2"
                                   (typepred x!2)
                                   (expand o -4)
                                   (flatten)
                                   (decompose-equality -5)
                                   (inst -1 x!2)
                                   (("1"
                                     (assert)
                                     (inst -3 "x!2 - r!2`length")
                                     (assert))
                                    ("2" (assert))))))
                                ("2"
                                 (skosimp)
                                 (prop)
                                 (("1" (replace -3 -1 rl) (assert))
                                  ("2" (replace -3 1 rl) (assert))))
                                ("3" (skosimp) (assert))))
                              ("2" (skosimp) (assert))))
                            ("2"
                             (hide-all-but (-1 -3 -5 1))
                             (expand o)
                             (flatten)
                             (hide -4)
                             (assert))))
                          ("2"
                           (hide-all-but (-1 -2 -4 1))
                           (expand o)
                           (flatten)
                           (hide -4)
                           (assert))))
                        ("2" (assert) (skosimp) (grind))))
                      ("2"
                       (skosimp)
                       (typepred j!1)
                       (hide 2 3 4 5 6)
                       (expand o)
                       (flatten)
                       (hide -3)
                       (assert))
                      ("3" (assert))))))))))))
            ("2"
             (case "r!1 = r!2")
             (("1"
               (replaces -1)
               (expand left_pos)
               (inst 5 r!2 p1!1 q1!2)
               (assert)
               (ground)
               (replace -4 -2)
               (hide-all-but (-2 -3 -6 1 2 3 4 6))
               (expand* o first finseq_appl)
               (flatten)
               (decompose-equality -2)
               (inst -1 "r!2`length")
               (("1" (assert))
                ("2"
                 (hide-all-but (1 4))
                 (lemma empty_0[posnat])
                 (inst -1 q1!1)
                 (assert))))
              ("2"
               (case "<=(r!1, r!2) OR <=(r!2, r!1)")
               (("1"
                 (prop)
                 (("1"
                   (expand <=)
                   (skosimp)
                   (replaces -1)
                   (expand left_pos)
                   (inst 6 r!1 p1!1 "p1!3 o q1!2")
                   (assert)
                   (ground)
                   (("1"
                     (hide-all-but (-1 1))
                     (replaces -1)
                     (expand o)
                     (decompose-equality)
                     (("1" (lift-if) (lift-if) (lift-if) (ground))
                      ("2" (skosimp) (assert)) ("3" (skosimp) (assert))
                      ("4" (skosimp) (assert)) ("5" (skosimp) (assert))))
                    ("2"
                     (hide-all-but (-1 2))
                     (lemma seq_empty[posnat])
                     (inst -1 p1!3 q1!2)
                     (lemma empty_0[posnat])
                     (inst -1 q1!2)
                     (assert))
                    ("3"
                     (case "p1!3 o p1!2 = q1!1")
                     (("1"
                       (replace -1 -7 rl)
                       (rewrite first_compo)
                       (("1"
                         (rewrite first_compo)
                         (hide-all-but (1 3))
                         (flatten)
                         (rewrite empty_0)
                         (replaces -1)
                         (rewrite seq_o_empty))
                        ("2"
                         (hide-all-but (1 3))
                         (flatten)
                         (rewrite empty_0)
                         (replaces -1)
                         (rewrite seq_o_empty))))
                      ("2"
                       (hide-all-but (-2 -4 1 5 6))
                       (replaces -2)
                       (expand o)
                       (flatten)
                       (decompose-equality -2)
                       (decompose-equality 1)
                       (("1"
                         (decompose-equality 1)
                         (("1"
                           (lift-if)
                           (ground)
                           (("1" (inst -2 "x!2 + r!1`length") (assert))
                            ("2" (inst -1 "x!2 + r!1`length") (assert))))
                          ("2" (grind))))
                        ("2" (grind)) ("3" (grind))))))))
                  ("2"
                   (expand <=)
                   (skosimp)
                   (replaces -1)
                   (expand left_pos)
                   (inst 6 r!2 "p1!3 o p1!1" q1!2)
                   (assert)
                   (flatten)
                   (hide 6)
                   (prop)
                   (("1"
                     (hide-all-but (-5 1))
                     (replaces -1)
                     (expand o)
                     (decompose-equality)
                     (("1" (grind)) ("2" (grind)) ("3" (grind))
                      ("4" (grind)) ("5" (grind))))
                    ("2"
                     (hide-all-but (-1 5))
                     (lemma seq_empty[posnat])
                     (inst -1 p1!3 p1!1)
                     (lemma empty_0[posnat])
                     (inst -1 p1!1)
                     (assert))
                    ("3"
                     (case "p1!3 o q1!1 = p1!2")
                     (("1"
                       (replace -1 -4 rl)
                       (rewrite first_compo)
                       (("1"
                         (rewrite first_compo)
                         (hide-all-but (1 3))
                         (flatten)
                         (rewrite empty_0)
                         (replaces -1)
                         (rewrite seq_o_empty))
                        ("2"
                         (hide-all-but (1 3))
                         (flatten)
                         (rewrite empty_0)
                         (replaces -1)
                         (rewrite seq_o_empty))))
                      ("2"
                       (hide-all-but (-2 -4 1 5 6))
                       (replaces -2)
                       (expand o)
                       (flatten)
                       (decompose-equality -2)
                       (decompose-equality 1)
                       (("1"
                         (decompose-equality 1)
                         (("1"
                           (inst -1 "x!2 + r!2`length")
                           (assert)
                           (grind))
                          ("2" (grind))))
                        ("2" (grind)) ("3" (grind))))))))))
                ("2"
                 (flatten)
                 (hide-all-but (-2 -4 1 2 3 4 5))
                 (replaces -1)
                 (case "length(r!2) > length(r!1)")
                 (("1"
                   (hide 2)
                   (expand <=)
                   (name "pi"
                         "(# length := length(r!2) - length(r!1),
                                                                                                                      seq := (LAMBDA (j: below[length(r!2) - length(r!1)]): q1!1`seq(j)) #)")
                   (("1"
                     (inst 1 pi)
                     (("1"
                       (decompose-equality -1)
                       (("1"
                         (decompose-equality -2)
                         (("1"
                           (expand o 1)
                           (decompose-equality 1)
                           (("1"
                             (decompose-equality 1)
                             (("1"
                               (lift-if)
                               (prop)
                               (("1"
                                 (expand o -5)
                                 (flatten)
                                 (decompose-equality -6)
                                 (inst -1 x!2)
                                 (("1" (assert)) ("2" (assert))))
                                ("2"
                                 (typepred x!2)
                                 (expand o -5)
                                 (flatten)
                                 (decompose-equality -6)
                                 (inst -1 x!2)
                                 (("1"
                                   (assert)
                                   (inst -3 "x!2 - r!1`length")
                                   (assert))
                                  ("2" (assert))))))
                              ("2"
                               (skosimp)
                               (prop)
                               (("1" (replace -3 -1 rl) (assert))
                                ("2" (replace -3 1 rl) (assert))))
                              ("3" (skosimp) (assert))))
                            ("2" (skosimp) (assert))))
                          ("2"
                           (hide-all-but (-1 -3 -6 1))
                           (expand o)
                           (flatten)
                           (decompose-equality)
                           (hide -1)
                           (assert))))
                        ("2"
                         (hide-all-but (-1 -2 -5 1))
                         (expand o)
                         (flatten)
                         (hide -4)
                         (assert))))
                      ("2" (assert) (skosimp) (grind))))
                    ("2"
                     (skosimp)
                     (typepred j!1)
                     (hide -2 2 3 4 5)
                     (expand o)
                     (flatten)
                     (hide -3)
                     (assert))
                    ("3" (assert))))
                  ("2"
                   (case "length(r!2) = length(r!1)")
                   (("1"
                     (decompose-equality 4)
                     (decompose-equality 1)
                     (expand o)
                     (flatten)
                     (decompose-equality -3)
                     (inst -1 x!2)
                     (("1" (assert)) ("2" (assert))))
                    ("2"
                     (hide 3)
                     (expand <=)
                     (name "pi"
                           "(# length := length(r!1) - length(r!2),
                                                                                                                                                    seq := (LAMBDA (j: below[length(r!1) - length(r!2)]): p1!2`seq(j)) #)")
                     (("1"
                       (inst 3 pi)
                       (("1"
                         (decompose-equality -1)
                         (("1"
                           (decompose-equality -2)
                           (("1"
                             (expand o 3)
                             (decompose-equality 3)
                             (("1"
                               (decompose-equality 1)
                               (("1"
                                 (lift-if)
                                 (prop)
                                 (("1"
                                   (expand o -4)
                                   (flatten)
                                   (decompose-equality -5)
                                   (inst -1 x!2)
                                   (("1" (assert)) ("2" (assert))))
                                  ("2"
                                   (typepred x!2)
                                   (expand o -4)
                                   (flatten)
                                   (decompose-equality -5)
                                   (inst -1 x!2)
                                   (("1"
                                     (assert)
                                     (inst -3 "x!2 - r!2`length")
                                     (assert))
                                    ("2" (assert))))))
                                ("2"
                                 (skosimp)
                                 (prop)
                                 (("1" (replace -3 -1 rl) (assert))
                                  ("2" (replace -3 1 rl) (assert))))
                                ("3" (skosimp) (assert))))
                              ("2" (skosimp) (assert))))
                            ("2"
                             (hide-all-but (-1 -3 -5 1))
                             (expand o)
                             (flatten)
                             (hide -4)
                             (assert))))
                          ("2"
                           (hide-all-but (-1 -2 -4 1))
                           (expand o)
                           (flatten)
                           (hide -4)
                           (assert))))
                        ("2" (assert) (skosimp) (grind))))
                      ("2"
                       (skosimp)
                       (typepred j!1)
                       (hide 2 3 4 5 6)
                       (expand o)
                       (flatten)
                       (hide -3)
                       (assert))
                      ("3" (assert))))))))))))))))
        ("2"
         (hide -1 -2 -4 2 3)
         (lemma right_pos_subset)
         (inst -1 s!1 q!1)
         (expand subset?)
         (inst -1 x!1)
         (assert)
         (hide -2)
         (expand member)
         (propax))))
      ("2"
       (hide -2 2 3)
       (lemma right_pos_subset)
       (inst -1 s!1 q!1)
       (expand subset?)
       (inst -1 x!1)
       (assert)
       (hide -2)
       (expand member)
       (propax))))
    ("2" (lemma equal_right_pos) (inst -1 s!1 q!1 p!1) (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma subset_right_pos)
   (inst -1 s!1 p!1 "next_position(s!1, t!1, p!1)")
   (("1"
     (lemma next_pos_member_right_pos)
     (inst -1 s!1 t!1 p!1)
     (lemma next_pos_is_a_diff_pos)
     (inst -1 s!1 t!1 p!1)
     (assert)
     (hide -1 -2)
     (lemma card_subset[position])
     (inst -1 "right_pos(s!1, next_position(s!1, t!1, p!1))"
      "right_pos(s!1, p!1)")
     (expand strict_subset?)
     (flatten)
     (assert)
     (rewrite same_card_subset))
    ("2" (rewrite next_position_is_position))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (name-replace "sp" "subtermOF(s!1, p!1)" :hide? nil)
   (name-replace "tp" "subtermOF(t!1, p!1)" :hide? nil)
   (name-replace "sig1" "link_of_frst_diff(sp, tp)" :hide? nil)
   (assert)
   (flatten)
   (prop)
   (("1"
     (lemma "vars_subst_not_in")
     (inst -1 s!1 sig1 x!1)
     (assert)
     (skosimp)
     (lemma "dom_ran_link_disjoint")
     (inst -1 sp tp)
     (replace -5)
     (assert)
     (inst -1 "x!1" "r!1")
     (("1" (hide-all-but (-1 1)) (expand member) (propax))
      ("2" (hide-all-but (-7 1)) (expand member) (propax))))
    ("2"
     (lemma "vars_subst_not_in")
     (inst -1 "t!1" "sig1" "x!1")
     (assert)
     (skosimp)
     (lemma "dom_ran_link_disjoint")
     (inst -1 sp tp)
     (replace -5)
     (assert)
     (inst -1 "x!1" "r!1")
     (("1" (hide-all-but (-1 1)) (expand member) (propax))
      ("2" (hide-all-but (-7 1)) (expand member) (propax))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (assert)
   (flatten)
   (name-replace "sig1"
    "link_of_frst_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))" :hide?
    nil)
   (name "pi" "first_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))")
   (name-replace "sp" "subtermOF(s!1, p!1)" :hide? nil)
   (name-replace "tp" "subtermOF(t!1, p!1)" :hide? nil)
   (expand* "subset?")
   (skosimp)
   (expand* "union" "member")
   (flatten)
   (case "member(x!1, VRan(sig1))")
   (("1"
     (expand* "member" "VRan")
     (expand "IUnion")
     (skosimp)
     (lemma "dom_link_of_frst_diff_is")
     (inst -1 pi sp tp)
     (assert)
     (replace -6)
     (replace -5)
     (assert)
     (expand* "restrict" "singleton")
     (prop)
     (("1"
       (decompose-equality -2)
       (inst -1 "i!1")
       (assert)
       (replaces -1)
       (replace -6 -2 rl)
       (expand "link_of_frst_diff" -2)
       (replace -5)
       (prop)
       (("1"
         (hide-all-but (-1 -3 -5 4))
         (expand "Vars")
         (skosimp)
         (typepred "p!2")
         (lemma pos_o_term)
         (inst -1 p!1 "pi o p!2" t!1)
         (replace -4)
         (lemma pos_o_term)
         (inst -1 pi p!2 tp)
         (lemma position_t_first_diff)
         (inst -1 sp tp pi)
         (assert)
         (inst 1 "p!1 o (pi o p!2)")
         (lemma pos_subterm)
         (inst -1 p!1 "pi o p!2" t!1)
         (assert)
         (replace -7)
         (lemma pos_subterm)
         (inst -1 pi p!2 tp)
         (assert))
        ("2"
         (hide-all-but (-1 -3 -6 -7 1))
         (expand link_of_frst_diff)
         (replace -3)
         (assert))))
      ("2"
       (decompose-equality -1)
       (("1"
         (inst -1 i!1)
         (assert)
         (replaces -1)
         (replace -5 -1 rl)
         (expand "link_of_frst_diff" -1)
         (replace -4)
         (prop)
         (("1"
           (hide-all-but (-1 -4 -5 4))
           (expand "Vars")
           (skosimp)
           (typepred p!2)
           (lemma pos_o_term)
           (inst -1 p!1 "pi o p!2" s!1)
           (replace -4)
           (lemma pos_o_term)
           (inst -1 pi p!2 sp)
           (lemma position_s_first_diff)
           (inst -1 sp tp pi)
           (assert)
           (inst 1 "p!1 o (pi o p!2)")
           (lemma pos_subterm)
           (inst -1 p!1 "pi o p!2" s!1)
           (assert)
           (replace -7)
           (lemma pos_subterm)
           (inst -1 pi p!2 sp)
           (assert))
          ("2"
           (hide-all-but (-1 -3 -6 -7 1 2))
           (expand link_of_frst_diff)
           (replace -3)
           (assert))
          ("3" (expand link_of_frst_diff) (assert))))
        ("2"
         (hide-all-but (-7 1))
         (lemma position_t_first_diff)
         (inst -1 sp tp pi)
         (assert))))))
    ("2"
     (expand "member")
     (case "vars?(subtermOF(sp,pi))")
     (("1"
       (case "VRan(sig1) = Vars(subtermOF(tp,pi))")
       (("1"
         (replaces -1)
         (lemma ext_link_remove_x)
         (inst -1 x!1 s!1 t!1 p!1)
         (replace -3)
         (replace -4)
         (replace -6)
         (expand "member")
         (assert)
         (lemma "positions_of_ext")
         (inst -1 sig1 s!1)
         (decompose-equality -1)
         (expand "Vars" -7)
         (skosimp)
         (inst -1 "p!2")
         (assert)
         (expand "union")
         (prop)
         (("1"
           (expand "member")
           (flatten)
           (rewrite "subterm_ext_commute")
           (decompose-equality -7)
           (prop)
           (("1"
             (hide-all-but (-1 1))
             (expand "ext")
             (assert)
             (lift-if)
             (prop)
             (assert))
            ("2"
             (hide-all-but -2)
             (typepred "x!1")
             (expand "V")
             (assert))))
          ("2"
           (expand "member")
           (skosimp)
           (replace -1 -10)
           (rewrite "pos_subterm")
           (rewrite "subterm_ext_commute")
           (expand ext -10)
           (assert)
           (case "subtermOF(s!1, p1!1) = subtermOF(sp, pi)")
           (("1"
             (replace -10 -11 rl)
             (expand "link_of_frst_diff" -11)
             (assert)
             (replace -9)
             (lift-if)
             (prop)
             (("1" (hide-all-but (-1 3)) (expand "Vars") (inst 1 "p2!1"))
              ("2"
               (hide-all-but (-1 -8 -11 -12 3))
               (expand link_of_frst_diff)
               (replace -3)
               (assert))))
            ("2"
             (replace -9 -10 rl)
             (expand link_of_frst_diff -10)
             (replace -8)
             (assert)
             (lift-if)
             (prop)
             (("1"
               (expand ext -5)
               (replace -10 -5 rl)
               (expand link_of_frst_diff -5)
               (assert)
               (lemma "pos_o_term")
               (inst -1 "p1!1" "p2!1" "s!1")
               (assert)
               (lemma "pos_subterm")
               (inst -1 "p1!1" "p2!1" "s!1")
               (assert)
               (replace -1 -3 rl)
               (hide-all-but (-3 6))
               (expand "Vars")
               (inst 1 "p1!1 o p2!1"))
              ("2"
               (hide-all-but (-1 -7 -10 -11 4))
               (expand link_of_frst_diff)
               (replace -3)
               (assert))))))))
        ("2"
         (decompose-equality 1)
         (iff)
         (prop)
         (("1"
           (expand "VRan" -1)
           (expand "IUnion")
           (skosimp)
           (lemma "dom_link_of_frst_diff_is")
           (inst -1 pi sp tp)
           (replace -7)
           (replace -6)
           (expand* "restrict" "singleton")
           (decompose-equality -1)
           (inst -1 "i!1")
           (assert)
           (replaces -1)
           (replace -6 -1 rl)
           (expand "link_of_frst_diff" -1)
           (replace -5)
           (prop)
           (hide-all-but (-1 -3 -6 -7 3))
           (expand link_of_frst_diff)
           (replace -3)
           (assert))
          ("2"
           (expand "VRan" 1)
           (expand "IUnion")
           (inst 1 "subtermOF(sp, pi)")
           (("1"
             (replace -6 1 rl)
             (expand "link_of_frst_diff" 1)
             (replace -5)
             (prop)
             (hide-all-but (-1 -3 -6 -7 3))
             (expand link_of_frst_diff)
             (replace -3)
             (assert))
            ("2"
             (expand V)
             (expand "Dom")
             (lemma dom_link_of_frst_diff_is)
             (inst -1 pi sp tp)
             (replace -7)
             (replace -6)
             (assert)
             (expand* restrict singleton)
             (decompose-equality -1)
             (inst -1 "subtermOF(sp, pi)")
             (expand Dom)
             (assert))))))
        ("3"
         (hide-all-but (-4 1))
         (lemma position_t_first_diff)
         (inst -1 sp tp pi)
         (assert))))
      ("2"
       (case "vars?(subtermOF(tp, pi))")
       (("1"
         (case "VRan(sig1) = Vars(subtermOF(sp,pi))")
         (("1"
           (replaces -1)
           (lemma ext_link_remove_x)
           (inst -1 x!1 s!1 t!1 p!1)
           (replace -3)
           (replace -4)
           (replace -6)
           (expand member)
           (assert)
           (lemma "positions_of_ext")
           (inst -1 sig1 s!1)
           (decompose-equality -1)
           (expand Vars -7)
           (skosimp)
           (inst -1 "p!2")
           (assert)
           (expand "union")
           (prop)
           (("1"
             (expand "member")
             (flatten)
             (rewrite "subterm_ext_commute")
             (decompose-equality -7)
             (prop)
             (("1"
               (hide-all-but (-1 1))
               (expand "ext")
               (assert)
               (lift-if)
               (prop)
               (assert))
              ("2"
               (hide-all-but -2)
               (typepred "x!1")
               (expand "V")
               (assert))))
            ("2"
             (expand "member")
             (skosimp)
             (replace -1 -10)
             (rewrite "pos_subterm")
             (rewrite "subterm_ext_commute")
             (expand ext -10)
             (assert)
             (case "subtermOF(s!1, p1!1) = subtermOF(tp, pi)")
             (("1"
               (replace -10 -11 rl)
               (expand link_of_frst_diff -11)
               (replace -9)
               (assert)
               (lift-if)
               (prop)
               (("1" (hide-all-but (-1 4)) (expand Vars) (inst 1 p2!1))
                ("2"
                 (hide-all-but (-1 -8 -11 -12 2 4))
                 (expand link_of_frst_diff)
                 (replace -3)
                 (assert))))
              ("2"
               (replace -9 -10 rl)
               (expand link_of_frst_diff -10)
               (replace -8)
               (assert)
               (lift-if)
               (prop)
               (("1"
                 (lemma pos_subterm)
                 (inst -1 p1!1 p2!1 s!1)
                 (lemma pos_o_term)
                 (inst -1 p1!1 p2!1 s!1)
                 (expand ext -7)
                 (replace -12 -7 rl)
                 (expand link_of_frst_diff -7)
                 (replace -11)
                 (split -7)
                 (("1"
                   (assert)
                   (replace -5 -2 rl)
                   (replace -5 -3 rl)
                   (hide-all-but (-2 -3 -4 7))
                   (expand Vars)
                   (inst 1 p!2)
                   (assert))
                  ("2" (assert))))
                ("2"
                 (hide-all-but (-1 -7 -10 -11 3 5))
                 (expand link_of_frst_diff)
                 (replace -3)
                 (assert))))))))
          ("2"
           (decompose-equality 1)
           (iff)
           (prop)
           (("1"
             (expand "VRan" -1)
             (expand "IUnion")
             (skosimp)
             (lemma "dom_link_of_frst_diff_is")
             (inst -1 pi sp tp)
             (replace -7)
             (replace -6)
             (assert)
             (expand* "restrict" "singleton")
             (decompose-equality -1)
             (inst -1 "i!1")
             (assert)
             (replaces -1)
             (replace -6 -1 rl)
             (expand "link_of_frst_diff" -1)
             (replace -5)
             (prop)
             (hide-all-but (-1 -3 -6 -7 2 4))
             (expand link_of_frst_diff)
             (replace -3)
             (assert))
            ("2"
             (expand "VRan" 1)
             (expand "IUnion")
             (inst 1 "subtermOF(tp, pi)")
             (("1"
               (replace -6 1 rl)
               (expand "link_of_frst_diff" 1)
               (replace -5)
               (prop)
               (hide-all-but (-1 -3 -6 -7 2 4))
               (expand "link_of_frst_diff")
               (replace -3)
               (assert))
              ("2"
               (expand V)
               (lemma dom_link_of_frst_diff_is)
               (inst -1 pi sp tp)
               (replace -7)
               (replace -6)
               (expand* restrict singleton)
               (decompose-equality -1)
               (inst -1 "subtermOF(tp, pi)"))))))))
        ("2"
         (hide-all-but (-3 -4 1 2 4))
         (expand link_of_frst_diff)
         (replace -1)
         (assert))
        ("3"
         (hide-all-but (-3 1))
         (lemma position_t_first_diff)
         (inst -1 sp tp pi)
         (assert))))
      ("3"
       (hide-all-but (-3 1))
       (lemma position_s_first_diff)
       (inst -1 sp tp pi)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (name-replace "sp" "subtermOF(s!1, p!1)" :hide? nil)
   (name-replace "tp" "subtermOF(t!1, p!1)" :hide? nil)
   (name-replace "sig!1" "link_of_frst_diff(sp, tp)" :hide? nil)
   (name "q!1" "first_diff(sp, tp)")
   (assert)
   (flatten)
   (case "NOT vars?(subtermOF(sp, q!1))")
   (("1"
     (lemma comutative_link_fd)
     (lemma vars_ext_link_s_subset)
     (inst -1 t!1 s!1 p!1)
     (inst -2 sp tp)
     (replace -6)
     (replace -5)
     (replace -4)
     (replace -3)
     (assert)
     (assert)
     (case "union(Vars(t!1), Vars(s!1)) = union(Vars(s!1), Vars(t!1))")
     (("1" (assert))
      ("2"
       (hide-all-but 1)
       (decompose-equality)
       (expand union)
       (iff)
       (prop))))
    ("2"
     (expand* "subset?")
     (skosimp)
     (expand* "union" "member")
     (flatten)
     (case "member(x!1, VRan(sig!1))")
     (("1"
       (expand* "member" "VRan")
       (expand "IUnion")
       (skosimp)
       (lemma "dom_link_of_frst_diff_is")
       (inst -1 q!1 sp tp)
       (replace -5)
       (assert)
       (assert)
       (expand* "restrict" "singleton")
       (decompose-equality -1)
       (typepred "i!1")
       (inst -3 "i!1")
       (assert)
       (replaces -3)
       (hide -1)
       (replace -5 -2 rl)
       (expand "link_of_frst_diff" -2)
       (replace -4)
       (prop)
       (("1"
         (hide-all-but (-1 -4 -6 4))
         (expand "Vars")
         (skosimp)
         (typepred "p!2")
         (lemma "pos_o_term")
         (inst -1 "q!1" "p!2" "tp")
         (lemma position_t_first_diff)
         (inst -1 sp tp q!1)
         (lemma "pos_o_term")
         (inst -1 p!1 "q!1 o p!2" t!1)
         (replace -7)
         (ground)
         (inst 1 "p!1 o (q!1 o p!2)")
         (lemma pos_subterm)
         (inst -1 q!1 p!2 tp)
         (assert)
         (replace -1 -6 rl)
         (replace -8 -6 rl)
         (hide-all-but (-4 -6 1))
         (lemma pos_subterm)
         (inst -1 p!1 "q!1 o p!2" t!1)
         (assert))
        ("2"
         (hide-all-but (-1 -4 -5 -6 1))
         (expand link_of_frst_diff)
         (replace -3)
         (assert))))
      ("2"
       (expand "member")
       (case "VRan(sig!1) = Vars(subtermOF(tp,q!1))")
       (("1"
         (replaces -1)
         (lemma ext_link_remove_x)
         (inst -1 x!1 s!1 t!1 p!1)
         (replace -6)
         (replace -5)
         (replace -4)
         (assert)
         (assert)
         (expand "member")
         (lemma "positions_of_ext")
         (inst -1 "sig!1" "t!1")
         (decompose-equality -1)
         (expand Vars -7)
         (skosimp)
         (inst -1 "p!2")
         (assert)
         (expand "union")
         (expand member)
         (prop)
         (("1"
           (rewrite "subterm_ext_commute")
           (decompose-equality -7)
           (prop)
           (("1"
             (hide-all-but (-1 1))
             (expand "ext")
             (assert)
             (lift-if)
             (prop)
             (assert))
            ("2"
             (hide-all-but -2)
             (typepred "x!1")
             (expand "V")
             (assert))))
          ("2"
           (skosimp)
           (replace -1 -10)
           (rewrite "pos_subterm")
           (rewrite "subterm_ext_commute")
           (expand "ext" -10)
           (assert)
           (case "subtermOF(t!1, p1!1) = subtermOF(sp, q!1)")
           (("1"
             (replace -8 -11 rl)
             (expand "link_of_frst_diff" -11)
             (replace -7)
             (assert)
             (lift-if)
             (prop)
             (("1" (hide-all-but (-1 3)) (expand Vars) (inst 1 p2!1))
              ("2"
               (hide-all-but (-1 -8 -9 -10 3))
               (expand link_of_frst_diff)
               (replaces -3)
               (assert))))
            ("2"
             (replace -7 -10 rl)
             (expand "link_of_frst_diff" -10)
             (replace -6)
             (assert)
             (lift-if)
             (prop)
             (("1"
               (replace -8 -5 rl)
               (expand link_of_frst_diff -5)
               (replace -7)
               (assert)
               (expand ext -5)
               (lemma pos_o_term)
               (inst -1 p1!1 p2!1 t!1)
               (assert)
               (lemma pos_subterm)
               (inst -1 p1!1 p2!1 t!1)
               (assert)
               (replace -1 -3 rl)
               (replace -4 -3 rl)
               (replace -4 -2 rl)
               (hide-all-but (-2 -3 7))
               (expand Vars)
               (inst 1 p!2))
              ("2"
               (hide-all-but (-1 -7 -8 -9 4))
               (expand link_of_frst_diff)
               (replace -3)
               (assert))))))))
        ("2"
         (decompose-equality 1)
         (iff)
         (prop)
         (("1"
           (expand "VRan" -1)
           (expand "IUnion")
           (skosimp)
           (lemma "dom_link_of_frst_diff_is")
           (inst -1 q!1 sp tp)
           (replace -4)
           (replace -5)
           (assert)
           (expand* "restrict" "singleton")
           (decompose-equality -1)
           (inst -1 "i!1")
           (assert)
           (replaces -1)
           (replace -4 -1 rl)
           (expand "link_of_frst_diff" -1)
           (replace -3)
           (prop)
           (hide-all-but (-1 -3 -4 -5 3))
           (expand link_of_frst_diff)
           (replace -3)
           (assert))
          ("2"
           (expand "VRan" 1)
           (expand "IUnion")
           (lemma dom_link_of_frst_diff_is)
           (inst -1 q!1 sp tp)
           (replace -4)
           (replace -5)
           (assert)
           (expand* restrict singleton)
           (decompose-equality -1)
           (inst -1 "subtermOF(sp, q!1)")
           (("1"
             (inst 1 "subtermOF(sp, q!1)")
             (replace -5 1 rl)
             (expand link_of_frst_diff 1)
             (replace -4)
             (assert)
             (prop)
             (hide-all-but (-1 -4 -5 -6 3))
             (expand link_of_frst_diff)
             (replace -3)
             (assert))
            ("2" (hide-all-but (-2 1)) (expand V) (propax))))))
        ("3"
         (hide-all-but (-2 1))
         (lemma position_t_first_diff)
         (inst -1 sp tp q!1)
         (assert))))))
    ("3"
     (hide-all-but (-1 1))
     (lemma position_s_first_diff)
     (inst -1 sp tp q!1)
     (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (flatten)
   (name-replace "sig!1"
    "link_of_frst_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))" :hide?
    nil)
   (decompose-equality 2)
   (iff)
   (prop)
   (("1"
     (expand "difference")
     (expand "union")
     (expand "member")
     (prop)
     (("1"
       (lemma vars_ext_link_s_subset)
       (inst -1 "s!1" "t!1" "p!1")
       (replace -3 -1)
       (assert)
       (expand "subset?")
       (inst -1 "x!1")
       (expand* "union" "member"))
      ("2"
       (lemma ext_link_remove_x)
       (inst -1 "x!1" "s!1" "t!1" "p!1")
       (replace -4 -1)
       (assert)
       (assert)
       (prop)
       (expand "member")
       (propax))
      ("3"
       (lemma vars_ext_link_t_subset)
       (inst -1 "s!1" "t!1" "p!1")
       (replace -3 -1)
       (assert)
       (expand "subset?")
       (inst -1 "x!1")
       (expand* "union" "member"))
      ("4"
       (lemma ext_link_remove_x)
       (inst -1 "x!1" "s!1" "t!1" "p!1")
       (replace -4 -1)
       (assert)
       (assert)
       (prop)
       (expand member)
       (propax))))
    ("2"
     (expand* "difference" "union" "member")
     (prop)
     (("1"
       (hide 3)
       (expand "Vars")
       (skosimp)
       (inst 2 "p!2")
       (("1"
         (rewrite "subterm_ext_commute")
         (replaces -1)
         (typepred "x!1")
         (expand* "V" "Dom" "ext")
         (assert))
        ("2" (rewrite "ext_preserv_pos"))))
      ("2"
       (hide 2)
       (expand "Vars")
       (skosimp)
       (inst 2 "p!2")
       (("1"
         (rewrite "subterm_ext_commute")
         (replaces -1)
         (typepred "x!1")
         (expand* "V" "Dom" "ext")
         (assert))
        ("2" (rewrite "ext_preserv_pos"))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (prop)
   (name-replace "sig1"
    "link_of_frst_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))" :hide?
    nil)
   (lemma "card_diff_subset[(V)]")
   (lemma "union_vars_ext_link_subterm")
   (inst -1 "s!1" "t!1" "p!1")
   (assert)
   (replace -3 -1)
   (assert)
   (replaces -1)
   (inst -1 "Dom(sig1)" "union(Vars(s!1), Vars(t!1))")
   (("1"
     (prop)
     (("1"
       (case-replace "card(Dom(sig1)) = 1")
       (("1" (assert))
        ("2"
         (hide-all-but (-2 1 2))
         (rewrite "card_one")
         (lemma "dom_link_of_frst_diff_is")
         (inst -1 "first_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))"
          "subtermOF(s!1, p!1)" "subtermOF(t!1, p!1)")
         (replace -2 -1)
         (assert)
         (prop)
         (("1"
           (expand "restrict")
           (inst 1
            "subtermOF(subtermOF(s!1, p!1),
                                         first_diff(subtermOF(s!1, p!1),
                                                    subtermOF(t!1, p!1)))")
           (("1"
             (decompose-equality 1)
             (decompose-equality -2)
             (inst -1 "x!1")
             (hide -2 -3 2)
             (expand singleton)
             (propax))
            ("2" (expand "V") (propax))))
          ("2"
           (expand "restrict")
           (case "vars?(subtermOF(subtermOF(t!1, p!1),
                                       first_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))))")
           (("1"
             (inst 2
              "subtermOF(subtermOF(t!1, p!1),
                                           first_diff(subtermOF(s!1, p!1),
                                                      subtermOF(t!1, p!1)))")
             (("1"
               (decompose-equality -2)
               (decompose-equality 2)
               (inst -1 "x!1")
               (hide-all-but (-1 1))
               (expand singleton)
               (propax))
              ("2" (expand "V") (propax))))
            ("2" (hide -1 3) (expand "link_of_frst_diff") (assert))
            ("3"
             (hide-all-but 1)
             (lemma "position_s_first_diff")
             (inst -1 "subtermOF(t!1, p!1)" "subtermOF(s!1, p!1)"
              "first_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))")
             (assert)
             (hide 2)
             (lemma "comutative_first_diff")
             (inst -1 "subtermOF(s!1, p!1)" "subtermOF(t!1, p!1)"
              "first_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))"))))))))
      ("2"
       (lemma "dom_link_of_frst_diff_is")
       (inst -1 "first_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))"
        "subtermOF(s!1, p!1)" "subtermOF(t!1, p!1)")
       (replace -2 -1)
       (assert)
       (expand "restrict")
       (prop)
       (("1"
         (decompose-equality -2)
         (hide 3)
         (expand "subset?")
         (skosimp)
         (inst -1 "x!1")
         (expand "member")
         (iff)
         (assert)
         (expand "singleton")
         (expand "union")
         (flatten)
         (hide-all-but (-1 1))
         (expand* "member" "Vars")
         (inst 1
          "p!1 o first_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))")
         (("1"
           (rewrite pos_subterm)
           (("1" (assert))
            ("2"
             (hide -1 2)
             (lemma position_s_first_diff)
             (inst -1 "subtermOF(s!1, p!1)" "subtermOF(t!1, p!1)"
              "first_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))")
             (rewrite pos_o_term))))
          ("2"
           (hide -1)
           (lemma position_s_first_diff)
           (inst -1 "subtermOF(s!1, p!1)" "subtermOF(t!1, p!1)"
            "first_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))")
           (rewrite pos_o_term))))
        ("2"
         (case "vars?(subtermOF(subtermOF(t!1, p!1),
                                     first_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))))")
         (("1"
           (hide 1 4)
           (expand "subset?")
           (skosimp)
           (decompose-equality -2)
           (inst -1 "x!1")
           (expand "member")
           (iff)
           (assert)
           (hide -2 -3)
           (expand* "union" "member")
           (flatten)
           (hide 1)
           (expand "Vars")
           (inst 1
            "p!1 o first_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))")
           (("1"
             (expand singleton)
             (rewrite pos_subterm)
             (("1" (assert))
              ("2"
               (hide -1 2)
               (lemma position_t_first_diff)
               (inst -1 "subtermOF(s!1, p!1)" "subtermOF(t!1, p!1)"
                "first_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))")
               (rewrite pos_o_term))))
            ("2"
             (hide -1 -2 2)
             (lemma position_t_first_diff)
             (inst -1 "subtermOF(s!1, p!1)" "subtermOF(t!1, p!1)"
              "first_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))")
             (rewrite pos_o_term))))
          ("2" (hide -1 3 5) (expand "link_of_frst_diff") (assert))
          ("3"
           (hide-all-but 1)
           (lemma position_t_first_diff)
           (inst -1 "subtermOF(s!1, p!1)" "subtermOF(t!1, p!1)"
            "first_diff(subtermOF(s!1, p!1), subtermOF(t!1, p!1))"))))))))
    ("2" (hide -1 2 3) (typepred "sig1") (expand "Sub?") (propax))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("s!1" "t!1" "_"))
   (measure-induct+
    "IF p = empty_seq
                             THEN lex2(0,0)
                             ELSE lex2(length(p),
                             arity(f(subtermOF(s!1,delete(p,length(p) - 1)))) - last(p))
                             ENDIF"
    ("p"))
   (("1"
     (name-replace "p!1" "next_position(s!1, t!1, x!1)" :hide? nil)
     (case "x!1 = empty_seq")
     (("1"
       (hide -3)
       (replaces -1)
       (expand next_position)
       (replace -1 -2 rl)
       (hide -1)
       (expand subtermOF)
       (rewrite empty_0)
       (assert))
      ("2"
       (expand next_position -1)
       (assert)
       (lift-if)
       (ground)
       (("1"
         (inst -5
          "add_last(delete(x!1, length(x!1) - 1), 1 + last(x!1))")
         (("1"
           (replace -2)
           (prop)
           (hide -2 -5)
           (lemma next_position_TCC17)
           (inst -1 s!1 t!1 x!1)
           (assert)
           (inst -1 "delete(x!1, length(x!1) - 1)")
           (("1"
             (assert)
             (inst -1
              "add_last(delete(x!1, length(x!1) - 1), 1 + last(x!1))")
             (("1" (assert))
              ("2"
               (lift-if)
               (prop)
               (("1" (hide-all-but -1) (grind))
                ("2"
                 (hide-all-but (3 4))
                 (lemma empty_0[posnat])
                 (inst -1 x!1)
                 (assert))))))
            ("2"
             (hide-all-but (1 3))
             (lemma empty_0[posnat])
             (inst -1 x!1)
             (assert))))
          ("2"
           (hide-all-but (1 2))
           (lemma empty_0[posnat])
           (inst -1 x!1)
           (assert))))
        ("2"
         (inst -3 "delete(x!1, length(x!1) - 1)")
         (("1"
           (replace -1)
           (prop)
           (hide -3 -1)
           (lemma next_position_TCC19)
           (inst -1 s!1 t!1 x!1)
           (assert)
           (inst -1 "delete(x!1, length(x!1) - 1)")
           (("1"
             (assert)
             (inst -1
              "add_last(delete(x!1, length(x!1) - 1), 1 + last(x!1))")
             (hide-all-but (1 5))
             (lemma empty_0[posnat])
             (inst -1 x!1)
             (assert))
            ("2"
             (hide-all-but (1 5))
             (lemma empty_0[posnat])
             (inst -1 x!1)
             (assert))))
          ("2"
           (hide-all-but (1 4))
           (lemma empty_0[posnat])
           (inst -1 x!1)
           (assert))))
        ("3"
         (hide-all-but (-2 -5))
         (replace -1 -2 rl)
         (hide -1)
         (expand subtermOF)
         (rewrite empty_0)
         (assert))))))
    ("2"
     (hide 2)
     (lemma next_position_is_position)
     (inst -1 t!1 s!1 p!1)
     (lemma next_position_commute)
     (inst -1 s!1 t!1 p!1)
     (assert))
    ("3" (hide 2) (replaces -1) (rewrite next_position_is_position))
    ("4"
     (hide 3)
     (lemma next_position_TCC5)
     (inst -1 s!1 t!1 p!1)
     (assert))
    ("5" (hide 2) (rewrite empty_0))
    ("6"
     (hide 3)
     (lemma next_position_TCC3)
     (inst -1 s!1 t!1 p!1)
     (assert))
    ("7"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("8" (hide 3) (lemma empty_0[posnat]) (inst -1 p!1) (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (assert)
   (name-replace "pi" "next_position(s!1, t!1, p!1)" :hide? nil)
   (name-replace "qi"
    "first_diff(subtermOF(s!1, pi), subtermOF(t!1, pi))" :hide? nil)
   (lemma position_s_first_diff)
   (lemma position_t_first_diff)
   (inst -1 "subtermOF(s!1, pi)" "subtermOF(t!1, pi)" qi)
   (inst -2 "subtermOF(s!1, pi)" "subtermOF(t!1, pi)" qi)
   (assert)
   (lemma next_position_is_position)
   (inst-cp -1 s!1 t!1 p!1)
   (inst -1 t!1 s!1 p!1)
   (lemma next_position_commute)
   (inst -1 s!1 t!1 p!1)
   (replace -1 -2 rl)
   (hide -1)
   (replace -6)
   (hide -5 -6)
   (lemma pos_o_term)
   (inst-cp -1 pi qi s!1)
   (inst -1 pi qi t!1)
   (assert))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+
    "IF p = empty_seq
              THEN lex2(0,0)
              ELSE lex2(length(p),
                        arity(f(subtermOF(s,
                                       delete(p,length(p) - 1)))) - last(p))
              ENDIF"
    ("s" "t" "p"))
   (("1"
     (skosimp)
     (name-replace "np" "next_position(x!1, x!2, x!3)" :hide? nil)
     (expand next_position -1)
     (lift-if -1)
     (prop)
     (("1"
       (hide-all-but (-2 -4))
       (replace -1 -2 rl)
       (hide -1)
       (expand child)
       (skosimp)
       (lemma seq_empty[posnat])
       (inst -1 q!1 p1!1)
       (assert)
       (flatten)
       (rewrite empty_0 -2))
      ("2"
       (hide -2 1)
       (expand child)
       (skosimp)
       (inst 3 "p1!1 o #(last(x!3))")
       (("1"
         (split)
         (("1"
           (hide-all-but 1)
           (expand* "#" o empty_seq)
           (flatten)
           (assert))
          ("2"
           (rewrite o_assoc)
           (replace -2 1 rl)
           (hide -2)
           (lemma add_last_delete[posnat])
           (inst -1 x!3)
           (lemma empty_0[posnat])
           (inst -1 x!3)
           (assert)
           (replace -2)
           (rewrite add_last_is_o))))
        ("2" (flatten) (rewrite empty_0))))
      ("3"
       (hide -2 -3 -4 1)
       (lemma add_last_delete[posnat])
       (inst -1 x!3)
       (lemma empty_0[posnat])
       (inst -1 x!3)
       (assert)
       (name-replace "dp" "delete(x!3, x!3`length - 1)" :hide? nil)
       (rewrite add_last_is_o)
       (rewrite add_last_is_o)
       (expand child)
       (skosimp)
       (case "dp = q!1")
       (("1"
         (inst 4 "#(last(x!3))")
         (assert)
         (flatten)
         (hide-all-but -6)
         (expand* "#" empty_seq))
        ("2"
         (case "length(q!1) < length(dp)")
         (("1"
           (lemma o_length_o[posnat])
           (inst -1 q!1 p1!1 dp "#(1 + last(x!3))")
           (assert)
           (skosimp)
           (replace -1 -4)
           (inst 5 "seq!1 o  #(last(x!3))")
           (rewrite o_assoc)
           (assert)
           (hide-all-but 5)
           (flatten)
           (expand* "#" o empty_seq)
           (flatten)
           (hide -2)
           (assert))
          ("2"
           (hide-all-but (-3 -4 1 2 5))
           (replaces -2)
           (lemma o_equals_o[posnat])
           (inst -1 q!1 p1!1 dp "#(1 + last(x!3))")
           (assert)
           (hide 3)
           (lemma empty_0[posnat])
           (inst -1 p1!1)
           (assert)
           (hide 4)
           (expand o)
           (flatten)
           (hide -2)
           (expand "#")
           (assert))))))
      ("4"
       (name-replace "pi"
        "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))" :hide?
        nil)
       (("1"
         (name-replace "dp" "delete(x!3, length(x!3) - 1)" :hide? nil)
         (("1"
           (inst -7 x!1 x!2 pi)
           (inst -7 q!1)
           (assert)
           (prop)
           (("1"
             (hide -4 -5 -6 -7 -8)
             (lemma add_last_delete[posnat])
             (inst -1 x!3)
             (lemma empty_0[posnat])
             (inst -1 x!3)
             (assert)
             (replace -3)
             (rewrite add_last_is_o)
             (rewrite add_last_is_o)
             (expand child)
             (skosimp)
             (replace -2 -4)
             (case "dp = q!1")
             (("1"
               (inst 4 "#(last(x!3))")
               (assert)
               (hide-all-but 4)
               (flatten)
               (expand* "#" empty_seq))
              ("2"
               (case "length(dp) > length(q!1)")
               (("1"
                 (lemma o_length_o[posnat])
                 (inst -1 "q!1" "p1!1" "dp" "#(1 + last(x!3))")
                 (assert)
                 (skosimp)
                 (replace -1 -3)
                 (inst 5 "seq!1 o  #(last(x!3))")
                 (rewrite o_assoc)
                 (assert)
                 (hide-all-but 5)
                 (expand* "#" o empty_seq)
                 (flatten)
                 (hide -2)
                 (assert))
                ("2"
                 (hide-all-but (-4 1 2 4))
                 (lemma empty_0[posnat])
                 (inst -1 p1!1)
                 (assert)
                 (lemma o_equals_o[posnat])
                 (inst -1 "q!1" "p1!1" "dp" "#(1 + last(x!3))")
                 (assert)
                 (expand o)
                 (flatten)
                 (hide -2)
                 (expand "#")
                 (assert))))))
            ("2"
             (lift-if)
             (prop)
             (("1"
               (hide-all-but (-1 -3))
               (replace -2 -1 rl)
               (hide -2)
               (expand* add_last insert? empty_seq)
               (flatten)
               (hide -2)
               (assert))
              ("2"
               (hide -7 4)
               (lemma next_position_TCC17)
               (inst -1 x!1 x!2 x!3)
               (assert)
               (inst -1 dp)
               (assert)
               (replace -2)
               (inst -1 pi)
               (assert))))))
          ("2"
           (hide-all-but (1 2))
           (lemma empty_0[posnat])
           (inst -1 x!3)
           (assert))))
        ("2"
         (hide-all-but (1 2))
         (lemma empty_0[posnat])
         (inst -1 x!3)
         (assert))))
      ("5"
       (name-replace "dp" "delete(x!3, length(x!3) - 1)" :hide? nil)
       (("1"
         (inst -4 x!1 x!2 dp)
         (replace -2)
         (inst -4 q!1)
         (assert)
         (lemma next_position_TCC19)
         (inst -1 x!1 x!2 x!3)
         (assert)
         (inst -1 dp)
         (assert)
         (replace -2)
         (inst -1 "add_last(dp, 1 + last(x!3))")
         (assert)
         (hide-all-but (-2 -5 3 4))
         (lemma add_last_delete[posnat])
         (inst -1 x!3)
         (lemma empty_0[posnat])
         (inst -1 x!3)
         (assert)
         (replace -2)
         (rewrite add_last_is_o)
         (expand child)
         (skosimp)
         (replace -3 -1)
         (inst 4 "p1!1 o  #(last(x!3))")
         (rewrite o_assoc)
         (assert)
         (hide-all-but 4)
         (flatten)
         (expand* "#" o empty_seq)
         (flatten)
         (hide -2)
         (assert))
        ("2"
         (hide-all-but (1 4))
         (lemma empty_0[posnat])
         (inst -1 x!3)
         (assert))))
      ("6"
       (hide-all-but (-2 -5))
       (replace -1 -2 rl)
       (hide -1)
       (expand child)
       (skosimp)
       (lemma seq_empty[posnat])
       (inst -1 q!1 p1!1)
       (assert)
       (flatten)
       (rewrite empty_0 -2))))
    ("2"
     (hide-all-but (1 2))
     (lemma next_position_TCC5)
     (inst -1 x!1 x!2 x!3)
     (assert))
    ("3" (hide-all-but (-1 1)) (rewrite empty_0))
    ("4"
     (hide-all-but (1 2))
     (lemma next_position_TCC3)
     (inst -1 x!1 x!2 x!3)
     (assert))
    ("5"
     (hide-all-but (1 2))
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("6" (hide -1 3) (lemma empty_0[posnat]) (inst -1 x!3) (assert))
    ("7"
     (hide -1 3)
     (lemma next_position_TCC5)
     (inst -1 y!1 y!2 y!3)
     (assert))
    ("8" (hide -2 2) (rewrite empty_0))
    ("9"
     (hide -1 3)
     (lemma next_position_TCC3)
     (inst -1 y!1 y!2 y!3)
     (assert))
    ("10"
     (hide -1 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("11" (hide -1 3) (lemma empty_0[posnat]) (inst -1 y!3) (assert))
    ("12"
     (hide 3)
     (lemma next_position_TCC5)
     (inst -1 x!1 x!2 x!3)
     (assert))
    ("13" (hide 2) (rewrite empty_0))
    ("14"
     (hide 3)
     (lemma next_position_TCC3)
     (inst -1 x!1 x!2 x!3)
     (assert))
    ("15"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("16" (hide 3) (lemma empty_0[posnat]) (inst -1 x!3) (assert))
    ("17"
     (hide 3)
     (lemma next_position_TCC5)
     (inst -1 y!1 y!2 y!3)
     (assert))
    ("18" (hide 2) (rewrite empty_0))
    ("19"
     (hide 3)
     (lemma next_position_TCC3)
     (inst -1 y!1 y!2 y!3)
     (assert))
    ("20"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("21" (hide 3) (lemma empty_0[posnat]) (inst -1 y!3) (assert))
    ("22" (hide 3) (lemma next_position_TCC5) (inst?) (assert))
    ("23" (hide 2) (rewrite empty_0))
    ("24" (hide 3) (lemma next_position_TCC3) (inst?) (assert))
    ("25"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("26" (hide 3) (lemma empty_0[posnat]) (inst?) (assert))
    ("27" (hide 3) (lemma next_position_TCC5) (inst?) (assert))
    ("28" (hide 2) (rewrite empty_0))
    ("29" (hide 3) (lemma next_position_TCC3) (inst?) (assert))
    ("30"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("31" (hide 3) (lemma empty_0[posnat]) (inst?) (assert))
    ("32" (hide 3) (lemma next_position_TCC5) (inst?) (assert))
    ("33" (hide 2) (rewrite empty_0))
    ("34" (hide 3) (lemma next_position_TCC3) (inst?) (assert))
    ("35"
     (hide 3)
     (rewrite delete_is_position)
     (hide 3)
     (flatten)
     (rewrite empty_0))
    ("36" (hide 3) (lemma empty_0[posnat]) (inst?) (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+
    "lex2(length(p),
                              arity(f(subtermOF(s,
                                             delete(p,length(p) - 1)))) - last(p))"
    ("s" "t" "p"))
   (("1"
     (skosimp)
     (expand next_position -2)
     (lift-if)
     (prop)
     (("1"
       (hide-all-but (-1 -3 1))
       (replaces -1)
       (inst -1 empty_seq)
       (("1"
         (assert)
         (hide 1)
         (expand child)
         (inst 1 x!3)
         (assert)
         (rewrite empty_o_seq))
        ("2"
         (hide 2)
         (split)
         (("1"
           (expand positionsOF)
           (lift-if)
           (expand* only_empty_seq union member))
          ("2"
           (expand positionsOF)
           (lift-if)
           (expand* only_empty_seq union member))))))
      ("2" (hide-all-but -1) (grind))
      ("3"
       (name-replace "nx3"
        "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))" :hide?
        nil)
       (("1"
         (inst -6 x!1 x!2 nx3)
         (("1"
           (prop)
           (("1"
             (case "q!1 = nx3")
             (("1" (assert))
              ("2"
               (case "child(q!1, nx3)")
               (("1"
                 (hide-all-but (-1 -4 2))
                 (expand child)
                 (skosimp)
                 (replace -1 2)
                 (rewrite pos_subterm)
                 (rewrite pos_subterm)
                 (assert))
                ("2"
                 (case "left_without_children(nx3, q!1)")
                 (("1" (inst -2 q!1) (assert))
                  ("2"
                   (hide-all-but (-2 -8 1 2 3))
                   (lemma lwc_add_last_delete)
                   (inst -1 x!3 q!1)
                   (assert))))))))
            ("2"
             (skosimp)
             (inst -7 p1!1)
             (assert)
             (hide-all-but (-1 -2 2))
             (expand child)
             (skosimp)
             (inst 2
              "add_last(delete(p1!2, length(p1!2) - 1), last(p1!2) - 1)")
             (("1"
               (split)
               (("1" (hide-all-but 1) (grind))
                ("2"
                 (replaces -1)
                 (case "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3)) = delete(x!3, length(x!3) - 1) o #(1 + last(x!3))")
                 (("1"
                   (replaces -1)
                   (case "add_last(delete(p1!2, length(p1!2) - 1), last(p1!2) - 1) = delete(p1!2, length(p1!2) - 1) o #(last(p1!2) - 1)")
                   (("1"
                     (replaces -1)
                     (lemma add_last_delete[posnat])
                     (inst -1 x!3)
                     (lemma empty_0[posnat])
                     (inst -1 x!3)
                     (assert)
                     (rewrite add_last_delete_is_o)
                     (expand finseq_appl)
                     (lemma add_last_delete[posnat])
                     (inst -1 p1!2)
                     (lemma empty_0[posnat])
                     (inst -1 p1!2)
                     (assert)
                     (rewrite add_last_delete_is_o)
                     (expand finseq_appl)
                     (rewrite o_assoc)
                     (expand* last finseq_appl)
                     (assert)
                     (replace -1 -3)
                     (rewrite o_assoc)
                     (name-replace "pi1" "delete(x!3, x!3`length - 1)"
                      :hide? nil)
                     (name-replace "pi2"
                      "(p1!1 o delete(p1!2, p1!2`length - 1))" :hide?
                      nil)
                     (lemma o_equals_o[posnat])
                     (inst -1 pi1 "#(1 + x!3`seq(x!3`length - 1))" pi2
                      "#(p1!2`seq(p1!2`length - 1))")
                     (assert)
                     (split)
                     (("1"
                       (case "x!3`seq(x!3`length - 1) = p1!2`seq(p1!2`length - 1) - 1")
                       (("1" (assert))
                        ("2"
                         (lemma equal_prefix[posnat])
                         (inst -1 pi1 "#(1 + x!3`seq(x!3`length - 1))"
                          "#(p1!2`seq(p1!2`length - 1))")
                         (assert)
                         (expand "#" -1)
                         (decompose-equality -1)
                         (inst -1 0))))
                      ("2"
                       (hide-all-but (-5 1))
                       (expand o)
                       (flatten)
                       (hide -2)
                       (expand "#")
                       (propax))))
                    ("2"
                     (hide-all-but (1 3))
                     (lemma nth_add_last[posnat])
                     (inst?)
                     (("1"
                       (expand finseq_appl)
                       (decompose-equality 1)
                       (("1" (hide-all-but 1) (grind))
                        ("2"
                         (decompose-equality 1)
                         (("1"
                           (typepred x!4)
                           (inst -2 x!4)
                           (("1"
                             (prop)
                             (("1"
                               (replaces -2)
                               (expand o)
                               (assert)
                               (expand "#")
                               (propax))
                              ("2"
                               (replaces -1)
                               (expand o)
                               (lift-if)
                               (prop)
                               (hide 2 4)
                               (grind))))
                            ("2" (hide 2 3) (grind))))
                          ("2"
                           (hide -1)
                           (lemma empty_0[posnat])
                           (inst -1 p1!2)
                           (assert))))
                        ("3"
                         (hide -1)
                         (lemma empty_0[posnat])
                         (inst -1 p1!2)
                         (assert))))
                      ("2"
                       (hide 2)
                       (lemma empty_0[posnat])
                       (inst -1 p1!2)
                       (assert))
                      ("3"
                       (hide 2)
                       (lemma empty_0[posnat])
                       (inst -1 p1!2)
                       (assert))))
                    ("3"
                     (hide-all-but (1 3))
                     (lemma empty_0[posnat])
                     (inst -1 p1!2)
                     (assert))
                    ("4"
                     (hide-all-but (1 3))
                     (lemma empty_0[posnat])
                     (inst -1 p1!2)
                     (assert))))
                  ("2"
                   (hide -1 2)
                   (lemma nth_add_last[posnat])
                   (expand finseq_appl)
                   (decompose-equality 1)
                   (("1"
                     (hide-all-but 1)
                     (expand* add_last insert? o "#"))
                    ("2"
                     (decompose-equality 1)
                     (("1"
                       (typepred x!4)
                       (inst?)
                       (("1"
                         (inst?)
                         (("1"
                           (prop)
                           (("1"
                             (replaces -2)
                             (expand o)
                             (assert)
                             (replace -1 1)
                             (assert)
                             (expand "#")
                             (propax))
                            ("2"
                             (replaces -1)
                             (expand o)
                             (assert)
                             (lift-if)
                             (prop)
                             (hide-all-but (-1 1 3))
                             (expand* add_last insert?)
                             (assert))))
                          ("2" (hide 2 3 4) (expand* add_last insert?))))
                        ("2"
                         (hide-all-but 1)
                         (lemma empty_0[posnat])
                         (inst -1 x!3)
                         (assert))))
                      ("2"
                       (hide-all-but 1)
                       (lemma empty_0[posnat])
                       (inst -1 x!3)
                       (assert))))
                    ("3"
                     (hide-all-but 1)
                     (lemma empty_0[posnat])
                     (inst -1 x!3)
                     (assert))))
                  ("3"
                   (hide-all-but 1)
                   (lemma empty_0[posnat])
                   (inst -1 x!3)
                   (assert))))))
              ("2"
               (lemma empty_0[posnat])
               (inst-cp -1 p1!2)
               (inst -1 x!3)
               (assert)
               (case "last(p1!2) = 1 + last(x!3)")
               (("1" (assert))
                ("2"
                 (replaces -1)
                 (hide 4)
                 (expand* add_last insert? o finseq_appl)
                 (flatten)
                 (decompose-equality -2)
                 (inst -1 "length(delete(x!3, length(x!3) - 1))")
                 (assert)
                 (expand last 1 1)
                 (expand finseq_appl)
                 (assert))))
              ("3" (hide-all-but (1 2)) (flatten) (rewrite empty_0))
              ("4"
               (hide-all-but (1 2))
               (lemma empty_0[posnat])
               (inst -1 p1!2)
               (assert))))
            ("3"
             (hide -6 -7 2)
             (lemma next_position_TCC17)
             (inst -1 x!1 x!2 x!3)
             (assert)
             (inst -1 "delete(x!3, length(x!3) - 1)")
             (("1"
               (assert)
               (inst -1 nx3)
               (assert)
               (lift-if)
               (prop)
               (hide-all-but (-1 -3))
               (replaces -1)
               (grind))
              ("2"
               (hide-all-but 1)
               (lemma empty_0[posnat])
               (inst -1 x!3)
               (assert))))))
          ("2"
           (assert)
           (prop)
           (("1"
             (lemma next_position_TCC15)
             (inst -1 x!1 x!2 x!3)
             (assert)
             (inst -1 "delete(x!3, length(x!3) - 1)")
             (("1" (assert) (inst -1 nx3) (assert))
              ("2"
               (hide-all-but 1)
               (lemma empty_0[posnat])
               (inst -1 x!3)
               (assert))))
            ("2" (hide-all-but (-1 -2)) (replaces -1) (grind))))))
        ("2"
         (hide-all-but 1)
         (lemma empty_0[posnat])
         (inst -1 x!3)
         (assert))))
      ("4"
       (name-replace "px3" "delete(x!3, length(x!3) - 1)" :hide? nil)
       (("1"
         (inst -4 x!1 x!2 px3)
         (("1"
           (prop)
           (("1"
             (case "left_without_children(px3, q!1)")
             (("1" (inst -2 q!1) (assert))
              ("2"
               (hide -1 -3 -4 -5 4)
               (case "EXISTS (r : position): q!1 = px3 o r AND first(r) > last(x!3)")
               (("1"
                 (skosimp)
                 (case "r!1 = empty_seq")
                 (("1"
                   (hide-all-but (-1 -2 -4 -5 2))
                   (replaces -1)
                   (rewrite seq_o_empty)
                   (replaces -1)
                   (expand left_without_children)
                   (skosimp)
                   (lemma add_last_delete[posnat])
                   (inst -1 x!3)
                   (lemma empty_0[posnat])
                   (inst -1 x!3)
                   (assert)
                   (rewrite add_last_delete_is_o)
                   (expand finseq_appl)
                   (replace -2 -1)
                   (replace -1 -4)
                   (replace -3 -4)
                   (lemma equal_prefix[posnat])
                   (inst -1 r!2 "q1!1 o  #(x!3`seq(x!3`length - 1))"
                    p1!1)
                   (rewrite o_assoc)
                   (assert)
                   (hide -2 -3 -4 -5)
                   (expand* first o finseq_appl)
                   (decompose-equality -1)
                   (decompose-equality -2)
                   (inst -1 0)
                   (("1"
                     (lift-if)
                     (prop)
                     (("1" (assert))
                      ("2"
                       (hide-all-but (1 4))
                       (lemma empty_0[posnat])
                       (inst -1 q1!1)
                       (assert))))
                    ("2" (hide-all-but 1) (expand "#") (assert))))
                  ("2"
                   (lemma seq_first_rest_1[posnat])
                   (inst -1 r!1)
                   (lemma empty_0[posnat])
                   (inst -1 r!1)
                   (assert)
                   (replace -1 -2)
                   (rewrite o_assoc)
                   (name-replace "q!2" "px3 o  #(first(r!1))" :hide? nil)
                   (lemma pos_ax)
                   (inst -1 q!2 "rest(r!1)" x!1)
                   (assert)
                   (hide -3 -4 -6 -7 3)
                   (case "add_last(px3, 1 + last(x!3)) = px3 o #(1 + last(x!3))")
                   (("1"
                     (replaces -1)
                     (lemma pos_subterm_ax)
                     (inst -1 px3 "#(first(r!1))" x!1)
                     (assert)
                     (hide -2)
                     (lemma pos_o_term)
                     (inst -1 "px3" "#(1 + last(x!3))" "x!1")
                     (assert)
                     (split)
                     (("1"
                       (hide-all-but 1)
                       (reveal -10)
                       (replace -1 1 rl)
                       (rewrite delete_is_position)
                       (flatten)
                       (rewrite empty_0))
                      ("2"
                       (hide 5)
                       (lemma subterms_acc_arity)
                       (inst -1 "first(r!1)" "1 + last(x!3)"
                        "subtermOF(x!1, px3)")
                       (assert))))
                    ("2"
                     (hide - 2 3 5)
                     (expand o)
                     (decompose-equality 1)
                     (("1" (expand* add_last insert? "#" finseq_appl))
                      ("2"
                       (decompose-equality 1)
                       (("1"
                         (lemma nth_add_last[posnat])
                         (expand finseq_appl)
                         (lift-if)
                         (prop)
                         (("1"
                           (inst -2 px3 "1 + last(x!3)" x!4)
                           (("1" (assert)) ("2" (assert))))
                          ("2"
                           (inst -1 px3 "1 + last(x!3)" x!4)
                           (("1"
                             (ground)
                             (("1"
                               (replaces -2)
                               (replace -1 2)
                               (assert)
                               (expand* last finseq_appl "#"))
                              ("2"
                               (typepred x!4)
                               (hide -2 3 4)
                               (expand* add_last insert?)
                               (assert))))
                            ("2"
                             (typepred x!4)
                             (hide 3 4)
                             (expand* add_last insert?))))))
                        ("2"
                         (skosimp)
                         (expand* add_last insert? last "#" finseq_appl))
                        ("3" (skosimp) (assert))))
                      ("3" (skosimp) (assert))))))))
                ("2"
                 (hide 4)
                 (expand left_without_children)
                 (skosimp)
                 (case "length(r!1) = length(px3)")
                 (("1"
                   (lemma add_last_delete[posnat])
                   (inst -1 x!3)
                   (lemma empty_0[posnat])
                   (inst -1 x!3)
                   (assert)
                   (rewrite add_last_delete_is_o)
                   (replace -3 -1)
                   (expand finseq_appl)
                   (replace -1 -5)
                   (lemma o_equals_o[posnat])
                   (inst -1 px3 "#(x!3`seq(x!3`length - 1))" r!1 p1!1)
                   (assert)
                   (inst 2 q1!1)
                   (assert)
                   (case "last(x!3) = first(p1!1)")
                   (("1" (assert))
                    ("2"
                     (hide-all-but (-1 -4 -6 1 2 5 7))
                     (replaces -1)
                     (replace -1 -2 rl)
                     (hide -1)
                     (expand* o last first delete "#" finseq_appl)
                     (flatten)
                     (decompose-equality -2)
                     (("1"
                       (inst -1 "x!3`length - 1")
                       (("1" (assert))
                        ("2"
                         (hide -1 2 4 5)
                         (expand* "#" delete)
                         (assert))))
                      ("2"
                       (hide-all-but (-1 1))
                       (expand* "#" delete)
                       (assert))
                      ("3"
                       (hide-all-but 1)
                       (typepred x!4)
                       (expand* "#" delete)
                       (assert))))))
                  ("2"
                   (lemma add_last_delete[posnat])
                   (inst -1 x!3)
                   (lemma empty_0[posnat])
                   (inst -1 x!3)
                   (assert)
                   (rewrite add_last_delete_is_o)
                   (expand finseq_appl)
                   (replace -2 -1)
                   (replace -1 -4)
                   (case "length(r!1) > length(px3)")
                   (("1"
                     (lemma o_length_o[posnat])
                     (inst -1 px3 "#(x!3`seq(x!3`length - 1))" r!1 p1!1)
                     (assert)
                     (skosimp)
                     (replace -1 -5)
                     (inst 3 "seq!1 o q1!1")
                     (rewrite o_assoc)
                     (assert)
                     (case "seq!1 = empty_seq")
                     (("1"
                       (replace -1 -2)
                       (rewrite seq_o_empty)
                       (lemma o_equals_o[posnat])
                       (inst -1 px3 "#(x!3`seq(x!3`length - 1))" r!1
                        p1!1)
                       (assert))
                      ("2"
                       (lemma empty_0[posnat])
                       (inst -1 seq!1)
                       (assert)
                       (rewrite first_compo)
                       (replace -1 -6)
                       (lemma equal_prefix[posnat])
                       (inst -1 px3 "#(x!3`seq(x!3`length - 1))"
                        "seq!1 o p1!1")
                       (rewrite o_assoc)
                       (assert)
                       (hide-all-but (-1 1 9))
                       (expand* "#" o)
                       (flatten)
                       (hide -2)
                       (lemma empty_0[posnat])
                       (inst -1 p1!1)
                       (assert))))
                    ("2"
                     (lemma o_length_o[posnat])
                     (inst -1 r!1 p1!1 px3 "#(x!3`seq(x!3`length - 1))")
                     (assert)
                     (skosimp)
                     (case "seq!1 = empty_seq")
                     (("1"
                       (hide-all-but (-1 -2 3))
                       (replaces -1)
                       (rewrite seq_o_empty)
                       (assert))
                      ("2"
                       (replace -1 -5)
                       (lemma equal_prefix[posnat])
                       (inst -1 r!1 "seq!1 o  #(x!3`seq(x!3`length - 1))"
                        p1!1)
                       (rewrite o_assoc)
                       (assert)
                       (inst 6 r!1 seq!1 q1!1)
                       (assert)
                       (hide-all-but (-1 -7 1 6))
                       (case "first(seq!1) = first(p1!1)")
                       (("1" (assert))
                        ("2"
                         (hide-all-but (-1 1 2))
                         (replace -1 1 rl)
                         (rewrite first_compo)
                         (hide -1 2)
                         (flatten)
                         (rewrite empty_0))))))))))
                ("3"
                 (skosimp)
                 (lemma empty_0[posnat])
                 (inst -1 r!1)
                 (assert)
                 (replace -1 -2)
                 (rewrite seq_o_empty)
                 (hide -1 -3 1 3)
                 (replaces -1)
                 (expand left_without_children)
                 (skosimp)
                 (lemma add_last_delete[posnat])
                 (inst -1 x!3)
                 (lemma empty_0[posnat])
                 (inst -1 x!3)
                 (assert)
                 (rewrite add_last_delete_is_o)
                 (expand finseq_appl)
                 (replace -2 -1)
                 (replace -1 -4)
                 (replace -3 -4)
                 (lemma equal_prefix[posnat])
                 (inst -1 r!2 "q1!1 o  #(x!3`seq(x!3`length - 1))" p1!1)
                 (rewrite o_assoc)
                 (assert)
                 (replace -1 -6 rl)
                 (hide-all-but (-6 3))
                 (rewrite first_compo)
                 (("1" (assert))
                  ("2" (hide -1) (flatten) (rewrite empty_0))))))))
            ("2"
             (skosimp)
             (inst -5 p1!1)
             (assert)
             (hide-all-but (-1 -2 4))
             (expand child)
             (skosimp)
             (inst 2 "add_last(p1!2, last(x!3))")
             (("1"
               (prop)
               (("1" (hide-all-but -1) (grind))
                ("2"
                 (replaces -1)
                 (lemma empty_0[posnat])
                 (inst-cp -1 x!3)
                 (inst -1 p1!2)
                 (assert)
                 (expand* delete o add_last insert? finseq_appl)
                 (flatten)
                 (decompose-equality -2)
                 (decompose-equality 3)
                 (("1"
                   (decompose-equality 1)
                   (("1"
                     (lift-if)
                     (prop)
                     (("1" (inst -2 x!4) (("1" (assert)) ("2" (assert))))
                      ("2" (inst -2 x!4) (("1" (assert)) ("2" (assert))))
                      ("3"
                       (hide -1)
                       (typepred x!4)
                       (expand* last finseq_appl)
                       (assert))))
                    ("2"
                     (skosimp)
                     (hide -1)
                     (expand* add_last insert? finseq_appl)
                     (ground))
                    ("3" (skosimp) (assert))))
                  ("2"
                   (skosimp)
                   (hide -1)
                   (expand* add_last insert? finseq_appl))
                  ("3" (skosimp) (assert))))))
              ("2" (hide - 2) (flatten) (rewrite empty_0))))
            ("3"
             (hide -4 -5 4)
             (lemma next_position_TCC19)
             (inst -1 x!1 x!2 x!3)
             (assert)
             (inst -1 px3)
             (assert)
             (inst -1 "add_last(px3, 1 + last(x!3))")
             (assert))))
          ("2"
           (assert)
           (replace -1 1 rl)
           (rewrite delete_is_position)
           (("1"
             (rewrite delete_is_position)
             (hide-all-but 1)
             (lemma empty_0[posnat])
             (inst -1 x!3)
             (assert))
            ("2"
             (hide-all-but 1)
             (lemma empty_0[posnat])
             (inst -1 x!3)
             (assert))))))
        ("2"
         (hide-all-but 1)
         (lemma empty_0[posnat])
         (inst -1 x!3)
         (assert))))
      ("5"
       (hide -2 -3 -4 2)
       (name-replace "px3" "delete(x!3, length(x!3) - 1)" :hide? nil)
       (("1"
         (typepred q!1)
         (hide -2)
         (expand left_without_children)
         (skosimp)
         (lemma add_last_delete[posnat])
         (inst -1 x!3)
         (lemma empty_0[posnat])
         (inst -1 x!3)
         (assert)
         (rewrite add_last_delete_is_o)
         (expand finseq_appl)
         (replace -3 -1)
         (replace -1 -6)
         (replace -4)
         (rewrite empty_o_seq)
         (copy -6)
         (expand "#" -1)
         (expand o -1)
         (flatten)
         (hide -2)
         (lemma empty_0[posnat])
         (inst -1 p1!1)
         (assert)
         (case "p1!1`length = 1 AND r!1`length = 0")
         (("1"
           (flatten)
           (lemma empty_0[posnat])
           (inst -1 r!1)
           (assert)
           (replace -1 (-9 -10))
           (rewrite empty_o_seq)
           (rewrite empty_o_seq)
           (replace -9 -11 rl)
           (lemma seq_first_rest_1[posnat])
           (inst -1 q!1)
           (lemma empty_0[posnat])
           (inst -1 q!1)
           (assert)
           (lemma pos_ax)
           (inst -1 "#(first(q!1))" "rest(q!1)" x!1)
           (assert)
           (case "add_last(empty_seq, 1 + last(x!3)) = #(1 + last(x!3))")
           (("1"
             (replaces -1)
             (case "first(p1!1) = last(x!3)")
             (("1"
               (replace -1 4 rl)
               (hide-all-but (-2 -14 4))
               (lemma subterms_acc_arity)
               (inst -1 "first(q!1)" "1 + first(p1!1)" "x!1")
               (assert))
              ("2"
               (hide-all-but (-12 1))
               (replace -1 1 rl)
               (hide -1)
               (expand* first last "#" finseq_appl))))
            ("2" (hide-all-but 1) (expand* add_last insert? "#"))))
          ("2" (assert))))
        ("2"
         (typepred x!3)
         (hide-all-but (-3 1))
         (lemma empty_0[posnat])
         (inst -1 x!3)
         (assert))))))
    ("2"
     (hide-all-but 1)
     (skosimp)
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst -1 "p1!1" "p1!2" "y!2")
     (assert)
     (lemma not_var)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!2)
     (lemma empty_0[posnat])
     (inst -1 p1!2)
     (assert)
     (inst -2 "first(p1!2)" "p1!2" "rest(p1!2)" "subtermOF(y!2, p1!1)")
     (assert))
    ("3"
     (hide-all-but 1)
     (skosimp)
     (lemma app_term)
     (inst -1 y!3 p1!1 y!1)
     (assert))
    ("4"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 x!1 x!2 x!3)
     (assert))
    ("5" (hide 1) (rewrite empty_0))
    ("6" (hide 2) (rewrite subterm_is_app) (flatten) (rewrite empty_0))
    ("7"
     (hide 2)
     (rewrite delete_is_position)
     (flatten)
     (rewrite empty_0))
    ("8" (hide 2) (lemma empty_0[posnat]) (inst -1 x!3) (assert))
    ("9"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 y!1 y!2 y!3)
     (assert))
    ("10" (hide 1) (rewrite empty_0))
    ("11" (hide 2) (rewrite subterm_is_app) (flatten) (rewrite empty_0))
    ("12"
     (hide 2)
     (rewrite delete_is_position)
     (flatten)
     (rewrite empty_0))
    ("13" (hide 2) (lemma empty_0[posnat]) (inst -1 y!3) (assert))
    ("14"
     (hide-all-but 1)
     (skosimp)
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst?)
     (inst?)
     (assert)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!1)
     (lemma empty_0[posnat])
     (inst -1 p1!1)
     (assert)
     (lemma not_var)
     (inst?)
     (inst?)
     (assert))
    ("15"
     (hide-all-but 1)
     (skosimp)
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst?)
     (inst?)
     (assert)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!1)
     (lemma empty_0[posnat])
     (inst -1 p1!1)
     (assert)
     (lemma not_var)
     (inst?)
     (inst?)
     (assert))
    ("16"
     (hide-all-but 1)
     (skosimp)
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst?)
     (inst?)
     (assert)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!2)
     (lemma empty_0[posnat])
     (inst -1 p1!2)
     (assert)
     (lemma not_var)
     (inst?)
     (inst?)
     (assert))
    ("17"
     (hide-all-but 1)
     (skosimp)
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst?)
     (inst?)
     (assert)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!2)
     (lemma empty_0[posnat])
     (inst -1 p1!2)
     (assert)
     (lemma not_var)
     (inst?)
     (inst?)
     (assert))
    ("18"
     (hide 2)
     (lemma next_position_TCC5)
     (inst?)
     (inst?)
     (inst?)
     (assert))
    ("19" (hide 1) (rewrite empty_0) (assert))
    ("20" (hide 2) (rewrite subterm_is_app) (flatten) (rewrite empty_0))
    ("21"
     (hide 2)
     (rewrite delete_is_position)
     (flatten)
     (rewrite empty_0))
    ("22" (hide 2) (lemma empty_0[posnat]) (inst?) (assert))
    ("23"
     (hide 2)
     (lemma next_position_TCC5)
     (inst?)
     (inst?)
     (inst?)
     (assert))
    ("24" (hide 1) (rewrite empty_0) (assert))
    ("25" (hide 2) (rewrite subterm_is_app) (flatten) (rewrite empty_0))
    ("26"
     (hide 2)
     (rewrite delete_is_position)
     (flatten)
     (rewrite empty_0))
    ("27" (hide 2) (lemma empty_0[posnat]) (inst?) (assert))
    ("28"
     (hide -1 2)
     (skosimp)
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst -1 p1!1 p1!2 t!1)
     (assert)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!2)
     (lemma empty_0[posnat])
     (inst -1 p1!2)
     (assert)
     (lemma not_var)
     (inst -1 "first(p1!2)" "p1!2" "rest(p1!2)" "subtermOF(t!1, p1!1)")
     (assert))
    ("29"
     (hide -1 2)
     (skosimp)
     (expand child)
     (skosimp)
     (lemma pos_subterm_ax)
     (inst -1 p1!1 p1!2 s!1)
     (assert)
     (lemma seq_first_rest[posnat])
     (inst -1 p1!2)
     (lemma empty_0[posnat])
     (inst -1 p1!2)
     (assert)
     (lemma not_var)
     (inst -1 "first(p1!2)" "p1!2" "rest(p1!2)" "subtermOF(s!1, p1!1)")
     (assert))
    ("30"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 s!1 t!1 p!1)
     (assert))
    ("31" (hide 1) (rewrite empty_0))
    ("32" (hide 2) (rewrite subterm_is_app) (flatten) (rewrite empty_0))
    ("33"
     (hide 2)
     (rewrite delete_is_position)
     (flatten)
     (rewrite empty_0))
    ("34" (hide 2) (lemma empty_0[posnat]) (inst -1 p!1) (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+
    "lex2(length(p),
                                    arity(f(subtermOF(s,
                                                   delete(p,length(p) - 1)))) - last(p))"
    ("s" "t" "p"))
   (("1"
     (typepred x!3)
     (hide -1 -2)
     (flatten)
     (skosimp)
     (name-replace "np" "next_position(x!1, x!2, x!3)" :hide? nil)
     (expand next_position -1)
     (lift-if)
     (prop)
     (("1"
       (hide-all-but (-1 -3 1 2 3))
       (inst -2 np)
       (("1"
         (assert)
         (hide 1)
         (expand child)
         (inst 2 "#(last(x!3))")
         (("1"
           (lemma add_last_delete[posnat])
           (inst -1 x!3)
           (lemma empty_0[posnat])
           (inst -1 x!3)
           (assert)
           (rewrite add_last_is_o)
           (replace -2)
           (assert)
           (flatten)
           (hide-all-but -3)
           (expand* "#" empty_seq))
          ("2" (flatten) (rewrite empty_0))))
        ("2"
         (hide 2 4)
         (replace -1 1 rl)
         (rewrite delete_is_position)
         (("1"
           (rewrite delete_is_position)
           (hide -1 2)
           (flatten)
           (rewrite empty_0))
          ("2" (hide -1 2) (flatten) (rewrite empty_0))))))
      ("2"
       (replace -1)
       (hide -3 -4 -5 1)
       (case "left_without_children(q!1, x!3)")
       (("1" (inst -4 q!1) (assert))
        ("2"
         (case "x!3 <= q!1")
         (("1"
           (expand "<=")
           (skosimp)
           (case "p1!1 = empty_seq")
           (("1" (replaces -1) (rewrite seq_o_empty) (assert))
            ("2"
             (hide -2 -3 -4 -6 2 4)
             (lemma pos_subterm)
             (inst-cp -1 x!3 p1!1 x!2)
             (inst -1 x!3 p1!1 x!1)
             (assert))))
          ("2"
           (hide-all-but (-1 -5 1 2 3))
           (lemma lwc_add_last_delete1)
           (inst -1 q!1 x!3)
           (assert)
           (replace -2)
           (assert)
           (prop)
           (("1" (expand* child <=) (skosimp) (inst 2 p1!1))
            ("2"
             (expand <=)
             (inst 1 empty_seq)
             (rewrite seq_o_empty))))))))
      ("3"
       (name-replace "pi"
        "add_last(delete(x!3, length(x!3) - 1), 1 + last(x!3))" :hide?
        nil)
       (("1"
         (inst -6 x!1 x!2 pi)
         (("1"
           (lemma next_position_TCC17)
           (inst -1 x!1 x!2 x!3)
           (assert)
           (inst -1 "delete(x!3, length(x!3) - 1)")
           (("1"
             (assert)
             (inst -1 pi)
             (assert)
             (case "pi = empty_seq")
             (("1"
               (hide-all-but (-1 -3))
               (replaces -1)
               (expand* add_last insert? empty_seq)
               (flatten)
               (assert))
              ("2"
               (assert)
               (hide -1)
               (replace -3)
               (prop)
               (("1" (inst -1 q!1) (assert))
                ("2"
                 (hide -2 -3 -5 -7 -8 -9 4 5)
                 (skosimp)
                 (inst -4 p1!1)
                 (assert)
                 (hide 1)
                 (lemma add_last_delete[posnat])
                 (inst -1 x!3)
                 (lemma empty_0[posnat])
                 (inst -1 x!3)
                 (assert)
                 (rewrite add_last_is_o)
                 (name-replace "dp" "delete(x!3, length(x!3) - 1)")
                 (rewrite add_last_is_o)
                 (expand child)
                 (skosimp)
                 (case "length(p1!1) = length(dp)")
                 (("1"
                   (lemma o_equals_o[posnat])
                   (inst -1 dp "#(1 + last(x!3))" p1!1 p1!2)
                   (assert)
                   (inst 5 "#(last(x!3))")
                   (assert)
                   (hide-all-but 5)
                   (flatten)
                   (expand* "#" empty_seq))
                  ("2"
                   (case "length(p1!1) < length(dp)")
                   (("1"
                     (lemma o_length_o[posnat])
                     (inst -1 p1!1 p1!2 dp "#(1 + last(x!3))")
                     (assert)
                     (skosimp)
                     (replace -1 -3)
                     (inst 6 "seq!1 o  #(last(x!3))")
                     (rewrite o_assoc)
                     (assert)
                     (hide-all-but 6)
                     (flatten)
                     (expand* o "#" empty_seq)
                     (flatten)
                     (hide -2)
                     (assert))
                    ("2"
                     (hide -1 -4 5 7)
                     (replaces -1)
                     (expand* "#" o)
                     (flatten)
                     (hide -2)
                     (lemma empty_0[posnat])
                     (inst -1 p1!2)
                     (assert))))))
                ("3"
                 (hide -2 -3 -5 -6 -9 4 5)
                 (skosimp)
                 (case "left_without_children(q!2, x!3)")
                 (("1" (inst -5 q!2) (assert))
                  ("2"
                   (case "x!3 <= q!2")
                   (("1"
                     (expand "<=")
                     (skosimp)
                     (case "p1!1 = empty_seq")
                     (("1" (replaces -1) (rewrite seq_o_empty) (assert))
                      ("2"
                       (replace -1 3)
                       (rewrite pos_subterm)
                       (rewrite pos_subterm)
                       (hide-all-but (-6 3))
                       (assert))))
                    ("2"
                     (hide-all-but (-1 -2 1 2 5))
                     (lemma lwc_add_last_delete1)
                     (inst -1 q!2 x!3)
                     (assert)
                     (replace -3)
                     (assert)
                     (prop)
                     (("1" (expand* child <=) (skosimp) (inst 2 p1!1))
                      ("2"
                       (expand <=)
                       (inst 1 empty_seq)
                       (rewrite seq_o_empty))))))))))))
            ("2"
             (hide-all-but (1 2))
             (lemma empty_0[posnat])
             (inst -1 x!3)
             (assert))))
          ("2"
           (assert)
           (hide -2 -6 -7 -8 -9 4)
           (lemma next_position_TCC15)
           (inst -1 x!1 x!2 x!3)
           (assert)
           (inst -1 "delete(x!3, length(x!3) - 1)")
           (("1"
             (assert)
             (inst -1 pi)
             (assert)
             (hide-all-but (-2 1))
             (flatten)
             (replaces -1)
             (expand* add_last insert? empty_seq)
             (flatten)
             (hide -2)
             (assert))
            ("2"
             (hide-all-but (1 3))
             (lemma empty_0[posnat])
             (inst -1 x!3)
             (assert))))))
        ("2"
         (hide-all-but (1 2))
         (lemma empty_0[posnat])
         (inst -1 x!3)
         (assert))))
      ("4"
       (name-replace "dp" "delete(x!3, length(x!3) - 1)" :hide? nil)
       (("1"
         (name-replace "pi" "add_last(dp, 1 + last(x!3))" :hide? nil)
         (inst -5 x!1 x!2 dp)
         (("1"
           (lemma next_position_TCC19)
           (inst -1 x!1 x!2 x!3)
           (assert)
           (inst -1 dp)
           (assert)
           (inst -1 pi)
           (assert)
           (hide -1)
           (replace -3)
           (prop)
           (("1" (inst -1 q!1) (assert))
            ("2"
             (skosimp)
             (hide-all-but (-1 -3 -6 1 2 4))
             (inst -3 p1!1)
             (assert)
             (hide 1)
             (expand child)
             (skosimp)
             (lemma add_last_delete[posnat])
             (inst -1 x!3)
             (lemma empty_0[posnat])
             (inst -1 x!3)
             (assert)
             (rewrite add_last_is_o)
             (replace -3)
             (replace -2 -1)
             (inst 5 "p1!2 o  #(last(x!3))")
             (rewrite o_assoc)
             (assert)
             (hide-all-but 5)
             (flatten)
             (expand* "#" o empty_seq)
             (flatten)
             (hide -2)
             (assert))
            ("3"
             (hide-all-but (-2 -6 1 2 4))
             (skosimp)
             (inst -3 q!2)
             (assert)
             (hide 1)
             (expand "left_without_children")
             (skosimp)
             (lemma add_last_delete[posnat])
             (inst -1 x!3)
             (lemma empty_0[posnat])
             (inst -1 x!3)
             (assert)
             (replace -5)
             (rewrite add_last_is_o)
             (replace -2 -1)
             (inst 6 r!1 p1!1 "q1!1 o  #(last(x!3))")
             (rewrite o_assoc)
             (rewrite first_compo)
             (("1"
               (assert)
               (hide-all-but 6)
               (flatten)
               (expand* "#" o empty_seq)
               (flatten)
               (hide -2)
               (assert))
              ("2" (hide-all-but (1 3)) (flatten) (rewrite empty_0))))
            ("4"
             (lemma equal_term)
             (inst -1 "subtermOF(x!1, dp)" "subtermOF(x!2, dp)"
              "#(last(x!3))")
             (("1"
               (ground)
               (("1"
                 (skosimp)
                 (typepred q!2)
                 (hide-all-but (-1 -3 -4 -5 3 4 5))
                 (expand left_without_children)
                 (skosimp)
                 (rewrite add_last_is_o)
                 (replace -5 4 rl)
                 (rewrite pos_o_term)
                 (("1"
                   (hide-all-but (-6 1 3))
                   (replace -1 1 rl)
                   (rewrite delete_is_position)
                   (hide -1 2)
                   (flatten)
                   (rewrite empty_0))
                  ("2"
                   (case "r!1 = empty_seq")
                   (("1"
                     (replaces -1)
                     (rewrite empty_o_seq)
                     (rewrite empty_o_seq)
                     (lemma seq_first_rest_1[posnat])
                     (inst -1 q1!1)
                     (lemma empty_0[posnat])
                     (inst -1 q1!1)
                     (assert)
                     (replace -1 -5)
                     (rewrite first_compo)
                     (("1"
                       (replaces -3)
                       (expand first -4 2)
                       (expand finseq_appl)
                       (expand "#" -4)
                       (lemma pos_ax)
                       (inst -1 "#(first(q1!1))" "rest(q1!1)"
                        "subtermOF(x!1, dp)")
                       (assert)
                       (lemma subterms_acc_arity)
                       (inst -1 "first(q1!1)" "1 + last(x!3)"
                        "subtermOF(x!1, dp)")
                       (assert)
                       (hide-all-but (-4 -5 1))
                       (case "last(x!3) = first(p1!1)")
                       (("1" (assert))
                        ("2"
                         (hide -2 2)
                         (replace -1 1 rl)
                         (hide -1)
                         (expand* first finseq_appl)
                         (expand "#")
                         (propax))))
                      ("2"
                       (hide-all-but 1)
                       (flatten)
                       (expand "#")
                       (assert))))
                    ("2"
                     (hide-all-but (-3 1 4))
                     (expand* "#" o)
                     (flatten)
                     (hide -2)
                     (lemma empty_0[posnat])
                     (inst-cp -1 r!1)
                     (inst -1 p1!1)
                     (assert))))))
                ("2"
                 (skosimp)
                 (case "left_without_children(dp o q!2, x!3)")
                 (("1"
                   (inst -8 "dp o q!2")
                   (("1"
                     (assert)
                     (hide-all-but (-4 -8 1))
                     (typepred q!2)
                     (rewrite pos_subterm)
                     (("1"
                       (rewrite pos_subterm)
                       (hide -4 2)
                       (rewrite pos_o_term)
                       (replace -3 1 rl)
                       (rewrite delete_is_position)
                       (flatten)
                       (rewrite empty_0))
                      ("2"
                       (hide -4 2)
                       (rewrite pos_o_term)
                       (replace -3 1 rl)
                       (rewrite delete_is_position)
                       (flatten)
                       (rewrite empty_0))))
                    ("2"
                     (hide-all-but (-4 1 6))
                     (typepred q!2)
                     (rewrite pos_o_term)
                     (("1"
                       (rewrite pos_o_term)
                       (replace -3 1 rl)
                       (rewrite delete_is_position)
                       (flatten)
                       (rewrite empty_0))
                      ("2"
                       (replace -3 1 rl)
                       (rewrite delete_is_position)
                       (flatten)
                       (rewrite empty_0))))))
                  ("2"
                   (hide-all-but (-1 -3 1 4 6))
                   (expand left_without_children)
                   (skosimp)
                   (case "r!1 = empty_seq")
                   (("1"
                     (replaces -1)
                     (rewrite empty_o_seq)
                     (rewrite empty_o_seq)
                     (inst 1 dp p1!1 q1!1)
                     (lemma add_last_delete[posnat])
                     (inst -1 x!3)
                     (lemma empty_0[posnat])
                     (inst -1 x!3)
                     (assert)
                     (rewrite add_last_is_o)
                     (replace -5)
                     (replace -2)
                     (propax))
                    ("2"
                     (hide-all-but (-1 1 3))
                     (expand* "#" o)
                     (flatten)
                     (hide -2)
                     (lemma empty_0[posnat])
                     (inst-cp -1 r!1)
                     (inst -1 q1!1)
                     (assert))))))
                ("3"
                 (skosimp)
                 (lemma pos_subterm)
                 (inst-cp -1 dp p1!1 x!1)
                 (inst -1 dp p1!1 x!2)
                 (split)
                 (("1"
                   (split)
                   (("1"
                     (replace -1 1 rl)
                     (replace -2 1 rl)
                     (hide -1 -2 -4 -6 -7 -9 -10 -11 2 4 6 7)
                     (case "child(x!3, dp o p1!1)")
                     (("1"
                       (inst -4 "dp o p1!1")
                       (("1" (assert))
                        ("2"
                         (hide -1 -2 2 3)
                         (typepred p1!1)
                         (rewrite pos_o_term)
                         (("1"
                           (rewrite pos_o_term)
                           (hide -1 -2 2)
                           (replace -1 1 rl)
                           (rewrite delete_is_position)
                           (hide -1 2)
                           (flatten)
                           (rewrite empty_0))
                          ("2"
                           (hide -1 -2 2)
                           (replace -1 1 rl)
                           (rewrite delete_is_position)
                           (hide -1 2)
                           (flatten)
                           (rewrite empty_0))))))
                      ("2"
                       (hide -3 2)
                       (expand child)
                       (skosimp)
                       (case "p1!1 = empty_seq")
                       (("1"
                         (replaces -1)
                         (rewrite empty_o_seq)
                         (rewrite seq_o_empty)
                         (inst 1 p1!2)
                         (assert)
                         (lemma add_last_delete[posnat])
                         (inst -1 x!3)
                         (lemma empty_0[posnat])
                         (inst -1 x!3)
                         (assert)
                         (replace -3)
                         (rewrite add_last_is_o)
                         (assert))
                        ("2"
                         (hide-all-but (-1 1 3))
                         (expand* "#" o)
                         (flatten)
                         (hide -2)
                         (lemma empty_0[posnat])
                         (inst-cp -1 p1!1)
                         (inst -1 p1!2)
                         (assert))))))
                    ("2"
                     (hide-all-but (-4 1 6))
                     (typepred p1!1)
                     (hide -2)
                     (rewrite pos_o_term)
                     (replace -2 1 rl)
                     (rewrite delete_is_position)
                     (flatten)
                     (rewrite empty_0))))
                  ("2"
                   (hide-all-but (-4 1 6))
                   (typepred p1!1)
                   (hide -1)
                   (rewrite pos_o_term)
                   (replace -2 1 rl)
                   (rewrite delete_is_position)
                   (flatten)
                   (rewrite empty_0))))
                ("4"
                 (hide-all-but (-2 -7 1 5))
                 (lemma add_last_delete[posnat])
                 (inst -1 x!3)
                 (lemma empty_0[posnat])
                 (inst -1 x!3)
                 (assert)
                 (replace -2)
                 (rewrite add_last_is_o)
                 (lemma pos_subterm)
                 (inst-cp -1 dp "#(last(x!3))" x!2)
                 (inst -1 dp "#(last(x!3))" x!1)
                 (assert))
                ("5" (hide-all-but -1) (expand* "#" empty_seq))))
              ("2"
               (hide-all-but (-2 1 5))
               (lemma add_last_delete[posnat])
               (inst -1 x!3)
               (lemma empty_0[posnat])
               (inst -1 x!3)
               (assert)
               (replace -2)
               (rewrite add_last_is_o)
               (rewrite pos_subterm_ax)
               (rewrite pos_subterm_ax))))))
          ("2"
           (hide-all-but (-2 1 2 4))
           (assert)
           (replace -1 1 rl)
           (rewrite delete_is_position)
           (("1"
             (rewrite delete_is_position)
             (hide-all-but (1 4))
             (flatten)
             (rewrite empty_0))
            ("2" (hide-all-but (1 4)) (flatten) (rewrite empty_0))))))
        ("2"
         (hide-all-but (1 4))
         (lemma empty_0[posnat])
         (inst -1 x!3)
         (assert))))
      ("5" (hide-all-but (-2 3)) (assert))))
    ("2"
     (hide -1 2)
     (skosimp)
     (lemma app_term)
     (inst -1 y!3 p1!1 y!2)
     (assert))
    ("3"
     (hide -1 2)
     (skosimp)
     (lemma app_term)
     (inst -1 y!3 p1!1 y!1)
     (assert))
    ("4"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 x!1 x!2 x!3)
     (assert))
    ("5" (hide 1) (rewrite empty_0))
    ("6"
     (hide 2)
     (lemma next_position_TCC3)
     (inst -1 x!1 x!2 x!3)
     (assert))
    ("7"
     (hide 2)
     (rewrite delete_is_position)
     (hide 2)
     (flatten)
     (rewrite empty_0))
    ("8" (hide 2) (lemma empty_0[posnat]) (inst -1 x!3) (assert))
    ("9"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 y!1 y!2 y!3)
     (assert))
    ("10" (hide 1) (rewrite empty_0))
    ("11"
     (hide 2)
     (lemma app_term)
     (inst -1 "y!3" "delete(y!3, length(y!3) - 1)" "y!1")
     (("1"
       (assert)
       (hide 2)
       (rewrite delete_is_position)
       (("1"
         (name-replace "dp" "delete(y!3, length(y!3) - 1)" :hide? nil)
         (("1"
           (lemma add_last_delete[posnat])
           (inst -1 y!3)
           (lemma empty_0[posnat])
           (inst -1 y!3)
           (assert)
           (replace -2)
           (rewrite add_last_is_o)
           (expand child)
           (inst 2 "#(last(y!3))")
           (assert)
           (flatten)
           (expand* "#" empty_seq))
          ("2" (hide 2) (lemma empty_0[posnat]) (inst -1 y!3) (assert))))
        ("2" (hide 2) (flatten) (rewrite empty_0))))
      ("2" (hide 2) (lemma empty_0[posnat]) (inst -1 y!3) (assert))))
    ("12"
     (hide 2)
     (rewrite delete_is_position)
     (flatten)
     (rewrite empty_0))
    ("13" (hide 2) (lemma empty_0[posnat]) (inst -1 y!3) (assert))
    ("14"
     (hide -1 2)
     (skosimp)
     (lemma app_term)
     (inst -1 "x!1`3" "p11!1" "x!1`2")
     (assert))
    ("15"
     (hide -1 2)
     (skosimp)
     (lemma app_term)
     (inst -1 "x!1`3" "p11!1" "x!1`1")
     (assert))
    ("16"
     (hide -1 2)
     (skosimp)
     (lemma app_term)
     (inst -1 "y!1`3" "p1!1" "y!1`2")
     (assert))
    ("17"
     (hide -1 2)
     (skosimp)
     (lemma app_term)
     (inst -1 "y!1`3" "p1!1" "y!1`1")
     (assert))
    ("18"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 "x!1`1" "x!1`2" "x!1`3")
     (assert))
    ("19" (hide 1) (rewrite empty_0) (assert))
    ("20"
     (hide 2)
     (name-replace "dp" "delete(x!1`3, length(x!1`3) - 1)" :hide? nil)
     (("1"
       (lemma add_last_delete[posnat])
       (inst -1 "x!1`3")
       (lemma empty_0[posnat])
       (inst -1 "x!1`3")
       (assert)
       (replace -2)
       (rewrite add_last_is_o)
       (lemma app_term)
       (inst -1 "x!1`3" "dp" "x!1`1")
       (assert)
       (split)
       (("1" (replace -2 1 rl) (rewrite delete_is_position))
        ("2"
         (hide 3)
         (expand child)
         (inst 1 "#(last(x!1`3))")
         (assert)
         (flatten)
         (expand* "#" empty_seq))))
      ("2" (hide 2) (lemma empty_0[posnat]) (inst -1 "x!1`3") (assert))))
    ("21"
     (hide 2)
     (rewrite delete_is_position)
     (flatten)
     (rewrite empty_0))
    ("22" (hide 2) (lemma empty_0[posnat]) (inst -1 "x!1`3") (assert))
    ("23"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 "y!1`1" "y!1`2" "y!1`3")
     (assert))
    ("24" (hide 1) (rewrite empty_0) (assert))
    ("25"
     (hide 2)
     (lemma empty_0[posnat])
     (inst -1 "y!1`3")
     (assert)
     (name-replace "dp" "delete(y!1`3, length(y!1`3) - 1)" :hide? nil)
     (lemma add_last_delete[posnat])
     (inst -1 "y!1`3")
     (assert)
     (replace -2)
     (rewrite add_last_is_o)
     (lemma app_term)
     (inst -1 "y!1`3" "dp" "y!1`1")
     (assert)
     (split)
     (("1" (replace -2 1 rl) (rewrite delete_is_position))
      ("2"
       (hide 3)
       (expand child)
       (inst 1 "#(last(y!1`3))")
       (assert)
       (flatten)
       (expand* "#" empty_seq))))
    ("26"
     (hide 2)
     (rewrite delete_is_position)
     (flatten)
     (rewrite empty_0))
    ("27" (hide 2) (lemma empty_0[posnat]) (inst -1 "y!1`3") (assert))
    ("28" (hide 2) (lemma app_term) (inst -1 p!1 p1!1 t!1) (assert))
    ("29" (hide 2) (lemma app_term) (inst -1 p!1 p1!1 s!1) (assert))
    ("30"
     (hide 2)
     (lemma next_position_TCC5)
     (inst -1 s!1 t!1 p!1)
     (assert))
    ("31" (hide 1) (rewrite empty_0))
    ("32"
     (hide 2)
     (lemma empty_0[posnat])
     (inst -1 p!1)
     (assert)
     (name-replace "dp" "delete(p!1, length(p!1) - 1)" :hide? nil)
     (lemma add_last_delete[posnat])
     (inst -1 p!1)
     (assert)
     (replace -2)
     (rewrite add_last_is_o)
     (lemma app_term)
     (inst -1 p!1 dp s!1)
     (assert)
     (split)
     (("1" (replace -2 1 rl) (rewrite delete_is_position))
      ("2"
       (hide 3)
       (expand child)
       (inst 1 "#(last(p!1))")
       (assert)
       (flatten)
       (expand* "#" empty_seq))))
    ("33"
     (hide 2)
     (rewrite delete_is_position)
     (flatten)
     (rewrite empty_0))
    ("34" (hide 2) (lemma empty_0[posnat]) (inst -1 p!1) (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "length(first_diff(s, t))" ("s" "t"))
   (skosimp)
   (name-replace "fd" "first_diff(x!1, x!2)" :hide? nil)
   (expand first_diff -1)
   (lift-if)
   (prop)
   (("1"
     (hide-all-but (-2 -4))
     (replace -1 -2 rl)
     (hide -1)
     (expand left_without_children)
     (skosimp)
     (lemma seq_empty[posnat])
     (inst -1 r!1 q1!1)
     (assert)
     (flatten)
     (rewrite empty_0 -2))
    ("2"
     (hide-all-but (-2 -4))
     (replace -1 -2 rl)
     (hide -1)
     (expand left_without_children)
     (skosimp)
     (lemma seq_empty[posnat])
     (inst -1 r!1 q1!1)
     (assert)
     (flatten)
     (rewrite empty_0 -2))
    ("3"
     (hide-all-but (-2 -4))
     (replace -1 -2 rl)
     (hide -1)
     (expand left_without_children)
     (skosimp)
     (lemma seq_empty[posnat])
     (inst -1 r!1 q1!1)
     (assert)
     (flatten)
     (rewrite empty_0 -2))
    ("4"
     (name-replace "k1"
      "min({kk: below[length(args(x!2))] |
                                                            subtermOF(x!1,  #(kk + 1)) /=
                                                             subtermOF(x!2,  #(kk + 1))})"
      :hide? nil)
     (("1"
       (assert)
       (expand left_without_children)
       (skosimp)
       (case "r!1 = empty_seq")
       (("1"
         (hide -5)
         (replaces -1)
         (rewrite empty_o_seq)
         (rewrite empty_o_seq)
         (replace -4 (-6 4) rl)
         (replace -5 (-6 5) rl)
         (hide -4 -5)
         (rewrite add_first_is_o)
         (replace -3 -4 rl)
         (rewrite first_compo)
         (("1"
           (lemma seq_first_rest_1[posnat])
           (inst -1 p!1)
           (lemma empty_0[posnat])
           (inst -1 p!1)
           (assert)
           (replace -1 -5)
           (rewrite first_compo)
           (("1"
             (expand first -5 1)
             (expand finseq_appl)
             (expand "#" -5 1)
             (replace -1 7)
             (rewrite pos_subterm)
             (rewrite pos_subterm)
             (case "subtermOF(x!1,  #(first(p!1))) = subtermOF(x!2,  #(first(p!1)))")
             (("1" (assert))
              ("2"
               (hide 8)
               (expand first -5 2)
               (expand finseq_appl)
               (expand "#" -5)
               (name-replace "B" "length(args(x!2))" :hide? nil)
               (lemma "min_def[below[B]]")
               (inst -1 "k1"
                "{kk: below[length(args(x!2))] |
                             NOT subtermOF(x!1,  #(1 + kk)) = subtermOF(x!2,  #(1 + kk))}")
               (("1"
                 (expand "minimum?")
                 (prop)
                 (("1"
                   (inst -2 "first(p!1) -1")
                   (("1" (assert)) ("2" (assert))))
                  ("2"
                   (hide-all-but (-1 -3 1))
                   (skosimp*)
                   (typepred "k1")
                   (typepred "x!3")
                   (replace -4 -1 rl)
                   (inst -3 "x!3")
                   (assert))))
                ("2"
                 (expand "nonempty?")
                 (expand "empty?")
                 (inst -1 "k1")
                 (("1" (expand "member") (assert))
                  ("2" (typepred "k1") (replaces -3 -1))))
                ("3"
                 (hide-all-but (-1 1))
                 (skosimp*)
                 (prop)
                 (("1" (assert)) ("2" (assert))))
                ("4"
                 (skosimp*)
                 (lemma "positions_of_arg")
                 (inst -1 "x!2" "kk!1")
                 (assert))
                ("5" (skosimp*) (rewrite "positions_of_arg"))
                ("6"
                 (typepred "k1")
                 (hide-all-but (-1 -3 2))
                 (assert))))))
            ("2"
             (hide-all-but (1 7))
             (expand* "#" first finseq_appl)
             (assert))))
          ("2" (hide-all-but 1) (flatten) (expand "#") (assert))))
        ("2"
         (inst -4 "subtermOF(x!1,  #(1 + k1))"
          "subtermOF(x!2,  #(1 + k1))")
         (replace -3 -4 rl)
         (expand add_first -4)
         (expand insert? -4)
         (inst -4 "rest(p!1)")
         (("1"
           (split)
           (("1"
             (lemma seq_first_rest_1[posnat])
             (inst -1 p!1)
             (split)
             (("1"
               (case "first(p!1) = 1 + k1")
               (("1"
                 (replace -1 -2)
                 (replace -2 7)
                 (rewrite pos_subterm)
                 (rewrite pos_subterm))
                ("2"
                 (hide -1 -2 -3 -4 -8 3 4 5 8)
                 (replace -3 1)
                 (rewrite first_compo)
                 (("1"
                   (replace -2 -1)
                   (rewrite add_first_is_o)
                   (expand* first finseq_appl)
                   (expand "#" -1 1)
                   (expand o -1)
                   (flatten)
                   (decompose-equality -2)
                   (inst -1 0)
                   (("1"
                     (assert)
                     (lemma empty_0[posnat])
                     (inst -1 r!1)
                     (assert))
                    ("2" (assert))))
                  ("2" (flatten) (rewrite empty_0))))))
              ("2"
               (hide-all-but (-6 1 2 7))
               (flatten)
               (rewrite empty_0)
               (replaces -1)
               (lemma seq_empty[posnat])
               (inst -1 r!1 p1!1)
               (assert)
               (flatten)
               (rewrite empty_0))))
            ("2"
             (hide-all-but (-3 -4 -5 -6 1 2 6 7))
             (lemma seq_first_rest_1[posnat])
             (inst -1 r!1)
             (lemma empty_0[posnat])
             (inst -1 r!1)
             (assert)
             (inst 2 "rest(r!1)" "p1!1" "q1!1")
             (assert)
             (rewrite add_first_is_o)
             (lemma o_equals_o[posnat])
             (inst -1 "#(1 + k1)"
              "first_diff(subtermOF(x!1,  #(1 + k1)), subtermOF(x!2,  #(1 + k1)))"
              "#(first(r!1))" "rest(r!1) o q1!1")
             (rewrite o_assoc)
             (assert)
             (split)
             (("1"
               (lemma equal_prefix[posnat])
               (inst -1 "#(1 + k1)"
                "first_diff(subtermOF(x!1,  #(1 + k1)), subtermOF(x!2,  #(1 + k1)))"
                "rest(r!1) o q1!1")
               (rewrite o_assoc)
               (assert)
               (hide -1 -2 -4 -5 4)
               (lemma seq_first_rest_1[posnat])
               (inst -1 p!1)
               (split)
               (("1"
                 (replace -1 -3)
                 (replace -2 -3)
                 (hide -1 -2)
                 (lemma o_equals_o[posnat])
                 (inst -1 "#(first(p!1))" "rest(p!1)" "#(first(r!1))"
                  "rest(r!1) o p1!1")
                 (rewrite o_assoc)
                 (assert)
                 (split)
                 (("1"
                   (replaces -1)
                   (lemma equal_prefix[posnat])
                   (inst -1 "#(first(r!1))" "rest(p!1)"
                    "rest(r!1) o p1!1")
                   (assert)
                   (rewrite o_assoc))
                  ("2"
                   (hide-all-but 1)
                   (expand* "#" first finseq_appl))))
                ("2"
                 (hide-all-but (-2 1 4 5))
                 (flatten)
                 (rewrite empty_0)
                 (replaces -1)
                 (lemma seq_empty[posnat])
                 (inst -1 r!1 p1!1)
                 (assert))))
              ("2" (hide-all-but 1) (expand* "#" first finseq_appl))))))
          ("2"
           (case "p!1 = #(1 + k1) o rest(p!1)")
           (("1"
             (hide-all-but (-1 1))
             (rewrite pos_subterm_ax)
             (rewrite pos_subterm_ax))
            ("2"
             (hide -1 -2 -6 2 4 5 6 9)
             (rewrite add_first_is_o)
             (lemma seq_first_rest_1[posnat])
             (inst -1 r!1)
             (lemma empty_0[posnat])
             (inst -1 r!1)
             (assert)
             (replace -1 (-3 -4))
             (replace -3 -2)
             (hide -3)
             (lemma o_equals_o[posnat])
             (inst -1 "#(1 + k1)"
              "first_diff(subtermOF(x!1,  #(1 + k1)), subtermOF(x!2,  #(1 + k1)))"
              "#(first(r!1))" "rest(r!1) o q1!1")
             (rewrite o_assoc)
             (assert)
             (split)
             (("1"
               (replace -1 -4 rl)
               (hide -1 -2 -3 1)
               (lemma seq_first_rest_1[posnat])
               (inst -1 p!1)
               (split)
               (("1"
                 (lemma o_equals_o[posnat])
                 (inst -1 "#(first(p!1))" "rest(p!1)" "#(1 + k1)"
                  "rest(r!1) o p1!1")
                 (rewrite o_assoc)
                 (assert)
                 (hide-all-but 1)
                 (expand* "#" first finseq_appl))
                ("2"
                 (hide 2 3 4)
                 (flatten)
                 (rewrite empty_0)
                 (replaces -1)
                 (lemma seq_empty[posnat])
                 (inst -1 "#(1 + k1) o rest(r!1)" "p1!1")
                 (assert)
                 (flatten)
                 (rewrite empty_0 -2))))
              ("2"
               (hide-all-but 1)
               (expand* "#" first finseq_appl))))))))))
      ("2"
       (hide-all-but (-1 1 2 3 4))
       (lemma first_diff_TCC3)
       (inst -1 x!1 x!2 "f(x!1)" "args(x!1)")
       (assert)
       (case "x!1 = app(f(x!1), args(x!1))")
       (("1"
         (assert)
         (inst -2 "f(x!2)" "args(x!2)")
         (case "x!2 = app(f(x!2), args(x!2))")
         (("1"
           (assert)
           (hide -3)
           (lemma "first_diff_TCC7")
           (inst -1 "x!1" "x!2" "f(x!1)" "args(x!1)")
           (assert)
           (inst -1 "f(x!2)" "args(x!2)")
           (assert))
          ("2" (hide-all-but (1 3)) (decompose-equality))))
        ("2" (hide-all-but (1 5)) (decompose-equality))))
      ("3" (skosimp) (rewrite positions_of_arg))
      ("4"
       (hide -2 -3 -4 5)
       (skosimp)
       (rewrite positions_of_arg)
       (typepred kk!1)
       (typepred "args(x!2)")
       (assert))))
    ("5"
     (hide-all-but (-1 -3))
     (replace -1 -2 rl)
     (hide -1)
     (expand left_without_children)
     (skosimp)
     (lemma seq_empty[posnat])
     (inst -1 r!1 q1!1)
     (assert)
     (flatten)
     (rewrite empty_0 -2))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (name-replace "sp" "subtermOF(s!1, p!1)" :hide? nil)
   (name-replace "tp" "subtermOF(t!1, p!1)" :hide? nil)
   (name-replace "fd" "first_diff(sp, tp)" :hide? nil)
   (assert)
   (prop)
   (skosimp)
   (case "child(p!1, q!1)")
   (("1"
     (inst -5 q!1)
     (("1"
       (assert)
       (lemma ext_preserve_symbol)
       (inst-cp -1 t!1 sig!1 q!1)
       (inst -1 s!1 sig!1 q!1)
       (lemma app_term)
       (inst-cp -1 p!1 q!1 t!1)
       (inst -1 p!1 q!1 s!1)
       (assert)
       (split -1)
       (("1"
         (split -2)
         (("1" (assert))
          ("2"
           (hide-all-but (-4 1))
           (expand child)
           (skosimp)
           (lemma pos_ax)
           (inst -1 q!1 p1!1 t!1)
           (assert))))
        ("2"
         (hide-all-but (-4 1))
         (expand child)
         (skosimp)
         (lemma pos_ax)
         (inst -1 q!1 p1!1 s!1)
         (assert))))
      ("2"
       (hide-all-but (-1 1))
       (expand child)
       (skosimp)
       (lemma pos_ax)
       (inst-cp -1 q!1 p1!1 t!1)
       (inst -1 q!1 p1!1 s!1)
       (assert))))
    ("2"
     (hide -4)
     (lemma fd_equal_symbol)
     (expand child -5)
     (skosimp)
     (case "length(p!1) < length(q!1)")
     (("1"
       (lemma o_length_o[posnat])
       (inst -1 p!1 fd q!1 p1!1)
       (assert)
       (skosimp)
       (replace -1 -7)
       (lemma equal_prefix[posnat])
       (inst -1 p!1 fd "seq!1 o  p1!1")
       (rewrite o_assoc)
       (assert)
       (inst -4 sp tp seq!1)
       (("1"
         (replace -5)
         (split)
         (("1"
           (replace -7 -1 rl)
           (replace -6 -1 rl)
           (lemma pos_subterm)
           (inst-cp -1 p!1 seq!1 s!1)
           (inst -1 p!1 seq!1 t!1)
           (split)
           (("1"
             (split)
             (("1"
               (replace -1 -3 rl)
               (replace -2 -3 rl)
               (replace -5 -3 rl)
               (lemma ext_preserve_symbol)
               (inst-cp -1 s!1 sig!1 q!1)
               (inst -1 t!1 sig!1 q!1)
               (split)
               (("1"
                 (split)
                 (("1" (assert))
                  ("2"
                   (hide-all-but (-6 -8 -9 -10 -11 1 3))
                   (replace -1 -5 rl)
                   (hide -1)
                   (lemma app_term)
                   (inst -1 "p!1 o fd" "q!1" "s!1")
                   (assert)
                   (prop)
                   (("1"
                     (hide -4 2 3)
                     (typepred p!1)
                     (hide -2 -3)
                     (lemma position_s_first_diff)
                     (inst -1 sp tp fd)
                     (assert)
                     (lemma pos_o_term)
                     (inst -1 p!1 fd s!1)
                     (assert))
                    ("2"
                     (hide 2)
                     (typepred p!1)
                     (hide -2 -3)
                     (lemma position_s_first_diff)
                     (inst -1 sp tp fd)
                     (assert)
                     (lemma pos_o_term)
                     (inst -1 p!1 fd s!1)
                     (assert)
                     (lemma pos_ax)
                     (inst -1 q!1 p1!1 s!1)
                     (assert))
                    ("3"
                     (hide-all-but (-4 1 3))
                     (expand child)
                     (inst 1 p1!1)
                     (assert))))))
                ("2"
                 (hide-all-but (-6 -8 -9 -10 -11 1 3))
                 (replace -1 -5 rl)
                 (hide -1)
                 (lemma app_term)
                 (inst -1 "p!1 o fd" "q!1" "t!1")
                 (assert)
                 (typepred p!1)
                 (hide -1 -3)
                 (lemma position_t_first_diff)
                 (inst -1 sp tp fd)
                 (assert)
                 (lemma pos_o_term)
                 (inst -1 p!1 fd t!1)
                 (assert)
                 (lemma pos_ax)
                 (inst -1 q!1 p1!1 t!1)
                 (assert)
                 (hide-all-but (-8 1 3))
                 (expand child)
                 (inst 1 p1!1)
                 (assert))))
              ("2"
               (hide-all-but (-4 -6 -7 -8 -9 1))
               (replace -1 (-5 1) rl)
               (hide -1)
               (typepred p!1)
               (hide -2 -3)
               (lemma position_s_first_diff)
               (inst -1 sp tp fd)
               (assert)
               (lemma pos_o_term)
               (inst -1 p!1 fd s!1)
               (assert)
               (replace -7 -1)
               (lemma pos_ax)
               (inst -1 q!1 p1!1 s!1)
               (assert))))
            ("2"
             (hide-all-but (-4 -6 -7 -8 -9 1))
             (replace -1 (-5 1) rl)
             (hide -1)
             (typepred p!1)
             (hide -1 -3)
             (lemma position_t_first_diff)
             (inst -1 sp tp fd)
             (assert)
             (lemma pos_o_term)
             (inst -1 p!1 fd t!1)
             (assert)
             (replace -7 -1)
             (lemma pos_ax)
             (inst -1 q!1 p1!1 t!1)
             (assert))))
          ("2"
           (hide-all-but (-1 1 3))
           (expand child)
           (inst 1 p1!1)
           (assert))))
        ("2"
         (replace -6 1 rl)
         (replace -5 1 rl)
         (rewrite pos_subterm_ax)
         (("1"
           (rewrite pos_subterm_ax)
           (hide-all-but (-2 -4 -5 -6 -7 1))
           (replace -1 (-5 1) rl)
           (typepred p!1)
           (hide -1 -3 -4)
           (lemma position_t_first_diff)
           (inst -1 sp tp fd)
           (assert)
           (lemma pos_o_term)
           (inst -1 p!1 fd t!1)
           (assert)
           (replace -7 -1)
           (lemma pos_ax)
           (inst -1 q!1 p1!1 t!1)
           (assert))
          ("2"
           (hide-all-but (-2 -4 -5 -6 -7 1))
           (replace -1 (-5 1) rl)
           (typepred p!1)
           (hide -2 -3 -4)
           (lemma position_s_first_diff)
           (inst -1 sp tp fd)
           (assert)
           (lemma pos_o_term)
           (inst -1 p!1 fd s!1)
           (assert)
           (replace -7 -1)
           (lemma pos_ax)
           (inst -1 q!1 p1!1 s!1)
           (assert))))))
      ("2"
       (case "length(q!1) < length(p!1)")
       (("1"
         (hide-all-but (-1 -6 1 2))
         (lemma o_length_o[posnat])
         (inst -1 q!1 p1!1 p!1 fd)
         (assert)
         (skosimp)
         (expand child)
         (inst 2 seq!1)
         (assert)
         (flatten)
         (replaces -3)
         (rewrite seq_o_empty)
         (decompose-equality -1))
        ("2"
         (lemma o_equals_o[posnat])
         (inst -1 q!1 p1!1 p!1 fd)
         (assert)
         (inst -2 sp tp empty_seq)
         (("1"
           (replace -3)
           (split)
           (("1"
             (rewrite subterm_empty_seq)
             (rewrite subterm_empty_seq)
             (replace -5 -1 rl)
             (replace -4 -1 rl)
             (lemma ext_preserve_symbol)
             (inst-cp -1 s!1 sig!1 p!1)
             (inst -1 t!1 sig!1 p!1)
             (split)
             (("1"
               (split)
               (("1" (assert))
                ("2"
                 (case "fd /= empty_seq")
                 (("1"
                   (lemma app_term)
                   (inst -1 "p!1 o fd" p!1 s!1)
                   (lemma pos_o_term)
                   (inst -1 p!1 fd s!1)
                   (lemma position_s_first_diff)
                   (inst -1 sp tp fd)
                   (assert)
                   (expand child 1)
                   (inst 1 fd))
                  ("2"
                   (hide-all-but (-3 -7 1 6))
                   (replaces -1)
                   (flatten)
                   (replaces -1)
                   (lemma equal_prefix[posnat])
                   (inst -1 p!1 empty_seq p1!1)
                   (assert))))))
              ("2"
               (case "fd /= empty_seq")
               (("1"
                 (lemma app_term)
                 (inst -1 "p!1 o fd" p!1 t!1)
                 (lemma pos_o_term)
                 (inst -1 p!1 fd t!1)
                 (lemma position_t_first_diff)
                 (inst -1 sp tp fd)
                 (assert)
                 (expand child 1)
                 (inst 1 fd))
                ("2"
                 (hide-all-but (-3 -7 1 6))
                 (replaces -1)
                 (flatten)
                 (replaces -1)
                 (lemma equal_prefix[posnat])
                 (inst -1 p!1 empty_seq p1!1)
                 (assert))))))
            ("2"
             (case "fd /= empty_seq")
             (("1"
               (hide-all-but (-1 1))
               (expand child)
               (inst 1 fd)
               (assert)
               (rewrite empty_o_seq))
              ("2"
               (hide-all-but (-1 -5 1 6))
               (replaces -1)
               (flatten)
               (replaces -1)
               (lemma equal_prefix[posnat])
               (inst -1 p!1 empty_seq p1!1)
               (assert))))))
          ("2"
           (hide-all-but 1)
           (split)
           (("1"
             (expand positionsOF)
             (lift-if)
             (expand* only_empty_seq union member))
            ("2"
             (expand positionsOF)
             (lift-if)
             (expand* only_empty_seq union member))))))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand left_without_children -1)
   (skosimp)
   (case "length(p!1) > length(r!1)")
   (("1"
     (lemma o_length_o[posnat])
     (inst -1 r!1 q1!1 p!1 p1!1)
     (assert)
     (skosimp)
     (lemma equal_prefix[posnat])
     (inst -1 r!1 "seq!1 o p1!1" q1!1)
     (rewrite o_assoc)
     (assert)
     (replace -1 -6 rl)
     (rewrite first_compo)
     (("1"
       (expand left_without_children 3)
       (inst 3 r!1 p1!2 seq!1)
       (assert)
       (flatten)
       (replace -7 -2)
       (rewrite seq_o_empty)
       (decompose-equality -2))
      ("2"
       (flatten)
       (rewrite empty_0 -1)
       (replace -1 -3)
       (rewrite seq_o_empty)
       (decompose-equality -3))))
    ("2"
     (case "EXISTS (seq : position) : r!1 = p!1 o seq")
     (("1"
       (skosimp)
       (inst 5 "seq!1 o p1!2")
       (rewrite o_assoc)
       (assert)
       (lemma equal_prefix[posnat])
       (inst -1 p!1 p1!1 "seq!1 o q1!1")
       (rewrite o_assoc)
       (assert)
       (expand left_without_children 5)
       (inst 5 seq!1 p1!2 q1!1)
       (assert))
      ("2"
       (hide-all-but (-1 1 2))
       (lemma o_length_o[posnat])
       (inst -1 p!1 p1!1 r!1 q1!1)
       (assert)
       (prop)
       (lemma o_equals_o[posnat])
       (inst -1 p!1 p1!1 r!1 q1!1)
       (assert)
       (inst 2 empty_seq)
       (rewrite seq_o_empty)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (name-replace "fd" "first_diff(s!1, t!1)" :hide? nil)
   (assert)
   (prop)
   (name-replace "x1" "subtermOF(t!1, p1!1)" :hide? nil)
   (copy -3)
   (expand left_without_children -1)
   (skosimp)
   (case "length(p1!1) > length(r!1)")
   (("1"
     (lemma o_length_o[posnat])
     (inst -1 r!1 p1!2 p1!1 p2!1)
     (assert)
     (skosimp)
     (lemma equal_prefix[posnat])
     (inst -1 r!1 "seq!1 o p2!1" p1!2)
     (rewrite o_assoc)
     (assert)
     (replace -1 -6 rl)
     (rewrite first_compo)
     (("1"
       (lemma fd_equal_subterm)
       (inst -1 s!1 t!1 p1!1)
       (("1"
         (replace -9)
         (assert)
         (split)
         (("1"
           (replace -8)
           (hide-all-but (-1 -11 -12 -14 3))
           (replaces -3)
           (lemma pos_subterm_ax)
           (inst -1 p1!1 p2!1 s!1)
           (assert)
           (expand positionsOF -1)
           (expand only_empty_seq)
           (propax))
          ("2"
           (hide-all-but (-2 -3 -4 -6 1 2))
           (expand left_without_children)
           (inst 1 r!1 seq!1 q1!1)
           (assert)
           (flatten)
           (replaces -1)
           (rewrite seq_o_empty)
           (decompose-equality -1))))
        ("2"
         (hide-all-but (-10 -11 1))
         (lemma pos_ax)
         (inst -1 p1!1 p2!1 s!1)
         (assert))))
      ("2"
       (hide-all-but (-2 -3 1))
       (flatten)
       (rewrite empty_0)
       (replaces -1)
       (rewrite seq_o_empty)
       (decompose-equality -1))))
    ("2"
     (case "EXISTS(seq : position): r!1 = p1!1 o seq")
     (("1"
       (skosimp)
       (replace -1 -2)
       (hide-all-but (-2 -5 -6 -11 2))
       (lemma position_t_first_diff)
       (inst -1 s!1 t!1 fd)
       (assert)
       (lemma pos_subterm_ax)
       (inst -1 "p1!1" "seq!1 o q1!1" "t!1")
       (rewrite o_assoc)
       (assert)
       (expand positionsOF -1)
       (expand only_empty_seq)
       (lemma seq_empty[posnat])
       (inst -1 seq!1 q1!1)
       (assert)
       (flatten)
       (rewrite empty_0 -2))
      ("2"
       (hide-all-but (-2 -8 1 2))
       (replaces -1)
       (lemma o_length_o[posnat])
       (inst -1 p1!1 p2!1 r!1 p1!2)
       (assert)
       (prop)
       (lemma o_equals_o[posnat])
       (inst -1 p1!1 p2!1 r!1 p1!2)
       (assert)
       (inst 2 empty_seq)
       (rewrite seq_o_empty)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: robinsonunificationEF
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (name-replace "sp" "subtermOF(s!1, p!1)" :hide? nil)
   (name-replace "tp" "subtermOF(t!1, p!1)" :hide? nil)
   (name-replace "fd" "first_diff(sp, tp)" :hide? nil)
   (assert)
   (prop)
   (skosimp)
   (case "left_without_children(q!1, p!1)")
   (("1"
     (lemma positions_of_ext)
     (inst-cp -1 sig!1 s!1)
     (inst -1 sig!1 t!1)
     (decompose-equality -1)
     (decompose-equality -2)
     (inst -1 q!1)
     (inst -2 q!1)
     (assert)
     (expand* union member)
     (prop)
     (("1"
       (inst -7 q!1)
       (("1"
         (assert)
         (rewrite subterm_ext_commute)
         (rewrite subterm_ext_commute)
         (assert))
        ("2" (assert))))
      ("2"
       (skosimp)
       (expand left_without_children -6)
       (skosimp)
       (case "length(p1!1) <= length(r!1)")
       (("1"
         (hide-all-but (-1 -2 -3 -4 -7 -8 2 3))
         (typepred p!1)
         (hide -1 -3)
         (lemma o_equals_o[posnat])
         (inst -1 p1!1 p2!1 r!1 p1!2)
         (assert)
         (split)
         (("1"
           (replace -1 -7 rl)
           (hide -1 -3 -4 -8)
           (replace -4 -1)
           (lemma pos_subterm_ax)
           (inst -1 p1!1 q1!1 t!1)
           (assert)
           (expand positionsOF -1)
           (expand only_empty_seq)
           (propax))
          ("2"
           (lemma o_length_o[posnat])
           (inst -1 p1!1 p2!1 r!1 p1!2)
           (assert)
           (skosimp)
           (replace -1 -7)
           (hide -1 -3 -4 -8 1)
           (replace -4 -1)
           (lemma pos_subterm_ax)
           (inst -1 "p1!1" "seq!1 o q1!1" "t!1")
           (rewrite o_assoc)
           (assert)
           (expand positionsOF -1)
           (expand only_empty_seq)
           (lemma seq_empty[posnat])
           (inst -1 seq!1 q1!1)
           (assert)
           (flatten)
           (rewrite empty_0 -2))))
        ("2"
         (inst -12 p1!1)
         (("1"
           (split)
           (("1"
             (replace -2 5)
             (rewrite pos_subterm)
             (rewrite pos_subterm)
             (lemma subterm_ext_commute)
             (inst-cp -1 p1!1 t!1 sig!1)
             (inst -1 p1!1 s!1 sig!1)
             (assert)
             (split)
             (("1" (assert))
              ("2"
               (hide-all-but (-3 -7 1))
               (replaces -1)
               (lemma pos_ax)
               (inst -1 p1!1 p2!1 s!1)
               (assert))))
            ("2"
             (hide-all-but (-1 -6 -7 -8 1 2 4 5))
             (lemma o_length_o[posnat])
             (inst -1 "r!1" "p1!2" "p1!1" "p2!1")
             (assert)
             (skosimp)
             (case "seq!1 = empty_seq")
             (("1"
               (hide-all-but (-1 -2 2))
               (replaces -1)
               (rewrite seq_o_empty)
               (decompose-equality -1))
              ("2"
               (replace -4 -2)
               (replace -1 -2)
               (lemma equal_prefix[posnat])
               (inst -1 "r!1" "p1!2" "seq!1 o p2!1")
               (rewrite o_assoc)
               (assert)
               (replace -1 -6)
               (rewrite first_compo)
               (("1"
                 (hide-all-but (-2 -4 -6 1 2 4))
                 (expand left_without_children)
                 (inst 2 r!1 seq!1 q1!1)
                 (assert))
                ("2"
                 (hide-all-but (1 2))
                 (flatten)
                 (rewrite empty_0))))))))
          ("2"
           (assert)
           (hide-all-but (-1 -5 1))
           (replaces -1)
           (lemma pos_ax)
           (inst -1 p1!1 p2!1 s!1)
           (assert))))))
      ("3"
       (skosimp)
       (expand left_without_children -6)
       (skosimp)
       (case "length(p1!1) <= length(r!1)")
       (("1"
         (hide-all-but (-1 -3 -4 -5 -7 -8 2 3))
         (typepred p!1)
         (hide -2 -3)
         (lemma o_equals_o[posnat])
         (inst -1 p1!1 p2!1 r!1 p1!2)
         (assert)
         (split)
         (("1"
           (replace -1 -7 rl)
           (hide -1 -3 -4 -8)
           (replace -4 -1)
           (lemma pos_subterm_ax)
           (inst -1 p1!1 q1!1 s!1)
           (assert)
           (expand positionsOF -1)
           (expand only_empty_seq)
           (propax))
          ("2"
           (lemma o_length_o[posnat])
           (inst -1 p1!1 p2!1 r!1 p1!2)
           (assert)
           (skosimp)
           (replace -1 -7)
           (hide -1 -3 -4 -8 1)
           (replace -4 -1)
           (lemma pos_subterm_ax)
           (inst -1 "p1!1" "seq!1 o q1!1" "s!1")
           (rewrite o_assoc)
           (assert)
           (expand positionsOF -1)
           (expand only_empty_seq)
           (lemma seq_empty[posnat])
           (inst -1 seq!1 q1!1)
           (assert)
           (flatten)
           (rewrite empty_0 -2))))
        ("2"
         (inst -12 p1!1)
         (("1"
           (split)
           (("1"
             (replace -3 5)
             (rewrite pos_subterm)
             (rewrite pos_subterm)
             (lemma subterm_ext_commute)
             (inst-cp -1 p1!1 t!1 sig!1)
             (inst -1 p1!1 s!1 sig!1)
             (assert)
             (hide-all-but (-3 -4 1))
             (replaces -2)
             (lemma pos_ax)
             (inst -1 p1!1 p2!1 t!1)
             (assert))
            ("2"
             (hide-all-but (-2 -6 -7 -8 1 2 4 5))
             (lemma o_length_o[posnat])
             (inst -1 "r!1" "p1!2" "p1!1" "p2!1")
             (assert)
             (skosimp)
             (case "seq!1 = empty_seq")
             (("1"
               (hide-all-but (-1 -2 2))
               (replaces -1)
               (rewrite seq_o_empty)
               (decompose-equality -1))
              ("2"
               (replace -4 -2)
               (replace -1 -2)
               (lemma equal_prefix[posnat])
               (inst -1 "r!1" "p1!2" "seq!1 o p2!1")
               (rewrite o_assoc)
               (assert)
               (replace -1 -6)
               (rewrite first_compo)
               (("1"
                 (hide-all-but (-2 -4 -6 1 2 4))
                 (expand left_without_children)
                 (inst 2 r!1 seq!1 q1!1)
                 (assert))
                ("2"
                 (hide-all-but (1 2))
                 (flatten)
                 (rewrite empty_0))))))))
          ("2"
           (assert)
           (hide-all-but (-1 -2 1))
           (replaces -2)
           (lemma pos_ax)
           (inst -1 p1!1 p2!1 t!1)
           (assert))))))
      ("4"
       (skosimp*)
       (expand left_without_children -9)
       (skosimp)
       (case "length(p1!1) <= length(r!1) OR length(p1!2) <= length(r!1)")
       (("1"
         (split)
         (("1"
           (hide-all-but (-1 -2 -3 -4 -10 -11 1 2))
           (typepred p!1)
           (hide -1 -3)
           (lemma o_equals_o[posnat])
           (inst -1 p1!1 p2!1 r!1 p1!3)
           (assert)
           (split)
           (("1"
             (replace -1 -7 rl)
             (hide -1 -3 -4 -8)
             (replace -4 -1)
             (lemma pos_subterm_ax)
             (inst -1 p1!1 q1!1 t!1)
             (assert)
             (expand positionsOF -1)
             (expand only_empty_seq)
             (propax))
            ("2"
             (lemma o_length_o[posnat])
             (inst -1 p1!1 p2!1 r!1 p1!3)
             (assert)
             (skosimp)
             (replace -1 -7)
             (hide -1 -3 -4 -8 1)
             (replace -4 -1)
             (lemma pos_subterm_ax)
             (inst -1 "p1!1" "seq!1 o q1!1" "t!1")
             (rewrite o_assoc)
             (assert)
             (expand positionsOF -1)
             (expand only_empty_seq)
             (lemma seq_empty[posnat])
             (inst -1 seq!1 q1!1)
             (assert)
             (flatten)
             (rewrite empty_0 -2))))
          ("2"
           (hide-all-but (-1 -6 -7 -8 -10 -11 1 2))
           (typepred p!1)
           (hide -2 -3)
           (lemma o_equals_o[posnat])
           (inst -1 p1!2 p2!2 r!1 p1!3)
           (assert)
           (split)
           (("1"
             (replace -1 -7 rl)
             (hide -1 -3 -4 -8)
             (replace -4 -1)
             (lemma pos_subterm_ax)
             (inst -1 p1!2 q1!1 s!1)
             (assert)
             (expand positionsOF -1)
             (expand only_empty_seq)
             (propax))
            ("2"
             (lemma o_length_o[posnat])
             (inst -1 p1!2 p2!2 r!1 p1!3)
             (assert)
             (skosimp)
             (replace -1 -7)
             (hide -1 -3 -4 -8 1)
             (replace -4 -1)
             (lemma pos_subterm_ax)
             (inst -1 "p1!2" "seq!1 o q1!1" "s!1")
             (rewrite o_assoc)
             (assert)
             (expand positionsOF -1)
             (expand only_empty_seq)
             (lemma seq_empty[posnat])
             (inst -1 seq!1 q1!1)
             (assert)
             (flatten)
             (rewrite empty_0 -2))))))
        ("2"
         (flatten)
         (case "length(p1!1) <= length(p1!2)")
         (("1"
           (lemma o_equals_o[posnat])
           (inst -1 p1!1 p2!1 p1!2 p2!2)
           (assert)
           (split)
           (("1"
             (replaces -1)
             (inst -16 p1!2)
             (split)
             (("1"
               (hide-all-but (-1 -3 -4 -6 -8 -10 5))
               (replace -2)
               (rewrite pos_subterm)
               (rewrite pos_subterm)
               (lemma subterm_ext_commute)
               (inst-cp -1 p1!2 s!1 sig!1)
               (inst -1 p1!2 t!1 sig!1)
               (assert))
              ("2"
               (hide-all-but (-2 -10 -11 -12 1 2 4 5))
               (lemma o_length_o[posnat])
               (inst -1 r!1 p1!3 p1!2 p2!1)
               (assert)
               (skosimp)
               (case "seq!1 = empty_seq")
               (("1"
                 (hide-all-but (-1 -2 2))
                 (replaces -1)
                 (rewrite seq_o_empty)
                 (decompose-equality -1))
                ("2"
                 (replace -4 -2)
                 (replace -1 -2)
                 (lemma equal_prefix[posnat])
                 (inst -1 r!1 p1!3 "seq!1 o p2!1")
                 (rewrite o_assoc)
                 (assert)
                 (replace -1 -6)
                 (rewrite first_compo)
                 (("1"
                   (hide-all-but (-2 -4 -6 1 2 4))
                   (expand left_without_children)
                   (inst 2 r!1 seq!1 q1!1)
                   (assert))
                  ("2"
                   (hide-all-but (1 2))
                   (flatten)
                   (rewrite empty_0))))))))
            ("2"
             (lemma o_length_o[posnat])
             (inst -1 p1!1 p2!1 p1!2 p2!2)
             (assert)
             (skosimp)
             (lemma pos_ax)
             (inst -1 p1!1 seq!1 s!1)
             (assert)
             (inst -18 p1!1)
             (split)
             (("1"
               (hide-all-but (-1 -2 -5 -6 -8 -12 6))
               (replace -3)
               (rewrite pos_subterm)
               (rewrite pos_subterm)
               (lemma subterm_ext_commute)
               (inst-cp -1 p1!1 s!1 sig!1)
               (inst -1 p1!1 t!1 sig!1)
               (assert))
              ("2"
               (hide-all-but (-4 -12 -13 -14 1 3 5 6))
               (lemma o_length_o[posnat])
               (inst -1 r!1 p1!3 p1!1 p2!1)
               (assert)
               (skosimp)
               (case "seq!2 = empty_seq")
               (("1"
                 (hide-all-but (-1 -2 2))
                 (replaces -1)
                 (rewrite seq_o_empty)
                 (decompose-equality -1))
                ("2"
                 (replace -4 -2)
                 (replace -1 -2)
                 (lemma equal_prefix[posnat])
                 (inst -1 r!1 p1!3 "seq!2 o p2!1")
                 (rewrite o_assoc)
                 (assert)
                 (replace -1 -6)
                 (rewrite first_compo)
                 (("1"
                   (hide-all-but (-2 -4 -6 1 2 4))
                   (expand left_without_children)
                   (inst 2 r!1 seq!2 q1!1)
                   (assert))
                  ("2"
                   (hide-all-but (1 2))
                   (flatten)
                   (rewrite empty_0))))))))))
          ("2"
           (lemma o_length_o[posnat])
           (inst -1 p1!2 p2!2 p1!1 p2!1)
           (assert)
           (skosimp)
           (lemma pos_ax)
           (inst -1 p1!2 seq!1 t!1)
           (assert)
           (inst -17 p1!2)
           (split)
           (("1"
             (hide-all-but (-1 -2 -7 -8 -9 -11 6))
             (replace -4)
             (rewrite pos_subterm)
             (rewrite pos_subterm)
             (lemma subterm_ext_commute)
             (inst-cp -1 p1!2 s!1 sig!1)
             (inst -1 p1!2 t!1 sig!1)
             (assert))
            ("2"
             (hide-all-but (-7 -11 -12 -13 1 4 5 6))
             (lemma o_length_o[posnat])
             (inst -1 r!1 p1!3 p1!2 p2!2)
             (assert)
             (skosimp)
             (case "seq!2 = empty_seq")
             (("1"
               (hide-all-but (-1 -2 2))
               (replaces -1)
               (rewrite seq_o_empty)
               (decompose-equality -1))
              ("2"
               (replace -4 -2)
               (replace -1 -2)
               (lemma equal_prefix[posnat])
               (inst -1 r!1 p1!3 "seq!2 o p2!2")
               (rewrite o_assoc)
               (assert)
               (replace -1 -6)
               (rewrite first_compo)
               (("1"
                 (hide-all-but (-2 -4 -6 1 2 4))
                 (expand left_without_children)
                 (inst 2 r!1 seq!2 q1!1)
                 (assert))
                ("2"
                 (hide-all-but (1 2))
                 (flatten)
                 (rewrite empty_0))))))))))))))
    ("2"
     (lemma separation_lwc_pos)
     (inst -1 p!1 fd q!1)
     (assert)
     (skosimp)
     (hide -6)
     (lemma fd_equal_subterm)
     (lemma positions_of_ext)
     (replace -3 2)
     (rewrite pos_subterm)
     (rewrite pos_subterm)
     (rewrite subterm_ext_commute)
     (lemma subterm_ext_commute)
     (inst -1 p!1 t!1 sig!1)
     (assert)
     (replace -1 2)
     (hide -1)
     (replace -7 2)
     (replace -6 2)
     (lemma pos_subterm_ax)
     (inst-cp -1 p!1 q1!1 "ext(sig!1)(s!1)")
     (inst -1 p!1 q1!1 "ext(sig!1)(t!1)")
     (assert)
     (rewrite subterm_ext_commute)
     (rewrite subterm_ext_commute)
     (replace -8 -1)
     (replace -9 -2)
     (hide -5 -8 -9 -10 1)
     (inst-cp -3 sig!1 sp)
     (inst -3 sig!1 tp)
     (decompose-equality -3)
     (decompose-equality -4)
     (inst -1 q1!1)
     (inst -2 q1!1)
     (expand* union member)
     (assert)
     (prop)
     (("1"
       (inst -5 sp tp q1!1)
       (("1"
         (assert)
         (rewrite subterm_ext_commute)
         (rewrite subterm_ext_commute)
         (assert))
        ("2" (assert))))
      ("2"
       (skosimp)
       (case "p2!1 = empty_seq")
       (("1"
         (replace -1 -2)
         (rewrite seq_o_empty)
         (inst -9 sp tp q1!1)
         (("1" (assert))
          ("2"
           (rewrite subterm_ext_commute)
           (replace -2 -3 rl)
           (assert))))
        ("2"
         (lemma lwc_o_fd_empty_seq)
         (inst -1 q1!1 p1!1 p2!1 sp tp)
         (assert)
         (assert))))
      ("3"
       (skosimp)
       (case "p2!1 = empty_seq")
       (("1"
         (replace -1 -3)
         (rewrite seq_o_empty)
         (replace -3 -4 rl)
         (inst -9 sp tp q1!1)
         (("1" (assert)) ("2" (assert))))
        ("2"
         (lemma lwc_o_fd_empty_seq)
         (inst -1 q1!1 p1!1 p2!1 tp sp)
         (assert)
         (lemma comutative_first_diff)
         (inst -1 sp tp fd)
         (assert))))
      ("4"
       (skosimp*)
       (case "length(p1!1) = length(p1!2)")
       (("1"
         (lemma o_equals_o[posnat])
         (inst -1 p1!1 p2!1 p1!2 p2!2)
         (assert)
         (lemma equal_prefix[posnat])
         (inst -1 p1!1 p2!1 p2!2)
         (assert)
         (replaces -1)
         (replaces -1)
         (expand left_without_children -12)
         (skosimp)
         (case "EXISTS(seq:position) : r!1 = p1!2 o seq")
         (("1"
           (skosimp)
           (hide-all-but (-1 -7 -8 -13 -16 1))
           (lemma position_s_first_diff)
           (inst -1 sp tp fd)
           (assert)
           (replace -5 -1)
           (replace -2 -1)
           (lemma pos_subterm_ax)
           (inst -1 p1!2 "seq!1 o q1!2" sp)
           (rewrite o_assoc)
           (assert)
           (expand positionsOF -1)
           (expand only_empty_seq)
           (lemma seq_empty[posnat])
           (inst -1 seq!1 q1!2)
           (assert)
           (flatten)
           (rewrite empty_0 -2))
          ("2"
           (lemma o_length_o[posnat])
           (inst -1 r!1 p1!3 p1!2 p2!2)
           (assert)
           (split)
           (("1"
             (skosimp)
             (inst -12 sp tp p1!2)
             (split)
             (("1"
               (replace -3 4)
               (rewrite pos_subterm)
               (rewrite pos_subterm)
               (rewrite subterm_ext_commute)
               (lemma subterm_ext_commute)
               (inst -1 p1!2 tp sig!1)
               (assert))
              ("2"
               (replace -15)
               (hide-all-but (-1 -2 -12 -13 -14 1 2 3 4))
               (replace -1 -2)
               (replace -2 -4)
               (lemma equal_prefix[posnat])
               (inst -1 r!1 "seq!1 o p2!2" p1!3)
               (rewrite o_assoc)
               (assert)
               (replace -1 -6 rl)
               (rewrite first_compo)
               (("1"
                 (hide -1 -3 -5)
                 (expand left_without_children)
                 (inst 1 r!1 seq!1 q1!2)
                 (assert)
                 (flatten)
                 (replaces -1)
                 (rewrite seq_o_empty)
                 (inst 1 empty_seq)
                 (rewrite seq_o_empty)
                 (assert))
                ("2"
                 (flatten)
                 (rewrite empty_0)
                 (hide-all-but (-1 -3 2))
                 (replaces -1)
                 (inst 1 empty_seq)
                 (rewrite seq_o_empty)
                 (rewrite seq_o_empty)
                 (assert))))))
            ("2"
             (hide-all-but (-1 -13 1 2))
             (replaces -1)
             (lemma o_length_o[posnat])
             (inst -1 p1!2 p2!2 r!1 p1!3)
             (assert)
             (prop)
             (lemma o_equals_o[posnat])
             (inst -1 p1!2 p2!2 r!1 p1!3)
             (assert)
             (inst 3 empty_seq)
             (rewrite seq_o_empty)
             (assert))))))
        ("2"
         (lemma o_length_o[posnat])
         (inst -1 p1!1 p2!1 p1!2 p2!2)
         (assert)
         (split)
         (("1"
           (skosimp)
           (lemma lwc_o_fd_empty_seq)
           (inst -1 p1!2 p1!1 seq!1 sp tp)
           (replace -15)
           (assert)
           (assert)
           (prop)
           (("1"
             (hide-all-but (-1 -2 1))
             (replaces -1)
             (rewrite seq_o_empty)
             (decompose-equality -1))
            ("2"
             (expand left_without_children -13)
             (skosimp)
             (case "length(p1!2) <= length(r!1)")
             (("1"
               (lemma o_equals_o[posnat])
               (inst -1 p1!2 p2!2 r!1 p1!3)
               (assert)
               (split)
               (("1"
                 (hide-all-but (-1 -3 -5 -6 -15 3))
                 (lemma position_t_first_diff)
                 (inst -1 sp tp fd)
                 (assert)
                 (replace -6 -1)
                 (replaces -2)
                 (replaces -2)
                 (lemma pos_subterm_ax)
                 (inst -1 p1!1 "seq!1 o q1!2" tp)
                 (rewrite o_assoc)
                 (assert)
                 (expand positionsOF -1)
                 (expand only_empty_seq)
                 (lemma seq_empty[posnat])
                 (inst -1 seq!1 q1!2)
                 (assert)
                 (flatten)
                 (rewrite empty_0 -2))
                ("2"
                 (lemma o_length_o[posnat])
                 (inst -1 p1!2 p2!2 r!1 p1!3)
                 (assert)
                 (skosimp)
                 (hide-all-but (-1 -3 -5 -6 -15 4))
                 (lemma position_t_first_diff)
                 (inst -1 sp tp fd)
                 (assert)
                 (replace -6 -1)
                 (replaces -2)
                 (replaces -2)
                 (lemma pos_subterm_ax)
                 (inst -1 p1!1 "seq!1 o seq!2 o q1!2" tp)
                 (rewrite o_assoc)
                 (rewrite o_assoc)
                 (assert)
                 (expand positionsOF -1)
                 (expand only_empty_seq)
                 (lemma seq_empty[posnat])
                 (inst -1 "seq!1 o seq!2" q1!2)
                 (assert)
                 (flatten)
                 (rewrite empty_0 -2))))
              ("2"
               (lemma o_length_o[posnat])
               (inst -1 r!1 p1!3 p1!2 p2!2)
               (assert)
               (skosimp)
               (hide-all-but (-1 -7 -14 -15 -16 1 2 4 5))
               (expand left_without_children)
               (inst 2 r!1 seq!2 q1!2)
               (assert)
               (lemma equal_prefix[posnat])
               (inst -1 r!1 "seq!2 o p2!2" p1!3)
               (rewrite o_assoc)
               (assert)
               (replace -1 -6 rl)
               (rewrite first_compo)
               (("1"
                 (assert)
                 (flatten)
                 (replaces -3)
                 (rewrite seq_o_empty)
                 (decompose-equality -2))
                ("2"
                 (flatten)
                 (rewrite empty_0)
                 (replaces -1)
                 (rewrite seq_o_empty)
                 (decompose-equality -2))))))))
          ("2"
           (lemma o_length_o[posnat])
           (inst -1 p1!2 p2!2 p1!1 p2!1)
           (assert)
           (skosimp)
           (lemma lwc_o_fd_empty_seq)
           (inst -1 p1!1 p1!2 seq!1 tp sp)
           (lemma comutative_first_diff)
           (inst -1 sp tp fd)
           (assert)
           (assert)
           (replace -1 -2 rl)
           (prop)
           (("1"
             (hide-all-but (-1 -3 2))
             (replaces -1)
             (rewrite seq_o_empty)
             (decompose-equality -1))
            ("2"
             (expand left_without_children -14)
             (skosimp)
             (case "length(p1!1) <= length(r!1)")
             (("1"
               (lemma o_equals_o[posnat])
               (inst -1 p1!1 p2!1 r!1 p1!3)
               (assert)
               (split)
               (("1"
                 (hide-all-but (-1 -4 -10 -11 -16 4))
                 (lemma position_s_first_diff)
                 (inst -1 sp tp fd)
                 (assert)
                 (replace -6 -1)
                 (replaces -2)
                 (replaces -2)
                 (lemma pos_subterm_ax)
                 (inst -1 p1!2 "seq!1 o q1!2" sp)
                 (rewrite o_assoc)
                 (assert)
                 (expand positionsOF -1)
                 (expand only_empty_seq)
                 (lemma seq_empty[posnat])
                 (inst -1 seq!1 q1!2)
                 (assert)
                 (flatten)
                 (rewrite empty_0 -2))
                ("2"
                 (lemma o_length_o[posnat])
                 (inst -1 p1!1 p2!1 r!1 p1!3)
                 (assert)
                 (skosimp)
                 (hide-all-but (-1 -4 -10 -11 -16 5))
                 (lemma position_s_first_diff)
                 (inst -1 sp tp fd)
                 (assert)
                 (replace -6 -1)
                 (replaces -2)
                 (replaces -2)
                 (lemma pos_subterm_ax)
                 (inst -1 p1!2 "seq!1 o seq!2 o q1!2" sp)
                 (rewrite o_assoc)
                 (rewrite o_assoc)
                 (assert)
                 (expand positionsOF -1)
                 (expand only_empty_seq)
                 (lemma seq_empty[posnat])
                 (inst -1 "seq!1 o seq!2" q1!2)
                 (assert)
                 (flatten)
                 (rewrite empty_0 -2))))
              ("2"
               (lemma o_length_o[posnat])
               (inst -1 r!1 p1!3 p1!1 p2!1)
               (assert)
               (skosimp)
               (hide-all-but (-1 -4 -15 -16 -17 1 2 5 6))
               (expand left_without_children)
               (inst 2 r!1 seq!2 q1!2)
               (assert)
               (lemma equal_prefix[posnat])
               (inst -1 r!1 "seq!2 o p2!1" p1!3)
               (rewrite o_assoc)
               (assert)
               (replace -1 -6 rl)
               (rewrite first_compo)
               (("1"
                 (assert)
                 (flatten)
                 (replaces -3)
                 (rewrite seq_o_empty)
                 (decompose-equality -2))
                ("2"
                 (flatten)
                 (rewrite empty_0)
                 (replaces -1)
                 (rewrite seq_o_empty)
                 (decompose-equality -2))))))))))))))))


