(0) Obligation:

Clauses:

sublist(Xs, Ys) :- ','(app(X1, Zs, Ys), app(Xs, X2, Zs)).
app([], X, X).
app(.(X, Xs), Ys, .(X, Zs)) :- app(Xs, Ys, Zs).

Queries:

sublist(a,g).

(1) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph.

(2) Obligation:

Clauses:

app7([], T23, T23).
app7(.(T30, T33), X57, .(T30, T32)) :- app7(T33, X57, T32).
p3([], T16, T16, T7, X9) :- app7(T7, X9, T16).
p3(.(X84, X85), X86, .(X84, T38), T7, X9) :- p3(X85, X86, T38, T7, X9).
sublist1(T7, T6) :- p3(X7, X8, T6, T7, X9).

Queries:

sublist1(a,g).

(3) PrologToPiTRSProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
sublist1_in: (f,b)
p3_in: (f,f,b,f,f)
app7_in: (f,f,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

sublist1_in_ag(T7, T6) → U4_ag(T7, T6, p3_in_aagaa(X7, X8, T6, T7, X9))
p3_in_aagaa([], T16, T16, T7, X9) → U2_aagaa(T16, T7, X9, app7_in_aag(T7, X9, T16))
app7_in_aag([], T23, T23) → app7_out_aag([], T23, T23)
app7_in_aag(.(T30, T33), X57, .(T30, T32)) → U1_aag(T30, T33, X57, T32, app7_in_aag(T33, X57, T32))
U1_aag(T30, T33, X57, T32, app7_out_aag(T33, X57, T32)) → app7_out_aag(.(T30, T33), X57, .(T30, T32))
U2_aagaa(T16, T7, X9, app7_out_aag(T7, X9, T16)) → p3_out_aagaa([], T16, T16, T7, X9)
p3_in_aagaa(.(X84, X85), X86, .(X84, T38), T7, X9) → U3_aagaa(X84, X85, X86, T38, T7, X9, p3_in_aagaa(X85, X86, T38, T7, X9))
U3_aagaa(X84, X85, X86, T38, T7, X9, p3_out_aagaa(X85, X86, T38, T7, X9)) → p3_out_aagaa(.(X84, X85), X86, .(X84, T38), T7, X9)
U4_ag(T7, T6, p3_out_aagaa(X7, X8, T6, T7, X9)) → sublist1_out_ag(T7, T6)

The argument filtering Pi contains the following mapping:
sublist1_in_ag(x1, x2)  =  sublist1_in_ag(x2)
U4_ag(x1, x2, x3)  =  U4_ag(x3)
p3_in_aagaa(x1, x2, x3, x4, x5)  =  p3_in_aagaa(x3)
U2_aagaa(x1, x2, x3, x4)  =  U2_aagaa(x1, x4)
app7_in_aag(x1, x2, x3)  =  app7_in_aag(x3)
app7_out_aag(x1, x2, x3)  =  app7_out_aag(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_aag(x1, x2, x3, x4, x5)  =  U1_aag(x1, x5)
p3_out_aagaa(x1, x2, x3, x4, x5)  =  p3_out_aagaa(x1, x2, x4, x5)
U3_aagaa(x1, x2, x3, x4, x5, x6, x7)  =  U3_aagaa(x1, x7)
sublist1_out_ag(x1, x2)  =  sublist1_out_ag(x1)
[]  =  []

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

sublist1_in_ag(T7, T6) → U4_ag(T7, T6, p3_in_aagaa(X7, X8, T6, T7, X9))
p3_in_aagaa([], T16, T16, T7, X9) → U2_aagaa(T16, T7, X9, app7_in_aag(T7, X9, T16))
app7_in_aag([], T23, T23) → app7_out_aag([], T23, T23)
app7_in_aag(.(T30, T33), X57, .(T30, T32)) → U1_aag(T30, T33, X57, T32, app7_in_aag(T33, X57, T32))
U1_aag(T30, T33, X57, T32, app7_out_aag(T33, X57, T32)) → app7_out_aag(.(T30, T33), X57, .(T30, T32))
U2_aagaa(T16, T7, X9, app7_out_aag(T7, X9, T16)) → p3_out_aagaa([], T16, T16, T7, X9)
p3_in_aagaa(.(X84, X85), X86, .(X84, T38), T7, X9) → U3_aagaa(X84, X85, X86, T38, T7, X9, p3_in_aagaa(X85, X86, T38, T7, X9))
U3_aagaa(X84, X85, X86, T38, T7, X9, p3_out_aagaa(X85, X86, T38, T7, X9)) → p3_out_aagaa(.(X84, X85), X86, .(X84, T38), T7, X9)
U4_ag(T7, T6, p3_out_aagaa(X7, X8, T6, T7, X9)) → sublist1_out_ag(T7, T6)

The argument filtering Pi contains the following mapping:
sublist1_in_ag(x1, x2)  =  sublist1_in_ag(x2)
U4_ag(x1, x2, x3)  =  U4_ag(x3)
p3_in_aagaa(x1, x2, x3, x4, x5)  =  p3_in_aagaa(x3)
U2_aagaa(x1, x2, x3, x4)  =  U2_aagaa(x1, x4)
app7_in_aag(x1, x2, x3)  =  app7_in_aag(x3)
app7_out_aag(x1, x2, x3)  =  app7_out_aag(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_aag(x1, x2, x3, x4, x5)  =  U1_aag(x1, x5)
p3_out_aagaa(x1, x2, x3, x4, x5)  =  p3_out_aagaa(x1, x2, x4, x5)
U3_aagaa(x1, x2, x3, x4, x5, x6, x7)  =  U3_aagaa(x1, x7)
sublist1_out_ag(x1, x2)  =  sublist1_out_ag(x1)
[]  =  []

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

SUBLIST1_IN_AG(T7, T6) → U4_AG(T7, T6, p3_in_aagaa(X7, X8, T6, T7, X9))
SUBLIST1_IN_AG(T7, T6) → P3_IN_AAGAA(X7, X8, T6, T7, X9)
P3_IN_AAGAA([], T16, T16, T7, X9) → U2_AAGAA(T16, T7, X9, app7_in_aag(T7, X9, T16))
P3_IN_AAGAA([], T16, T16, T7, X9) → APP7_IN_AAG(T7, X9, T16)
APP7_IN_AAG(.(T30, T33), X57, .(T30, T32)) → U1_AAG(T30, T33, X57, T32, app7_in_aag(T33, X57, T32))
APP7_IN_AAG(.(T30, T33), X57, .(T30, T32)) → APP7_IN_AAG(T33, X57, T32)
P3_IN_AAGAA(.(X84, X85), X86, .(X84, T38), T7, X9) → U3_AAGAA(X84, X85, X86, T38, T7, X9, p3_in_aagaa(X85, X86, T38, T7, X9))
P3_IN_AAGAA(.(X84, X85), X86, .(X84, T38), T7, X9) → P3_IN_AAGAA(X85, X86, T38, T7, X9)

The TRS R consists of the following rules:

sublist1_in_ag(T7, T6) → U4_ag(T7, T6, p3_in_aagaa(X7, X8, T6, T7, X9))
p3_in_aagaa([], T16, T16, T7, X9) → U2_aagaa(T16, T7, X9, app7_in_aag(T7, X9, T16))
app7_in_aag([], T23, T23) → app7_out_aag([], T23, T23)
app7_in_aag(.(T30, T33), X57, .(T30, T32)) → U1_aag(T30, T33, X57, T32, app7_in_aag(T33, X57, T32))
U1_aag(T30, T33, X57, T32, app7_out_aag(T33, X57, T32)) → app7_out_aag(.(T30, T33), X57, .(T30, T32))
U2_aagaa(T16, T7, X9, app7_out_aag(T7, X9, T16)) → p3_out_aagaa([], T16, T16, T7, X9)
p3_in_aagaa(.(X84, X85), X86, .(X84, T38), T7, X9) → U3_aagaa(X84, X85, X86, T38, T7, X9, p3_in_aagaa(X85, X86, T38, T7, X9))
U3_aagaa(X84, X85, X86, T38, T7, X9, p3_out_aagaa(X85, X86, T38, T7, X9)) → p3_out_aagaa(.(X84, X85), X86, .(X84, T38), T7, X9)
U4_ag(T7, T6, p3_out_aagaa(X7, X8, T6, T7, X9)) → sublist1_out_ag(T7, T6)

The argument filtering Pi contains the following mapping:
sublist1_in_ag(x1, x2)  =  sublist1_in_ag(x2)
U4_ag(x1, x2, x3)  =  U4_ag(x3)
p3_in_aagaa(x1, x2, x3, x4, x5)  =  p3_in_aagaa(x3)
U2_aagaa(x1, x2, x3, x4)  =  U2_aagaa(x1, x4)
app7_in_aag(x1, x2, x3)  =  app7_in_aag(x3)
app7_out_aag(x1, x2, x3)  =  app7_out_aag(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_aag(x1, x2, x3, x4, x5)  =  U1_aag(x1, x5)
p3_out_aagaa(x1, x2, x3, x4, x5)  =  p3_out_aagaa(x1, x2, x4, x5)
U3_aagaa(x1, x2, x3, x4, x5, x6, x7)  =  U3_aagaa(x1, x7)
sublist1_out_ag(x1, x2)  =  sublist1_out_ag(x1)
[]  =  []
SUBLIST1_IN_AG(x1, x2)  =  SUBLIST1_IN_AG(x2)
U4_AG(x1, x2, x3)  =  U4_AG(x3)
P3_IN_AAGAA(x1, x2, x3, x4, x5)  =  P3_IN_AAGAA(x3)
U2_AAGAA(x1, x2, x3, x4)  =  U2_AAGAA(x1, x4)
APP7_IN_AAG(x1, x2, x3)  =  APP7_IN_AAG(x3)
U1_AAG(x1, x2, x3, x4, x5)  =  U1_AAG(x1, x5)
U3_AAGAA(x1, x2, x3, x4, x5, x6, x7)  =  U3_AAGAA(x1, x7)

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

(6) Obligation:

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

SUBLIST1_IN_AG(T7, T6) → U4_AG(T7, T6, p3_in_aagaa(X7, X8, T6, T7, X9))
SUBLIST1_IN_AG(T7, T6) → P3_IN_AAGAA(X7, X8, T6, T7, X9)
P3_IN_AAGAA([], T16, T16, T7, X9) → U2_AAGAA(T16, T7, X9, app7_in_aag(T7, X9, T16))
P3_IN_AAGAA([], T16, T16, T7, X9) → APP7_IN_AAG(T7, X9, T16)
APP7_IN_AAG(.(T30, T33), X57, .(T30, T32)) → U1_AAG(T30, T33, X57, T32, app7_in_aag(T33, X57, T32))
APP7_IN_AAG(.(T30, T33), X57, .(T30, T32)) → APP7_IN_AAG(T33, X57, T32)
P3_IN_AAGAA(.(X84, X85), X86, .(X84, T38), T7, X9) → U3_AAGAA(X84, X85, X86, T38, T7, X9, p3_in_aagaa(X85, X86, T38, T7, X9))
P3_IN_AAGAA(.(X84, X85), X86, .(X84, T38), T7, X9) → P3_IN_AAGAA(X85, X86, T38, T7, X9)

The TRS R consists of the following rules:

sublist1_in_ag(T7, T6) → U4_ag(T7, T6, p3_in_aagaa(X7, X8, T6, T7, X9))
p3_in_aagaa([], T16, T16, T7, X9) → U2_aagaa(T16, T7, X9, app7_in_aag(T7, X9, T16))
app7_in_aag([], T23, T23) → app7_out_aag([], T23, T23)
app7_in_aag(.(T30, T33), X57, .(T30, T32)) → U1_aag(T30, T33, X57, T32, app7_in_aag(T33, X57, T32))
U1_aag(T30, T33, X57, T32, app7_out_aag(T33, X57, T32)) → app7_out_aag(.(T30, T33), X57, .(T30, T32))
U2_aagaa(T16, T7, X9, app7_out_aag(T7, X9, T16)) → p3_out_aagaa([], T16, T16, T7, X9)
p3_in_aagaa(.(X84, X85), X86, .(X84, T38), T7, X9) → U3_aagaa(X84, X85, X86, T38, T7, X9, p3_in_aagaa(X85, X86, T38, T7, X9))
U3_aagaa(X84, X85, X86, T38, T7, X9, p3_out_aagaa(X85, X86, T38, T7, X9)) → p3_out_aagaa(.(X84, X85), X86, .(X84, T38), T7, X9)
U4_ag(T7, T6, p3_out_aagaa(X7, X8, T6, T7, X9)) → sublist1_out_ag(T7, T6)

The argument filtering Pi contains the following mapping:
sublist1_in_ag(x1, x2)  =  sublist1_in_ag(x2)
U4_ag(x1, x2, x3)  =  U4_ag(x3)
p3_in_aagaa(x1, x2, x3, x4, x5)  =  p3_in_aagaa(x3)
U2_aagaa(x1, x2, x3, x4)  =  U2_aagaa(x1, x4)
app7_in_aag(x1, x2, x3)  =  app7_in_aag(x3)
app7_out_aag(x1, x2, x3)  =  app7_out_aag(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_aag(x1, x2, x3, x4, x5)  =  U1_aag(x1, x5)
p3_out_aagaa(x1, x2, x3, x4, x5)  =  p3_out_aagaa(x1, x2, x4, x5)
U3_aagaa(x1, x2, x3, x4, x5, x6, x7)  =  U3_aagaa(x1, x7)
sublist1_out_ag(x1, x2)  =  sublist1_out_ag(x1)
[]  =  []
SUBLIST1_IN_AG(x1, x2)  =  SUBLIST1_IN_AG(x2)
U4_AG(x1, x2, x3)  =  U4_AG(x3)
P3_IN_AAGAA(x1, x2, x3, x4, x5)  =  P3_IN_AAGAA(x3)
U2_AAGAA(x1, x2, x3, x4)  =  U2_AAGAA(x1, x4)
APP7_IN_AAG(x1, x2, x3)  =  APP7_IN_AAG(x3)
U1_AAG(x1, x2, x3, x4, x5)  =  U1_AAG(x1, x5)
U3_AAGAA(x1, x2, x3, x4, x5, x6, x7)  =  U3_AAGAA(x1, x7)

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

(7) DependencyGraphProof (EQUIVALENT transformation)

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

(8) Complex Obligation (AND)

(9) Obligation:

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

APP7_IN_AAG(.(T30, T33), X57, .(T30, T32)) → APP7_IN_AAG(T33, X57, T32)

The TRS R consists of the following rules:

sublist1_in_ag(T7, T6) → U4_ag(T7, T6, p3_in_aagaa(X7, X8, T6, T7, X9))
p3_in_aagaa([], T16, T16, T7, X9) → U2_aagaa(T16, T7, X9, app7_in_aag(T7, X9, T16))
app7_in_aag([], T23, T23) → app7_out_aag([], T23, T23)
app7_in_aag(.(T30, T33), X57, .(T30, T32)) → U1_aag(T30, T33, X57, T32, app7_in_aag(T33, X57, T32))
U1_aag(T30, T33, X57, T32, app7_out_aag(T33, X57, T32)) → app7_out_aag(.(T30, T33), X57, .(T30, T32))
U2_aagaa(T16, T7, X9, app7_out_aag(T7, X9, T16)) → p3_out_aagaa([], T16, T16, T7, X9)
p3_in_aagaa(.(X84, X85), X86, .(X84, T38), T7, X9) → U3_aagaa(X84, X85, X86, T38, T7, X9, p3_in_aagaa(X85, X86, T38, T7, X9))
U3_aagaa(X84, X85, X86, T38, T7, X9, p3_out_aagaa(X85, X86, T38, T7, X9)) → p3_out_aagaa(.(X84, X85), X86, .(X84, T38), T7, X9)
U4_ag(T7, T6, p3_out_aagaa(X7, X8, T6, T7, X9)) → sublist1_out_ag(T7, T6)

The argument filtering Pi contains the following mapping:
sublist1_in_ag(x1, x2)  =  sublist1_in_ag(x2)
U4_ag(x1, x2, x3)  =  U4_ag(x3)
p3_in_aagaa(x1, x2, x3, x4, x5)  =  p3_in_aagaa(x3)
U2_aagaa(x1, x2, x3, x4)  =  U2_aagaa(x1, x4)
app7_in_aag(x1, x2, x3)  =  app7_in_aag(x3)
app7_out_aag(x1, x2, x3)  =  app7_out_aag(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_aag(x1, x2, x3, x4, x5)  =  U1_aag(x1, x5)
p3_out_aagaa(x1, x2, x3, x4, x5)  =  p3_out_aagaa(x1, x2, x4, x5)
U3_aagaa(x1, x2, x3, x4, x5, x6, x7)  =  U3_aagaa(x1, x7)
sublist1_out_ag(x1, x2)  =  sublist1_out_ag(x1)
[]  =  []
APP7_IN_AAG(x1, x2, x3)  =  APP7_IN_AAG(x3)

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

(10) UsableRulesProof (EQUIVALENT transformation)

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

(11) Obligation:

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

APP7_IN_AAG(.(T30, T33), X57, .(T30, T32)) → APP7_IN_AAG(T33, X57, T32)

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

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

(12) PiDPToQDPProof (SOUND transformation)

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

(13) Obligation:

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

APP7_IN_AAG(.(T30, T32)) → APP7_IN_AAG(T32)

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

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

  • APP7_IN_AAG(.(T30, T32)) → APP7_IN_AAG(T32)
    The graph contains the following edges 1 > 1

(15) YES

(16) Obligation:

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

P3_IN_AAGAA(.(X84, X85), X86, .(X84, T38), T7, X9) → P3_IN_AAGAA(X85, X86, T38, T7, X9)

The TRS R consists of the following rules:

sublist1_in_ag(T7, T6) → U4_ag(T7, T6, p3_in_aagaa(X7, X8, T6, T7, X9))
p3_in_aagaa([], T16, T16, T7, X9) → U2_aagaa(T16, T7, X9, app7_in_aag(T7, X9, T16))
app7_in_aag([], T23, T23) → app7_out_aag([], T23, T23)
app7_in_aag(.(T30, T33), X57, .(T30, T32)) → U1_aag(T30, T33, X57, T32, app7_in_aag(T33, X57, T32))
U1_aag(T30, T33, X57, T32, app7_out_aag(T33, X57, T32)) → app7_out_aag(.(T30, T33), X57, .(T30, T32))
U2_aagaa(T16, T7, X9, app7_out_aag(T7, X9, T16)) → p3_out_aagaa([], T16, T16, T7, X9)
p3_in_aagaa(.(X84, X85), X86, .(X84, T38), T7, X9) → U3_aagaa(X84, X85, X86, T38, T7, X9, p3_in_aagaa(X85, X86, T38, T7, X9))
U3_aagaa(X84, X85, X86, T38, T7, X9, p3_out_aagaa(X85, X86, T38, T7, X9)) → p3_out_aagaa(.(X84, X85), X86, .(X84, T38), T7, X9)
U4_ag(T7, T6, p3_out_aagaa(X7, X8, T6, T7, X9)) → sublist1_out_ag(T7, T6)

The argument filtering Pi contains the following mapping:
sublist1_in_ag(x1, x2)  =  sublist1_in_ag(x2)
U4_ag(x1, x2, x3)  =  U4_ag(x3)
p3_in_aagaa(x1, x2, x3, x4, x5)  =  p3_in_aagaa(x3)
U2_aagaa(x1, x2, x3, x4)  =  U2_aagaa(x1, x4)
app7_in_aag(x1, x2, x3)  =  app7_in_aag(x3)
app7_out_aag(x1, x2, x3)  =  app7_out_aag(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_aag(x1, x2, x3, x4, x5)  =  U1_aag(x1, x5)
p3_out_aagaa(x1, x2, x3, x4, x5)  =  p3_out_aagaa(x1, x2, x4, x5)
U3_aagaa(x1, x2, x3, x4, x5, x6, x7)  =  U3_aagaa(x1, x7)
sublist1_out_ag(x1, x2)  =  sublist1_out_ag(x1)
[]  =  []
P3_IN_AAGAA(x1, x2, x3, x4, x5)  =  P3_IN_AAGAA(x3)

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

(17) UsableRulesProof (EQUIVALENT transformation)

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

(18) Obligation:

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

P3_IN_AAGAA(.(X84, X85), X86, .(X84, T38), T7, X9) → P3_IN_AAGAA(X85, X86, T38, T7, X9)

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

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

(19) PiDPToQDPProof (SOUND transformation)

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

(20) Obligation:

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

P3_IN_AAGAA(.(X84, T38)) → P3_IN_AAGAA(T38)

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

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

  • P3_IN_AAGAA(.(X84, T38)) → P3_IN_AAGAA(T38)
    The graph contains the following edges 1 > 1

(22) YES