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))) minus(minus(x,y),z) -> minus(x,plus(y,z)) 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: minus#(minus(x,y),z) -> minus#(x,plus(y,z)) p5: minus#(minus(x,y),z) -> plus#(y,z) p6: plus#(s(x),s(y)) -> plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) p7: plus#(s(x),s(y)) -> if#(gt(x,y),x,y) p8: plus#(s(x),s(y)) -> gt#(x,y) p9: plus#(s(x),s(y)) -> if#(not(gt(x,y)),id(x),id(y)) p10: plus#(s(x),s(y)) -> not#(gt(x,y)) p11: plus#(s(x),s(y)) -> id#(x) p12: plus#(s(x),s(y)) -> id#(y) p13: plus#(s(x),x) -> plus#(if(gt(x,x),id(x),id(x)),s(x)) p14: plus#(s(x),x) -> if#(gt(x,x),id(x),id(x)) p15: plus#(s(x),x) -> gt#(x,x) p16: plus#(s(x),x) -> id#(x) p17: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),y,s(y))) p18: plus#(id(x),s(y)) -> if#(gt(s(y),y),y,s(y)) p19: plus#(id(x),s(y)) -> gt#(s(y),y) p20: not#(x) -> if#(x,false(),true()) p21: 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: minus(minus(x,y),z) -> minus(x,plus(y,z)) r6: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r7: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r8: plus(zero(),y) -> y r9: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r10: id(x) -> x r11: if(true(),x,y) -> x r12: if(false(),x,y) -> y r13: not(x) -> if(x,false(),true()) r14: gt(s(x),zero()) -> true() r15: gt(zero(),y) -> false() r16: gt(s(x),s(y)) -> gt(x,y) The estimated dependency graph contains the following SCCs: {p2} {p1, p4} {p6, p13, p17} {p21} -- 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: minus(minus(x,y),z) -> minus(x,plus(y,z)) r6: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r7: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r8: plus(zero(),y) -> y r9: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r10: id(x) -> x r11: if(true(),x,y) -> x r12: if(false(),x,y) -> y r13: not(x) -> if(x,false(),true()) r14: gt(s(x),zero()) -> true() r15: gt(zero(),y) -> false() r16: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r1, r2, r5, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: quot#_A(x1,x2) = 0 s_A(x1) = max{37, x1 + 5} minus_A(x1,x2) = max{27, x1 + 5} |0|_A = 4 plus_A(x1,x2) = max{31, x1 + 7} gt_A(x1,x2) = max{45, x2 - 3} zero_A = 2 true_A = 1 false_A = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: quot#_A(x1,x2) = max{0, x2 - 37} s_A(x1) = max{41, x1 + 38} minus_A(x1,x2) = max{39, x1} |0|_A = 42 plus_A(x1,x2) = max{1, x1 - 29, x2 - 40} gt_A(x1,x2) = max{12, x1 - 85, x2 - 2} zero_A = 43 true_A = 41 false_A = 12 quot#!_A(x1,x2) = max{36, x1 - 1} s!_A(x1) = 0 minus!_A(x1,x2) = 0 |0|!_A = 2 plus!_A(x1,x2) = max{68, x1 + 63, x2 + 63} gt!_A(x1,x2) = max{105, x1 + 1, x2 - 44} zero!_A = 46 true!_A = 0 false!_A = 45 partial status: pi(quot#) = [] pi(s) = [] pi(minus) = [] pi(|0|) = [] pi(plus) = [1] pi(gt) = [] 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: 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: minus(minus(x,y),z) -> minus(x,plus(y,z)) r6: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r7: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r8: plus(zero(),y) -> y r9: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r10: id(x) -> x r11: if(true(),x,y) -> x r12: if(false(),x,y) -> y r13: not(x) -> if(x,false(),true()) r14: gt(s(x),zero()) -> true() r15: gt(zero(),y) -> false() r16: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16 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{10, x1} minus_A(x1,x2) = max{20, x1 - 22, x2 - 20} plus_A(x1,x2) = max{17, x1 + 7, x2 + 7} if_A(x1,x2,x3) = max{1, x1 - 10, x2, x3} gt_A(x1,x2) = max{6, x1 - 14, x2 - 11} not_A(x1) = max{2, x1 - 7} id_A(x1) = max{2, x1} zero_A = 13 true_A = 1 false_A = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus#_A(x1,x2) = max{0, x1 - 27, x2 - 36} s_A(x1) = max{7, x1} minus_A(x1,x2) = max{26, x1 + 1, x2 - 9} plus_A(x1,x2) = max{8, x1, x2} if_A(x1,x2,x3) = max{8, x1 - 23, x2, x3} gt_A(x1,x2) = max{x1, x2 + 1} not_A(x1) = max{16, x1 - 1} id_A(x1) = max{5, x1} zero_A = 7 true_A = 8 false_A = 2 minus#!_A(x1,x2) = max{17, x1 - 8} s!_A(x1) = 15 minus!_A(x1,x2) = max{16, x1 - 27, x2 - 45} plus!_A(x1,x2) = max{19, x2 + 6} if!_A(x1,x2,x3) = max{21, x1 - 2, x2 + 9, x3 - 6} gt!_A(x1,x2) = max{16, x1 - 8, x2 - 8} not!_A(x1) = max{20, x1 - 3} id!_A(x1) = max{0, x1 - 18} zero!_A = 2 true!_A = 1 false!_A = 0 partial status: pi(minus#) = [] pi(s) = [] pi(minus) = [] pi(plus) = [] pi(if) = [2, 3] pi(gt) = [] pi(not) = [] pi(id) = [1] pi(zero) = [] pi(true) = [] pi(false) = [] The following rules are removed: p2 -- SCC decomposition. 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: minus(minus(x,y),z) -> minus(x,plus(y,z)) r6: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r7: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r8: plus(zero(),y) -> y r9: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r10: id(x) -> x r11: if(true(),x,y) -> x r12: if(false(),x,y) -> y r13: not(x) -> if(x,false(),true()) r14: gt(s(x),zero()) -> true() r15: gt(zero(),y) -> false() r16: 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: 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: minus(minus(x,y),z) -> minus(x,plus(y,z)) r6: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r7: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r8: plus(zero(),y) -> y r9: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r10: id(x) -> x r11: if(true(),x,y) -> x r12: if(false(),x,y) -> y r13: not(x) -> if(x,false(),true()) r14: gt(s(x),zero()) -> true() r15: gt(zero(),y) -> false() r16: 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) = 1 s_A(x1) = max{5, x1 - 17} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus#_A(x1,x2) = max{0, x1 - 34, x2 - 34} s_A(x1) = x1 + 33 minus#!_A(x1,x2) = max{4, x1 - 28, x2 - 34} s!_A(x1) = max{3, x1 - 256} 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: minus(minus(x,y),z) -> minus(x,plus(y,z)) r6: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r7: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r8: plus(zero(),y) -> y r9: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r10: id(x) -> x r11: if(true(),x,y) -> x r12: if(false(),x,y) -> y r13: not(x) -> if(x,false(),true()) r14: gt(s(x),zero()) -> true() r15: gt(zero(),y) -> false() r16: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r10, r11, r12, r13, r14, r15, r16 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) = x1 + 13 if_A(x1,x2,x3) = max{6, x1 - 5, x2 + 3, x3 + 3} gt_A(x1,x2) = max{8, x1 - 5, x2 - 14} not_A(x1) = max{8, x1 - 4} id_A(x1) = x1 true_A = 3 false_A = 0 zero_A = 4 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 138, x2 - 142} s_A(x1) = x1 + 136 if_A(x1,x2,x3) = max{133, x1 - 59, x2 + 2, x3} gt_A(x1,x2) = max{185, x1 - 137, x2 - 558} not_A(x1) = max{200, x1 - 59} id_A(x1) = max{121, x1 + 118} true_A = 1 false_A = 0 zero_A = 0 plus#!_A(x1,x2) = max{1, x1 - 134, x2 - 164} s!_A(x1) = max{5, x1 - 803} if!_A(x1,x2,x3) = max{11, x1 - 227, x2 - 156, x3 - 145} gt!_A(x1,x2) = max{11, x1 - 165, x2 - 802} not!_A(x1) = max{12, x1 - 214} id!_A(x1) = max{10, x1 - 16} true!_A = 0 false!_A = 0 zero!_A = 1 partial status: pi(plus#) = [] pi(s) = [1] pi(if) = [] pi(gt) = [] pi(not) = [] pi(id) = [1] pi(true) = [] pi(false) = [] pi(zero) = [] The following rules are removed: p1, p3 -- 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: minus(minus(x,y),z) -> minus(x,plus(y,z)) r6: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r7: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r8: plus(zero(),y) -> y r9: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r10: id(x) -> x r11: if(true(),x,y) -> x r12: if(false(),x,y) -> y r13: not(x) -> if(x,false(),true()) r14: gt(s(x),zero()) -> true() r15: gt(zero(),y) -> false() r16: 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: minus(minus(x,y),z) -> minus(x,plus(y,z)) r6: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r7: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r8: plus(zero(),y) -> y r9: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r10: id(x) -> x r11: if(true(),x,y) -> x r12: if(false(),x,y) -> y r13: not(x) -> if(x,false(),true()) r14: gt(s(x),zero()) -> true() r15: gt(zero(),y) -> false() r16: 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: max/plus interpretation on natural numbers: plus#_A(x1,x2) = x1 + 1 id_A(x1) = max{4, x1 + 2} s_A(x1) = x1 + 18 if_A(x1,x2,x3) = max{x1 - 2, x2 + 19, x3 + 15} gt_A(x1,x2) = max{36, x1 - 59, x2 - 41} true_A = 17 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = 0 id_A(x1) = max{0, x1 - 10} s_A(x1) = 35 if_A(x1,x2,x3) = max{x1 - 7, x2 + 18, x3 - 17} gt_A(x1,x2) = max{24, x1 - 10, x2 - 10} true_A = 33 plus#!_A(x1,x2) = 0 id!_A(x1) = max{40, x1 - 21} s!_A(x1) = max{39, x1 + 35} if!_A(x1,x2,x3) = max{41, x1 - 23, x2 - 26, x3 - 55} gt!_A(x1,x2) = max{41, x1 - 10} true!_A = 36 partial status: pi(plus#) = [1] pi(id) = [1] pi(s) = [1] pi(if) = [] pi(gt) = [] 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: 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: minus(minus(x,y),z) -> minus(x,plus(y,z)) r6: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r7: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r8: plus(zero(),y) -> y r9: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r10: id(x) -> x r11: if(true(),x,y) -> x r12: if(false(),x,y) -> y r13: not(x) -> if(x,false(),true()) r14: gt(s(x),zero()) -> true() r15: gt(zero(),y) -> false() r16: 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) = 1 s_A(x1) = max{5, x1 - 70} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: gt#_A(x1,x2) = max{0, x1 - 8, x2 - 8} s_A(x1) = x1 + 7 gt#!_A(x1,x2) = max{5, x1 - 1, x2 - 8} s!_A(x1) = 4 partial status: pi(gt#) = [] pi(s) = [] The following rules are removed: p1 Then no dependency pair remains.