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 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!): max/plus interpretation on natural numbers: sum#_A(x1) = max{19, x1 - 38} app_A(x1,x2) = max{37, x1 + 31, x2 + 25} cons_A(x1,x2) = max{5, x2} sum_A(x1) = 32 nil_A = 32 plus_A(x1,x2) = max{3, x1 - 30, x2} sum#!_A(x1) = max{4, x1 - 31} app!_A(x1,x2) = max{27, x1} cons!_A(x1,x2) = 2 sum!_A(x1) = 3 nil!_A = 0 plus!_A(x1,x2) = max{6, x2 - 6} 2. 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) = x2 + 3 sum_A(x1) = 4 nil_A() = 1 plus_A(x1,x2) = x1 + 1 sum#!_A(x1) = 4 app!_A(x1,x2) = x1 + x2 + 1 cons!_A(x1,x2) = 3 sum!_A(x1) = 1 nil!_A() = 2 plus!_A(x1,x2) = x1 + 4 partial status: pi(sum#) = [1] pi(app) = [1, 2] pi(cons) = [] pi(sum) = [] pi(nil) = [] pi(plus) = [1, 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: 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!): max/plus interpretation on natural numbers: app#_A(x1,x2) = max{0, x1 - 13} cons_A(x1,x2) = max{x1 + 12, x2 + 12} app#!_A(x1,x2) = max{5, x1 - 13, x2 - 1} cons!_A(x1,x2) = max{4, x1 - 170} 2. 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) = x2 + 4 app#!_A(x1,x2) = x1 cons!_A(x1,x2) = 12 partial status: pi(app#) = [] 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 r13, 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!): max/plus interpretation on natural numbers: sum#_A(x1) = 0 cons_A(x1,x2) = max{15, x2 + 9} plus_A(x1,x2) = max{11, x2 - 16} id_A(x1) = x1 + 210 gt_A(x1,x2) = 291 s_A(x1) = 28 zero_A = 0 true_A = 1 false_A = 211 sum#!_A(x1) = max{1, x1 - 13} cons!_A(x1,x2) = x2 + 6 plus!_A(x1,x2) = 0 id!_A(x1) = max{0, x1 - 1} gt!_A(x1,x2) = 0 s!_A(x1) = 0 zero!_A = 1 true!_A = 0 false!_A = 0 2. 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) = 4 plus_A(x1,x2) = x2 + 1 id_A(x1) = x1 + 1 gt_A(x1,x2) = x1 + 1 s_A(x1) = x1 + 1 zero_A() = 1 true_A() = 1 false_A() = 1 sum#!_A(x1) = 6 cons!_A(x1,x2) = x2 + 7 plus!_A(x1,x2) = 12 id!_A(x1) = 11 gt!_A(x1,x2) = 2 s!_A(x1) = 3 zero!_A() = 1 true!_A() = 0 false!_A() = 0 partial status: pi(sum#) = [] pi(cons) = [2] pi(plus) = [1] pi(id) = [1] pi(gt) = [] pi(s) = [] pi(zero) = [] pi(true) = [] pi(false) = [] 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, 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!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 53, x2 - 54} s_A(x1) = x1 + 55 if_A(x1,x2,x3) = max{x2 + 11, x3} gt_A(x1,x2) = max{54, x2 - 57} not_A(x1) = 53 id_A(x1) = max{22, x1 + 17} true_A = 56 false_A = 1 zero_A = 113 plus#!_A(x1,x2) = max{3, x1, x2 - 55} s!_A(x1) = 32 if!_A(x1,x2,x3) = x2 + 65 gt!_A(x1,x2) = max{2, x2 - 52} not!_A(x1) = max{65, x1 - 55} id!_A(x1) = x1 + 65 true!_A = 3 false!_A = 1 zero!_A = 4 2. 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) = 3 if_A(x1,x2,x3) = x2 + x3 + 1 gt_A(x1,x2) = 3 not_A(x1) = 5 id_A(x1) = x1 + 2 true_A() = 1 false_A() = 3 zero_A() = 1 plus#!_A(x1,x2) = 0 s!_A(x1) = 1 if!_A(x1,x2,x3) = x2 + 2 gt!_A(x1,x2) = x2 + 2 not!_A(x1) = 4 id!_A(x1) = x1 + 4 true!_A() = 0 false!_A() = 0 zero!_A() = 1 partial status: pi(plus#) = [] pi(s) = [1] pi(if) = [2, 3] pi(gt) = [2] 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, 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!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 83, x2 - 18} s_A(x1) = x1 + 81 if_A(x1,x2,x3) = max{17, x1 - 98, x2, x3} gt_A(x1,x2) = max{x1 - 82, x2 + 119} not_A(x1) = max{17, x1 - 2} id_A(x1) = max{24, x1 + 15} true_A = 1 false_A = 1 zero_A = 0 plus#!_A(x1,x2) = max{x1 + 67, x2 + 132} s!_A(x1) = max{3, x1 - 81} if!_A(x1,x2,x3) = max{x1 + 95, x2 + 214, x3 + 198} gt!_A(x1,x2) = max{x1 + 67, x2 - 82} not!_A(x1) = x1 + 231 id!_A(x1) = max{197, x1 - 13} true!_A = 2 false!_A = 66 zero!_A = 67 2. 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) = 7 if_A(x1,x2,x3) = x2 + x3 + 8 gt_A(x1,x2) = 1 not_A(x1) = x1 + 10 id_A(x1) = x1 + 7 true_A() = 1 false_A() = 1 zero_A() = 1 plus#!_A(x1,x2) = 4 s!_A(x1) = 6 if!_A(x1,x2,x3) = x2 + 3 gt!_A(x1,x2) = 3 not!_A(x1) = 5 id!_A(x1) = x1 + 8 true!_A() = 0 false!_A() = 0 zero!_A() = 1 partial status: pi(plus#) = [] pi(s) = [] pi(if) = [2, 3] pi(gt) = [] pi(not) = [1] 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 (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!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 51} id_A(x1) = max{50, x1 + 25} s_A(x1) = x1 + 25 if_A(x1,x2,x3) = max{43, x1 - 1, x2, x3 - 25} gt_A(x1,x2) = max{x1 - 24, x2 + 1} plus#!_A(x1,x2) = max{24, x1 - 25} id!_A(x1) = x1 + 23 s!_A(x1) = 22 if!_A(x1,x2,x3) = x3 + 77 gt!_A(x1,x2) = 2 2. 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 id_A(x1) = 10 s_A(x1) = x1 + 1 if_A(x1,x2,x3) = x3 + 9 gt_A(x1,x2) = x2 + 1 plus#!_A(x1,x2) = 10 id!_A(x1) = 11 s!_A(x1) = 7 if!_A(x1,x2,x3) = 9 gt!_A(x1,x2) = x2 + 5 partial status: pi(plus#) = [1] pi(id) = [1] pi(s) = [1] pi(if) = [1, 2, 3] pi(gt) = [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: 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 r11 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!): max/plus interpretation on natural numbers: gt#_A(x1,x2) = max{0, x1 - 137, x2 - 137} s_A(x1) = x1 + 136 plus_A(x1,x2) = max{x1 - 1382, x2 + 314} zero_A = 37 gt#!_A(x1,x2) = max{36, x2 - 1} s!_A(x1) = x1 + 35 plus!_A(x1,x2) = max{311, x2 + 310} zero!_A = 1 2. 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 + 5 plus_A(x1,x2) = x2 + 1 zero_A() = 1 gt#!_A(x1,x2) = x1 + x2 s!_A(x1) = 13 plus!_A(x1,x2) = x1 + 9 zero!_A() = 1 partial status: pi(gt#) = [1] pi(s) = [1] pi(plus) = [2] pi(zero) = [] The following rules are removed: p1 Then no dependency pair remains.