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: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: quot#_A(x1,x2) = x1 s_A(x1) = x1 + 2 minus_A(x1,x2) = x1 + 1 |0|_A() = 3 quot#!_A(x1,x2) = x1 + 1 s!_A(x1) = x1 + 1 minus!_A(x1,x2) = x1 |0|!_A() = 0 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: quot#_A(x1,x2) = max{7, x1 - 19, x2 - 21} s_A(x1) = x1 + 20 minus_A(x1,x2) = max{26, x1 + 13, x2 + 13} |0|_A = 13 quot#!_A(x1,x2) = max{34, x1 + 9, x2 + 15} s!_A(x1) = max{33, x1 + 22} minus!_A(x1,x2) = max{33, x1 - 21} |0|!_A = 23 partial status: pi(quot#) = [] pi(s) = [1] pi(minus) = [1] pi(|0|) = [] The following rules are removed: p1 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: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: minus#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 4 minus#!_A(x1,x2) = x1 + x2 s!_A(x1) = 6 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus#_A(x1,x2) = 0 s_A(x1) = max{2, x1 - 2} minus#!_A(x1,x2) = max{3, x1 - 3, x2 - 3} s!_A(x1) = 2 partial status: pi(minus#) = [] pi(s) = [] The following rules are removed: p1 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: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: shuffle#_A(x1) = x1 add_A(x1,x2) = x1 + x2 + 4 reverse_A(x1) = x1 + 1 app_A(x1,x2) = x1 + x2 nil_A() = 0 shuffle#!_A(x1) = 0 add!_A(x1,x2) = x2 + 3 reverse!_A(x1) = x1 + 2 app!_A(x1,x2) = x1 + x2 nil!_A() = 0 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: shuffle#_A(x1) = max{0, x1 - 7} add_A(x1,x2) = max{3, x1 + 2, x2} reverse_A(x1) = max{6, x1} app_A(x1,x2) = max{4, x1, x2} nil_A = 2 shuffle#!_A(x1) = max{8, x1 + 3} add!_A(x1,x2) = max{1, x2 - 9} reverse!_A(x1) = max{7, x1 + 2} app!_A(x1,x2) = max{6, x1 - 16} nil!_A = 6 partial status: pi(shuffle#) = [1] pi(add) = [] pi(reverse) = [] pi(app) = [2] pi(nil) = [] The following rules are removed: p1 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 r3 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: reverse#_A(x1) = x1 add_A(x1,x2) = x1 + x2 + 5 quot_A(x1,x2) = 1 |0|_A() = 1 s_A(x1) = x1 + 2 reverse#!_A(x1) = x1 add!_A(x1,x2) = 4 quot!_A(x1,x2) = x1 + x2 |0|!_A() = 0 s!_A(x1) = x1 + 5 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: reverse#_A(x1) = 0 add_A(x1,x2) = max{25, x1 - 9, x2 - 9} quot_A(x1,x2) = max{3, x2 - 3} |0|_A = 3 s_A(x1) = max{4, x1 - 4} reverse#!_A(x1) = max{3, x1 - 26} add!_A(x1,x2) = max{2, x1 - 10, x2 - 24} quot!_A(x1,x2) = max{x1 - 5, x2 + 9} |0|!_A = 2 s!_A(x1) = x1 + 3 partial status: pi(reverse#) = [] pi(add) = [2] pi(quot) = [] pi(|0|) = [] pi(s) = [1] The following rules are removed: p1 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: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: app#_A(x1,x2) = x1 add_A(x1,x2) = x1 + x2 + 2 app#!_A(x1,x2) = 0 add!_A(x1,x2) = 2 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = 0 add_A(x1,x2) = max{9, x1 - 28, x2 - 28} app#!_A(x1,x2) = 6 add!_A(x1,x2) = max{29, x1 + 5, x2 + 3} partial status: pi(app#) = [1] pi(add) = [2] The following rules are removed: p1 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: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: less_leaves#_A(x1,x2) = x1 + x2 cons_A(x1,x2) = x1 + x2 + 2 concat_A(x1,x2) = x1 + x2 + 1 leaf_A() = 1 less_leaves#!_A(x1,x2) = x1 cons!_A(x1,x2) = 3 concat!_A(x1,x2) = 5 leaf!_A() = 1 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: less_leaves#_A(x1,x2) = max{0, x1 - 9, x2 - 7} cons_A(x1,x2) = max{6, x1 + 1, x2} concat_A(x1,x2) = max{5, x1, x2} leaf_A = 6 less_leaves#!_A(x1,x2) = x1 + 4 cons!_A(x1,x2) = max{1, x2 - 10} concat!_A(x1,x2) = max{3, x1 - 7, x2 - 8} leaf!_A = 2 partial status: pi(less_leaves#) = [] pi(cons) = [1] pi(concat) = [1, 2] pi(leaf) = [] The following rules are removed: p1 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: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: concat#_A(x1,x2) = x1 cons_A(x1,x2) = x2 + 2 concat#!_A(x1,x2) = x1 cons!_A(x1,x2) = x2 + 2 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: concat#_A(x1,x2) = 0 cons_A(x1,x2) = max{x1 + 1, x2 - 5} concat#!_A(x1,x2) = max{1, x1 - 2, x2 - 1} cons!_A(x1,x2) = 0 partial status: pi(concat#) = [] pi(cons) = [] The following rules are removed: p1 Then no dependency pair remains.