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))) plus(|0|(),y) -> y plus(s(x),y) -> s(plus(x,y)) minus(minus(x,y),z) -> minus(x,plus(y,z)) 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))))) 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: 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: plus#(s(x),y) -> plus#(x,y) p5: minus#(minus(x,y),z) -> minus#(x,plus(y,z)) p6: minus#(minus(x,y),z) -> plus#(y,z) p7: app#(cons(x,l),k) -> app#(l,k) p8: sum#(cons(x,cons(y,l))) -> sum#(cons(plus(x,y),l)) p9: sum#(cons(x,cons(y,l))) -> plus#(x,y) p10: sum#(app(l,cons(x,cons(y,k)))) -> sum#(app(l,sum(cons(x,cons(y,k))))) p11: sum#(app(l,cons(x,cons(y,k)))) -> app#(l,sum(cons(x,cons(y,k)))) p12: sum#(app(l,cons(x,cons(y,k)))) -> sum#(cons(x,cons(y,k))) p13: plus#(s(x),s(y)) -> plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) p14: plus#(s(x),s(y)) -> if#(gt(x,y),x,y) p15: plus#(s(x),s(y)) -> gt#(x,y) p16: plus#(s(x),s(y)) -> if#(not(gt(x,y)),id(x),id(y)) p17: plus#(s(x),s(y)) -> not#(gt(x,y)) p18: plus#(s(x),s(y)) -> id#(x) p19: plus#(s(x),s(y)) -> id#(y) p20: plus#(s(x),x) -> plus#(if(gt(x,x),id(x),id(x)),s(x)) p21: plus#(s(x),x) -> if#(gt(x,x),id(x),id(x)) p22: plus#(s(x),x) -> gt#(x,x) p23: plus#(s(x),x) -> id#(x) p24: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),y,s(y))) p25: plus#(id(x),s(y)) -> if#(gt(s(y),y),y,s(y)) p26: plus#(id(x),s(y)) -> gt#(s(y),y) p27: not#(x) -> if#(x,false(),true()) p28: gt#(s(x),s(y)) -> gt#(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: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r14: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r15: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r16: plus(zero(),y) -> y r17: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r18: id(x) -> x r19: if(true(),x,y) -> x r20: if(false(),x,y) -> y r21: not(x) -> if(x,false(),true()) r22: gt(s(x),zero()) -> true() r23: gt(zero(),y) -> false() r24: gt(s(x),s(y)) -> gt(x,y) The estimated dependency graph contains the following SCCs: {p2} {p1, p5} {p10} {p8} {p4, p13, p20, p24} {p7} {p28} -- 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: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r14: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r15: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r16: plus(zero(),y) -> y r17: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r18: id(x) -> x r19: if(true(),x,y) -> x r20: if(false(),x,y) -> y r21: not(x) -> if(x,false(),true()) r22: gt(s(x),zero()) -> true() r23: gt(zero(),y) -> false() r24: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r1, r2, r5, r7, r16, 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: quot#_A(x1,x2) = max{0, x1 - 294, x2 - 166} s_A(x1) = x1 + 166 minus_A(x1,x2) = max{293, x1 + 83} |0|_A = 208 plus_A(x1,x2) = max{40, x1 - 85, x2 + 39} zero_A = 10 if_A(x1,x2,x3) = max{1, x1 - 206, x2} true_A = 372 quot#!_A(x1,x2) = max{0, x1 - 292} s!_A(x1) = max{452, x1 - 124} minus!_A(x1,x2) = max{0, x1 - 125} |0|!_A = 1 plus!_A(x1,x2) = x1 + 286 zero!_A = 7 if!_A(x1,x2,x3) = max{451, x1 - 207} true!_A = 8 2. 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 + 5 minus_A(x1,x2) = x1 + 1 |0|_A() = 2 plus_A(x1,x2) = x2 + 5 zero_A() = 1 if_A(x1,x2,x3) = x2 + 2 true_A() = 3 quot#!_A(x1,x2) = 14 s!_A(x1) = 15 minus!_A(x1,x2) = x1 + 16 |0|!_A() = 0 plus!_A(x1,x2) = x1 + x2 + 11 zero!_A() = 15 if!_A(x1,x2,x3) = 12 true!_A() = 14 partial status: pi(quot#) = [1] pi(s) = [1] pi(minus) = [1] pi(|0|) = [] pi(plus) = [2] pi(zero) = [] pi(if) = [1, 2] pi(true) = [] 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) p2: minus#(minus(x,y),z) -> minus#(x,plus(y,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: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r14: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r15: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r16: plus(zero(),y) -> y r17: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r18: id(x) -> x r19: if(true(),x,y) -> x r20: if(false(),x,y) -> y r21: not(x) -> if(x,false(),true()) r22: gt(s(x),zero()) -> true() r23: gt(zero(),y) -> false() r24: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r1, 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: minus#_A(x1,x2) = max{0, x1 - 97} s_A(x1) = max{72, x1 + 28} minus_A(x1,x2) = max{x1 + 96, x2 + 96} plus_A(x1,x2) = max{x1 - 97, x2 + 28} |0|_A = 96 if_A(x1,x2,x3) = max{24, x1 - 85, x2 + 17} true_A = 29 minus#!_A(x1,x2) = max{139, x1 - 73} s!_A(x1) = 137 minus!_A(x1,x2) = max{91, x2 + 64} plus!_A(x1,x2) = max{138, x1 - 25, x2 + 65} |0|!_A = 93 if!_A(x1,x2,x3) = max{143, x1 - 45, x2 - 73} true!_A = 137 2. 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 s_A(x1) = x1 + 4 minus_A(x1,x2) = x1 + 6 plus_A(x1,x2) = x1 + x2 + 1 |0|_A() = 2 if_A(x1,x2,x3) = x2 + 3 true_A() = 3 minus#!_A(x1,x2) = x1 s!_A(x1) = 9 minus!_A(x1,x2) = x1 + 1 plus!_A(x1,x2) = x1 + 8 |0|!_A() = 0 if!_A(x1,x2,x3) = 13 true!_A() = 8 partial status: pi(minus#) = [] pi(s) = [] pi(minus) = [1] pi(plus) = [] pi(|0|) = [] pi(if) = [2] pi(true) = [] The following rules are removed: p1, p2 Then no dependency pair remains. -- 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: 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: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r14: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r15: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r16: plus(zero(),y) -> y r17: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r18: id(x) -> x r19: if(true(),x,y) -> x r20: if(false(),x,y) -> y r21: not(x) -> if(x,false(),true()) r22: gt(s(x),zero()) -> true() r23: gt(zero(),y) -> false() r24: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r8, r9, r10, r11, r12, r13 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 app_A(x1,x2) = max{x1 + 3, x2 + 13} cons_A(x1,x2) = max{8, x2} sum_A(x1) = 8 nil_A = 7 plus_A(x1,x2) = max{26, x2} sum#!_A(x1) = max{10, x1 - 2} app!_A(x1,x2) = max{x1 + 20, x2 + 14} cons!_A(x1,x2) = max{4, x2} sum!_A(x1) = max{6, x1} nil!_A = 5 plus!_A(x1,x2) = max{43, x1 + 26} 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 + 4 sum_A(x1) = 5 nil_A() = 1 plus_A(x1,x2) = x1 + 3 sum#!_A(x1) = 10 app!_A(x1,x2) = x1 + x2 cons!_A(x1,x2) = x2 + 2 sum!_A(x1) = x1 + 1 nil!_A() = 0 plus!_A(x1,x2) = x1 + 10 partial status: pi(sum#) = [1] pi(app) = [1, 2] pi(cons) = [2] pi(sum) = [1] pi(nil) = [] pi(plus) = [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: 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: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r14: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r15: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r16: plus(zero(),y) -> y r17: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r18: id(x) -> x r19: if(true(),x,y) -> x r20: if(false(),x,y) -> y r21: not(x) -> if(x,false(),true()) r22: gt(s(x),zero()) -> true() r23: gt(zero(),y) -> false() r24: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r18, r20 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{0, x1 - 69} cons_A(x1,x2) = max{31, x2 + 6} plus_A(x1,x2) = max{6, x1 - 19, x2 - 19} id_A(x1) = x1 if_A(x1,x2,x3) = max{x1 + 1, x2, x3 + 12} false_A = 32 sum#!_A(x1) = max{30, x1 - 7} cons!_A(x1,x2) = max{4, x2 + 1} plus!_A(x1,x2) = 0 id!_A(x1) = x1 + 2 if!_A(x1,x2,x3) = max{x1 + 30, x2 - 1, x3 + 18} false!_A = 33 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) = 2 plus_A(x1,x2) = x1 + x2 + 3 id_A(x1) = x1 + 1 if_A(x1,x2,x3) = x3 + 1 false_A() = 2 sum#!_A(x1) = 1 cons!_A(x1,x2) = 2 plus!_A(x1,x2) = 0 id!_A(x1) = 8 if!_A(x1,x2,x3) = 9 false!_A() = 10 partial status: pi(sum#) = [1] pi(cons) = [2] pi(plus) = [1, 2] pi(id) = [1] pi(if) = [1, 2, 3] 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),y) -> plus#(x,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)) p4: plus#(s(x),s(y)) -> plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(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: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r14: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r15: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r16: plus(zero(),y) -> y r17: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r18: id(x) -> x r19: if(true(),x,y) -> x r20: if(false(),x,y) -> y r21: not(x) -> if(x,false(),true()) r22: gt(s(x),zero()) -> true() r23: gt(zero(),y) -> false() r24: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r11, r18, r19, r20, r22, r23, r24 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 - 316, x2 - 372} s_A(x1) = max{86, x1 + 62} id_A(x1) = x1 + 5 if_A(x1,x2,x3) = max{62, x2, x3} gt_A(x1,x2) = max{31, x1 - 336, x2 - 93} not_A(x1) = max{62, x1 - 186} sum_A(x1) = max{181, x1 + 51} cons_A(x1,x2) = x1 + 102 nil_A = 91 true_A = 2 false_A = 31 zero_A = 92 plus#!_A(x1,x2) = max{247, x1 + 243, x2 + 240} s!_A(x1) = max{325, x1 + 243} id!_A(x1) = max{24, x1 + 2} if!_A(x1,x2,x3) = max{331, x2 + 300, x3 + 329} gt!_A(x1,x2) = max{1, x2 - 87} not!_A(x1) = max{330, x1 - 32} sum!_A(x1) = x1 + 129 cons!_A(x1,x2) = 23 nil!_A = 22 true!_A = 4 false!_A = 2 zero!_A = 3 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 id_A(x1) = x1 + 1 if_A(x1,x2,x3) = x2 + x3 + 1 gt_A(x1,x2) = 1 not_A(x1) = 3 sum_A(x1) = x1 + 4 cons_A(x1,x2) = x1 + x2 + 1 nil_A() = 0 true_A() = 1 false_A() = 1 zero_A() = 1 plus#!_A(x1,x2) = 10 s!_A(x1) = x1 + 7 id!_A(x1) = 4 if!_A(x1,x2,x3) = 9 gt!_A(x1,x2) = 5 not!_A(x1) = 8 sum!_A(x1) = 7 cons!_A(x1,x2) = 5 nil!_A() = 0 true!_A() = 4 false!_A() = 6 zero!_A() = 3 partial status: pi(plus#) = [] pi(s) = [1] pi(id) = [1] pi(if) = [2, 3] pi(gt) = [1, 2] pi(not) = [1] pi(sum) = [1] pi(cons) = [1] pi(nil) = [] pi(true) = [] pi(false) = [] pi(zero) = [] The following rules are removed: p3, p4 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: plus#(s(x),y) -> plus#(x,y) p2: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),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: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r14: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r15: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r16: plus(zero(),y) -> y r17: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r18: id(x) -> x r19: if(true(),x,y) -> x r20: if(false(),x,y) -> y r21: not(x) -> if(x,false(),true()) r22: gt(s(x),zero()) -> true() r23: gt(zero(),y) -> false() r24: 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),y) -> plus#(x,y) p2: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),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: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r14: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r15: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r16: plus(zero(),y) -> y r17: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r18: id(x) -> x r19: if(true(),x,y) -> x r20: if(false(),x,y) -> y r21: not(x) -> if(x,false(),true()) r22: gt(s(x),zero()) -> true() r23: gt(zero(),y) -> false() r24: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r19, r20, r22, r23, r24 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 - 255, x2 - 142} s_A(x1) = max{131, x1 + 91} id_A(x1) = max{110, x1 + 29} if_A(x1,x2,x3) = max{141, x1 - 1, x2 + 63, x3} gt_A(x1,x2) = max{64, x1 - 132, x2 - 92} true_A = 36 false_A = 64 zero_A = 0 plus#!_A(x1,x2) = max{77, x1 - 132, x2 - 64} s!_A(x1) = max{77, x1 - 2} id!_A(x1) = max{0, x1 - 388} if!_A(x1,x2,x3) = max{14, x1 + 2, x3 - 115} gt!_A(x1,x2) = max{84, x1 - 5} true!_A = 85 false!_A = 1 zero!_A = 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) = x1 s_A(x1) = x1 + 6 id_A(x1) = x1 + 1 if_A(x1,x2,x3) = x2 + x3 + 7 gt_A(x1,x2) = x1 + 1 true_A() = 1 false_A() = 1 zero_A() = 2 plus#!_A(x1,x2) = x1 + 17 s!_A(x1) = x1 + 14 id!_A(x1) = 11 if!_A(x1,x2,x3) = x2 + 12 gt!_A(x1,x2) = x2 + 17 true!_A() = 18 false!_A() = 18 zero!_A() = 19 partial status: pi(plus#) = [2] pi(s) = [1] pi(id) = [] pi(if) = [2, 3] pi(gt) = [] pi(true) = [] pi(false) = [] pi(zero) = [] The following rules are removed: p1, p2 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: 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: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r14: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r15: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r16: plus(zero(),y) -> y r17: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r18: id(x) -> x r19: if(true(),x,y) -> x r20: if(false(),x,y) -> y r21: not(x) -> if(x,false(),true()) r22: gt(s(x),zero()) -> true() r23: gt(zero(),y) -> false() r24: 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 - 11} cons_A(x1,x2) = max{x1 - 23, x2 + 10} app#!_A(x1,x2) = x1 + 27 cons!_A(x1,x2) = x2 + 26 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) = x1 + x2 + 1 app#!_A(x1,x2) = x1 + 3 cons!_A(x1,x2) = x2 + 2 partial status: pi(app#) = [] pi(cons) = [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: gt#(s(x),s(y)) -> gt#(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: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r14: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r15: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r16: plus(zero(),y) -> y r17: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r18: id(x) -> x r19: if(true(),x,y) -> x r20: if(false(),x,y) -> y r21: not(x) -> if(x,false(),true()) r22: gt(s(x),zero()) -> true() r23: gt(zero(),y) -> false() r24: 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: gt#_A(x1,x2) = 0 s_A(x1) = 102 gt#!_A(x1,x2) = 234 s!_A(x1) = 233 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 + 8 gt#!_A(x1,x2) = x1 + x2 + 17 s!_A(x1) = x1 + 16 partial status: pi(gt#) = [] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.