YES Problem: g(A()) -> A() g(B()) -> A() g(B()) -> B() g(C()) -> A() g(C()) -> B() g(C()) -> C() foldB(t,0()) -> t foldB(t,s(n)) -> f(foldB(t,n),B()) foldC(t,0()) -> t foldC(t,s(n)) -> f(foldC(t,n),C()) f(t,x) -> f'(t,g(x)) f'(triple(a,b,c),C()) -> triple(a,b,s(c)) f'(triple(a,b,c),B()) -> f(triple(a,b,c),A()) f'(triple(a,b,c),A()) -> f''(foldB(triple(s(a),0(),c),b)) f''(triple(a,b,c)) -> foldC(triple(a,b,0()),c) fold(t,x,0()) -> t fold(t,x,s(n)) -> f(fold(t,x,n),x) Proof: DP Processor: DPs: foldB#(t,s(n)) -> foldB#(t,n) foldB#(t,s(n)) -> f#(foldB(t,n),B()) foldC#(t,s(n)) -> foldC#(t,n) foldC#(t,s(n)) -> f#(foldC(t,n),C()) f#(t,x) -> g#(x) f#(t,x) -> f'#(t,g(x)) f'#(triple(a,b,c),B()) -> f#(triple(a,b,c),A()) f'#(triple(a,b,c),A()) -> foldB#(triple(s(a),0(),c),b) f'#(triple(a,b,c),A()) -> f''#(foldB(triple(s(a),0(),c),b)) f''#(triple(a,b,c)) -> foldC#(triple(a,b,0()),c) fold#(t,x,s(n)) -> fold#(t,x,n) fold#(t,x,s(n)) -> f#(fold(t,x,n),x) TRS: g(A()) -> A() g(B()) -> A() g(B()) -> B() g(C()) -> A() g(C()) -> B() g(C()) -> C() foldB(t,0()) -> t foldB(t,s(n)) -> f(foldB(t,n),B()) foldC(t,0()) -> t foldC(t,s(n)) -> f(foldC(t,n),C()) f(t,x) -> f'(t,g(x)) f'(triple(a,b,c),C()) -> triple(a,b,s(c)) f'(triple(a,b,c),B()) -> f(triple(a,b,c),A()) f'(triple(a,b,c),A()) -> f''(foldB(triple(s(a),0(),c),b)) f''(triple(a,b,c)) -> foldC(triple(a,b,0()),c) fold(t,x,0()) -> t fold(t,x,s(n)) -> f(fold(t,x,n),x) TDG Processor: DPs: foldB#(t,s(n)) -> foldB#(t,n) foldB#(t,s(n)) -> f#(foldB(t,n),B()) foldC#(t,s(n)) -> foldC#(t,n) foldC#(t,s(n)) -> f#(foldC(t,n),C()) f#(t,x) -> g#(x) f#(t,x) -> f'#(t,g(x)) f'#(triple(a,b,c),B()) -> f#(triple(a,b,c),A()) f'#(triple(a,b,c),A()) -> foldB#(triple(s(a),0(),c),b) f'#(triple(a,b,c),A()) -> f''#(foldB(triple(s(a),0(),c),b)) f''#(triple(a,b,c)) -> foldC#(triple(a,b,0()),c) fold#(t,x,s(n)) -> fold#(t,x,n) fold#(t,x,s(n)) -> f#(fold(t,x,n),x) TRS: g(A()) -> A() g(B()) -> A() g(B()) -> B() g(C()) -> A() g(C()) -> B() g(C()) -> C() foldB(t,0()) -> t foldB(t,s(n)) -> f(foldB(t,n),B()) foldC(t,0()) -> t foldC(t,s(n)) -> f(foldC(t,n),C()) f(t,x) -> f'(t,g(x)) f'(triple(a,b,c),C()) -> triple(a,b,s(c)) f'(triple(a,b,c),B()) -> f(triple(a,b,c),A()) f'(triple(a,b,c),A()) -> f''(foldB(triple(s(a),0(),c),b)) f''(triple(a,b,c)) -> foldC(triple(a,b,0()),c) fold(t,x,0()) -> t fold(t,x,s(n)) -> f(fold(t,x,n),x) graph: fold#(t,x,s(n)) -> fold#(t,x,n) -> fold#(t,x,s(n)) -> f#(fold(t,x,n),x) fold#(t,x,s(n)) -> fold#(t,x,n) -> fold#(t,x,s(n)) -> fold#(t,x,n) fold#(t,x,s(n)) -> f#(fold(t,x,n),x) -> f#(t,x) -> f'#(t,g(x)) fold#(t,x,s(n)) -> f#(fold(t,x,n),x) -> f#(t,x) -> g#(x) f''#(triple(a,b,c)) -> foldC#(triple(a,b,0()),c) -> foldC#(t,s(n)) -> f#(foldC(t,n),C()) f''#(triple(a,b,c)) -> foldC#(triple(a,b,0()),c) -> foldC#(t,s(n)) -> foldC#(t,n) f'#(triple(a,b,c),B()) -> f#(triple(a,b,c),A()) -> f#(t,x) -> f'#(t,g(x)) f'#(triple(a,b,c),B()) -> f#(triple(a,b,c),A()) -> f#(t,x) -> g#(x) f'#(triple(a,b,c),A()) -> f''#(foldB(triple(s(a),0(),c),b)) -> f''#(triple(a,b,c)) -> foldC#(triple(a,b,0()),c) f'#(triple(a,b,c),A()) -> foldB#(triple(s(a),0(),c),b) -> foldB#(t,s(n)) -> f#(foldB(t,n),B()) f'#(triple(a,b,c),A()) -> foldB#(triple(s(a),0(),c),b) -> foldB#(t,s(n)) -> foldB#(t,n) foldC#(t,s(n)) -> foldC#(t,n) -> foldC#(t,s(n)) -> f#(foldC(t,n),C()) foldC#(t,s(n)) -> foldC#(t,n) -> foldC#(t,s(n)) -> foldC#(t,n) foldC#(t,s(n)) -> f#(foldC(t,n),C()) -> f#(t,x) -> f'#(t,g(x)) foldC#(t,s(n)) -> f#(foldC(t,n),C()) -> f#(t,x) -> g#(x) f#(t,x) -> f'#(t,g(x)) -> f'#(triple(a,b,c),A()) -> f''#(foldB(triple(s(a),0(),c),b)) f#(t,x) -> f'#(t,g(x)) -> f'#(triple(a,b,c),A()) -> foldB#(triple(s(a),0(),c),b) f#(t,x) -> f'#(t,g(x)) -> f'#(triple(a,b,c),B()) -> f#(triple(a,b,c),A()) foldB#(t,s(n)) -> f#(foldB(t,n),B()) -> f#(t,x) -> f'#(t,g(x)) foldB#(t,s(n)) -> f#(foldB(t,n),B()) -> f#(t,x) -> g#(x) foldB#(t,s(n)) -> foldB#(t,n) -> foldB#(t,s(n)) -> f#(foldB(t,n),B()) foldB#(t,s(n)) -> foldB#(t,n) -> foldB#(t,s(n)) -> foldB#(t,n) SCC Processor: #sccs: 2 #rules: 10 #arcs: 22/144 DPs: fold#(t,x,s(n)) -> fold#(t,x,n) TRS: g(A()) -> A() g(B()) -> A() g(B()) -> B() g(C()) -> A() g(C()) -> B() g(C()) -> C() foldB(t,0()) -> t foldB(t,s(n)) -> f(foldB(t,n),B()) foldC(t,0()) -> t foldC(t,s(n)) -> f(foldC(t,n),C()) f(t,x) -> f'(t,g(x)) f'(triple(a,b,c),C()) -> triple(a,b,s(c)) f'(triple(a,b,c),B()) -> f(triple(a,b,c),A()) f'(triple(a,b,c),A()) -> f''(foldB(triple(s(a),0(),c),b)) f''(triple(a,b,c)) -> foldC(triple(a,b,0()),c) fold(t,x,0()) -> t fold(t,x,s(n)) -> f(fold(t,x,n),x) KBO Processor: argument filtering: pi(A) = [] pi(g) = 0 pi(B) = [] pi(C) = [] pi(0) = [] pi(foldB) = 0 pi(s) = [0] pi(f) = 0 pi(foldC) = 0 pi(f') = 0 pi(triple) = [] pi(f'') = 0 pi(fold) = [0,2] pi(fold#) = 2 weight function: w0 = 1 w(fold#) = w(triple) = w(foldC) = w(0) = w(C) = w(B) = w(A) = 1 w(fold) = w(f'') = w(f') = w(f) = w(s) = w(foldB) = w(g) = 0 precedence: fold# ~ fold ~ s ~ 0 ~ C > B > f'' ~ triple ~ f' ~ foldC ~ f ~ foldB ~ g ~ A problem: DPs: TRS: g(A()) -> A() g(B()) -> A() g(B()) -> B() g(C()) -> A() g(C()) -> B() g(C()) -> C() foldB(t,0()) -> t foldB(t,s(n)) -> f(foldB(t,n),B()) foldC(t,0()) -> t foldC(t,s(n)) -> f(foldC(t,n),C()) f(t,x) -> f'(t,g(x)) f'(triple(a,b,c),C()) -> triple(a,b,s(c)) f'(triple(a,b,c),B()) -> f(triple(a,b,c),A()) f'(triple(a,b,c),A()) -> f''(foldB(triple(s(a),0(),c),b)) f''(triple(a,b,c)) -> foldC(triple(a,b,0()),c) fold(t,x,0()) -> t fold(t,x,s(n)) -> f(fold(t,x,n),x) Qed DPs: f#(t,x) -> f'#(t,g(x)) f'#(triple(a,b,c),B()) -> f#(triple(a,b,c),A()) f'#(triple(a,b,c),A()) -> foldB#(triple(s(a),0(),c),b) foldB#(t,s(n)) -> foldB#(t,n) foldB#(t,s(n)) -> f#(foldB(t,n),B()) f'#(triple(a,b,c),A()) -> f''#(foldB(triple(s(a),0(),c),b)) f''#(triple(a,b,c)) -> foldC#(triple(a,b,0()),c) foldC#(t,s(n)) -> foldC#(t,n) foldC#(t,s(n)) -> f#(foldC(t,n),C()) TRS: g(A()) -> A() g(B()) -> A() g(B()) -> B() g(C()) -> A() g(C()) -> B() g(C()) -> C() foldB(t,0()) -> t foldB(t,s(n)) -> f(foldB(t,n),B()) foldC(t,0()) -> t foldC(t,s(n)) -> f(foldC(t,n),C()) f(t,x) -> f'(t,g(x)) f'(triple(a,b,c),C()) -> triple(a,b,s(c)) f'(triple(a,b,c),B()) -> f(triple(a,b,c),A()) f'(triple(a,b,c),A()) -> f''(foldB(triple(s(a),0(),c),b)) f''(triple(a,b,c)) -> foldC(triple(a,b,0()),c) fold(t,x,0()) -> t fold(t,x,s(n)) -> f(fold(t,x,n),x) Matrix Interpretation Processor: dim=1 interpretation: [f''#](x0) = x0 + 7, [f'#](x0, x1) = x0 + 2x1 + 1, [foldC#](x0, x1) = x0 + x1 + 6, [f#](x0, x1) = x0 + 2x1 + 2, [foldB#](x0, x1) = x0 + 3x1, [fold](x0, x1, x2) = 6x0 + 2x1 + x2, [f''](x0) = x0, [triple](x0, x1, x2) = 4x1 + x2 + 2, [f'](x0, x1) = x0 + 7, [foldC](x0, x1) = x0 + x1, [f](x0, x1) = x0 + 7, [s](x0) = x0 + 7, [foldB](x0, x1) = x0 + 3x1, [0] = 0, [C] = 5, [B] = 5, [g](x0) = x0, [A] = 4 orientation: f#(t,x) = t + 2x + 2 >= t + 2x + 1 = f'#(t,g(x)) f'#(triple(a,b,c),B()) = 4b + c + 13 >= 4b + c + 12 = f#(triple(a,b,c),A()) f'#(triple(a,b,c),A()) = 4b + c + 11 >= 3b + c + 2 = foldB#(triple(s(a),0(),c),b) foldB#(t,s(n)) = 3n + t + 21 >= 3n + t = foldB#(t,n) foldB#(t,s(n)) = 3n + t + 21 >= 3n + t + 12 = f#(foldB(t,n),B()) f'#(triple(a,b,c),A()) = 4b + c + 11 >= 3b + c + 9 = f''#(foldB(triple(s(a),0(),c),b)) f''#(triple(a,b,c)) = 4b + c + 9 >= 4b + c + 8 = foldC#(triple(a,b,0()),c) foldC#(t,s(n)) = n + t + 13 >= n + t + 6 = foldC#(t,n) foldC#(t,s(n)) = n + t + 13 >= n + t + 12 = f#(foldC(t,n),C()) g(A()) = 4 >= 4 = A() g(B()) = 5 >= 4 = A() g(B()) = 5 >= 5 = B() g(C()) = 5 >= 4 = A() g(C()) = 5 >= 5 = B() g(C()) = 5 >= 5 = C() foldB(t,0()) = t >= t = t foldB(t,s(n)) = 3n + t + 21 >= 3n + t + 7 = f(foldB(t,n),B()) foldC(t,0()) = t >= t = t foldC(t,s(n)) = n + t + 7 >= n + t + 7 = f(foldC(t,n),C()) f(t,x) = t + 7 >= t + 7 = f'(t,g(x)) f'(triple(a,b,c),C()) = 4b + c + 9 >= 4b + c + 9 = triple(a,b,s(c)) f'(triple(a,b,c),B()) = 4b + c + 9 >= 4b + c + 9 = f(triple(a,b,c),A()) f'(triple(a,b,c),A()) = 4b + c + 9 >= 3b + c + 2 = f''(foldB(triple(s(a),0(),c),b)) f''(triple(a,b,c)) = 4b + c + 2 >= 4b + c + 2 = foldC(triple(a,b,0()),c) fold(t,x,0()) = 6t + 2x >= t = t fold(t,x,s(n)) = n + 6t + 2x + 7 >= n + 6t + 2x + 7 = f(fold(t,x,n),x) problem: DPs: TRS: g(A()) -> A() g(B()) -> A() g(B()) -> B() g(C()) -> A() g(C()) -> B() g(C()) -> C() foldB(t,0()) -> t foldB(t,s(n)) -> f(foldB(t,n),B()) foldC(t,0()) -> t foldC(t,s(n)) -> f(foldC(t,n),C()) f(t,x) -> f'(t,g(x)) f'(triple(a,b,c),C()) -> triple(a,b,s(c)) f'(triple(a,b,c),B()) -> f(triple(a,b,c),A()) f'(triple(a,b,c),A()) -> f''(foldB(triple(s(a),0(),c),b)) f''(triple(a,b,c)) -> foldC(triple(a,b,0()),c) fold(t,x,0()) -> t fold(t,x,s(n)) -> f(fold(t,x,n),x) Qed