(0) Obligation:

Clauses:

delete(X, tree(X, void, Right), Right).
delete(X, tree(X, Left, void), Left).
delete(X, tree(X, Left, Right), tree(Y, Left, Right1)) :- delmin(Right, Y, Right1).
delete(X, tree(Y, Left, Right), tree(Y, Left1, Right)) :- ','(less(X, Y), delete(X, Left, Left1)).
delete(X, tree(Y, Left, Right), tree(Y, Left, Right1)) :- ','(less(Y, X), delete(X, Right, Right1)).
delmin(tree(Y, void, Right), Y, Right).
delmin(tree(X, Left, X1), Y, tree(X, Left1, X2)) :- delmin(Left, Y, Left1).
less(0, s(X3)).
less(s(X), s(Y)) :- less(X, Y).

Query: delete(g,a,g)

(1) PrologToTRSTransformerProof (SOUND transformation)

Transformed Prolog program to TRS.

(2) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

f2_in(T12, T13) → f2_out1
f2_in(T44, tree(T47, T45, T48)) → U1(f44_in(T47, T48), T44, tree(T47, T45, T48))
U1(f44_out1, T44, tree(T47, T45, T48)) → f2_out1
f2_in(T107, tree(T108, T111, T110)) → U2(f79_in(T107, T108, T111), T107, tree(T108, T111, T110))
U2(f79_out1, T107, tree(T108, T111, T110)) → f2_out1
f2_in(T144, tree(T145, T146, T148)) → U3(f109_in(T145, T144, T148), T144, tree(T145, T146, T148))
U3(f109_out1, T144, tree(T145, T146, T148)) → f2_out1
f44_in(T62, T63) → f44_out1
f44_in(T79, tree(T76, T80, T81)) → U4(f44_in(T79, T80), T79, tree(T76, T80, T81))
U4(f44_out1, T79, tree(T76, T80, T81)) → f44_out1
f81_in(0, s(T121)) → f81_out1
f81_in(s(T126), s(T127)) → U5(f81_in(T126, T127), s(T126), s(T127))
U5(f81_out1, s(T126), s(T127)) → f81_out1
f79_in(T107, T108, T111) → U6(f81_in(T107, T108), T107, T108, T111)
U6(f81_out1, T107, T108, T111) → U7(f2_in(T107, T111), T107, T108, T111)
U7(f2_out1, T107, T108, T111) → f79_out1
f109_in(T145, T144, T148) → U8(f81_in(T145, T144), T145, T144, T148)
U8(f81_out1, T145, T144, T148) → U9(f2_in(T144, T148), T145, T144, T148)
U9(f2_out1, T145, T144, T148) → f109_out1

Q is empty.

(3) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.

(4) Obligation:

Q DP problem:
The TRS P consists of the following rules:

F2_IN(T44, tree(T47, T45, T48)) → U11(f44_in(T47, T48), T44, tree(T47, T45, T48))
F2_IN(T44, tree(T47, T45, T48)) → F44_IN(T47, T48)
F2_IN(T107, tree(T108, T111, T110)) → U21(f79_in(T107, T108, T111), T107, tree(T108, T111, T110))
F2_IN(T107, tree(T108, T111, T110)) → F79_IN(T107, T108, T111)
F2_IN(T144, tree(T145, T146, T148)) → U31(f109_in(T145, T144, T148), T144, tree(T145, T146, T148))
F2_IN(T144, tree(T145, T146, T148)) → F109_IN(T145, T144, T148)
F44_IN(T79, tree(T76, T80, T81)) → U41(f44_in(T79, T80), T79, tree(T76, T80, T81))
F44_IN(T79, tree(T76, T80, T81)) → F44_IN(T79, T80)
F81_IN(s(T126), s(T127)) → U51(f81_in(T126, T127), s(T126), s(T127))
F81_IN(s(T126), s(T127)) → F81_IN(T126, T127)
F79_IN(T107, T108, T111) → U61(f81_in(T107, T108), T107, T108, T111)
F79_IN(T107, T108, T111) → F81_IN(T107, T108)
U61(f81_out1, T107, T108, T111) → U71(f2_in(T107, T111), T107, T108, T111)
U61(f81_out1, T107, T108, T111) → F2_IN(T107, T111)
F109_IN(T145, T144, T148) → U81(f81_in(T145, T144), T145, T144, T148)
F109_IN(T145, T144, T148) → F81_IN(T145, T144)
U81(f81_out1, T145, T144, T148) → U91(f2_in(T144, T148), T145, T144, T148)
U81(f81_out1, T145, T144, T148) → F2_IN(T144, T148)

The TRS R consists of the following rules:

f2_in(T12, T13) → f2_out1
f2_in(T44, tree(T47, T45, T48)) → U1(f44_in(T47, T48), T44, tree(T47, T45, T48))
U1(f44_out1, T44, tree(T47, T45, T48)) → f2_out1
f2_in(T107, tree(T108, T111, T110)) → U2(f79_in(T107, T108, T111), T107, tree(T108, T111, T110))
U2(f79_out1, T107, tree(T108, T111, T110)) → f2_out1
f2_in(T144, tree(T145, T146, T148)) → U3(f109_in(T145, T144, T148), T144, tree(T145, T146, T148))
U3(f109_out1, T144, tree(T145, T146, T148)) → f2_out1
f44_in(T62, T63) → f44_out1
f44_in(T79, tree(T76, T80, T81)) → U4(f44_in(T79, T80), T79, tree(T76, T80, T81))
U4(f44_out1, T79, tree(T76, T80, T81)) → f44_out1
f81_in(0, s(T121)) → f81_out1
f81_in(s(T126), s(T127)) → U5(f81_in(T126, T127), s(T126), s(T127))
U5(f81_out1, s(T126), s(T127)) → f81_out1
f79_in(T107, T108, T111) → U6(f81_in(T107, T108), T107, T108, T111)
U6(f81_out1, T107, T108, T111) → U7(f2_in(T107, T111), T107, T108, T111)
U7(f2_out1, T107, T108, T111) → f79_out1
f109_in(T145, T144, T148) → U8(f81_in(T145, T144), T145, T144, T148)
U8(f81_out1, T145, T144, T148) → U9(f2_in(T144, T148), T145, T144, T148)
U9(f2_out1, T145, T144, T148) → f109_out1

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 3 SCCs with 10 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Q DP problem:
The TRS P consists of the following rules:

F81_IN(s(T126), s(T127)) → F81_IN(T126, T127)

The TRS R consists of the following rules:

f2_in(T12, T13) → f2_out1
f2_in(T44, tree(T47, T45, T48)) → U1(f44_in(T47, T48), T44, tree(T47, T45, T48))
U1(f44_out1, T44, tree(T47, T45, T48)) → f2_out1
f2_in(T107, tree(T108, T111, T110)) → U2(f79_in(T107, T108, T111), T107, tree(T108, T111, T110))
U2(f79_out1, T107, tree(T108, T111, T110)) → f2_out1
f2_in(T144, tree(T145, T146, T148)) → U3(f109_in(T145, T144, T148), T144, tree(T145, T146, T148))
U3(f109_out1, T144, tree(T145, T146, T148)) → f2_out1
f44_in(T62, T63) → f44_out1
f44_in(T79, tree(T76, T80, T81)) → U4(f44_in(T79, T80), T79, tree(T76, T80, T81))
U4(f44_out1, T79, tree(T76, T80, T81)) → f44_out1
f81_in(0, s(T121)) → f81_out1
f81_in(s(T126), s(T127)) → U5(f81_in(T126, T127), s(T126), s(T127))
U5(f81_out1, s(T126), s(T127)) → f81_out1
f79_in(T107, T108, T111) → U6(f81_in(T107, T108), T107, T108, T111)
U6(f81_out1, T107, T108, T111) → U7(f2_in(T107, T111), T107, T108, T111)
U7(f2_out1, T107, T108, T111) → f79_out1
f109_in(T145, T144, T148) → U8(f81_in(T145, T144), T145, T144, T148)
U8(f81_out1, T145, T144, T148) → U9(f2_in(T144, T148), T145, T144, T148)
U9(f2_out1, T145, T144, T148) → f109_out1

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(8) UsableRulesProof (EQUIVALENT transformation)

We can use the usable rules and reduction pair processor [LPAR04] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its arguments. Then, we can delete all non-usable rules [FROCOS05] from R.

(9) Obligation:

Q DP problem:
The TRS P consists of the following rules:

F81_IN(s(T126), s(T127)) → F81_IN(T126, T127)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(10) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • F81_IN(s(T126), s(T127)) → F81_IN(T126, T127)
    The graph contains the following edges 1 > 1, 2 > 2

(11) YES

(12) Obligation:

Q DP problem:
The TRS P consists of the following rules:

F44_IN(T79, tree(T76, T80, T81)) → F44_IN(T79, T80)

The TRS R consists of the following rules:

f2_in(T12, T13) → f2_out1
f2_in(T44, tree(T47, T45, T48)) → U1(f44_in(T47, T48), T44, tree(T47, T45, T48))
U1(f44_out1, T44, tree(T47, T45, T48)) → f2_out1
f2_in(T107, tree(T108, T111, T110)) → U2(f79_in(T107, T108, T111), T107, tree(T108, T111, T110))
U2(f79_out1, T107, tree(T108, T111, T110)) → f2_out1
f2_in(T144, tree(T145, T146, T148)) → U3(f109_in(T145, T144, T148), T144, tree(T145, T146, T148))
U3(f109_out1, T144, tree(T145, T146, T148)) → f2_out1
f44_in(T62, T63) → f44_out1
f44_in(T79, tree(T76, T80, T81)) → U4(f44_in(T79, T80), T79, tree(T76, T80, T81))
U4(f44_out1, T79, tree(T76, T80, T81)) → f44_out1
f81_in(0, s(T121)) → f81_out1
f81_in(s(T126), s(T127)) → U5(f81_in(T126, T127), s(T126), s(T127))
U5(f81_out1, s(T126), s(T127)) → f81_out1
f79_in(T107, T108, T111) → U6(f81_in(T107, T108), T107, T108, T111)
U6(f81_out1, T107, T108, T111) → U7(f2_in(T107, T111), T107, T108, T111)
U7(f2_out1, T107, T108, T111) → f79_out1
f109_in(T145, T144, T148) → U8(f81_in(T145, T144), T145, T144, T148)
U8(f81_out1, T145, T144, T148) → U9(f2_in(T144, T148), T145, T144, T148)
U9(f2_out1, T145, T144, T148) → f109_out1

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(13) UsableRulesProof (EQUIVALENT transformation)

We can use the usable rules and reduction pair processor [LPAR04] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its arguments. Then, we can delete all non-usable rules [FROCOS05] from R.

(14) Obligation:

Q DP problem:
The TRS P consists of the following rules:

F44_IN(T79, tree(T76, T80, T81)) → F44_IN(T79, T80)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(15) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • F44_IN(T79, tree(T76, T80, T81)) → F44_IN(T79, T80)
    The graph contains the following edges 1 >= 1, 2 > 2

(16) YES

(17) Obligation:

Q DP problem:
The TRS P consists of the following rules:

F2_IN(T107, tree(T108, T111, T110)) → F79_IN(T107, T108, T111)
F79_IN(T107, T108, T111) → U61(f81_in(T107, T108), T107, T108, T111)
U61(f81_out1, T107, T108, T111) → F2_IN(T107, T111)
F2_IN(T144, tree(T145, T146, T148)) → F109_IN(T145, T144, T148)
F109_IN(T145, T144, T148) → U81(f81_in(T145, T144), T145, T144, T148)
U81(f81_out1, T145, T144, T148) → F2_IN(T144, T148)

The TRS R consists of the following rules:

f2_in(T12, T13) → f2_out1
f2_in(T44, tree(T47, T45, T48)) → U1(f44_in(T47, T48), T44, tree(T47, T45, T48))
U1(f44_out1, T44, tree(T47, T45, T48)) → f2_out1
f2_in(T107, tree(T108, T111, T110)) → U2(f79_in(T107, T108, T111), T107, tree(T108, T111, T110))
U2(f79_out1, T107, tree(T108, T111, T110)) → f2_out1
f2_in(T144, tree(T145, T146, T148)) → U3(f109_in(T145, T144, T148), T144, tree(T145, T146, T148))
U3(f109_out1, T144, tree(T145, T146, T148)) → f2_out1
f44_in(T62, T63) → f44_out1
f44_in(T79, tree(T76, T80, T81)) → U4(f44_in(T79, T80), T79, tree(T76, T80, T81))
U4(f44_out1, T79, tree(T76, T80, T81)) → f44_out1
f81_in(0, s(T121)) → f81_out1
f81_in(s(T126), s(T127)) → U5(f81_in(T126, T127), s(T126), s(T127))
U5(f81_out1, s(T126), s(T127)) → f81_out1
f79_in(T107, T108, T111) → U6(f81_in(T107, T108), T107, T108, T111)
U6(f81_out1, T107, T108, T111) → U7(f2_in(T107, T111), T107, T108, T111)
U7(f2_out1, T107, T108, T111) → f79_out1
f109_in(T145, T144, T148) → U8(f81_in(T145, T144), T145, T144, T148)
U8(f81_out1, T145, T144, T148) → U9(f2_in(T144, T148), T145, T144, T148)
U9(f2_out1, T145, T144, T148) → f109_out1

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(18) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • F79_IN(T107, T108, T111) → U61(f81_in(T107, T108), T107, T108, T111)
    The graph contains the following edges 1 >= 2, 2 >= 3, 3 >= 4

  • U61(f81_out1, T107, T108, T111) → F2_IN(T107, T111)
    The graph contains the following edges 2 >= 1, 4 >= 2

  • U81(f81_out1, T145, T144, T148) → F2_IN(T144, T148)
    The graph contains the following edges 3 >= 1, 4 >= 2

  • F2_IN(T107, tree(T108, T111, T110)) → F79_IN(T107, T108, T111)
    The graph contains the following edges 1 >= 1, 2 > 2, 2 > 3

  • F2_IN(T144, tree(T145, T146, T148)) → F109_IN(T145, T144, T148)
    The graph contains the following edges 2 > 1, 1 >= 2, 2 > 3

  • F109_IN(T145, T144, T148) → U81(f81_in(T145, T144), T145, T144, T148)
    The graph contains the following edges 1 >= 2, 2 >= 3, 3 >= 4

(19) YES