YES We show the termination of the TRS R: p(|0|()) -> |0|() p(s(x)) -> x plus(x,|0|()) -> x plus(|0|(),y) -> y plus(s(x),y) -> s(plus(x,y)) plus(s(x),y) -> s(plus(p(s(x)),y)) plus(x,s(y)) -> s(plus(x,p(s(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(zero(y),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(zero(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) zero(div(x,x)) -> x zero(divides(x,x)) -> x zero(times(x,x)) -> x zero(quot(x,x,x)) -> x zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: plus#(s(x),y) -> plus#(x,y) p2: plus#(s(x),y) -> plus#(p(s(x)),y) p3: plus#(s(x),y) -> p#(s(x)) p4: plus#(x,s(y)) -> plus#(x,p(s(y))) p5: plus#(x,s(y)) -> p#(s(y)) p6: times#(s(x),y) -> plus#(y,times(x,y)) p7: times#(s(x),y) -> times#(x,y) p8: div#(x,y) -> quot#(x,y,y) p9: quot#(s(x),s(y),z) -> quot#(x,y,z) p10: quot#(x,|0|(),s(z)) -> div#(x,s(z)) p11: div#(div(x,y),z) -> div#(x,times(zero(y),z)) p12: div#(div(x,y),z) -> times#(zero(y),z) p13: div#(div(x,y),z) -> zero#(y) p14: eq#(s(x),s(y)) -> eq#(x,y) p15: divides#(y,x) -> eq#(x,times(div(x,y),y)) p16: divides#(y,x) -> times#(div(x,y),y) p17: divides#(y,x) -> div#(x,y) p18: prime#(s(s(x))) -> pr#(s(s(x)),s(x)) p19: pr#(x,s(s(y))) -> if#(divides(s(s(y)),x),x,s(y)) p20: pr#(x,s(s(y))) -> divides#(s(s(y)),x) p21: if#(false(),x,y) -> pr#(x,y) p22: zero#(s(x)) -> if#(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) p23: zero#(s(x)) -> eq#(x,s(|0|())) p24: zero#(s(x)) -> plus#(zero(|0|()),|0|()) p25: zero#(s(x)) -> zero#(|0|()) p26: zero#(s(x)) -> plus#(|0|(),zero(|0|())) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The estimated dependency graph contains the following SCCs: {p8, p9, p10, p11, p13, p17, p19, p20, p21, p22} {p7} {p1, p2, p4} {p14} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: pr#(x,s(s(y))) -> divides#(s(s(y)),x) p2: divides#(y,x) -> div#(x,y) p3: div#(div(x,y),z) -> zero#(y) p4: zero#(s(x)) -> if#(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) p5: if#(false(),x,y) -> pr#(x,y) p6: pr#(x,s(s(y))) -> if#(divides(s(s(y)),x),x,s(y)) p7: div#(div(x,y),z) -> div#(x,times(zero(y),z)) p8: div#(x,y) -> quot#(x,y,y) p9: quot#(x,|0|(),s(z)) -> div#(x,s(z)) p10: quot#(s(x),s(y),z) -> quot#(x,y,z) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The set of usable rules consists of r3, r4, r8, r11, r13, r17, r18, r19, r20, r23, r27 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: pr#_A(x1,x2) = max{219, x1 + 89, x2 + 111} s_A(x1) = x1 + 108 divides#_A(x1,x2) = max{x1 + 109, x2 + 63} div#_A(x1,x2) = max{91, x1 + 62} div_A(x1,x2) = max{x1 + 132, x2 + 306} zero#_A(x1) = x1 + 306 if#_A(x1,x2,x3) = max{x2 + 89, x3 + 219} eq_A(x1,x2) = max{x1 + 107, x2 - 11} |0|_A = 1 plus_A(x1,x2) = max{x1 + 40, x2 + 19} zero_A(x1) = max{67, x1 - 131} false_A = 59 divides_A(x1,x2) = max{171, x1 - 120, x2 + 1} times_A(x1,x2) = x1 + 41 quot#_A(x1,x2,x3) = max{91, x1 + 62} quot_A(x1,x2,x3) = max{130, x1, x2, x3 - 109} true_A = 108 pr_A(x1,x2) = max{170, x1 - 167, x2 - 168} base order 2: precedence: div = pr > s = eq > pr# = div# = zero# = if# = |0| = quot# > divides# = zero = divides = quot > plus = true > false = times partial status: pi(pr#) = [1] pi(s) = [1] pi(divides#) = [] pi(div#) = [1] pi(div) = [1, 2] pi(zero#) = [1] pi(if#) = [2] pi(eq) = [1] pi(|0|) = [] pi(plus) = [1] pi(zero) = [] pi(false) = [] pi(divides) = [] pi(times) = [] pi(quot#) = [1] pi(quot) = [1, 2] pi(true) = [] pi(pr) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: divides#(y,x) -> div#(x,y) p2: div#(div(x,y),z) -> zero#(y) p3: zero#(s(x)) -> if#(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) p4: if#(false(),x,y) -> pr#(x,y) p5: pr#(x,s(s(y))) -> if#(divides(s(s(y)),x),x,s(y)) p6: div#(div(x,y),z) -> div#(x,times(zero(y),z)) p7: div#(x,y) -> quot#(x,y,y) p8: quot#(x,|0|(),s(z)) -> div#(x,s(z)) p9: quot#(s(x),s(y),z) -> quot#(x,y,z) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The estimated dependency graph contains the following SCCs: {p6, p7, p8, p9} {p4, p5} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: quot#(x,|0|(),s(z)) -> div#(x,s(z)) p2: div#(x,y) -> quot#(x,y,y) p3: quot#(s(x),s(y),z) -> quot#(x,y,z) p4: div#(div(x,y),z) -> div#(x,times(zero(y),z)) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The set of usable rules consists of r1, r8, r11, r13, r17, r18, r19, r23, r25 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: quot#_A(x1,x2,x3) = x1 + 56 |0|_A = 10 s_A(x1) = max{21, x1 + 2} div#_A(x1,x2) = x1 + 56 div_A(x1,x2) = max{31, x1 + 1, x2 - 24} times_A(x1,x2) = max{19, x1 - 46, x2 - 25} zero_A(x1) = max{21, x1 - 74} p_A(x1) = max{11, x1 - 38} quot_A(x1,x2,x3) = max{34, x1 - 22, x2 - 22, x3 - 24} eq_A(x1,x2) = max{20, x1 - 73, x2 - 22} true_A = 9 false_A = 8 pr_A(x1,x2) = max{25, x1 - 24, x2 - 13} if_A(x1,x2,x3) = max{21, x1 - 25, x2 - 25, x3 - 22} base order 2: precedence: s = div = quot = pr > times > quot# = div# > zero > eq = if > p > |0| > true > false partial status: pi(quot#) = [] pi(|0|) = [] pi(s) = [] pi(div#) = [] pi(div) = [] pi(times) = [] pi(zero) = [] pi(p) = [] pi(quot) = [] pi(eq) = [] pi(true) = [] pi(false) = [] pi(pr) = [] pi(if) = [] The following rules are removed: p4 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: quot#(x,|0|(),s(z)) -> div#(x,s(z)) p2: div#(x,y) -> quot#(x,y,y) p3: quot#(s(x),s(y),z) -> quot#(x,y,z) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) 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: quot#(x,|0|(),s(z)) -> div#(x,s(z)) p2: div#(x,y) -> quot#(x,y,y) p3: quot#(s(x),s(y),z) -> quot#(x,y,z) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The set of usable rules consists of r1, r8, r11, r13, r17, r18, r19, r25 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: quot#_A(x1,x2,x3) = max{3, x1 + 1} |0|_A = 6 s_A(x1) = x1 + 6 div#_A(x1,x2) = max{3, x1 + 1} p_A(x1) = max{6, x1 - 42} times_A(x1,x2) = max{21, x1 - 21, x2 - 42} div_A(x1,x2) = max{20, x1 - 25, x2 - 47} quot_A(x1,x2,x3) = max{7, x1 - 44, x2 - 50, x3 - 50} zero_A(x1) = max{15, x1 - 82} eq_A(x1,x2) = max{14, x1 - 77, x2 - 22} true_A = 13 false_A = 1 if_A(x1,x2,x3) = max{5, x1 - 15, x2 - 39, x3 - 45} base order 2: precedence: times = div = true > s = quot = zero > eq = if > p > |0| > quot# = div# = false partial status: pi(quot#) = [1] pi(|0|) = [] pi(s) = [1] pi(div#) = [1] pi(p) = [] pi(times) = [] pi(div) = [] pi(quot) = [] pi(zero) = [] pi(eq) = [] pi(true) = [] pi(false) = [] pi(if) = [] The following rules are removed: p3 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: quot#(x,|0|(),s(z)) -> div#(x,s(z)) p2: div#(x,y) -> quot#(x,y,y) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The estimated dependency graph contains the following SCCs: {p1, p2} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: quot#(x,|0|(),s(z)) -> div#(x,s(z)) p2: div#(x,y) -> quot#(x,y,y) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The set of usable rules consists of r1, r11, r13, r17, r18, r19, r25 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: quot#_A(x1,x2,x3) = max{4, x2 + 1, x3 - 1} |0|_A = 9 s_A(x1) = 3 div#_A(x1,x2) = x2 + 5 p_A(x1) = max{12, x1 - 10} div_A(x1,x2) = max{6, x1 + 3, x2} quot_A(x1,x2,x3) = max{7, x1 + 3, x2 + 3, x3 + 3} zero_A(x1) = max{22, x1 + 13} eq_A(x1,x2) = max{0, x1 - 50, x2 - 6} true_A = 0 false_A = 0 if_A(x1,x2,x3) = max{22, x1, x2 - 49, x3 - 32} base order 2: precedence: p = div = true > quot# = |0| > s = div# = quot > zero > eq = if > false partial status: pi(quot#) = [2] pi(|0|) = [] pi(s) = [] pi(div#) = [] pi(p) = [] pi(div) = [2] pi(quot) = [2, 3] pi(zero) = [] pi(eq) = [] pi(true) = [] pi(false) = [] 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) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The estimated dependency graph contains the following SCCs: (no SCCs) -- 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: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The set of usable rules consists of r1, r8, r13, r17, r18, r19, r20, r23, r25 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: if#_A(x1,x2,x3) = x3 + 3 false_A = 1 pr#_A(x1,x2) = max{2, x2 - 2} s_A(x1) = max{29, x1 + 6} divides_A(x1,x2) = max{34, x1 - 53, x2 - 40} p_A(x1) = max{81, x1 - 73} |0|_A = 32 times_A(x1,x2) = max{34, x1, x2} quot_A(x1,x2,x3) = max{33, x1, x2, x3} zero_A(x1) = max{0, x1 - 149} eq_A(x1,x2) = max{42, x1, x2 - 39} true_A = 33 pr_A(x1,x2) = max{35, x1 - 36, x2 - 37} if_A(x1,x2,x3) = max{5, x1 - 35, x3 - 37} base order 2: precedence: if# > pr# > s = p = quot = true > zero > |0| > false > if > pr > divides > times = eq partial status: pi(if#) = [3] pi(false) = [] pi(pr#) = [] pi(s) = [1] pi(divides) = [] pi(p) = [] pi(|0|) = [] pi(times) = [1] pi(quot) = [1, 2, 3] pi(zero) = [] pi(eq) = [1] pi(true) = [] pi(pr) = [] 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: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) 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: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The set of usable rules consists of r1, r8, r11, r13, r17, r18, r19, r23, r25 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: times#_A(x1,x2) = max{x1 + 12, x2 + 13} s_A(x1) = x1 + 11 p_A(x1) = max{38, x1 - 55} |0|_A = 37 times_A(x1,x2) = max{40, x1 - 40, x2 - 111} div_A(x1,x2) = max{39, x1 - 70, x2 - 111} quot_A(x1,x2,x3) = max{38, x1 - 108, x2 - 145, x3 - 119} zero_A(x1) = max{10, x1 - 182} eq_A(x1,x2) = max{6, x1 - 172, x2 - 49} true_A = 5 false_A = 1 pr_A(x1,x2) = max{2, x1 - 62, x2 - 42} if_A(x1,x2,x3) = max{3, x1 - 42, x2 - 4, x3 - 23} base order 2: precedence: times > times# = p = div = true > s = quot > |0| > zero > eq = if > pr > false partial status: pi(times#) = [1] pi(s) = [1] pi(p) = [] pi(|0|) = [] pi(times) = [] pi(div) = [] pi(quot) = [] pi(zero) = [] pi(eq) = [] pi(true) = [] pi(false) = [] pi(pr) = [] 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) p2: plus#(x,s(y)) -> plus#(x,p(s(y))) p3: plus#(s(x),y) -> plus#(p(s(x)),y) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The set of usable rules consists of r1, r2, r8, r11, r13, r17, r18, r19, r23, r25 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: plus#_A(x1,x2) = x1 + 2 s_A(x1) = x1 + 31 p_A(x1) = max{3, x1 - 30} |0|_A = 2 times_A(x1,x2) = max{26, x1 - 32, x2 - 57} div_A(x1,x2) = max{25, x1 - 63, x2 - 90} quot_A(x1,x2,x3) = max{56, x1 - 32, x2 - 89, x3 - 58} zero_A(x1) = max{24, x1 - 154} eq_A(x1,x2) = max{8, x1 - 124, x2 - 34} true_A = 7 false_A = 1 pr_A(x1,x2) = max{8, x1 - 64, x2 - 136} if_A(x1,x2,x3) = max{23, x1 - 9, x2 - 28, x3 - 71} base order 2: precedence: times = quot > div = true > plus# = s > p = zero > |0| = eq = if > pr > false partial status: pi(plus#) = [] pi(s) = [1] pi(p) = [] pi(|0|) = [] pi(times) = [] pi(div) = [] pi(quot) = [] pi(zero) = [] 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: plus#(x,s(y)) -> plus#(x,p(s(y))) p2: plus#(s(x),y) -> plus#(p(s(x)),y) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) 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#(x,s(y)) -> plus#(x,p(s(y))) p2: plus#(s(x),y) -> plus#(p(s(x)),y) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The set of usable rules consists of r2, r8, r11, r13, r17, r18, r19, r23, r25 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: plus#_A(x1,x2) = x1 + 11 s_A(x1) = max{28, x1 + 24} p_A(x1) = max{14, x1 - 16} times_A(x1,x2) = max{56, x1 - 155, x2 - 176} |0|_A = 55 div_A(x1,x2) = max{58, x1 - 59, x2 - 175} quot_A(x1,x2,x3) = max{83, x1 - 34, x2 - 203, x3 - 148} zero_A(x1) = max{26, x1 - 235} eq_A(x1,x2) = max{25, x1 - 212, x2 - 110} true_A = 20 false_A = 21 pr_A(x1,x2) = max{22, x1 - 49, x2 - 78} if_A(x1,x2,x3) = max{23, x1 - 58, x2 - 4, x3 - 63} base order 2: precedence: div > times = pr > if > plus# = s = |0| = quot > p = zero > eq > false > true partial status: pi(plus#) = [] pi(s) = [1] pi(p) = [] pi(times) = [] pi(|0|) = [] pi(div) = [] pi(quot) = [] pi(zero) = [] 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: plus#(x,s(y)) -> plus#(x,p(s(y))) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: plus#(x,s(y)) -> plus#(x,p(s(y))) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The set of usable rules consists of r1, r2, r8, r11, r13, r17, r18, r19, r23, r25, r30 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: plus#_A(x1,x2) = x2 + 1 s_A(x1) = x1 + 9 p_A(x1) = max{7, x1 - 7} |0|_A = 3 times_A(x1,x2) = max{22, x1 - 17, x2 - 28} div_A(x1,x2) = max{14, x1 - 28, x2 - 51} quot_A(x1,x2,x3) = max{x1 - 14, x2 - 50, x3 + 81} zero_A(x1) = max{13, x1 - 80} eq_A(x1,x2) = max{9, x1 - 72, x2 - 23} true_A = 2 false_A = 1 pr_A(x1,x2) = max{3, x1 - 74, x2 - 65} if_A(x1,x2,x3) = max{4, x1 - 24, x2 - 1, x3 - 44} base order 2: precedence: times = quot > div > zero > s > plus# = eq = if > p > |0| > true > false > pr partial status: pi(plus#) = [2] pi(s) = [] pi(p) = [] pi(|0|) = [] pi(times) = [] pi(div) = [] pi(quot) = [3] pi(zero) = [] pi(eq) = [] pi(true) = [] pi(false) = [] pi(pr) = [] 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: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: plus(x,|0|()) -> x r4: plus(|0|(),y) -> y r5: plus(s(x),y) -> s(plus(x,y)) r6: plus(s(x),y) -> s(plus(p(s(x)),y)) r7: plus(x,s(y)) -> s(plus(x,p(s(y)))) r8: times(|0|(),y) -> |0|() r9: times(s(|0|()),y) -> y r10: times(s(x),y) -> plus(y,times(x,y)) r11: div(|0|(),y) -> |0|() r12: div(x,y) -> quot(x,y,y) r13: quot(zero(y),s(y),z) -> |0|() r14: quot(s(x),s(y),z) -> quot(x,y,z) r15: quot(x,|0|(),s(z)) -> s(div(x,s(z))) r16: div(div(x,y),z) -> div(x,times(zero(y),z)) r17: eq(|0|(),|0|()) -> true() r18: eq(s(x),|0|()) -> false() r19: eq(|0|(),s(y)) -> false() r20: eq(s(x),s(y)) -> eq(x,y) r21: divides(y,x) -> eq(x,times(div(x,y),y)) r22: prime(s(s(x))) -> pr(s(s(x)),s(x)) r23: pr(x,s(|0|())) -> true() r24: pr(x,s(s(y))) -> if(divides(s(s(y)),x),x,s(y)) r25: if(true(),x,y) -> false() r26: if(false(),x,y) -> pr(x,y) r27: zero(div(x,x)) -> x r28: zero(divides(x,x)) -> x r29: zero(times(x,x)) -> x r30: zero(quot(x,x,x)) -> x r31: zero(s(x)) -> if(eq(x,s(|0|())),plus(zero(|0|()),|0|()),s(plus(|0|(),zero(|0|())))) The set of usable rules consists of r1, r8, r11, r13, r17, r18, r19, r23, r25 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: eq#_A(x1,x2) = max{x1 - 1, x2 + 2} s_A(x1) = max{11, x1 + 3} p_A(x1) = max{0, x1 - 47} |0|_A = 0 times_A(x1,x2) = max{0, x2 - 16} div_A(x1,x2) = max{48, x1 - 47, x2 - 47} quot_A(x1,x2,x3) = max{49, x1 - 43, x2 - 48, x3 - 48} zero_A(x1) = max{0, x1 - 47} eq_A(x1,x2) = max{0, x1 - 44, x2 - 95} true_A = 0 false_A = 0 pr_A(x1,x2) = max{0, x1 - 19, x2 - 21} if_A(x1,x2,x3) = max{0, x1 - 6, x2 - 19, x3 - 21} base order 2: precedence: times > eq# = div > s = quot > zero > eq = if > p = pr > |0| > true > false partial status: pi(eq#) = [2] pi(s) = [1] pi(p) = [] pi(|0|) = [] pi(times) = [] pi(div) = [] pi(quot) = [] pi(zero) = [] pi(eq) = [] pi(true) = [] pi(false) = [] pi(pr) = [] pi(if) = [] The following rules are removed: p1 Then no dependency pair remains.