(0) Obligation:

Clauses:

perm([], []).
perm(L, .(H, T)) :- ','(append2(V, .(H, U), L), ','(append1(V, U, W), perm(W, T))).
append1([], L, L).
append1(.(H, L1), L2, .(H, L3)) :- append1(L1, L2, L3).
append2([], L, L).
append2(.(H, L1), L2, .(H, L3)) :- append2(L1, L2, L3).

Query: perm(g,a)

(1) PrologToTRSTransformerProof (SOUND transformation)

Transformed Prolog program to TRS.

(2) Obligation:

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

f1_in([]) → f1_out1([])
f1_in(T9) → U1(f23_in(T9), T9)
U1(f23_out1(X13, T12, X14, X15, T13), T9) → f1_out1(.(T12, T13))
f48_in(.(T33, T34)) → f48_out1([], T33, T34)
f48_in(.(T42, T43)) → U2(f48_in(T43), .(T42, T43))
U2(f48_out1(X53, T44, X54), .(T42, T43)) → f48_out1(.(T42, X53), T44, X54)
f82_in([], T58) → f82_out1(T58)
f82_in(.(T65, T66), T67) → U3(f82_in(T66, T67), .(T65, T66), T67)
U3(f82_out1(X82), .(T65, T66), T67) → f82_out1(.(T65, X82))
f23_in(T9) → U4(f48_in(T9), T9)
U4(f48_out1(T18, T12, T19), T9) → U5(f49_in(T18, T19), T9, T18, T12, T19)
U5(f49_out1(X15, T20), T9, T18, T12, T19) → f23_out1(T18, T12, T19, X15, T20)
f49_in(T18, T19) → U6(f82_in(T18, T19), T18, T19)
U6(f82_out1(T51), T18, T19) → U7(f1_in(T51), T18, T19, T51)
U7(f1_out1(T20), T18, T19, T51) → f49_out1(T51, T20)

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:

F1_IN(T9) → U11(f23_in(T9), T9)
F1_IN(T9) → F23_IN(T9)
F48_IN(.(T42, T43)) → U21(f48_in(T43), .(T42, T43))
F48_IN(.(T42, T43)) → F48_IN(T43)
F82_IN(.(T65, T66), T67) → U31(f82_in(T66, T67), .(T65, T66), T67)
F82_IN(.(T65, T66), T67) → F82_IN(T66, T67)
F23_IN(T9) → U41(f48_in(T9), T9)
F23_IN(T9) → F48_IN(T9)
U41(f48_out1(T18, T12, T19), T9) → U51(f49_in(T18, T19), T9, T18, T12, T19)
U41(f48_out1(T18, T12, T19), T9) → F49_IN(T18, T19)
F49_IN(T18, T19) → U61(f82_in(T18, T19), T18, T19)
F49_IN(T18, T19) → F82_IN(T18, T19)
U61(f82_out1(T51), T18, T19) → U71(f1_in(T51), T18, T19, T51)
U61(f82_out1(T51), T18, T19) → F1_IN(T51)

The TRS R consists of the following rules:

f1_in([]) → f1_out1([])
f1_in(T9) → U1(f23_in(T9), T9)
U1(f23_out1(X13, T12, X14, X15, T13), T9) → f1_out1(.(T12, T13))
f48_in(.(T33, T34)) → f48_out1([], T33, T34)
f48_in(.(T42, T43)) → U2(f48_in(T43), .(T42, T43))
U2(f48_out1(X53, T44, X54), .(T42, T43)) → f48_out1(.(T42, X53), T44, X54)
f82_in([], T58) → f82_out1(T58)
f82_in(.(T65, T66), T67) → U3(f82_in(T66, T67), .(T65, T66), T67)
U3(f82_out1(X82), .(T65, T66), T67) → f82_out1(.(T65, X82))
f23_in(T9) → U4(f48_in(T9), T9)
U4(f48_out1(T18, T12, T19), T9) → U5(f49_in(T18, T19), T9, T18, T12, T19)
U5(f49_out1(X15, T20), T9, T18, T12, T19) → f23_out1(T18, T12, T19, X15, T20)
f49_in(T18, T19) → U6(f82_in(T18, T19), T18, T19)
U6(f82_out1(T51), T18, T19) → U7(f1_in(T51), T18, T19, T51)
U7(f1_out1(T20), T18, T19, T51) → f49_out1(T51, T20)

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 7 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

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

F82_IN(.(T65, T66), T67) → F82_IN(T66, T67)

The TRS R consists of the following rules:

f1_in([]) → f1_out1([])
f1_in(T9) → U1(f23_in(T9), T9)
U1(f23_out1(X13, T12, X14, X15, T13), T9) → f1_out1(.(T12, T13))
f48_in(.(T33, T34)) → f48_out1([], T33, T34)
f48_in(.(T42, T43)) → U2(f48_in(T43), .(T42, T43))
U2(f48_out1(X53, T44, X54), .(T42, T43)) → f48_out1(.(T42, X53), T44, X54)
f82_in([], T58) → f82_out1(T58)
f82_in(.(T65, T66), T67) → U3(f82_in(T66, T67), .(T65, T66), T67)
U3(f82_out1(X82), .(T65, T66), T67) → f82_out1(.(T65, X82))
f23_in(T9) → U4(f48_in(T9), T9)
U4(f48_out1(T18, T12, T19), T9) → U5(f49_in(T18, T19), T9, T18, T12, T19)
U5(f49_out1(X15, T20), T9, T18, T12, T19) → f23_out1(T18, T12, T19, X15, T20)
f49_in(T18, T19) → U6(f82_in(T18, T19), T18, T19)
U6(f82_out1(T51), T18, T19) → U7(f1_in(T51), T18, T19, T51)
U7(f1_out1(T20), T18, T19, T51) → f49_out1(T51, T20)

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:

F82_IN(.(T65, T66), T67) → F82_IN(T66, T67)

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:

  • F82_IN(.(T65, T66), T67) → F82_IN(T66, T67)
    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:

F48_IN(.(T42, T43)) → F48_IN(T43)

The TRS R consists of the following rules:

f1_in([]) → f1_out1([])
f1_in(T9) → U1(f23_in(T9), T9)
U1(f23_out1(X13, T12, X14, X15, T13), T9) → f1_out1(.(T12, T13))
f48_in(.(T33, T34)) → f48_out1([], T33, T34)
f48_in(.(T42, T43)) → U2(f48_in(T43), .(T42, T43))
U2(f48_out1(X53, T44, X54), .(T42, T43)) → f48_out1(.(T42, X53), T44, X54)
f82_in([], T58) → f82_out1(T58)
f82_in(.(T65, T66), T67) → U3(f82_in(T66, T67), .(T65, T66), T67)
U3(f82_out1(X82), .(T65, T66), T67) → f82_out1(.(T65, X82))
f23_in(T9) → U4(f48_in(T9), T9)
U4(f48_out1(T18, T12, T19), T9) → U5(f49_in(T18, T19), T9, T18, T12, T19)
U5(f49_out1(X15, T20), T9, T18, T12, T19) → f23_out1(T18, T12, T19, X15, T20)
f49_in(T18, T19) → U6(f82_in(T18, T19), T18, T19)
U6(f82_out1(T51), T18, T19) → U7(f1_in(T51), T18, T19, T51)
U7(f1_out1(T20), T18, T19, T51) → f49_out1(T51, T20)

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:

F48_IN(.(T42, T43)) → F48_IN(T43)

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:

  • F48_IN(.(T42, T43)) → F48_IN(T43)
    The graph contains the following edges 1 > 1

(16) YES

(17) Obligation:

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

F1_IN(T9) → F23_IN(T9)
F23_IN(T9) → U41(f48_in(T9), T9)
U41(f48_out1(T18, T12, T19), T9) → F49_IN(T18, T19)
F49_IN(T18, T19) → U61(f82_in(T18, T19), T18, T19)
U61(f82_out1(T51), T18, T19) → F1_IN(T51)

The TRS R consists of the following rules:

f1_in([]) → f1_out1([])
f1_in(T9) → U1(f23_in(T9), T9)
U1(f23_out1(X13, T12, X14, X15, T13), T9) → f1_out1(.(T12, T13))
f48_in(.(T33, T34)) → f48_out1([], T33, T34)
f48_in(.(T42, T43)) → U2(f48_in(T43), .(T42, T43))
U2(f48_out1(X53, T44, X54), .(T42, T43)) → f48_out1(.(T42, X53), T44, X54)
f82_in([], T58) → f82_out1(T58)
f82_in(.(T65, T66), T67) → U3(f82_in(T66, T67), .(T65, T66), T67)
U3(f82_out1(X82), .(T65, T66), T67) → f82_out1(.(T65, X82))
f23_in(T9) → U4(f48_in(T9), T9)
U4(f48_out1(T18, T12, T19), T9) → U5(f49_in(T18, T19), T9, T18, T12, T19)
U5(f49_out1(X15, T20), T9, T18, T12, T19) → f23_out1(T18, T12, T19, X15, T20)
f49_in(T18, T19) → U6(f82_in(T18, T19), T18, T19)
U6(f82_out1(T51), T18, T19) → U7(f1_in(T51), T18, T19, T51)
U7(f1_out1(T20), T18, T19, T51) → f49_out1(T51, T20)

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

(18) QDPOrderProof (EQUIVALENT transformation)

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


The following pairs can be oriented strictly and are deleted.


F23_IN(T9) → U41(f48_in(T9), T9)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 1 + x2   
POL(F1_IN(x1)) = 1 + x1   
POL(F23_IN(x1)) = 1 + x1   
POL(F49_IN(x1, x2)) = x1 + x2   
POL(U2(x1, x2)) = 1 + x1   
POL(U3(x1, x2, x3)) = 1 + x1   
POL(U41(x1, x2)) = x1   
POL(U61(x1, x2, x3)) = x1   
POL([]) = 1   
POL(f48_in(x1)) = x1   
POL(f48_out1(x1, x2, x3)) = x1 + x3   
POL(f82_in(x1, x2)) = x1 + x2   
POL(f82_out1(x1)) = 1 + x1   

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

f48_in(.(T33, T34)) → f48_out1([], T33, T34)
f48_in(.(T42, T43)) → U2(f48_in(T43), .(T42, T43))
f82_in([], T58) → f82_out1(T58)
f82_in(.(T65, T66), T67) → U3(f82_in(T66, T67), .(T65, T66), T67)
U2(f48_out1(X53, T44, X54), .(T42, T43)) → f48_out1(.(T42, X53), T44, X54)
U3(f82_out1(X82), .(T65, T66), T67) → f82_out1(.(T65, X82))

(19) Obligation:

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

F1_IN(T9) → F23_IN(T9)
U41(f48_out1(T18, T12, T19), T9) → F49_IN(T18, T19)
F49_IN(T18, T19) → U61(f82_in(T18, T19), T18, T19)
U61(f82_out1(T51), T18, T19) → F1_IN(T51)

The TRS R consists of the following rules:

f1_in([]) → f1_out1([])
f1_in(T9) → U1(f23_in(T9), T9)
U1(f23_out1(X13, T12, X14, X15, T13), T9) → f1_out1(.(T12, T13))
f48_in(.(T33, T34)) → f48_out1([], T33, T34)
f48_in(.(T42, T43)) → U2(f48_in(T43), .(T42, T43))
U2(f48_out1(X53, T44, X54), .(T42, T43)) → f48_out1(.(T42, X53), T44, X54)
f82_in([], T58) → f82_out1(T58)
f82_in(.(T65, T66), T67) → U3(f82_in(T66, T67), .(T65, T66), T67)
U3(f82_out1(X82), .(T65, T66), T67) → f82_out1(.(T65, X82))
f23_in(T9) → U4(f48_in(T9), T9)
U4(f48_out1(T18, T12, T19), T9) → U5(f49_in(T18, T19), T9, T18, T12, T19)
U5(f49_out1(X15, T20), T9, T18, T12, T19) → f23_out1(T18, T12, T19, X15, T20)
f49_in(T18, T19) → U6(f82_in(T18, T19), T18, T19)
U6(f82_out1(T51), T18, T19) → U7(f1_in(T51), T18, T19, T51)
U7(f1_out1(T20), T18, T19, T51) → f49_out1(T51, T20)

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

(20) DependencyGraphProof (EQUIVALENT transformation)

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

(21) TRUE