YES We show the termination of the TRS R: plus(x,|0|()) -> x plus(|0|(),y) -> y plus(s(x),y) -> s(plus(x,y)) times(|0|(),y) -> |0|() times(s(|0|()),y) -> y times(s(x),y) -> plus(y,times(x,y)) div(|0|(),y) -> |0|() div(x,y) -> quot(x,y,y) quot(|0|(),s(y),z) -> |0|() quot(s(x),s(y),z) -> quot(x,y,z) quot(x,|0|(),s(z)) -> s(div(x,s(z))) div(div(x,y),z) -> div(x,times(y,z)) eq(|0|(),|0|()) -> true() eq(s(x),|0|()) -> false() eq(|0|(),s(y)) -> false() eq(s(x),s(y)) -> eq(x,y) divides(y,x) -> eq(x,times(div(x,y),y)) prime(s(s(x))) -> pr(s(s(x)),s(x)) pr(x,s(|0|())) -> true() pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) if(true(),x,y) -> false() if(false(),x,y) -> pr(x,y) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: plus#(s(x),y) -> plus#(x,y) p2: times#(s(x),y) -> plus#(y,times(x,y)) p3: times#(s(x),y) -> times#(x,y) p4: div#(x,y) -> quot#(x,y,y) p5: quot#(s(x),s(y),z) -> quot#(x,y,z) p6: quot#(x,|0|(),s(z)) -> div#(x,s(z)) p7: div#(div(x,y),z) -> div#(x,times(y,z)) p8: div#(div(x,y),z) -> times#(y,z) p9: eq#(s(x),s(y)) -> eq#(x,y) p10: divides#(y,x) -> eq#(x,times(div(x,y),y)) p11: divides#(y,x) -> times#(div(x,y),y) p12: divides#(y,x) -> div#(x,y) p13: prime#(s(s(x))) -> pr#(s(s(x)),s(x)) p14: pr#(x,s(s(y))) -> if#(divides(s(s(y)),x),x,s(y)) p15: pr#(x,s(s(y))) -> divides#(s(s(y)),x) p16: if#(false(),x,y) -> pr#(x,y) and R consists of: r1: plus(x,|0|()) -> x r2: plus(|0|(),y) -> y r3: plus(s(x),y) -> s(plus(x,y)) r4: times(|0|(),y) -> |0|() r5: times(s(|0|()),y) -> y r6: times(s(x),y) -> plus(y,times(x,y)) r7: div(|0|(),y) -> |0|() r8: div(x,y) -> quot(x,y,y) r9: quot(|0|(),s(y),z) -> |0|() r10: quot(s(x),s(y),z) -> quot(x,y,z) r11: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r12: div(div(x,y),z) -> div(x,times(y,z)) r13: eq(|0|(),|0|()) -> true() r14: eq(s(x),|0|()) -> false() r15: eq(|0|(),s(y)) -> false() r16: eq(s(x),s(y)) -> eq(x,y) r17: divides(y,x) -> eq(x,times(div(x,y),y)) r18: prime(s(s(x))) -> pr(s(s(x)),s(x)) r19: pr(x,s(|0|())) -> true() r20: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r21: if(true(),x,y) -> false() r22: if(false(),x,y) -> pr(x,y) The estimated dependency graph contains the following SCCs: {p14, p16} {p4, p5, p6, p7} {p3} {p1} {p9} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: if#(false(),x,y) -> pr#(x,y) p2: pr#(x,s(s(y))) -> if#(divides(s(s(y)),x),x,s(y)) and R consists of: r1: plus(x,|0|()) -> x r2: plus(|0|(),y) -> y r3: plus(s(x),y) -> s(plus(x,y)) r4: times(|0|(),y) -> |0|() r5: times(s(|0|()),y) -> y r6: times(s(x),y) -> plus(y,times(x,y)) r7: div(|0|(),y) -> |0|() r8: div(x,y) -> quot(x,y,y) r9: quot(|0|(),s(y),z) -> |0|() r10: quot(s(x),s(y),z) -> quot(x,y,z) r11: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r12: div(div(x,y),z) -> div(x,times(y,z)) r13: eq(|0|(),|0|()) -> true() r14: eq(s(x),|0|()) -> false() r15: eq(|0|(),s(y)) -> false() r16: eq(s(x),s(y)) -> eq(x,y) r17: divides(y,x) -> eq(x,times(div(x,y),y)) r18: prime(s(s(x))) -> pr(s(s(x)),s(x)) r19: pr(x,s(|0|())) -> true() r20: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r21: if(true(),x,y) -> false() r22: if(false(),x,y) -> pr(x,y) The set of usable rules consists of r1, r4, r5, r9, r13, r14, r15, r16, r21 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: if#_A(x1,x2,x3) = max{3, x3 - 21} false_A = 3 pr#_A(x1,x2) = max{2, x2 - 36} s_A(x1) = x1 + 20 divides_A(x1,x2) = max{1, x1 - 105, x2 - 63} plus_A(x1,x2) = max{14, x1, x2 - 29} |0|_A = 27 times_A(x1,x2) = max{x1 + 50, x2} quot_A(x1,x2,x3) = max{x1 - 93, x2 - 13, x3 + 28} eq_A(x1,x2) = max{4, x1 - 28, x2 - 21} true_A = 5 if_A(x1,x2,x3) = max{41, x1 - 6, x2 - 61, x3 - 21} base order 2: precedence: plus = eq > divides > times = true = if > s = quot > pr# = |0| > if# = false partial status: pi(if#) = [] pi(false) = [] pi(pr#) = [] pi(s) = [1] pi(divides) = [] pi(plus) = [1] pi(|0|) = [] pi(times) = [2] pi(quot) = [3] pi(eq) = [] pi(true) = [] pi(if) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: pr#(x,s(s(y))) -> if#(divides(s(s(y)),x),x,s(y)) and R consists of: r1: plus(x,|0|()) -> x r2: plus(|0|(),y) -> y r3: plus(s(x),y) -> s(plus(x,y)) r4: times(|0|(),y) -> |0|() r5: times(s(|0|()),y) -> y r6: times(s(x),y) -> plus(y,times(x,y)) r7: div(|0|(),y) -> |0|() r8: div(x,y) -> quot(x,y,y) r9: quot(|0|(),s(y),z) -> |0|() r10: quot(s(x),s(y),z) -> quot(x,y,z) r11: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r12: div(div(x,y),z) -> div(x,times(y,z)) r13: eq(|0|(),|0|()) -> true() r14: eq(s(x),|0|()) -> false() r15: eq(|0|(),s(y)) -> false() r16: eq(s(x),s(y)) -> eq(x,y) r17: divides(y,x) -> eq(x,times(div(x,y),y)) r18: prime(s(s(x))) -> pr(s(s(x)),s(x)) r19: pr(x,s(|0|())) -> true() r20: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r21: if(true(),x,y) -> false() r22: if(false(),x,y) -> pr(x,y) The estimated dependency graph contains the following SCCs: (no SCCs) -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: div#(div(x,y),z) -> div#(x,times(y,z)) p2: div#(x,y) -> quot#(x,y,y) p3: quot#(x,|0|(),s(z)) -> div#(x,s(z)) p4: quot#(s(x),s(y),z) -> quot#(x,y,z) and R consists of: r1: plus(x,|0|()) -> x r2: plus(|0|(),y) -> y r3: plus(s(x),y) -> s(plus(x,y)) r4: times(|0|(),y) -> |0|() r5: times(s(|0|()),y) -> y r6: times(s(x),y) -> plus(y,times(x,y)) r7: div(|0|(),y) -> |0|() r8: div(x,y) -> quot(x,y,y) r9: quot(|0|(),s(y),z) -> |0|() r10: quot(s(x),s(y),z) -> quot(x,y,z) r11: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r12: div(div(x,y),z) -> div(x,times(y,z)) r13: eq(|0|(),|0|()) -> true() r14: eq(s(x),|0|()) -> false() r15: eq(|0|(),s(y)) -> false() r16: eq(s(x),s(y)) -> eq(x,y) r17: divides(y,x) -> eq(x,times(div(x,y),y)) r18: prime(s(s(x))) -> pr(s(s(x)),s(x)) r19: pr(x,s(|0|())) -> true() r20: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r21: if(true(),x,y) -> false() r22: if(false(),x,y) -> pr(x,y) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r9, r13, r14, r15, r19, r21 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: div#_A(x1,x2) = max{x1 + 16, x2 + 9} div_A(x1,x2) = max{x1 + 3, x2 - 4} times_A(x1,x2) = max{10, x1 + 3, x2} quot#_A(x1,x2,x3) = max{x1 + 16, x2 + 9, x3 + 9} |0|_A = 5 s_A(x1) = max{8, x1} plus_A(x1,x2) = max{x1, x2} quot_A(x1,x2,x3) = max{15, x1 + 7, x2 - 9, x3 - 9} eq_A(x1,x2) = max{9, x1 - 9, x2 - 11} true_A = 2 false_A = 1 pr_A(x1,x2) = max{8, x1 - 16, x2 - 10} if_A(x1,x2,x3) = max{9, x1 - 13, x2 - 1, x3 - 9} base order 2: precedence: div# = quot# > times > plus > s = if > div = quot = eq > |0| = pr > true > false partial status: pi(div#) = [1] pi(div) = [1] pi(times) = [1, 2] pi(quot#) = [1] pi(|0|) = [] pi(s) = [1] pi(plus) = [1, 2] pi(quot) = [] pi(eq) = [] pi(true) = [] pi(false) = [] pi(pr) = [] pi(if) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: div#(x,y) -> quot#(x,y,y) p2: quot#(x,|0|(),s(z)) -> div#(x,s(z)) p3: quot#(s(x),s(y),z) -> quot#(x,y,z) and R consists of: r1: plus(x,|0|()) -> x r2: plus(|0|(),y) -> y r3: plus(s(x),y) -> s(plus(x,y)) r4: times(|0|(),y) -> |0|() r5: times(s(|0|()),y) -> y r6: times(s(x),y) -> plus(y,times(x,y)) r7: div(|0|(),y) -> |0|() r8: div(x,y) -> quot(x,y,y) r9: quot(|0|(),s(y),z) -> |0|() r10: quot(s(x),s(y),z) -> quot(x,y,z) r11: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r12: div(div(x,y),z) -> div(x,times(y,z)) r13: eq(|0|(),|0|()) -> true() r14: eq(s(x),|0|()) -> false() r15: eq(|0|(),s(y)) -> false() r16: eq(s(x),s(y)) -> eq(x,y) r17: divides(y,x) -> eq(x,times(div(x,y),y)) r18: prime(s(s(x))) -> pr(s(s(x)),s(x)) r19: pr(x,s(|0|())) -> true() r20: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r21: if(true(),x,y) -> false() r22: if(false(),x,y) -> pr(x,y) The estimated dependency graph contains the following SCCs: {p1, p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: div#(x,y) -> quot#(x,y,y) p2: quot#(s(x),s(y),z) -> quot#(x,y,z) p3: quot#(x,|0|(),s(z)) -> div#(x,s(z)) and R consists of: r1: plus(x,|0|()) -> x r2: plus(|0|(),y) -> y r3: plus(s(x),y) -> s(plus(x,y)) r4: times(|0|(),y) -> |0|() r5: times(s(|0|()),y) -> y r6: times(s(x),y) -> plus(y,times(x,y)) r7: div(|0|(),y) -> |0|() r8: div(x,y) -> quot(x,y,y) r9: quot(|0|(),s(y),z) -> |0|() r10: quot(s(x),s(y),z) -> quot(x,y,z) r11: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r12: div(div(x,y),z) -> div(x,times(y,z)) r13: eq(|0|(),|0|()) -> true() r14: eq(s(x),|0|()) -> false() r15: eq(|0|(),s(y)) -> false() r16: eq(s(x),s(y)) -> eq(x,y) r17: divides(y,x) -> eq(x,times(div(x,y),y)) r18: prime(s(s(x))) -> pr(s(s(x)),s(x)) r19: pr(x,s(|0|())) -> true() r20: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r21: if(true(),x,y) -> false() r22: if(false(),x,y) -> pr(x,y) The set of usable rules consists of r4, r7, r9, r13, r14, r15, r19, r21 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: div#_A(x1,x2) = x1 + 10 quot#_A(x1,x2,x3) = x1 + 10 s_A(x1) = max{8, x1 + 2} |0|_A = 13 times_A(x1,x2) = max{14, x1 - 71, x2 - 61} div_A(x1,x2) = max{27, x1 - 28, x2 - 71} quot_A(x1,x2,x3) = max{14, x1 - 62, x2 - 75, x3 - 72} eq_A(x1,x2) = max{4, x1 - 7, x2 - 15} true_A = 5 false_A = 3 pr_A(x1,x2) = max{6, x1 - 90, x2 - 90} if_A(x1,x2,x3) = max{11, x1 - 29, x2 - 89, x3 - 9} base order 2: precedence: |0| > div# = quot# = s = times = div = true = if > quot = eq > pr > false partial status: pi(div#) = [] pi(quot#) = [] pi(s) = [1] pi(|0|) = [] pi(times) = [] pi(div) = [] pi(quot) = [] pi(eq) = [] pi(true) = [] pi(false) = [] pi(pr) = [] pi(if) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: div#(x,y) -> quot#(x,y,y) p2: quot#(x,|0|(),s(z)) -> div#(x,s(z)) and R consists of: r1: plus(x,|0|()) -> x r2: plus(|0|(),y) -> y r3: plus(s(x),y) -> s(plus(x,y)) r4: times(|0|(),y) -> |0|() r5: times(s(|0|()),y) -> y r6: times(s(x),y) -> plus(y,times(x,y)) r7: div(|0|(),y) -> |0|() r8: div(x,y) -> quot(x,y,y) r9: quot(|0|(),s(y),z) -> |0|() r10: quot(s(x),s(y),z) -> quot(x,y,z) r11: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r12: div(div(x,y),z) -> div(x,times(y,z)) r13: eq(|0|(),|0|()) -> true() r14: eq(s(x),|0|()) -> false() r15: eq(|0|(),s(y)) -> false() r16: eq(s(x),s(y)) -> eq(x,y) r17: divides(y,x) -> eq(x,times(div(x,y),y)) r18: prime(s(s(x))) -> pr(s(s(x)),s(x)) r19: pr(x,s(|0|())) -> true() r20: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r21: if(true(),x,y) -> false() r22: if(false(),x,y) -> pr(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: div#(x,y) -> quot#(x,y,y) p2: quot#(x,|0|(),s(z)) -> div#(x,s(z)) and R consists of: r1: plus(x,|0|()) -> x r2: plus(|0|(),y) -> y r3: plus(s(x),y) -> s(plus(x,y)) r4: times(|0|(),y) -> |0|() r5: times(s(|0|()),y) -> y r6: times(s(x),y) -> plus(y,times(x,y)) r7: div(|0|(),y) -> |0|() r8: div(x,y) -> quot(x,y,y) r9: quot(|0|(),s(y),z) -> |0|() r10: quot(s(x),s(y),z) -> quot(x,y,z) r11: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r12: div(div(x,y),z) -> div(x,times(y,z)) r13: eq(|0|(),|0|()) -> true() r14: eq(s(x),|0|()) -> false() r15: eq(|0|(),s(y)) -> false() r16: eq(s(x),s(y)) -> eq(x,y) r17: divides(y,x) -> eq(x,times(div(x,y),y)) r18: prime(s(s(x))) -> pr(s(s(x)),s(x)) r19: pr(x,s(|0|())) -> true() r20: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r21: if(true(),x,y) -> false() r22: if(false(),x,y) -> pr(x,y) The set of usable rules consists of r13, r14, r15, r19, r21 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: div#_A(x1,x2) = x2 + 3 quot#_A(x1,x2,x3) = max{2, x2 - 1, x3 - 1} |0|_A = 15 s_A(x1) = 10 eq_A(x1,x2) = max{11, x1 - 10, x2 - 10} true_A = 7 false_A = 6 pr_A(x1,x2) = max{8, x1 - 20, x2 - 42} if_A(x1,x2,x3) = max{9, x1 - 16, x2 - 19, x3 - 31} base order 2: precedence: quot# = |0| = if > div# = s = true > eq > pr > false partial status: pi(div#) = [] pi(quot#) = [] pi(|0|) = [] pi(s) = [] pi(eq) = [] pi(true) = [] pi(false) = [] pi(pr) = [] pi(if) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: quot#(x,|0|(),s(z)) -> div#(x,s(z)) and R consists of: r1: plus(x,|0|()) -> x r2: plus(|0|(),y) -> y r3: plus(s(x),y) -> s(plus(x,y)) r4: times(|0|(),y) -> |0|() r5: times(s(|0|()),y) -> y r6: times(s(x),y) -> plus(y,times(x,y)) r7: div(|0|(),y) -> |0|() r8: div(x,y) -> quot(x,y,y) r9: quot(|0|(),s(y),z) -> |0|() r10: quot(s(x),s(y),z) -> quot(x,y,z) r11: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r12: div(div(x,y),z) -> div(x,times(y,z)) r13: eq(|0|(),|0|()) -> true() r14: eq(s(x),|0|()) -> false() r15: eq(|0|(),s(y)) -> false() r16: eq(s(x),s(y)) -> eq(x,y) r17: divides(y,x) -> eq(x,times(div(x,y),y)) r18: prime(s(s(x))) -> pr(s(s(x)),s(x)) r19: pr(x,s(|0|())) -> true() r20: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r21: if(true(),x,y) -> false() r22: if(false(),x,y) -> pr(x,y) The estimated dependency graph contains the following SCCs: (no SCCs) -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: times#(s(x),y) -> times#(x,y) and R consists of: r1: plus(x,|0|()) -> x r2: plus(|0|(),y) -> y r3: plus(s(x),y) -> s(plus(x,y)) r4: times(|0|(),y) -> |0|() r5: times(s(|0|()),y) -> y r6: times(s(x),y) -> plus(y,times(x,y)) r7: div(|0|(),y) -> |0|() r8: div(x,y) -> quot(x,y,y) r9: quot(|0|(),s(y),z) -> |0|() r10: quot(s(x),s(y),z) -> quot(x,y,z) r11: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r12: div(div(x,y),z) -> div(x,times(y,z)) r13: eq(|0|(),|0|()) -> true() r14: eq(s(x),|0|()) -> false() r15: eq(|0|(),s(y)) -> false() r16: eq(s(x),s(y)) -> eq(x,y) r17: divides(y,x) -> eq(x,times(div(x,y),y)) r18: prime(s(s(x))) -> pr(s(s(x)),s(x)) r19: pr(x,s(|0|())) -> true() r20: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r21: if(true(),x,y) -> false() r22: if(false(),x,y) -> pr(x,y) The set of usable rules consists of r4, r7, r9, r13, r14, r15, r19, r21 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: times#_A(x1,x2) = max{4, x1 + 1} s_A(x1) = x1 + 8 times_A(x1,x2) = max{10, x1 - 10, x2 - 18} |0|_A = 7 div_A(x1,x2) = max{9, x1 - 24, x2 - 19} quot_A(x1,x2,x3) = max{18, x1 - 15, x2 - 22, x3 - 9} eq_A(x1,x2) = max{9, x1 - 14, x2 - 11} true_A = 3 false_A = 6 pr_A(x1,x2) = max{30, x1 + 4, x2 + 12} if_A(x1,x2,x3) = max{29, x1 - 27, x2 - 1, x3 - 7} base order 2: precedence: pr > times = eq = if > s = div = quot > times# = |0| > false > true partial status: pi(times#) = [1] pi(s) = [] pi(times) = [] pi(|0|) = [] pi(div) = [] pi(quot) = [] pi(eq) = [] pi(true) = [] pi(false) = [] pi(pr) = [2] pi(if) = [] 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) and R consists of: r1: plus(x,|0|()) -> x r2: plus(|0|(),y) -> y r3: plus(s(x),y) -> s(plus(x,y)) r4: times(|0|(),y) -> |0|() r5: times(s(|0|()),y) -> y r6: times(s(x),y) -> plus(y,times(x,y)) r7: div(|0|(),y) -> |0|() r8: div(x,y) -> quot(x,y,y) r9: quot(|0|(),s(y),z) -> |0|() r10: quot(s(x),s(y),z) -> quot(x,y,z) r11: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r12: div(div(x,y),z) -> div(x,times(y,z)) r13: eq(|0|(),|0|()) -> true() r14: eq(s(x),|0|()) -> false() r15: eq(|0|(),s(y)) -> false() r16: eq(s(x),s(y)) -> eq(x,y) r17: divides(y,x) -> eq(x,times(div(x,y),y)) r18: prime(s(s(x))) -> pr(s(s(x)),s(x)) r19: pr(x,s(|0|())) -> true() r20: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r21: if(true(),x,y) -> false() r22: if(false(),x,y) -> pr(x,y) The set of usable rules consists of r4, r7, r9, r13, r14, r15, r19, r21 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{7, x1 + 1} s_A(x1) = x1 + 14 times_A(x1,x2) = max{16, x1 - 16, x2 - 31} |0|_A = 13 div_A(x1,x2) = max{15, x1 - 30, x2 - 47} quot_A(x1,x2,x3) = max{30, x1 - 15, x2 - 46, x3 - 15} eq_A(x1,x2) = max{15, x1 - 20, x2 - 17} true_A = 10 false_A = 12 pr_A(x1,x2) = max{31, x1 + 7, x2 + 1} if_A(x1,x2,x3) = max{30, x1 + 1, x2 - 1, x3 - 9} base order 2: precedence: pr > times = eq = if > s = div = quot > plus# = |0| > false > true partial status: pi(plus#) = [1] pi(s) = [] pi(times) = [] pi(|0|) = [] pi(div) = [] pi(quot) = [] pi(eq) = [] pi(true) = [] pi(false) = [] pi(pr) = [2] pi(if) = [] 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: eq#(s(x),s(y)) -> eq#(x,y) and R consists of: r1: plus(x,|0|()) -> x r2: plus(|0|(),y) -> y r3: plus(s(x),y) -> s(plus(x,y)) r4: times(|0|(),y) -> |0|() r5: times(s(|0|()),y) -> y r6: times(s(x),y) -> plus(y,times(x,y)) r7: div(|0|(),y) -> |0|() r8: div(x,y) -> quot(x,y,y) r9: quot(|0|(),s(y),z) -> |0|() r10: quot(s(x),s(y),z) -> quot(x,y,z) r11: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r12: div(div(x,y),z) -> div(x,times(y,z)) r13: eq(|0|(),|0|()) -> true() r14: eq(s(x),|0|()) -> false() r15: eq(|0|(),s(y)) -> false() r16: eq(s(x),s(y)) -> eq(x,y) r17: divides(y,x) -> eq(x,times(div(x,y),y)) r18: prime(s(s(x))) -> pr(s(s(x)),s(x)) r19: pr(x,s(|0|())) -> true() r20: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r21: if(true(),x,y) -> false() r22: if(false(),x,y) -> pr(x,y) The set of usable rules consists of r4, r7, r9, r13, r14, r15, r16, r19, r21 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: eq#_A(x1,x2) = max{1, x1 - 17, x2 - 20} s_A(x1) = max{19, x1 + 10} times_A(x1,x2) = max{20, x1 - 37, x2 - 42} |0|_A = 7 div_A(x1,x2) = max{8, x1 - 36, x2 - 43} quot_A(x1,x2,x3) = max{20, x1 - 25, x2 - 44, x3 - 32} eq_A(x1,x2) = max{20, x1 - 31, x2 + 11} true_A = 6 false_A = 5 pr_A(x1,x2) = max{17, x1 - 84, x2 - 74} if_A(x1,x2,x3) = max{30, x1 - 33, x2 - 1, x3 - 20} base order 2: precedence: times > eq# = div = eq = if > s = quot > |0| = pr > true > false partial status: pi(eq#) = [] pi(s) = [1] pi(times) = [] pi(|0|) = [] pi(div) = [] pi(quot) = [] pi(eq) = [2] pi(true) = [] pi(false) = [] pi(pr) = [] pi(if) = [] The following rules are removed: p1 Then no dependency pair remains.