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(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),s(y)) -> plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) p5: plus#(s(x),s(y)) -> if#(gt(x,y),x,y) p6: plus#(s(x),s(y)) -> gt#(x,y) p7: plus#(s(x),s(y)) -> if#(not(gt(x,y)),id(x),id(y)) p8: plus#(s(x),s(y)) -> not#(gt(x,y)) p9: plus#(s(x),s(y)) -> id#(x) p10: plus#(s(x),s(y)) -> id#(y) p11: plus#(s(x),x) -> plus#(if(gt(x,x),id(x),id(x)),s(x)) p12: plus#(s(x),x) -> if#(gt(x,x),id(x),id(x)) p13: plus#(s(x),x) -> gt#(x,x) p14: plus#(s(x),x) -> id#(x) p15: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),y,s(y))) p16: plus#(id(x),s(y)) -> if#(gt(s(y),y),y,s(y)) p17: plus#(id(x),s(y)) -> gt#(s(y),y) p18: not#(x) -> if#(x,false(),true()) p19: 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(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r6: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r7: plus(zero(),y) -> y r8: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r9: id(x) -> x r10: if(true(),x,y) -> x r11: if(false(),x,y) -> y r12: not(x) -> if(x,false(),true()) r13: gt(s(x),zero()) -> true() r14: gt(zero(),y) -> false() r15: gt(s(x),s(y)) -> gt(x,y) The estimated dependency graph contains the following SCCs: {p2} {p1} {p4, p11, p15} {p19} -- 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(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r6: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r7: plus(zero(),y) -> y r8: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r9: id(x) -> x r10: if(true(),x,y) -> x r11: if(false(),x,y) -> y r12: not(x) -> if(x,false(),true()) r13: gt(s(x),zero()) -> true() r14: gt(zero(),y) -> false() r15: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r1, r2 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: quot#_A(x1,x2) = x1 + 1 s_A(x1) = max{30, x1 + 9} minus_A(x1,x2) = max{23, x1 + 7} |0|_A = 10 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: quot#_A(x1,x2) = max{14, x1 - 70, x2 - 70} s_A(x1) = max{69, x1 + 12} minus_A(x1,x2) = max{84, x1 + 12, x2 - 31} |0|_A = 96 quot#!_A(x1,x2) = max{0, x2 - 70} s!_A(x1) = max{0, x1 - 213} minus!_A(x1,x2) = max{0, x1 - 213} |0|!_A = 0 partial status: pi(quot#) = [1] pi(s) = [1] pi(minus) = [] 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: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r6: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r7: plus(zero(),y) -> y r8: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r9: id(x) -> x r10: if(true(),x,y) -> x r11: if(false(),x,y) -> y r12: not(x) -> if(x,false(),true()) r13: gt(s(x),zero()) -> true() r14: gt(zero(),y) -> false() r15: 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: max/plus interpretation on natural numbers: minus#_A(x1,x2) = 0 s_A(x1) = max{8, x1 - 23} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus#_A(x1,x2) = max{0, x1 - 15, x2 - 15} s_A(x1) = x1 + 14 minus#!_A(x1,x2) = max{3, x1 - 10, x2 - 45} s!_A(x1) = max{2, x1 - 46} 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: 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: 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(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r6: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r7: plus(zero(),y) -> y r8: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r9: id(x) -> x r10: if(true(),x,y) -> x r11: if(false(),x,y) -> y r12: not(x) -> if(x,false(),true()) r13: gt(s(x),zero()) -> true() r14: gt(zero(),y) -> false() r15: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r9, r10, r11, r12, r13, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: plus#_A(x1,x2) = 0 s_A(x1) = max{21, x1} if_A(x1,x2,x3) = max{120, x1 + 84, x2 + 7, x3 + 30} gt_A(x1,x2) = max{3, x1 - 6, x2 - 206} not_A(x1) = x1 + 121 id_A(x1) = x1 + 44 true_A = 4 false_A = 2 zero_A = 5 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 75, x2 - 115} s_A(x1) = x1 + 74 if_A(x1,x2,x3) = max{35, x1 - 9, x2 + 10, x3} gt_A(x1,x2) = max{56, x1 - 81, x2 + 37} not_A(x1) = max{56, x1 + 4} id_A(x1) = x1 + 64 true_A = 47 false_A = 0 zero_A = 0 plus#!_A(x1,x2) = max{13, x1 - 7, x2 - 33} s!_A(x1) = max{0, x1 - 6} if!_A(x1,x2,x3) = max{67, x1, x2, x3 - 47} gt!_A(x1,x2) = max{68, x1 - 81, x2 - 1} not!_A(x1) = max{67, x1 - 1} id!_A(x1) = 0 true!_A = 0 false!_A = 0 zero!_A = 1 partial status: pi(plus#) = [] pi(s) = [] pi(if) = [] pi(gt) = [] pi(not) = [] pi(id) = [] 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))) p2: plus#(s(x),x) -> plus#(if(gt(x,x),id(x),id(x)),s(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: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r6: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r7: plus(zero(),y) -> y r8: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r9: id(x) -> x r10: if(true(),x,y) -> x r11: if(false(),x,y) -> y r12: not(x) -> if(x,false(),true()) r13: gt(s(x),zero()) -> true() r14: gt(zero(),y) -> false() r15: 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#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),y,s(y))) p2: plus#(s(x),x) -> plus#(if(gt(x,x),id(x),id(x)),s(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: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r6: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r7: plus(zero(),y) -> y r8: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r9: id(x) -> x r10: if(true(),x,y) -> x r11: if(false(),x,y) -> y r12: not(x) -> if(x,false(),true()) r13: gt(s(x),zero()) -> true() r14: gt(zero(),y) -> false() r15: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r9, r10, r11, r13, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{3, x1 - 12} id_A(x1) = x1 + 13 s_A(x1) = x1 + 32 if_A(x1,x2,x3) = max{x1 - 134, x2 + 6, x3 + 4} gt_A(x1,x2) = max{15, x1 - 33, x2 - 185} true_A = 12 false_A = 0 zero_A = 32 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 79, x2 - 79} id_A(x1) = max{69, x1} s_A(x1) = x1 + 78 if_A(x1,x2,x3) = max{44, x1 - 42, x2, x3} gt_A(x1,x2) = max{42, x1 - 109, x2 - 79} true_A = 42 false_A = 42 zero_A = 78 plus#!_A(x1,x2) = max{19, x1 - 152, x2 - 141} id!_A(x1) = 17 s!_A(x1) = 17 if!_A(x1,x2,x3) = max{18, x1 - 104, x2 - 144, x3 - 144} gt!_A(x1,x2) = max{3, x1 - 142, x2 - 142} true!_A = 1 false!_A = 0 zero!_A = 2 partial status: pi(plus#) = [] pi(id) = [1] pi(s) = [] pi(if) = [2, 3] pi(gt) = [] pi(true) = [] pi(false) = [] pi(zero) = [] The following rules are removed: p2 -- 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: 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(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r6: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r7: plus(zero(),y) -> y r8: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r9: id(x) -> x r10: if(true(),x,y) -> x r11: if(false(),x,y) -> y r12: not(x) -> if(x,false(),true()) r13: gt(s(x),zero()) -> true() r14: gt(zero(),y) -> false() r15: 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: 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(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r6: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r7: plus(zero(),y) -> y r8: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r9: id(x) -> x r10: if(true(),x,y) -> x r11: if(false(),x,y) -> y r12: not(x) -> if(x,false(),true()) r13: gt(s(x),zero()) -> true() r14: gt(zero(),y) -> false() r15: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r10, r11, r13, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: plus#_A(x1,x2) = 1 id_A(x1) = max{44, x1 - 202} s_A(x1) = max{190, x1 + 47} if_A(x1,x2,x3) = max{95, x1 - 12, x2 + 51, x3 + 4} gt_A(x1,x2) = max{10, x1 - 25, x2 - 199} true_A = 23 false_A = 0 zero_A = 24 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 15, x2 - 5} id_A(x1) = x1 + 3 s_A(x1) = x1 + 4 if_A(x1,x2,x3) = max{x1 - 1, x2, x3} gt_A(x1,x2) = max{1, x1 - 9, x2 - 5} true_A = 1 false_A = 1 zero_A = 0 plus#!_A(x1,x2) = max{1, x1 - 1} id!_A(x1) = max{3, x1 - 44} s!_A(x1) = 4 if!_A(x1,x2,x3) = max{5, x1 - 6, x2 - 5, x3 - 5} gt!_A(x1,x2) = max{3, x1 - 22, x2 - 22} true!_A = 1 false!_A = 0 zero!_A = 2 partial status: pi(plus#) = [] pi(id) = [] pi(s) = [1] pi(if) = [] pi(gt) = [] 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: 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(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r6: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r7: plus(zero(),y) -> y r8: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r9: id(x) -> x r10: if(true(),x,y) -> x r11: if(false(),x,y) -> y r12: not(x) -> if(x,false(),true()) r13: gt(s(x),zero()) -> true() r14: gt(zero(),y) -> false() r15: 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: max/plus interpretation on natural numbers: gt#_A(x1,x2) = 0 s_A(x1) = max{4, x1 - 11} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: gt#_A(x1,x2) = max{0, x1 - 10, x2 - 10} s_A(x1) = x1 + 9 gt#!_A(x1,x2) = max{3, x1 + 1, x2 - 10} s!_A(x1) = max{2, x1 - 34} partial status: pi(gt#) = [] pi(s) = [] The following rules are removed: p1 Then no dependency pair remains.