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, r7, 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!): 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() = 2 plus_A(x1,x2) = 1 id_A(x1) = x1 + 5 if_A(x1,x2,x3) = x3 + 4 false_A() = 1 quot#!_A(x1,x2) = x1 + x2 + 4 s!_A(x1) = 10 minus!_A(x1,x2) = 9 |0|!_A() = 0 plus!_A(x1,x2) = x1 + 7 id!_A(x1) = 6 if!_A(x1,x2,x3) = x3 + 6 false!_A() = 12 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: quot#_A(x1,x2) = max{0, x1 - 225, x2 - 144} s_A(x1) = max{142, x1 + 28} minus_A(x1,x2) = max{224, x1 + 28} |0|_A = 201 plus_A(x1,x2) = max{x1 - 172, x2 + 28} id_A(x1) = x1 + 28 if_A(x1,x2,x3) = max{59, x2 + 58, x3 + 30} false_A = 28 quot#!_A(x1,x2) = max{18, x1 - 225, x2 - 9} s!_A(x1) = 21 minus!_A(x1,x2) = 20 |0|!_A = 1 plus!_A(x1,x2) = max{0, x1 - 172} id!_A(x1) = max{25, x1 + 23} if!_A(x1,x2,x3) = max{24, x1 - 1, x2 - 29, x3 - 120} false!_A = 27 partial status: pi(quot#) = [1] pi(s) = [1] pi(minus) = [1] pi(|0|) = [] pi(plus) = [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: 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 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: minus#_A(x1,x2) = x1 s_A(x1) = x1 + 6 minus_A(x1,x2) = x1 + 5 plus_A(x1,x2) = 2 if_A(x1,x2,x3) = x2 + x3 + 1 false_A() = 4 minus#!_A(x1,x2) = x1 + 2 s!_A(x1) = x1 + 3 minus!_A(x1,x2) = x1 + 5 plus!_A(x1,x2) = x1 + 6 if!_A(x1,x2,x3) = x1 false!_A() = 7 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus#_A(x1,x2) = 0 s_A(x1) = 0 minus_A(x1,x2) = 0 plus_A(x1,x2) = max{47, x1 - 58} if_A(x1,x2,x3) = max{x1, x2 - 58, x3} false_A = 1 minus#!_A(x1,x2) = 0 s!_A(x1) = x1 + 1 minus!_A(x1,x2) = max{x1 - 29, x2 + 51} plus!_A(x1,x2) = x1 + 51 if!_A(x1,x2,x3) = max{53, x1 + 30, x2 + 51, x3 - 29} false!_A = 55 partial status: pi(minus#) = [] pi(s) = [] pi(minus) = [1, 2] pi(plus) = [1] pi(if) = [2, 3] pi(false) = [] 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 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) = x2 + 6 sum_A(x1) = 8 nil_A() = 2 plus_A(x1,x2) = x2 + 3 sum#!_A(x1) = 11 app!_A(x1,x2) = x1 + x2 + 2 cons!_A(x1,x2) = 7 sum!_A(x1) = x1 nil!_A() = 9 plus!_A(x1,x2) = 13 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: sum#_A(x1) = 0 app_A(x1,x2) = max{x1 + 19, x2} cons_A(x1,x2) = 0 sum_A(x1) = max{22, x1 + 21} nil_A = 1 plus_A(x1,x2) = max{41, x1, x2} sum#!_A(x1) = max{42, x1 + 21} app!_A(x1,x2) = max{41, x1 + 21} cons!_A(x1,x2) = x2 + 5 sum!_A(x1) = max{3, x1 - 20} nil!_A = 7 plus!_A(x1,x2) = 0 partial status: pi(sum#) = [1] pi(app) = [1, 2] pi(cons) = [] pi(sum) = [1] pi(nil) = [] pi(plus) = [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: 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, 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!): 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 + 2 id_A(x1) = x1 + 6 if_A(x1,x2,x3) = x2 + x3 + 4 true_A() = 1 false_A() = 1 gt_A(x1,x2) = 10 s_A(x1) = 2 zero_A() = 1 sum#!_A(x1) = 1 cons!_A(x1,x2) = 2 plus!_A(x1,x2) = x1 + 3 id!_A(x1) = 7 if!_A(x1,x2,x3) = x1 + x2 true!_A() = 7 false!_A() = 7 gt!_A(x1,x2) = 8 s!_A(x1) = 6 zero!_A() = 8 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: sum#_A(x1) = 0 cons_A(x1,x2) = x2 + 107 plus_A(x1,x2) = max{19, x1 - 35} id_A(x1) = max{7, x1 + 6} if_A(x1,x2,x3) = max{x1 - 1, x2 + 8, x3 + 10} true_A = 1 false_A = 9 gt_A(x1,x2) = 9 s_A(x1) = 0 zero_A = 0 sum#!_A(x1) = 35 cons!_A(x1,x2) = max{69, x2 - 71} plus!_A(x1,x2) = max{393, x1 + 391, x2 + 391} id!_A(x1) = max{392, x1 + 3} if!_A(x1,x2,x3) = max{399, x1 - 5, x3 + 394} true!_A = 1 false!_A = 1 gt!_A(x1,x2) = 2 s!_A(x1) = max{46, x1 + 26} zero!_A = 2 partial status: pi(sum#) = [1] pi(cons) = [2] pi(plus) = [1] pi(id) = [1] pi(if) = [1, 2, 3] pi(true) = [] pi(false) = [] pi(gt) = [] pi(s) = [] 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: 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, r21, r22, r23 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 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 + 1 cons_A(x1,x2) = x2 + 1 nil_A() = 1 true_A() = 1 false_A() = 1 zero_A() = 1 plus#!_A(x1,x2) = 4 s!_A(x1) = 10 id!_A(x1) = x1 + 11 if!_A(x1,x2,x3) = x2 + 5 gt!_A(x1,x2) = 3 not!_A(x1) = x1 + 7 sum!_A(x1) = 10 cons!_A(x1,x2) = 11 nil!_A() = 0 true!_A() = 0 false!_A() = 2 zero!_A() = 1 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 48, x2 - 97} s_A(x1) = x1 + 72 id_A(x1) = max{49, x1 + 18} if_A(x1,x2,x3) = max{24, x2 + 18, x3} gt_A(x1,x2) = max{222, x1 - 73, x2 - 71} not_A(x1) = 150 sum_A(x1) = x1 + 10 cons_A(x1,x2) = max{4, x1 - 116, x2 - 54} nil_A = 3 true_A = 1 false_A = 50 zero_A = 70 plus#!_A(x1,x2) = max{1, x1 - 16, x2 - 75} s!_A(x1) = x1 + 72 id!_A(x1) = max{0, x1 - 1} if!_A(x1,x2,x3) = max{70, x2 - 51} gt!_A(x1,x2) = max{57, x2 - 71} not!_A(x1) = max{71, x1 + 69} sum!_A(x1) = x1 + 46 cons!_A(x1,x2) = max{57, x2 + 55} nil!_A = 3 true!_A = 71 false!_A = 68 zero!_A = 72 partial status: pi(plus#) = [] pi(s) = [1] pi(id) = [1] pi(if) = [2, 3] pi(gt) = [2] pi(not) = [] pi(sum) = [1] pi(cons) = [1, 2] 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: plus#_A(x1,x2) = 0 s_A(x1) = x1 + 1 id_A(x1) = x1 + 1 if_A(x1,x2,x3) = x2 + x3 + 1 gt_A(x1,x2) = x1 + 1 true_A() = 1 false_A() = 1 zero_A() = 1 plus#!_A(x1,x2) = x1 + 3 s!_A(x1) = x1 + 7 id!_A(x1) = x1 + 11 if!_A(x1,x2,x3) = 5 gt!_A(x1,x2) = 3 true!_A() = 2 false!_A() = 0 zero!_A() = 3 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = 0 s_A(x1) = x1 + 30 id_A(x1) = x1 + 30 if_A(x1,x2,x3) = max{28, x1 - 2, x2 + 14, x3} gt_A(x1,x2) = max{x1 + 107, x2 + 51} true_A = 138 false_A = 52 zero_A = 87 plus#!_A(x1,x2) = max{82, x2 + 1} s!_A(x1) = 0 id!_A(x1) = 2 if!_A(x1,x2,x3) = max{228, x1 - 52, x2 + 139, x3 - 31} gt!_A(x1,x2) = max{x1 + 139, x2 + 139} true!_A = 0 false!_A = 226 zero!_A = 227 partial status: pi(plus#) = [] pi(s) = [] pi(id) = [1] pi(if) = [1, 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: app#_A(x1,x2) = 0 cons_A(x1,x2) = 1 app#!_A(x1,x2) = 0 cons!_A(x1,x2) = 2 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = 0 cons_A(x1,x2) = max{3, x1 - 1, x2 - 88} app#!_A(x1,x2) = x2 + 36 cons!_A(x1,x2) = max{x1 + 33, x2 + 34} partial status: pi(app#) = [1] 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: gt#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 6 gt#!_A(x1,x2) = x1 + x2 s!_A(x1) = 14 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: gt#_A(x1,x2) = 0 s_A(x1) = max{21, x1 - 5} gt#!_A(x1,x2) = 5 s!_A(x1) = 4 partial status: pi(gt#) = [1] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.