(0) Obligation:

Clauses:

transpose(A, B) :- transpose_aux(A, [], B).
transpose_aux(.(R, Rs), X1, .(C, Cs)) :- ','(row2col(R, .(C, Cs), Cols1, Accm), transpose_aux(Rs, Accm, Cols1)).
transpose_aux([], X, X).
row2col(.(X, Xs), .(.(X, Ys), Cols), .(Ys, Cols1), .([], As)) :- row2col(Xs, Cols, Cols1, As).
row2col([], [], [], []).

Queries:

transpose(g,a).

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(2) Obligation:

Triples:

row2col14(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151)) :- row2col14(T82, T85, X150, X151).
p7(.(T56, T57), .(T56, T58), T60, .(T58, X96), .([], X97), T25) :- row2col14(T57, T60, X96, X97).
p7(T24, T28, T29, .(T120, T121), T117, .(T115, T116)) :- ','(row2colc9(T24, T28, T29, .(T120, T121), T117), p7(T115, T120, T121, X202, X203, T116)).
transpose1(.(T24, T25), .(T28, T29)) :- p7(T24, T28, T29, X35, X36, T25).

Clauses:

row2colc14(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151)) :- row2colc14(T82, T85, X150, X151).
row2colc14([], [], [], []).
qc7(T24, T28, T29, .(T120, T121), T117, .(T115, T116)) :- ','(row2colc9(T24, T28, T29, .(T120, T121), T117), qc7(T115, T120, T121, X202, X203, T116)).
qc7(T24, T28, T29, T128, T128, []) :- row2colc9(T24, T28, T29, T128, T128).
row2colc9(.(T56, T57), .(T56, T58), T60, .(T58, X96), .([], X97)) :- row2colc14(T57, T60, X96, X97).

Afs:

transpose1(x1, x2)  =  transpose1(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:
transpose1_in: (b,f)
p7_in: (b,f,f,f,f,b)
row2col14_in: (b,f,f,f)
row2colc9_in: (b,f,f,f,f)
row2colc14_in: (b,f,f,f)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

TRANSPOSE1_IN_GA(.(T24, T25), .(T28, T29)) → U5_GA(T24, T25, T28, T29, p7_in_gaaaag(T24, T28, T29, X35, X36, T25))
TRANSPOSE1_IN_GA(.(T24, T25), .(T28, T29)) → P7_IN_GAAAAG(T24, T28, T29, X35, X36, T25)
P7_IN_GAAAAG(.(T56, T57), .(T56, T58), T60, .(T58, X96), .([], X97), T25) → U2_GAAAAG(T56, T57, T58, T60, X96, X97, T25, row2col14_in_gaaa(T57, T60, X96, X97))
P7_IN_GAAAAG(.(T56, T57), .(T56, T58), T60, .(T58, X96), .([], X97), T25) → ROW2COL14_IN_GAAA(T57, T60, X96, X97)
ROW2COL14_IN_GAAA(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151)) → U1_GAAA(T81, T82, T83, T85, X150, X151, row2col14_in_gaaa(T82, T85, X150, X151))
ROW2COL14_IN_GAAA(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151)) → ROW2COL14_IN_GAAA(T82, T85, X150, X151)
P7_IN_GAAAAG(T24, T28, T29, .(T120, T121), T117, .(T115, T116)) → U3_GAAAAG(T24, T28, T29, T120, T121, T117, T115, T116, row2colc9_in_gaaaa(T24, T28, T29, .(T120, T121), T117))
U3_GAAAAG(T24, T28, T29, T120, T121, T117, T115, T116, row2colc9_out_gaaaa(T24, T28, T29, .(T120, T121), T117)) → U4_GAAAAG(T24, T28, T29, T120, T121, T117, T115, T116, p7_in_gaaaag(T115, T120, T121, X202, X203, T116))
U3_GAAAAG(T24, T28, T29, T120, T121, T117, T115, T116, row2colc9_out_gaaaa(T24, T28, T29, .(T120, T121), T117)) → P7_IN_GAAAAG(T115, T120, T121, X202, X203, T116)

The TRS R consists of the following rules:

row2colc9_in_gaaaa(.(T56, T57), .(T56, T58), T60, .(T58, X96), .([], X97)) → U11_gaaaa(T56, T57, T58, T60, X96, X97, row2colc14_in_gaaa(T57, T60, X96, X97))
row2colc14_in_gaaa(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151)) → U7_gaaa(T81, T82, T83, T85, X150, X151, row2colc14_in_gaaa(T82, T85, X150, X151))
row2colc14_in_gaaa([], [], [], []) → row2colc14_out_gaaa([], [], [], [])
U7_gaaa(T81, T82, T83, T85, X150, X151, row2colc14_out_gaaa(T82, T85, X150, X151)) → row2colc14_out_gaaa(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151))
U11_gaaaa(T56, T57, T58, T60, X96, X97, row2colc14_out_gaaa(T57, T60, X96, X97)) → row2colc9_out_gaaaa(.(T56, T57), .(T56, T58), T60, .(T58, X96), .([], X97))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
p7_in_gaaaag(x1, x2, x3, x4, x5, x6)  =  p7_in_gaaaag(x1, x6)
row2col14_in_gaaa(x1, x2, x3, x4)  =  row2col14_in_gaaa(x1)
row2colc9_in_gaaaa(x1, x2, x3, x4, x5)  =  row2colc9_in_gaaaa(x1)
U11_gaaaa(x1, x2, x3, x4, x5, x6, x7)  =  U11_gaaaa(x1, x2, x7)
row2colc14_in_gaaa(x1, x2, x3, x4)  =  row2colc14_in_gaaa(x1)
U7_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U7_gaaa(x1, x2, x7)
[]  =  []
row2colc14_out_gaaa(x1, x2, x3, x4)  =  row2colc14_out_gaaa(x1, x4)
row2colc9_out_gaaaa(x1, x2, x3, x4, x5)  =  row2colc9_out_gaaaa(x1, x5)
TRANSPOSE1_IN_GA(x1, x2)  =  TRANSPOSE1_IN_GA(x1)
U5_GA(x1, x2, x3, x4, x5)  =  U5_GA(x1, x2, x5)
P7_IN_GAAAAG(x1, x2, x3, x4, x5, x6)  =  P7_IN_GAAAAG(x1, x6)
U2_GAAAAG(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_GAAAAG(x1, x2, x7, x8)
ROW2COL14_IN_GAAA(x1, x2, x3, x4)  =  ROW2COL14_IN_GAAA(x1)
U1_GAAA(x1, x2, x3, x4, x5, x6, x7)  =  U1_GAAA(x1, x2, x7)
U3_GAAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U3_GAAAAG(x1, x7, x8, x9)
U4_GAAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U4_GAAAAG(x1, x6, x7, x8, x9)

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:

TRANSPOSE1_IN_GA(.(T24, T25), .(T28, T29)) → U5_GA(T24, T25, T28, T29, p7_in_gaaaag(T24, T28, T29, X35, X36, T25))
TRANSPOSE1_IN_GA(.(T24, T25), .(T28, T29)) → P7_IN_GAAAAG(T24, T28, T29, X35, X36, T25)
P7_IN_GAAAAG(.(T56, T57), .(T56, T58), T60, .(T58, X96), .([], X97), T25) → U2_GAAAAG(T56, T57, T58, T60, X96, X97, T25, row2col14_in_gaaa(T57, T60, X96, X97))
P7_IN_GAAAAG(.(T56, T57), .(T56, T58), T60, .(T58, X96), .([], X97), T25) → ROW2COL14_IN_GAAA(T57, T60, X96, X97)
ROW2COL14_IN_GAAA(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151)) → U1_GAAA(T81, T82, T83, T85, X150, X151, row2col14_in_gaaa(T82, T85, X150, X151))
ROW2COL14_IN_GAAA(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151)) → ROW2COL14_IN_GAAA(T82, T85, X150, X151)
P7_IN_GAAAAG(T24, T28, T29, .(T120, T121), T117, .(T115, T116)) → U3_GAAAAG(T24, T28, T29, T120, T121, T117, T115, T116, row2colc9_in_gaaaa(T24, T28, T29, .(T120, T121), T117))
U3_GAAAAG(T24, T28, T29, T120, T121, T117, T115, T116, row2colc9_out_gaaaa(T24, T28, T29, .(T120, T121), T117)) → U4_GAAAAG(T24, T28, T29, T120, T121, T117, T115, T116, p7_in_gaaaag(T115, T120, T121, X202, X203, T116))
U3_GAAAAG(T24, T28, T29, T120, T121, T117, T115, T116, row2colc9_out_gaaaa(T24, T28, T29, .(T120, T121), T117)) → P7_IN_GAAAAG(T115, T120, T121, X202, X203, T116)

The TRS R consists of the following rules:

row2colc9_in_gaaaa(.(T56, T57), .(T56, T58), T60, .(T58, X96), .([], X97)) → U11_gaaaa(T56, T57, T58, T60, X96, X97, row2colc14_in_gaaa(T57, T60, X96, X97))
row2colc14_in_gaaa(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151)) → U7_gaaa(T81, T82, T83, T85, X150, X151, row2colc14_in_gaaa(T82, T85, X150, X151))
row2colc14_in_gaaa([], [], [], []) → row2colc14_out_gaaa([], [], [], [])
U7_gaaa(T81, T82, T83, T85, X150, X151, row2colc14_out_gaaa(T82, T85, X150, X151)) → row2colc14_out_gaaa(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151))
U11_gaaaa(T56, T57, T58, T60, X96, X97, row2colc14_out_gaaa(T57, T60, X96, X97)) → row2colc9_out_gaaaa(.(T56, T57), .(T56, T58), T60, .(T58, X96), .([], X97))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
p7_in_gaaaag(x1, x2, x3, x4, x5, x6)  =  p7_in_gaaaag(x1, x6)
row2col14_in_gaaa(x1, x2, x3, x4)  =  row2col14_in_gaaa(x1)
row2colc9_in_gaaaa(x1, x2, x3, x4, x5)  =  row2colc9_in_gaaaa(x1)
U11_gaaaa(x1, x2, x3, x4, x5, x6, x7)  =  U11_gaaaa(x1, x2, x7)
row2colc14_in_gaaa(x1, x2, x3, x4)  =  row2colc14_in_gaaa(x1)
U7_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U7_gaaa(x1, x2, x7)
[]  =  []
row2colc14_out_gaaa(x1, x2, x3, x4)  =  row2colc14_out_gaaa(x1, x4)
row2colc9_out_gaaaa(x1, x2, x3, x4, x5)  =  row2colc9_out_gaaaa(x1, x5)
TRANSPOSE1_IN_GA(x1, x2)  =  TRANSPOSE1_IN_GA(x1)
U5_GA(x1, x2, x3, x4, x5)  =  U5_GA(x1, x2, x5)
P7_IN_GAAAAG(x1, x2, x3, x4, x5, x6)  =  P7_IN_GAAAAG(x1, x6)
U2_GAAAAG(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_GAAAAG(x1, x2, x7, x8)
ROW2COL14_IN_GAAA(x1, x2, x3, x4)  =  ROW2COL14_IN_GAAA(x1)
U1_GAAA(x1, x2, x3, x4, x5, x6, x7)  =  U1_GAAA(x1, x2, x7)
U3_GAAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U3_GAAAAG(x1, x7, x8, x9)
U4_GAAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U4_GAAAAG(x1, x6, x7, x8, x9)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

ROW2COL14_IN_GAAA(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151)) → ROW2COL14_IN_GAAA(T82, T85, X150, X151)

The TRS R consists of the following rules:

row2colc9_in_gaaaa(.(T56, T57), .(T56, T58), T60, .(T58, X96), .([], X97)) → U11_gaaaa(T56, T57, T58, T60, X96, X97, row2colc14_in_gaaa(T57, T60, X96, X97))
row2colc14_in_gaaa(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151)) → U7_gaaa(T81, T82, T83, T85, X150, X151, row2colc14_in_gaaa(T82, T85, X150, X151))
row2colc14_in_gaaa([], [], [], []) → row2colc14_out_gaaa([], [], [], [])
U7_gaaa(T81, T82, T83, T85, X150, X151, row2colc14_out_gaaa(T82, T85, X150, X151)) → row2colc14_out_gaaa(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151))
U11_gaaaa(T56, T57, T58, T60, X96, X97, row2colc14_out_gaaa(T57, T60, X96, X97)) → row2colc9_out_gaaaa(.(T56, T57), .(T56, T58), T60, .(T58, X96), .([], X97))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
row2colc9_in_gaaaa(x1, x2, x3, x4, x5)  =  row2colc9_in_gaaaa(x1)
U11_gaaaa(x1, x2, x3, x4, x5, x6, x7)  =  U11_gaaaa(x1, x2, x7)
row2colc14_in_gaaa(x1, x2, x3, x4)  =  row2colc14_in_gaaa(x1)
U7_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U7_gaaa(x1, x2, x7)
[]  =  []
row2colc14_out_gaaa(x1, x2, x3, x4)  =  row2colc14_out_gaaa(x1, x4)
row2colc9_out_gaaaa(x1, x2, x3, x4, x5)  =  row2colc9_out_gaaaa(x1, x5)
ROW2COL14_IN_GAAA(x1, x2, x3, x4)  =  ROW2COL14_IN_GAAA(x1)

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:

ROW2COL14_IN_GAAA(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151)) → ROW2COL14_IN_GAAA(T82, T85, X150, X151)

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

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:

ROW2COL14_IN_GAAA(.(T81, T82)) → ROW2COL14_IN_GAAA(T82)

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:

  • ROW2COL14_IN_GAAA(.(T81, T82)) → ROW2COL14_IN_GAAA(T82)
    The graph contains the following edges 1 > 1

(13) YES

(14) Obligation:

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

P7_IN_GAAAAG(T24, T28, T29, .(T120, T121), T117, .(T115, T116)) → U3_GAAAAG(T24, T28, T29, T120, T121, T117, T115, T116, row2colc9_in_gaaaa(T24, T28, T29, .(T120, T121), T117))
U3_GAAAAG(T24, T28, T29, T120, T121, T117, T115, T116, row2colc9_out_gaaaa(T24, T28, T29, .(T120, T121), T117)) → P7_IN_GAAAAG(T115, T120, T121, X202, X203, T116)

The TRS R consists of the following rules:

row2colc9_in_gaaaa(.(T56, T57), .(T56, T58), T60, .(T58, X96), .([], X97)) → U11_gaaaa(T56, T57, T58, T60, X96, X97, row2colc14_in_gaaa(T57, T60, X96, X97))
row2colc14_in_gaaa(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151)) → U7_gaaa(T81, T82, T83, T85, X150, X151, row2colc14_in_gaaa(T82, T85, X150, X151))
row2colc14_in_gaaa([], [], [], []) → row2colc14_out_gaaa([], [], [], [])
U7_gaaa(T81, T82, T83, T85, X150, X151, row2colc14_out_gaaa(T82, T85, X150, X151)) → row2colc14_out_gaaa(.(T81, T82), .(.(T81, T83), T85), .(T83, X150), .([], X151))
U11_gaaaa(T56, T57, T58, T60, X96, X97, row2colc14_out_gaaa(T57, T60, X96, X97)) → row2colc9_out_gaaaa(.(T56, T57), .(T56, T58), T60, .(T58, X96), .([], X97))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
row2colc9_in_gaaaa(x1, x2, x3, x4, x5)  =  row2colc9_in_gaaaa(x1)
U11_gaaaa(x1, x2, x3, x4, x5, x6, x7)  =  U11_gaaaa(x1, x2, x7)
row2colc14_in_gaaa(x1, x2, x3, x4)  =  row2colc14_in_gaaa(x1)
U7_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U7_gaaa(x1, x2, x7)
[]  =  []
row2colc14_out_gaaa(x1, x2, x3, x4)  =  row2colc14_out_gaaa(x1, x4)
row2colc9_out_gaaaa(x1, x2, x3, x4, x5)  =  row2colc9_out_gaaaa(x1, x5)
P7_IN_GAAAAG(x1, x2, x3, x4, x5, x6)  =  P7_IN_GAAAAG(x1, x6)
U3_GAAAAG(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U3_GAAAAG(x1, x7, x8, x9)

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:

P7_IN_GAAAAG(T24, .(T115, T116)) → U3_GAAAAG(T24, T115, T116, row2colc9_in_gaaaa(T24))
U3_GAAAAG(T24, T115, T116, row2colc9_out_gaaaa(T24, T117)) → P7_IN_GAAAAG(T115, T116)

The TRS R consists of the following rules:

row2colc9_in_gaaaa(.(T56, T57)) → U11_gaaaa(T56, T57, row2colc14_in_gaaa(T57))
row2colc14_in_gaaa(.(T81, T82)) → U7_gaaa(T81, T82, row2colc14_in_gaaa(T82))
row2colc14_in_gaaa([]) → row2colc14_out_gaaa([], [])
U7_gaaa(T81, T82, row2colc14_out_gaaa(T82, X151)) → row2colc14_out_gaaa(.(T81, T82), .([], X151))
U11_gaaaa(T56, T57, row2colc14_out_gaaa(T57, X97)) → row2colc9_out_gaaaa(.(T56, T57), .([], X97))

The set Q consists of the following terms:

row2colc9_in_gaaaa(x0)
row2colc14_in_gaaa(x0)
U7_gaaa(x0, x1, x2)
U11_gaaaa(x0, x1, x2)

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

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

  • U3_GAAAAG(T24, T115, T116, row2colc9_out_gaaaa(T24, T117)) → P7_IN_GAAAAG(T115, T116)
    The graph contains the following edges 2 >= 1, 3 >= 2

  • P7_IN_GAAAAG(T24, .(T115, T116)) → U3_GAAAAG(T24, T115, T116, row2colc9_in_gaaaa(T24))
    The graph contains the following edges 1 >= 1, 2 > 2, 2 > 3

(18) YES