(0) Obligation:

Clauses:

perm(Xs, .(X, Ys)) :- ','(app(X1s, .(X, X2s), Xs), ','(app(X1s, X2s, Zs), perm(Zs, Ys))).
perm([], []).
app(.(X, Xs), Ys, .(X, Zs)) :- app(Xs, Ys, Zs).
app([], Ys, Ys).

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(T15) → U1(f19_in(T15), T15)
U1(f19_out1(X22, T18, X23, X24, T19), T15) → f1_out1(.(T18, T19))
f1_in([]) → f1_out1([])
f26_in(.(T42, T43)) → U2(f26_in(T43), .(T42, T43))
U2(f26_out1(X72, T44, X73), .(T42, T43)) → f26_out1(.(T42, X72), T44, X73)
f26_in(.(T52, T53)) → f26_out1([], T52, T53)
f54_in(.(T73, T74), T75) → U3(f54_in(T74, T75), .(T73, T74), T75)
U3(f54_out1(X121), .(T73, T74), T75) → f54_out1(.(T73, X121))
f54_in([], T81) → f54_out1(T81)
f19_in(T15) → U4(f26_in(T15), T15)
U4(f26_out1(T23, T18, T24), T15) → U5(f28_in(T23, T24), T15, T23, T18, T24)
U5(f28_out1(X24, T25), T15, T23, T18, T24) → f19_out1(T23, T18, T24, X24, T25)
f28_in(T23, T24) → U6(f54_in(T23, T24), T23, T24)
U6(f54_out1(T57), T23, T24) → U7(f1_in(T57), T23, T24, T57)
U7(f1_out1(T25), T23, T24, T57) → f28_out1(T57, T25)

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(T15) → U11(f19_in(T15), T15)
F1_IN(T15) → F19_IN(T15)
F26_IN(.(T42, T43)) → U21(f26_in(T43), .(T42, T43))
F26_IN(.(T42, T43)) → F26_IN(T43)
F54_IN(.(T73, T74), T75) → U31(f54_in(T74, T75), .(T73, T74), T75)
F54_IN(.(T73, T74), T75) → F54_IN(T74, T75)
F19_IN(T15) → U41(f26_in(T15), T15)
F19_IN(T15) → F26_IN(T15)
U41(f26_out1(T23, T18, T24), T15) → U51(f28_in(T23, T24), T15, T23, T18, T24)
U41(f26_out1(T23, T18, T24), T15) → F28_IN(T23, T24)
F28_IN(T23, T24) → U61(f54_in(T23, T24), T23, T24)
F28_IN(T23, T24) → F54_IN(T23, T24)
U61(f54_out1(T57), T23, T24) → U71(f1_in(T57), T23, T24, T57)
U61(f54_out1(T57), T23, T24) → F1_IN(T57)

The TRS R consists of the following rules:

f1_in(T15) → U1(f19_in(T15), T15)
U1(f19_out1(X22, T18, X23, X24, T19), T15) → f1_out1(.(T18, T19))
f1_in([]) → f1_out1([])
f26_in(.(T42, T43)) → U2(f26_in(T43), .(T42, T43))
U2(f26_out1(X72, T44, X73), .(T42, T43)) → f26_out1(.(T42, X72), T44, X73)
f26_in(.(T52, T53)) → f26_out1([], T52, T53)
f54_in(.(T73, T74), T75) → U3(f54_in(T74, T75), .(T73, T74), T75)
U3(f54_out1(X121), .(T73, T74), T75) → f54_out1(.(T73, X121))
f54_in([], T81) → f54_out1(T81)
f19_in(T15) → U4(f26_in(T15), T15)
U4(f26_out1(T23, T18, T24), T15) → U5(f28_in(T23, T24), T15, T23, T18, T24)
U5(f28_out1(X24, T25), T15, T23, T18, T24) → f19_out1(T23, T18, T24, X24, T25)
f28_in(T23, T24) → U6(f54_in(T23, T24), T23, T24)
U6(f54_out1(T57), T23, T24) → U7(f1_in(T57), T23, T24, T57)
U7(f1_out1(T25), T23, T24, T57) → f28_out1(T57, T25)

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:

F54_IN(.(T73, T74), T75) → F54_IN(T74, T75)

The TRS R consists of the following rules:

f1_in(T15) → U1(f19_in(T15), T15)
U1(f19_out1(X22, T18, X23, X24, T19), T15) → f1_out1(.(T18, T19))
f1_in([]) → f1_out1([])
f26_in(.(T42, T43)) → U2(f26_in(T43), .(T42, T43))
U2(f26_out1(X72, T44, X73), .(T42, T43)) → f26_out1(.(T42, X72), T44, X73)
f26_in(.(T52, T53)) → f26_out1([], T52, T53)
f54_in(.(T73, T74), T75) → U3(f54_in(T74, T75), .(T73, T74), T75)
U3(f54_out1(X121), .(T73, T74), T75) → f54_out1(.(T73, X121))
f54_in([], T81) → f54_out1(T81)
f19_in(T15) → U4(f26_in(T15), T15)
U4(f26_out1(T23, T18, T24), T15) → U5(f28_in(T23, T24), T15, T23, T18, T24)
U5(f28_out1(X24, T25), T15, T23, T18, T24) → f19_out1(T23, T18, T24, X24, T25)
f28_in(T23, T24) → U6(f54_in(T23, T24), T23, T24)
U6(f54_out1(T57), T23, T24) → U7(f1_in(T57), T23, T24, T57)
U7(f1_out1(T25), T23, T24, T57) → f28_out1(T57, T25)

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:

F54_IN(.(T73, T74), T75) → F54_IN(T74, T75)

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:

  • F54_IN(.(T73, T74), T75) → F54_IN(T74, T75)
    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:

F26_IN(.(T42, T43)) → F26_IN(T43)

The TRS R consists of the following rules:

f1_in(T15) → U1(f19_in(T15), T15)
U1(f19_out1(X22, T18, X23, X24, T19), T15) → f1_out1(.(T18, T19))
f1_in([]) → f1_out1([])
f26_in(.(T42, T43)) → U2(f26_in(T43), .(T42, T43))
U2(f26_out1(X72, T44, X73), .(T42, T43)) → f26_out1(.(T42, X72), T44, X73)
f26_in(.(T52, T53)) → f26_out1([], T52, T53)
f54_in(.(T73, T74), T75) → U3(f54_in(T74, T75), .(T73, T74), T75)
U3(f54_out1(X121), .(T73, T74), T75) → f54_out1(.(T73, X121))
f54_in([], T81) → f54_out1(T81)
f19_in(T15) → U4(f26_in(T15), T15)
U4(f26_out1(T23, T18, T24), T15) → U5(f28_in(T23, T24), T15, T23, T18, T24)
U5(f28_out1(X24, T25), T15, T23, T18, T24) → f19_out1(T23, T18, T24, X24, T25)
f28_in(T23, T24) → U6(f54_in(T23, T24), T23, T24)
U6(f54_out1(T57), T23, T24) → U7(f1_in(T57), T23, T24, T57)
U7(f1_out1(T25), T23, T24, T57) → f28_out1(T57, T25)

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:

F26_IN(.(T42, T43)) → F26_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:

  • F26_IN(.(T42, T43)) → F26_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(T15) → F19_IN(T15)
F19_IN(T15) → U41(f26_in(T15), T15)
U41(f26_out1(T23, T18, T24), T15) → F28_IN(T23, T24)
F28_IN(T23, T24) → U61(f54_in(T23, T24), T23, T24)
U61(f54_out1(T57), T23, T24) → F1_IN(T57)

The TRS R consists of the following rules:

f1_in(T15) → U1(f19_in(T15), T15)
U1(f19_out1(X22, T18, X23, X24, T19), T15) → f1_out1(.(T18, T19))
f1_in([]) → f1_out1([])
f26_in(.(T42, T43)) → U2(f26_in(T43), .(T42, T43))
U2(f26_out1(X72, T44, X73), .(T42, T43)) → f26_out1(.(T42, X72), T44, X73)
f26_in(.(T52, T53)) → f26_out1([], T52, T53)
f54_in(.(T73, T74), T75) → U3(f54_in(T74, T75), .(T73, T74), T75)
U3(f54_out1(X121), .(T73, T74), T75) → f54_out1(.(T73, X121))
f54_in([], T81) → f54_out1(T81)
f19_in(T15) → U4(f26_in(T15), T15)
U4(f26_out1(T23, T18, T24), T15) → U5(f28_in(T23, T24), T15, T23, T18, T24)
U5(f28_out1(X24, T25), T15, T23, T18, T24) → f19_out1(T23, T18, T24, X24, T25)
f28_in(T23, T24) → U6(f54_in(T23, T24), T23, T24)
U6(f54_out1(T57), T23, T24) → U7(f1_in(T57), T23, T24, T57)
U7(f1_out1(T25), T23, T24, T57) → f28_out1(T57, T25)

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.


F1_IN(T15) → F19_IN(T15)
F19_IN(T15) → U41(f26_in(T15), T15)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial Order [NEGPOLO,POLO] with Interpretation:

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


POL( f26_in(x1) ) = x1


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


POL( U2(x1, x2) ) = x1 + 2


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


POL( [] ) = 0


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


POL( f54_in(x1, x2) ) = x1 + x2


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


POL( f54_out1(x1) ) = x1


POL( F1_IN(x1) ) = 2x1 + 2


POL( F19_IN(x1) ) = 2x1 + 1


POL( F28_IN(x1, x2) ) = 2x1 + 2x2 + 2



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

f26_in(.(T42, T43)) → U2(f26_in(T43), .(T42, T43))
f26_in(.(T52, T53)) → f26_out1([], T52, T53)
f54_in(.(T73, T74), T75) → U3(f54_in(T74, T75), .(T73, T74), T75)
f54_in([], T81) → f54_out1(T81)
U2(f26_out1(X72, T44, X73), .(T42, T43)) → f26_out1(.(T42, X72), T44, X73)
U3(f54_out1(X121), .(T73, T74), T75) → f54_out1(.(T73, X121))

(19) Obligation:

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

U41(f26_out1(T23, T18, T24), T15) → F28_IN(T23, T24)
F28_IN(T23, T24) → U61(f54_in(T23, T24), T23, T24)
U61(f54_out1(T57), T23, T24) → F1_IN(T57)

The TRS R consists of the following rules:

f1_in(T15) → U1(f19_in(T15), T15)
U1(f19_out1(X22, T18, X23, X24, T19), T15) → f1_out1(.(T18, T19))
f1_in([]) → f1_out1([])
f26_in(.(T42, T43)) → U2(f26_in(T43), .(T42, T43))
U2(f26_out1(X72, T44, X73), .(T42, T43)) → f26_out1(.(T42, X72), T44, X73)
f26_in(.(T52, T53)) → f26_out1([], T52, T53)
f54_in(.(T73, T74), T75) → U3(f54_in(T74, T75), .(T73, T74), T75)
U3(f54_out1(X121), .(T73, T74), T75) → f54_out1(.(T73, X121))
f54_in([], T81) → f54_out1(T81)
f19_in(T15) → U4(f26_in(T15), T15)
U4(f26_out1(T23, T18, T24), T15) → U5(f28_in(T23, T24), T15, T23, T18, T24)
U5(f28_out1(X24, T25), T15, T23, T18, T24) → f19_out1(T23, T18, T24, X24, T25)
f28_in(T23, T24) → U6(f54_in(T23, T24), T23, T24)
U6(f54_out1(T57), T23, T24) → U7(f1_in(T57), T23, T24, T57)
U7(f1_out1(T25), T23, T24, T57) → f28_out1(T57, T25)

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

(21) TRUE