(0) Obligation:

Clauses:

perm([], []).
perm(.(X, Y), .(U, V)) :- ','(delete(U, .(X, Y), W), perm(W, V)).
delete(X, .(X, Y), Y).
delete(U, .(X, Y), .(X, Z)) :- delete(U, Y, Z).

Queries:

perm(g,a).

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(2) Obligation:

Triples:

delete15(T70, .(T68, T69), .(T68, X83)) :- delete15(T70, T69, X83).
perm1(.(T21, T22), .(T21, T23)) :- perm1(T22, T23).
perm1(.(T37, T38), .(T39, T40)) :- delete15(T39, T38, X48).
perm1(.(T37, T38), .(T39, T46)) :- ','(deletec15(T39, T38, T45), perm1(.(T37, T45), T46)).

Clauses:

permc1([], []).
permc1(.(T21, T22), .(T21, T23)) :- permc1(T22, T23).
permc1(.(T37, T38), .(T39, T46)) :- ','(deletec15(T39, T38, T45), permc1(.(T37, T45), T46)).
deletec15(T59, .(T59, T60), T60).
deletec15(T70, .(T68, T69), .(T68, X83)) :- deletec15(T70, T69, X83).

Afs:

perm1(x1, x2)  =  perm1(x1)

(3) TriplesToPiDPProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
perm1_in: (b,f)
delete15_in: (f,b,f)
deletec15_in: (f,b,f)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

PERM1_IN_GA(.(T21, T22), .(T21, T23)) → U2_GA(T21, T22, T23, perm1_in_ga(T22, T23))
PERM1_IN_GA(.(T21, T22), .(T21, T23)) → PERM1_IN_GA(T22, T23)
PERM1_IN_GA(.(T37, T38), .(T39, T40)) → U3_GA(T37, T38, T39, T40, delete15_in_aga(T39, T38, X48))
PERM1_IN_GA(.(T37, T38), .(T39, T40)) → DELETE15_IN_AGA(T39, T38, X48)
DELETE15_IN_AGA(T70, .(T68, T69), .(T68, X83)) → U1_AGA(T70, T68, T69, X83, delete15_in_aga(T70, T69, X83))
DELETE15_IN_AGA(T70, .(T68, T69), .(T68, X83)) → DELETE15_IN_AGA(T70, T69, X83)
PERM1_IN_GA(.(T37, T38), .(T39, T46)) → U4_GA(T37, T38, T39, T46, deletec15_in_aga(T39, T38, T45))
U4_GA(T37, T38, T39, T46, deletec15_out_aga(T39, T38, T45)) → U5_GA(T37, T38, T39, T46, perm1_in_ga(.(T37, T45), T46))
U4_GA(T37, T38, T39, T46, deletec15_out_aga(T39, T38, T45)) → PERM1_IN_GA(.(T37, T45), T46)

The TRS R consists of the following rules:

deletec15_in_aga(T59, .(T59, T60), T60) → deletec15_out_aga(T59, .(T59, T60), T60)
deletec15_in_aga(T70, .(T68, T69), .(T68, X83)) → U10_aga(T70, T68, T69, X83, deletec15_in_aga(T70, T69, X83))
U10_aga(T70, T68, T69, X83, deletec15_out_aga(T70, T69, X83)) → deletec15_out_aga(T70, .(T68, T69), .(T68, X83))

The argument filtering Pi contains the following mapping:
perm1_in_ga(x1, x2)  =  perm1_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
delete15_in_aga(x1, x2, x3)  =  delete15_in_aga(x2)
deletec15_in_aga(x1, x2, x3)  =  deletec15_in_aga(x2)
deletec15_out_aga(x1, x2, x3)  =  deletec15_out_aga(x1, x2, x3)
U10_aga(x1, x2, x3, x4, x5)  =  U10_aga(x2, x3, x5)
PERM1_IN_GA(x1, x2)  =  PERM1_IN_GA(x1)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x1, x2, x4)
U3_GA(x1, x2, x3, x4, x5)  =  U3_GA(x1, x2, x5)
DELETE15_IN_AGA(x1, x2, x3)  =  DELETE15_IN_AGA(x2)
U1_AGA(x1, x2, x3, x4, x5)  =  U1_AGA(x2, x3, x5)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x5)
U5_GA(x1, x2, x3, x4, x5)  =  U5_GA(x1, x2, x5)

We have to consider all (P,R,Pi)-chains

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(4) Obligation:

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

PERM1_IN_GA(.(T21, T22), .(T21, T23)) → U2_GA(T21, T22, T23, perm1_in_ga(T22, T23))
PERM1_IN_GA(.(T21, T22), .(T21, T23)) → PERM1_IN_GA(T22, T23)
PERM1_IN_GA(.(T37, T38), .(T39, T40)) → U3_GA(T37, T38, T39, T40, delete15_in_aga(T39, T38, X48))
PERM1_IN_GA(.(T37, T38), .(T39, T40)) → DELETE15_IN_AGA(T39, T38, X48)
DELETE15_IN_AGA(T70, .(T68, T69), .(T68, X83)) → U1_AGA(T70, T68, T69, X83, delete15_in_aga(T70, T69, X83))
DELETE15_IN_AGA(T70, .(T68, T69), .(T68, X83)) → DELETE15_IN_AGA(T70, T69, X83)
PERM1_IN_GA(.(T37, T38), .(T39, T46)) → U4_GA(T37, T38, T39, T46, deletec15_in_aga(T39, T38, T45))
U4_GA(T37, T38, T39, T46, deletec15_out_aga(T39, T38, T45)) → U5_GA(T37, T38, T39, T46, perm1_in_ga(.(T37, T45), T46))
U4_GA(T37, T38, T39, T46, deletec15_out_aga(T39, T38, T45)) → PERM1_IN_GA(.(T37, T45), T46)

The TRS R consists of the following rules:

deletec15_in_aga(T59, .(T59, T60), T60) → deletec15_out_aga(T59, .(T59, T60), T60)
deletec15_in_aga(T70, .(T68, T69), .(T68, X83)) → U10_aga(T70, T68, T69, X83, deletec15_in_aga(T70, T69, X83))
U10_aga(T70, T68, T69, X83, deletec15_out_aga(T70, T69, X83)) → deletec15_out_aga(T70, .(T68, T69), .(T68, X83))

The argument filtering Pi contains the following mapping:
perm1_in_ga(x1, x2)  =  perm1_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
delete15_in_aga(x1, x2, x3)  =  delete15_in_aga(x2)
deletec15_in_aga(x1, x2, x3)  =  deletec15_in_aga(x2)
deletec15_out_aga(x1, x2, x3)  =  deletec15_out_aga(x1, x2, x3)
U10_aga(x1, x2, x3, x4, x5)  =  U10_aga(x2, x3, x5)
PERM1_IN_GA(x1, x2)  =  PERM1_IN_GA(x1)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x1, x2, x4)
U3_GA(x1, x2, x3, x4, x5)  =  U3_GA(x1, x2, x5)
DELETE15_IN_AGA(x1, x2, x3)  =  DELETE15_IN_AGA(x2)
U1_AGA(x1, x2, x3, x4, x5)  =  U1_AGA(x2, x3, x5)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x5)
U5_GA(x1, x2, x3, x4, x5)  =  U5_GA(x1, x2, x5)

We have to consider all (P,R,Pi)-chains

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 5 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

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

DELETE15_IN_AGA(T70, .(T68, T69), .(T68, X83)) → DELETE15_IN_AGA(T70, T69, X83)

The TRS R consists of the following rules:

deletec15_in_aga(T59, .(T59, T60), T60) → deletec15_out_aga(T59, .(T59, T60), T60)
deletec15_in_aga(T70, .(T68, T69), .(T68, X83)) → U10_aga(T70, T68, T69, X83, deletec15_in_aga(T70, T69, X83))
U10_aga(T70, T68, T69, X83, deletec15_out_aga(T70, T69, X83)) → deletec15_out_aga(T70, .(T68, T69), .(T68, X83))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
deletec15_in_aga(x1, x2, x3)  =  deletec15_in_aga(x2)
deletec15_out_aga(x1, x2, x3)  =  deletec15_out_aga(x1, x2, x3)
U10_aga(x1, x2, x3, x4, x5)  =  U10_aga(x2, x3, x5)
DELETE15_IN_AGA(x1, x2, x3)  =  DELETE15_IN_AGA(x2)

We have to consider all (P,R,Pi)-chains

(8) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(9) Obligation:

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

DELETE15_IN_AGA(T70, .(T68, T69), .(T68, X83)) → DELETE15_IN_AGA(T70, T69, X83)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
DELETE15_IN_AGA(x1, x2, x3)  =  DELETE15_IN_AGA(x2)

We have to consider all (P,R,Pi)-chains

(10) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(11) Obligation:

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

DELETE15_IN_AGA(.(T68, T69)) → DELETE15_IN_AGA(T69)

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

(12) 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:

  • DELETE15_IN_AGA(.(T68, T69)) → DELETE15_IN_AGA(T69)
    The graph contains the following edges 1 > 1

(13) YES

(14) Obligation:

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

PERM1_IN_GA(.(T37, T38), .(T39, T46)) → U4_GA(T37, T38, T39, T46, deletec15_in_aga(T39, T38, T45))
U4_GA(T37, T38, T39, T46, deletec15_out_aga(T39, T38, T45)) → PERM1_IN_GA(.(T37, T45), T46)
PERM1_IN_GA(.(T21, T22), .(T21, T23)) → PERM1_IN_GA(T22, T23)

The TRS R consists of the following rules:

deletec15_in_aga(T59, .(T59, T60), T60) → deletec15_out_aga(T59, .(T59, T60), T60)
deletec15_in_aga(T70, .(T68, T69), .(T68, X83)) → U10_aga(T70, T68, T69, X83, deletec15_in_aga(T70, T69, X83))
U10_aga(T70, T68, T69, X83, deletec15_out_aga(T70, T69, X83)) → deletec15_out_aga(T70, .(T68, T69), .(T68, X83))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
deletec15_in_aga(x1, x2, x3)  =  deletec15_in_aga(x2)
deletec15_out_aga(x1, x2, x3)  =  deletec15_out_aga(x1, x2, x3)
U10_aga(x1, x2, x3, x4, x5)  =  U10_aga(x2, x3, x5)
PERM1_IN_GA(x1, x2)  =  PERM1_IN_GA(x1)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x5)

We have to consider all (P,R,Pi)-chains

(15) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(16) Obligation:

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

PERM1_IN_GA(.(T37, T38)) → U4_GA(T37, T38, deletec15_in_aga(T38))
U4_GA(T37, T38, deletec15_out_aga(T39, T38, T45)) → PERM1_IN_GA(.(T37, T45))
PERM1_IN_GA(.(T21, T22)) → PERM1_IN_GA(T22)

The TRS R consists of the following rules:

deletec15_in_aga(.(T59, T60)) → deletec15_out_aga(T59, .(T59, T60), T60)
deletec15_in_aga(.(T68, T69)) → U10_aga(T68, T69, deletec15_in_aga(T69))
U10_aga(T68, T69, deletec15_out_aga(T70, T69, X83)) → deletec15_out_aga(T70, .(T68, T69), .(T68, X83))

The set Q consists of the following terms:

deletec15_in_aga(x0)
U10_aga(x0, x1, x2)

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

(17) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


U4_GA(T37, T38, deletec15_out_aga(T39, T38, T45)) → PERM1_IN_GA(.(T37, T45))
PERM1_IN_GA(.(T21, T22)) → PERM1_IN_GA(T22)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial Order [NEGPOLO,POLO] with Interpretation:

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


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


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


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


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


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



The following usable rules [FROCOS05] were oriented:

deletec15_in_aga(.(T59, T60)) → deletec15_out_aga(T59, .(T59, T60), T60)
deletec15_in_aga(.(T68, T69)) → U10_aga(T68, T69, deletec15_in_aga(T69))
U10_aga(T68, T69, deletec15_out_aga(T70, T69, X83)) → deletec15_out_aga(T70, .(T68, T69), .(T68, X83))

(18) Obligation:

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

PERM1_IN_GA(.(T37, T38)) → U4_GA(T37, T38, deletec15_in_aga(T38))

The TRS R consists of the following rules:

deletec15_in_aga(.(T59, T60)) → deletec15_out_aga(T59, .(T59, T60), T60)
deletec15_in_aga(.(T68, T69)) → U10_aga(T68, T69, deletec15_in_aga(T69))
U10_aga(T68, T69, deletec15_out_aga(T70, T69, X83)) → deletec15_out_aga(T70, .(T68, T69), .(T68, X83))

The set Q consists of the following terms:

deletec15_in_aga(x0)
U10_aga(x0, x1, x2)

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

(19) DependencyGraphProof (EQUIVALENT transformation)

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

(20) TRUE