YES We show the termination of the TRS R: minus(x,|0|()) -> x minus(s(x),s(y)) -> minus(x,y) quot(|0|(),s(y)) -> |0|() quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) app(nil(),y) -> y app(add(n,x),y) -> add(n,app(x,y)) reverse(nil()) -> nil() reverse(add(n,x)) -> app(reverse(x),add(n,nil())) shuffle(nil()) -> nil() shuffle(add(n,x)) -> add(n,shuffle(reverse(x))) concat(leaf(),y) -> y concat(cons(u,v),y) -> cons(u,concat(v,y)) less_leaves(x,leaf()) -> false() less_leaves(leaf(),cons(w,z)) -> true() less_leaves(cons(u,v),cons(w,z)) -> less_leaves(concat(u,v),concat(w,z)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: minus#(s(x),s(y)) -> minus#(x,y) p2: quot#(s(x),s(y)) -> quot#(minus(x,y),s(y)) p3: quot#(s(x),s(y)) -> minus#(x,y) p4: app#(add(n,x),y) -> app#(x,y) p5: reverse#(add(n,x)) -> app#(reverse(x),add(n,nil())) p6: reverse#(add(n,x)) -> reverse#(x) p7: shuffle#(add(n,x)) -> shuffle#(reverse(x)) p8: shuffle#(add(n,x)) -> reverse#(x) p9: concat#(cons(u,v),y) -> concat#(v,y) p10: less_leaves#(cons(u,v),cons(w,z)) -> less_leaves#(concat(u,v),concat(w,z)) p11: less_leaves#(cons(u,v),cons(w,z)) -> concat#(u,v) p12: less_leaves#(cons(u,v),cons(w,z)) -> concat#(w,z) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: app(nil(),y) -> y r6: app(add(n,x),y) -> add(n,app(x,y)) r7: reverse(nil()) -> nil() r8: reverse(add(n,x)) -> app(reverse(x),add(n,nil())) r9: shuffle(nil()) -> nil() r10: shuffle(add(n,x)) -> add(n,shuffle(reverse(x))) r11: concat(leaf(),y) -> y r12: concat(cons(u,v),y) -> cons(u,concat(v,y)) r13: less_leaves(x,leaf()) -> false() r14: less_leaves(leaf(),cons(w,z)) -> true() r15: less_leaves(cons(u,v),cons(w,z)) -> less_leaves(concat(u,v),concat(w,z)) The estimated dependency graph contains the following SCCs: {p2} {p1} {p7} {p6} {p4} {p10} {p9} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: quot#(s(x),s(y)) -> quot#(minus(x,y),s(y)) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: app(nil(),y) -> y r6: app(add(n,x),y) -> add(n,app(x,y)) r7: reverse(nil()) -> nil() r8: reverse(add(n,x)) -> app(reverse(x),add(n,nil())) r9: shuffle(nil()) -> nil() r10: shuffle(add(n,x)) -> add(n,shuffle(reverse(x))) r11: concat(leaf(),y) -> y r12: concat(cons(u,v),y) -> cons(u,concat(v,y)) r13: less_leaves(x,leaf()) -> false() r14: less_leaves(leaf(),cons(w,z)) -> true() r15: less_leaves(cons(u,v),cons(w,z)) -> less_leaves(concat(u,v),concat(w,z)) The set of usable rules consists of r1, r2 Take the reduction pair: lexicographic combination of reduction pairs: 1. matrix interpretations: carrier: N^4 order: lexicographic order interpretations: quot#_A(x1,x2) = ((1,0,0,0),(1,0,0,0),(0,0,0,0),(1,1,0,0)) x1 + ((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,1,1,1)) x2 s_A(x1) = ((1,0,0,0),(0,0,0,0),(1,1,0,0),(1,1,1,0)) x1 + (2,0,0,0) minus_A(x1,x2) = ((1,0,0,0),(1,1,0,0),(0,0,0,0),(0,1,1,0)) x1 + (1,2,1,1) |0|_A() = (1,0,0,0) 2. lexicographic path order with precedence: precedence: s > |0| > quot# > minus argument filter: pi(quot#) = [] pi(s) = [] pi(minus) = [] pi(|0|) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: minus#(s(x),s(y)) -> minus#(x,y) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: app(nil(),y) -> y r6: app(add(n,x),y) -> add(n,app(x,y)) r7: reverse(nil()) -> nil() r8: reverse(add(n,x)) -> app(reverse(x),add(n,nil())) r9: shuffle(nil()) -> nil() r10: shuffle(add(n,x)) -> add(n,shuffle(reverse(x))) r11: concat(leaf(),y) -> y r12: concat(cons(u,v),y) -> cons(u,concat(v,y)) r13: less_leaves(x,leaf()) -> false() r14: less_leaves(leaf(),cons(w,z)) -> true() r15: less_leaves(cons(u,v),cons(w,z)) -> less_leaves(concat(u,v),concat(w,z)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. matrix interpretations: carrier: N^4 order: lexicographic order interpretations: minus#_A(x1,x2) = ((1,0,0,0),(1,1,0,0),(1,0,1,0),(1,1,1,1)) x1 + ((1,0,0,0),(0,1,0,0),(0,0,1,0),(1,1,1,1)) x2 s_A(x1) = ((1,0,0,0),(1,1,0,0),(1,1,1,0),(1,1,1,1)) x1 + (1,1,1,1) 2. lexicographic path order with precedence: precedence: s > minus# argument filter: pi(minus#) = [2] pi(s) = 1 The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: shuffle#(add(n,x)) -> shuffle#(reverse(x)) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: app(nil(),y) -> y r6: app(add(n,x),y) -> add(n,app(x,y)) r7: reverse(nil()) -> nil() r8: reverse(add(n,x)) -> app(reverse(x),add(n,nil())) r9: shuffle(nil()) -> nil() r10: shuffle(add(n,x)) -> add(n,shuffle(reverse(x))) r11: concat(leaf(),y) -> y r12: concat(cons(u,v),y) -> cons(u,concat(v,y)) r13: less_leaves(x,leaf()) -> false() r14: less_leaves(leaf(),cons(w,z)) -> true() r15: less_leaves(cons(u,v),cons(w,z)) -> less_leaves(concat(u,v),concat(w,z)) The set of usable rules consists of r5, r6, r7, r8 Take the reduction pair: lexicographic combination of reduction pairs: 1. matrix interpretations: carrier: N^4 order: lexicographic order interpretations: shuffle#_A(x1) = ((0,0,0,0),(1,0,0,0),(1,1,0,0),(1,0,1,0)) x1 add_A(x1,x2) = ((1,0,0,0),(1,1,0,0),(1,1,1,0),(1,1,1,1)) x1 + ((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,1,0,1)) x2 + (3,1,1,1) reverse_A(x1) = ((1,0,0,0),(1,1,0,0),(1,0,1,0),(1,1,1,1)) x1 + (2,3,3,1) app_A(x1,x2) = ((1,0,0,0),(0,1,0,0),(0,1,1,0),(1,1,1,1)) x1 + ((1,0,0,0),(0,1,0,0),(0,0,1,0),(1,0,1,1)) x2 + (0,1,1,1) nil_A() = (0,1,1,1) 2. lexicographic path order with precedence: precedence: shuffle# > app > nil > reverse > add argument filter: pi(shuffle#) = [] pi(add) = 2 pi(reverse) = [1] pi(app) = 1 pi(nil) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: reverse#(add(n,x)) -> reverse#(x) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: app(nil(),y) -> y r6: app(add(n,x),y) -> add(n,app(x,y)) r7: reverse(nil()) -> nil() r8: reverse(add(n,x)) -> app(reverse(x),add(n,nil())) r9: shuffle(nil()) -> nil() r10: shuffle(add(n,x)) -> add(n,shuffle(reverse(x))) r11: concat(leaf(),y) -> y r12: concat(cons(u,v),y) -> cons(u,concat(v,y)) r13: less_leaves(x,leaf()) -> false() r14: less_leaves(leaf(),cons(w,z)) -> true() r15: less_leaves(cons(u,v),cons(w,z)) -> less_leaves(concat(u,v),concat(w,z)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. matrix interpretations: carrier: N^4 order: lexicographic order interpretations: reverse#_A(x1) = ((1,0,0,0),(0,1,0,0),(0,0,1,0),(1,1,1,1)) x1 add_A(x1,x2) = ((1,0,0,0),(1,1,0,0),(1,1,1,0),(1,1,1,1)) x1 + ((1,0,0,0),(1,1,0,0),(1,1,1,0),(1,1,1,1)) x2 + (1,1,1,1) 2. lexicographic path order with precedence: precedence: add > reverse# argument filter: pi(reverse#) = [] pi(add) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(add(n,x),y) -> app#(x,y) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: app(nil(),y) -> y r6: app(add(n,x),y) -> add(n,app(x,y)) r7: reverse(nil()) -> nil() r8: reverse(add(n,x)) -> app(reverse(x),add(n,nil())) r9: shuffle(nil()) -> nil() r10: shuffle(add(n,x)) -> add(n,shuffle(reverse(x))) r11: concat(leaf(),y) -> y r12: concat(cons(u,v),y) -> cons(u,concat(v,y)) r13: less_leaves(x,leaf()) -> false() r14: less_leaves(leaf(),cons(w,z)) -> true() r15: less_leaves(cons(u,v),cons(w,z)) -> less_leaves(concat(u,v),concat(w,z)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. matrix interpretations: carrier: N^4 order: lexicographic order interpretations: app#_A(x1,x2) = ((0,0,0,0),(0,0,0,0),(0,0,0,0),(1,0,0,0)) x1 + ((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,1,1,1)) x2 add_A(x1,x2) = ((1,0,0,0),(0,0,0,0),(0,1,0,0),(1,1,1,0)) x1 + ((1,0,0,0),(0,0,0,0),(0,0,0,0),(1,1,0,0)) x2 + (1,1,1,1) 2. lexicographic path order with precedence: precedence: add > app# argument filter: pi(app#) = [] pi(add) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: less_leaves#(cons(u,v),cons(w,z)) -> less_leaves#(concat(u,v),concat(w,z)) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: app(nil(),y) -> y r6: app(add(n,x),y) -> add(n,app(x,y)) r7: reverse(nil()) -> nil() r8: reverse(add(n,x)) -> app(reverse(x),add(n,nil())) r9: shuffle(nil()) -> nil() r10: shuffle(add(n,x)) -> add(n,shuffle(reverse(x))) r11: concat(leaf(),y) -> y r12: concat(cons(u,v),y) -> cons(u,concat(v,y)) r13: less_leaves(x,leaf()) -> false() r14: less_leaves(leaf(),cons(w,z)) -> true() r15: less_leaves(cons(u,v),cons(w,z)) -> less_leaves(concat(u,v),concat(w,z)) The set of usable rules consists of r11, r12 Take the reduction pair: lexicographic combination of reduction pairs: 1. matrix interpretations: carrier: N^4 order: lexicographic order interpretations: less_leaves#_A(x1,x2) = ((1,0,0,0),(1,1,0,0),(1,1,1,0),(1,1,0,1)) x1 + ((1,0,0,0),(1,1,0,0),(1,1,1,0),(1,1,0,0)) x2 cons_A(x1,x2) = ((1,0,0,0),(1,1,0,0),(1,1,1,0),(1,1,1,1)) x1 + ((1,0,0,0),(0,1,0,0),(0,1,1,0),(0,1,1,1)) x2 + (2,1,1,1) concat_A(x1,x2) = ((1,0,0,0),(1,1,0,0),(1,0,1,0),(1,1,1,1)) x1 + ((1,0,0,0),(1,1,0,0),(1,1,1,0),(1,1,1,1)) x2 + (1,3,2,1) leaf_A() = (1,1,1,1) 2. lexicographic path order with precedence: precedence: concat > leaf > cons > less_leaves# argument filter: pi(less_leaves#) = 1 pi(cons) = 2 pi(concat) = 2 pi(leaf) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: concat#(cons(u,v),y) -> concat#(v,y) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: app(nil(),y) -> y r6: app(add(n,x),y) -> add(n,app(x,y)) r7: reverse(nil()) -> nil() r8: reverse(add(n,x)) -> app(reverse(x),add(n,nil())) r9: shuffle(nil()) -> nil() r10: shuffle(add(n,x)) -> add(n,shuffle(reverse(x))) r11: concat(leaf(),y) -> y r12: concat(cons(u,v),y) -> cons(u,concat(v,y)) r13: less_leaves(x,leaf()) -> false() r14: less_leaves(leaf(),cons(w,z)) -> true() r15: less_leaves(cons(u,v),cons(w,z)) -> less_leaves(concat(u,v),concat(w,z)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. matrix interpretations: carrier: N^4 order: lexicographic order interpretations: concat#_A(x1,x2) = ((0,0,0,0),(0,0,0,0),(0,0,0,0),(1,0,0,0)) x1 + ((1,0,0,0),(0,0,0,0),(0,0,0,0),(0,1,0,0)) x2 cons_A(x1,x2) = ((1,0,0,0),(0,0,0,0),(0,1,0,0),(1,1,1,0)) x1 + ((1,0,0,0),(0,0,0,0),(0,0,0,0),(1,1,0,0)) x2 + (1,1,1,1) 2. lexicographic path order with precedence: precedence: cons > concat# argument filter: pi(concat#) = [] pi(cons) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.