YES We show the termination of the TRS R: app(nil(),k) -> k app(l,nil()) -> l app(cons(x,l),k) -> cons(x,app(l,k)) sum(cons(x,nil())) -> cons(x,nil()) sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) pred(cons(s(x),nil())) -> cons(x,nil()) plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) plus(zero(),y) -> y plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) id(x) -> x if(true(),x,y) -> x if(false(),x,y) -> y not(x) -> if(x,false(),true()) gt(s(x),zero()) -> true() gt(zero(),y) -> false() gt(s(x),s(y)) -> gt(x,y) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(cons(x,l),k) -> app#(l,k) p2: sum#(cons(x,cons(y,l))) -> sum#(cons(plus(x,y),l)) p3: sum#(cons(x,cons(y,l))) -> plus#(x,y) p4: sum#(app(l,cons(x,cons(y,k)))) -> sum#(app(l,sum(cons(x,cons(y,k))))) p5: sum#(app(l,cons(x,cons(y,k)))) -> app#(l,sum(cons(x,cons(y,k)))) p6: sum#(app(l,cons(x,cons(y,k)))) -> sum#(cons(x,cons(y,k))) p7: sum#(plus(cons(|0|(),x),cons(y,l))) -> pred#(sum(cons(s(x),cons(y,l)))) p8: sum#(plus(cons(|0|(),x),cons(y,l))) -> sum#(cons(s(x),cons(y,l))) p9: plus#(s(x),s(y)) -> plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) p10: plus#(s(x),s(y)) -> if#(gt(x,y),x,y) p11: plus#(s(x),s(y)) -> gt#(x,y) p12: plus#(s(x),s(y)) -> if#(not(gt(x,y)),id(x),id(y)) p13: plus#(s(x),s(y)) -> not#(gt(x,y)) p14: plus#(s(x),s(y)) -> id#(x) p15: plus#(s(x),s(y)) -> id#(y) p16: plus#(s(x),x) -> plus#(if(gt(x,x),id(x),id(x)),s(x)) p17: plus#(s(x),x) -> if#(gt(x,x),id(x),id(x)) p18: plus#(s(x),x) -> gt#(x,x) p19: plus#(s(x),x) -> id#(x) p20: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),y,s(y))) p21: plus#(id(x),s(y)) -> if#(gt(s(y),y),y,s(y)) p22: plus#(id(x),s(y)) -> gt#(s(y),y) p23: not#(x) -> if#(x,false(),true()) p24: gt#(s(x),s(y)) -> gt#(x,y) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r8: pred(cons(s(x),nil())) -> cons(x,nil()) r9: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r10: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r11: plus(zero(),y) -> y r12: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r13: id(x) -> x r14: if(true(),x,y) -> x r15: if(false(),x,y) -> y r16: not(x) -> if(x,false(),true()) r17: gt(s(x),zero()) -> true() r18: gt(zero(),y) -> false() r19: gt(s(x),s(y)) -> gt(x,y) The estimated dependency graph contains the following SCCs: {p4} {p1} {p2} {p9, p16, p20} {p24} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: sum#(app(l,cons(x,cons(y,k)))) -> sum#(app(l,sum(cons(x,cons(y,k))))) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r8: pred(cons(s(x),nil())) -> cons(x,nil()) r9: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r10: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r11: plus(zero(),y) -> y r12: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r13: id(x) -> x r14: if(true(),x,y) -> x r15: if(false(),x,y) -> y r16: not(x) -> if(x,false(),true()) r17: gt(s(x),zero()) -> true() r18: gt(zero(),y) -> false() r19: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r1, r2, r3, r4, r5, r9, 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: sum#_A(x1) = x1 app_A(x1,x2) = x1 + x2 + 1 cons_A(x1,x2) = 1 sum_A(x1) = 1 nil_A() = 1 plus_A(x1,x2) = 2 s_A(x1) = 1 if_A(x1,x2,x3) = x2 + x3 + 1 gt_A(x1,x2) = x2 + 1 not_A(x1) = 1 id_A(x1) = x1 + 1 sum#!_A(x1) = 4 app!_A(x1,x2) = 5 cons!_A(x1,x2) = 3 sum!_A(x1) = 3 nil!_A() = 4 plus!_A(x1,x2) = 4 s!_A(x1) = 2 if!_A(x1,x2,x3) = 1 gt!_A(x1,x2) = 1 not!_A(x1) = 3 id!_A(x1) = 5 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: sum#_A(x1) = 0 app_A(x1,x2) = max{x1 + 222, x2 + 55} cons_A(x1,x2) = 156 sum_A(x1) = 168 nil_A = 18 plus_A(x1,x2) = max{279, x1 - 79, x2 - 16} s_A(x1) = 123 if_A(x1,x2,x3) = max{77, x2 - 46, x3 - 15} gt_A(x1,x2) = max{x1 + 31, x2 + 154} not_A(x1) = 0 id_A(x1) = max{93, x1 - 62} sum#!_A(x1) = max{15, x1 - 135} app!_A(x1,x2) = max{13, x1 + 3, x2 - 155} cons!_A(x1,x2) = max{2, x2 - 140} sum!_A(x1) = 14 nil!_A = 15 plus!_A(x1,x2) = max{17, x1 - 78} s!_A(x1) = 14 if!_A(x1,x2,x3) = x2 + 62 gt!_A(x1,x2) = max{11, x1 - 124} not!_A(x1) = max{221, x1 - 155} id!_A(x1) = max{14, x1 + 12} partial status: pi(sum#) = [1] pi(app) = [1, 2] pi(cons) = [] pi(sum) = [] pi(nil) = [] pi(plus) = [] pi(s) = [] pi(if) = [] pi(gt) = [] pi(not) = [1] pi(id) = [] 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#(cons(x,l),k) -> app#(l,k) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r8: pred(cons(s(x),nil())) -> cons(x,nil()) r9: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r10: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r11: plus(zero(),y) -> y r12: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r13: id(x) -> x r14: if(true(),x,y) -> x r15: if(false(),x,y) -> y r16: not(x) -> if(x,false(),true()) r17: gt(s(x),zero()) -> true() r18: gt(zero(),y) -> false() r19: gt(s(x),s(y)) -> gt(x,y) 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 cons_A(x1,x2) = x1 + x2 + 8 app#!_A(x1,x2) = x1 + 12 cons!_A(x1,x2) = x2 + 11 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = max{0, x1 - 294} cons_A(x1,x2) = max{x1 - 36, x2 + 293} app#!_A(x1,x2) = max{440, x2 + 1} cons!_A(x1,x2) = x1 + 439 partial status: pi(app#) = [1] pi(cons) = [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: sum#(cons(x,cons(y,l))) -> sum#(cons(plus(x,y),l)) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r8: pred(cons(s(x),nil())) -> cons(x,nil()) r9: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r10: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r11: plus(zero(),y) -> y r12: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r13: id(x) -> x r14: if(true(),x,y) -> x r15: if(false(),x,y) -> y r16: not(x) -> if(x,false(),true()) r17: gt(s(x),zero()) -> true() r18: gt(zero(),y) -> false() r19: gt(s(x),s(y)) -> gt(x,y) 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: sum#_A(x1) = 0 cons_A(x1,x2) = x2 + 7 plus_A(x1,x2) = 13 sum#!_A(x1) = x1 + 11 cons!_A(x1,x2) = x2 + 10 plus!_A(x1,x2) = x1 + 26 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: sum#_A(x1) = 0 cons_A(x1,x2) = max{374, x2 + 40} plus_A(x1,x2) = max{31, x1 - 74, x2 - 21} sum#!_A(x1) = max{4, x1 - 75} cons!_A(x1,x2) = x2 + 5 plus!_A(x1,x2) = x2 + 92 partial status: pi(sum#) = [] pi(cons) = [2] pi(plus) = [] 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: plus#(s(x),s(y)) -> plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) p2: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),y,s(y))) p3: plus#(s(x),x) -> plus#(if(gt(x,x),id(x),id(x)),s(x)) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r8: pred(cons(s(x),nil())) -> cons(x,nil()) r9: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r10: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r11: plus(zero(),y) -> y r12: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r13: id(x) -> x r14: if(true(),x,y) -> x r15: if(false(),x,y) -> y r16: not(x) -> if(x,false(),true()) r17: gt(s(x),zero()) -> true() r18: gt(zero(),y) -> false() r19: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r13, r14, r15, r16, r17, r18, r19 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: plus#_A(x1,x2) = 0 s_A(x1) = 2 if_A(x1,x2,x3) = x2 + x3 + 1 gt_A(x1,x2) = 1 not_A(x1) = 3 id_A(x1) = x1 + 8 true_A() = 1 false_A() = 1 zero_A() = 1 plus#!_A(x1,x2) = 5 s!_A(x1) = x1 + 6 if!_A(x1,x2,x3) = 7 gt!_A(x1,x2) = 8 not!_A(x1) = x1 + 8 id!_A(x1) = 0 true!_A() = 7 false!_A() = 0 zero!_A() = 8 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = 0 s_A(x1) = max{73, x1 + 52} if_A(x1,x2,x3) = max{65, x2 + 16, x3} gt_A(x1,x2) = max{x1 - 165, x2 + 99} not_A(x1) = x1 + 181 id_A(x1) = max{47, x1 + 15} true_A = 181 false_A = 0 zero_A = 90 plus#!_A(x1,x2) = max{2, x1 - 46, x2 - 98} s!_A(x1) = 0 if!_A(x1,x2,x3) = max{162, x2 - 8, x3 - 19} gt!_A(x1,x2) = max{69, x1 - 19, x2 - 97} not!_A(x1) = x1 + 161 id!_A(x1) = 0 true!_A = 68 false!_A = 70 zero!_A = 67 partial status: pi(plus#) = [] pi(s) = [1] pi(if) = [2, 3] pi(gt) = [1] pi(not) = [1] pi(id) = [1] pi(true) = [] pi(false) = [] pi(zero) = [] The following rules are removed: p3 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: plus#(s(x),s(y)) -> plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) p2: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),y,s(y))) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r8: pred(cons(s(x),nil())) -> cons(x,nil()) r9: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r10: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r11: plus(zero(),y) -> y r12: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r13: id(x) -> x r14: if(true(),x,y) -> x r15: if(false(),x,y) -> y r16: not(x) -> if(x,false(),true()) r17: gt(s(x),zero()) -> true() r18: gt(zero(),y) -> false() r19: gt(s(x),s(y)) -> gt(x,y) The estimated dependency graph contains the following SCCs: {p1, p2} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: plus#(s(x),s(y)) -> plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) p2: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),y,s(y))) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r8: pred(cons(s(x),nil())) -> cons(x,nil()) r9: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r10: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r11: plus(zero(),y) -> y r12: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r13: id(x) -> x r14: if(true(),x,y) -> x r15: if(false(),x,y) -> y r16: not(x) -> if(x,false(),true()) r17: gt(s(x),zero()) -> true() r18: gt(zero(),y) -> false() r19: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r13, r14, r15, r17, r18, r19 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: plus#_A(x1,x2) = 0 s_A(x1) = 4 if_A(x1,x2,x3) = x2 + x3 + 6 gt_A(x1,x2) = 1 not_A(x1) = x1 + 8 id_A(x1) = x1 true_A() = 1 false_A() = 1 zero_A() = 1 plus#!_A(x1,x2) = 10 s!_A(x1) = x1 + 18 if!_A(x1,x2,x3) = 12 gt!_A(x1,x2) = 11 not!_A(x1) = x1 + 13 id!_A(x1) = 23 true!_A() = 19 false!_A() = 0 zero!_A() = 20 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{36, x1 - 87, x2 - 59} s_A(x1) = max{78, x1 + 30} if_A(x1,x2,x3) = max{32, x2, x3} gt_A(x1,x2) = max{89, x2 + 88} not_A(x1) = max{59, x1 - 30} id_A(x1) = max{95, x1} true_A = 168 false_A = 89 zero_A = 154 plus#!_A(x1,x2) = max{97, x1 + 30, x2 + 1} s!_A(x1) = 0 if!_A(x1,x2,x3) = max{126, x2 - 15, x3 - 96} gt!_A(x1,x2) = max{32, x1 - 155, x2 - 79} not!_A(x1) = x1 + 73 id!_A(x1) = max{0, x1 - 14} true!_A = 74 false!_A = 0 zero!_A = 75 partial status: pi(plus#) = [] pi(s) = [1] pi(if) = [2, 3] pi(gt) = [1, 2] pi(not) = [] pi(id) = [1] pi(true) = [] pi(false) = [] pi(zero) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),y,s(y))) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r8: pred(cons(s(x),nil())) -> cons(x,nil()) r9: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r10: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r11: plus(zero(),y) -> y r12: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r13: id(x) -> x r14: if(true(),x,y) -> x r15: if(false(),x,y) -> y r16: not(x) -> if(x,false(),true()) r17: gt(s(x),zero()) -> true() r18: gt(zero(),y) -> false() r19: gt(s(x),s(y)) -> gt(x,y) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),y,s(y))) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r8: pred(cons(s(x),nil())) -> cons(x,nil()) r9: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r10: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r11: plus(zero(),y) -> y r12: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r13: id(x) -> x r14: if(true(),x,y) -> x r15: if(false(),x,y) -> y r16: not(x) -> if(x,false(),true()) r17: gt(s(x),zero()) -> true() r18: gt(zero(),y) -> false() r19: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r4, r14, r15, r17, r18, r19 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: plus#_A(x1,x2) = x1 id_A(x1) = x1 + 1 s_A(x1) = x1 + 1 if_A(x1,x2,x3) = x2 + x3 + 5 gt_A(x1,x2) = x1 + 1 sum_A(x1) = x1 + 1 cons_A(x1,x2) = x1 + x2 + 1 nil_A() = 0 true_A() = 1 false_A() = 1 zero_A() = 1 plus#!_A(x1,x2) = x1 id!_A(x1) = 3 s!_A(x1) = 8 if!_A(x1,x2,x3) = 7 gt!_A(x1,x2) = x2 + 2 sum!_A(x1) = 12 cons!_A(x1,x2) = 9 nil!_A() = 0 true!_A() = 0 false!_A() = 0 zero!_A() = 1 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 46, x2 - 73} id_A(x1) = max{6, x1 + 2} s_A(x1) = max{50, x1 + 5} if_A(x1,x2,x3) = max{41, x1 - 1, x2 + 4, x3} gt_A(x1,x2) = max{73, x1 - 15, x2 - 6} sum_A(x1) = max{575, x1 + 169} cons_A(x1,x2) = max{20, x1 - 334, x2 - 715} nil_A = 98 true_A = 36 false_A = 0 zero_A = 0 plus#!_A(x1,x2) = max{31, x1 - 3} id!_A(x1) = x1 + 7 s!_A(x1) = x1 + 263 if!_A(x1,x2,x3) = max{87, x1 - 3, x2 - 38, x3 - 20} gt!_A(x1,x2) = max{264, x1 - 18, x2 - 51} sum!_A(x1) = x1 + 261 cons!_A(x1,x2) = max{0, x1 - 407, x2 - 99} nil!_A = 0 true!_A = 0 false!_A = 0 zero!_A = 1 partial status: pi(plus#) = [] pi(id) = [1] pi(s) = [1] pi(if) = [2, 3] pi(gt) = [2] pi(sum) = [1] pi(cons) = [1] pi(nil) = [] pi(true) = [] pi(false) = [] pi(zero) = [] 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: gt#(s(x),s(y)) -> gt#(x,y) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r8: pred(cons(s(x),nil())) -> cons(x,nil()) r9: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r10: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r11: plus(zero(),y) -> y r12: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r13: id(x) -> x r14: if(true(),x,y) -> x r15: if(false(),x,y) -> y r16: not(x) -> if(x,false(),true()) r17: gt(s(x),zero()) -> true() r18: gt(zero(),y) -> false() r19: gt(s(x),s(y)) -> gt(x,y) 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: gt#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 3 gt#!_A(x1,x2) = x1 + x2 s!_A(x1) = x1 + 3 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: gt#_A(x1,x2) = max{0, x1 - 1, x2 - 1} s_A(x1) = max{8, x1} gt#!_A(x1,x2) = max{23, x1 - 9, x2 - 9} s!_A(x1) = x1 + 22 partial status: pi(gt#) = [2] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.