(0) Obligation:

Clauses:

p(.(X, [])).
p(.(s(s(X)), .(Y, Xs))) :- ','(p(.(X, .(Y, Xs))), p(.(s(s(s(s(Y)))), Xs))).
p(.(0, Xs)) :- p(Xs).

Query: p(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(.(T6, [])) → f2_out1
f2_in(.(s(s(T19)), .(T20, T21))) → U1(f22_in(T19, T20, T21), .(s(s(T19)), .(T20, T21)))
U1(f22_out1, .(s(s(T19)), .(T20, T21))) → f2_out1
f2_in(.(0, T30)) → U2(f2_in(T30), .(0, T30))
U2(f2_out1, .(0, T30)) → f2_out1
f22_in(T19, T20, T21) → U3(f2_in(.(T19, .(T20, T21))), T19, T20, T21)
U3(f2_out1, T19, T20, T21) → U4(f2_in(.(s(s(s(s(T20)))), T21)), T19, T20, T21)
U4(f2_out1, T19, T20, T21) → f22_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(.(s(s(T19)), .(T20, T21))) → U11(f22_in(T19, T20, T21), .(s(s(T19)), .(T20, T21)))
F2_IN(.(s(s(T19)), .(T20, T21))) → F22_IN(T19, T20, T21)
F2_IN(.(0, T30)) → U21(f2_in(T30), .(0, T30))
F2_IN(.(0, T30)) → F2_IN(T30)
F22_IN(T19, T20, T21) → U31(f2_in(.(T19, .(T20, T21))), T19, T20, T21)
F22_IN(T19, T20, T21) → F2_IN(.(T19, .(T20, T21)))
U31(f2_out1, T19, T20, T21) → U41(f2_in(.(s(s(s(s(T20)))), T21)), T19, T20, T21)
U31(f2_out1, T19, T20, T21) → F2_IN(.(s(s(s(s(T20)))), T21))

The TRS R consists of the following rules:

f2_in(.(T6, [])) → f2_out1
f2_in(.(s(s(T19)), .(T20, T21))) → U1(f22_in(T19, T20, T21), .(s(s(T19)), .(T20, T21)))
U1(f22_out1, .(s(s(T19)), .(T20, T21))) → f2_out1
f2_in(.(0, T30)) → U2(f2_in(T30), .(0, T30))
U2(f2_out1, .(0, T30)) → f2_out1
f22_in(T19, T20, T21) → U3(f2_in(.(T19, .(T20, T21))), T19, T20, T21)
U3(f2_out1, T19, T20, T21) → U4(f2_in(.(s(s(s(s(T20)))), T21)), T19, T20, T21)
U4(f2_out1, T19, T20, T21) → f22_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 1 SCC with 3 less nodes.

(6) Obligation:

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

F2_IN(.(s(s(T19)), .(T20, T21))) → F22_IN(T19, T20, T21)
F22_IN(T19, T20, T21) → U31(f2_in(.(T19, .(T20, T21))), T19, T20, T21)
U31(f2_out1, T19, T20, T21) → F2_IN(.(s(s(s(s(T20)))), T21))
F22_IN(T19, T20, T21) → F2_IN(.(T19, .(T20, T21)))
F2_IN(.(0, T30)) → F2_IN(T30)

The TRS R consists of the following rules:

f2_in(.(T6, [])) → f2_out1
f2_in(.(s(s(T19)), .(T20, T21))) → U1(f22_in(T19, T20, T21), .(s(s(T19)), .(T20, T21)))
U1(f22_out1, .(s(s(T19)), .(T20, T21))) → f2_out1
f2_in(.(0, T30)) → U2(f2_in(T30), .(0, T30))
U2(f2_out1, .(0, T30)) → f2_out1
f22_in(T19, T20, T21) → U3(f2_in(.(T19, .(T20, T21))), T19, T20, T21)
U3(f2_out1, T19, T20, T21) → U4(f2_in(.(s(s(s(s(T20)))), T21)), T19, T20, T21)
U4(f2_out1, T19, T20, T21) → f22_out1

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

(7) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


F2_IN(.(0, T30)) → F2_IN(T30)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = x1 + x2   
POL(0) = 1   
POL(F22_IN(x1, x2, x3)) = x1 + x2 + x3   
POL(F2_IN(x1)) = x1   
POL(U1(x1, x2)) = 0   
POL(U2(x1, x2)) = 0   
POL(U3(x1, x2, x3, x4)) = 0   
POL(U31(x1, x2, x3, x4)) = x2 + x3 + x4   
POL(U4(x1, x2, x3, x4)) = 0   
POL([]) = 1   
POL(f22_in(x1, x2, x3)) = 0   
POL(f22_out1) = 0   
POL(f2_in(x1)) = 1 + x1   
POL(f2_out1) = 1   
POL(s(x1)) = x1   

The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
none

(8) Obligation:

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

F2_IN(.(s(s(T19)), .(T20, T21))) → F22_IN(T19, T20, T21)
F22_IN(T19, T20, T21) → U31(f2_in(.(T19, .(T20, T21))), T19, T20, T21)
U31(f2_out1, T19, T20, T21) → F2_IN(.(s(s(s(s(T20)))), T21))
F22_IN(T19, T20, T21) → F2_IN(.(T19, .(T20, T21)))

The TRS R consists of the following rules:

f2_in(.(T6, [])) → f2_out1
f2_in(.(s(s(T19)), .(T20, T21))) → U1(f22_in(T19, T20, T21), .(s(s(T19)), .(T20, T21)))
U1(f22_out1, .(s(s(T19)), .(T20, T21))) → f2_out1
f2_in(.(0, T30)) → U2(f2_in(T30), .(0, T30))
U2(f2_out1, .(0, T30)) → f2_out1
f22_in(T19, T20, T21) → U3(f2_in(.(T19, .(T20, T21))), T19, T20, T21)
U3(f2_out1, T19, T20, T21) → U4(f2_in(.(s(s(s(s(T20)))), T21)), T19, T20, T21)
U4(f2_out1, T19, T20, T21) → f22_out1

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

(9) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


U31(f2_out1, T19, T20, T21) → F2_IN(.(s(s(s(s(T20)))), T21))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial Order [NEGPOLO,POLO] with Interpretation:

POL( U31(x1, ..., x4) ) = 2x4 + 2


POL( f2_in(x1) ) = max{0, -2}


POL( .(x1, x2) ) = x2 + 1


POL( s(x1) ) = 0


POL( U1(x1, x2) ) = max{0, 2x1 - 1}


POL( f22_in(x1, ..., x3) ) = x3


POL( 0 ) = 2


POL( U2(x1, x2) ) = 1


POL( f22_out1 ) = 2


POL( f2_out1 ) = 0


POL( U3(x1, ..., x4) ) = max{0, x2 + x4 - 2}


POL( U4(x1, ..., x4) ) = max{0, x1 - 1}


POL( [] ) = 0


POL( F2_IN(x1) ) = max{0, 2x1 - 2}


POL( F22_IN(x1, ..., x3) ) = 2x3 + 2



The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
none

(10) Obligation:

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

F2_IN(.(s(s(T19)), .(T20, T21))) → F22_IN(T19, T20, T21)
F22_IN(T19, T20, T21) → U31(f2_in(.(T19, .(T20, T21))), T19, T20, T21)
F22_IN(T19, T20, T21) → F2_IN(.(T19, .(T20, T21)))

The TRS R consists of the following rules:

f2_in(.(T6, [])) → f2_out1
f2_in(.(s(s(T19)), .(T20, T21))) → U1(f22_in(T19, T20, T21), .(s(s(T19)), .(T20, T21)))
U1(f22_out1, .(s(s(T19)), .(T20, T21))) → f2_out1
f2_in(.(0, T30)) → U2(f2_in(T30), .(0, T30))
U2(f2_out1, .(0, T30)) → f2_out1
f22_in(T19, T20, T21) → U3(f2_in(.(T19, .(T20, T21))), T19, T20, T21)
U3(f2_out1, T19, T20, T21) → U4(f2_in(.(s(s(s(s(T20)))), T21)), T19, T20, T21)
U4(f2_out1, T19, T20, T21) → f22_out1

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

(11) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.

(12) Obligation:

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

F22_IN(T19, T20, T21) → F2_IN(.(T19, .(T20, T21)))
F2_IN(.(s(s(T19)), .(T20, T21))) → F22_IN(T19, T20, T21)

The TRS R consists of the following rules:

f2_in(.(T6, [])) → f2_out1
f2_in(.(s(s(T19)), .(T20, T21))) → U1(f22_in(T19, T20, T21), .(s(s(T19)), .(T20, T21)))
U1(f22_out1, .(s(s(T19)), .(T20, T21))) → f2_out1
f2_in(.(0, T30)) → U2(f2_in(T30), .(0, T30))
U2(f2_out1, .(0, T30)) → f2_out1
f22_in(T19, T20, T21) → U3(f2_in(.(T19, .(T20, T21))), T19, T20, T21)
U3(f2_out1, T19, T20, T21) → U4(f2_in(.(s(s(s(s(T20)))), T21)), T19, T20, T21)
U4(f2_out1, T19, T20, T21) → f22_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:

F22_IN(T19, T20, T21) → F2_IN(.(T19, .(T20, T21)))
F2_IN(.(s(s(T19)), .(T20, T21))) → F22_IN(T19, T20, T21)

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

(15) UsableRulesReductionPairsProof (EQUIVALENT transformation)

By using the usable rules with reduction pair processor [LPAR04] with a polynomial ordering [POLO], all dependency pairs and the corresponding usable rules [FROCOS05] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

F2_IN(.(s(s(T19)), .(T20, T21))) → F22_IN(T19, T20, T21)
No rules are removed from R.

Used ordering: POLO with Polynomial interpretation [POLO]:

POL(.(x1, x2)) = x1 + x2   
POL(F22_IN(x1, x2, x3)) = x1 + x2 + x3   
POL(F2_IN(x1)) = x1   
POL(s(x1)) = 2·x1   

(16) Obligation:

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

F22_IN(T19, T20, T21) → F2_IN(.(T19, .(T20, T21)))

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

(17) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(18) TRUE