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, r11, r13, r25, r27, r28 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: pr#_A(x1,x2) = max{x1 - 54, x2 + 140} s_A(x1) = 0 divides#_A(x1,x2) = max{140, x1 + 14} div#_A(x1,x2) = 140 div_A(x1,x2) = x1 + 6 zero#_A(x1) = 140 if#_A(x1,x2,x3) = max{x2 - 54, x3 + 140} eq_A(x1,x2) = max{x1 + 9, x2 - 10} |0|_A = 19 plus_A(x1,x2) = max{120, x1 + 53, x2 + 34} zero_A(x1) = max{86, x1 + 13} false_A = 87 divides_A(x1,x2) = max{141, x1 - 14, x2 + 16} times_A(x1,x2) = max{11, x1 + 7, x2 - 5} quot#_A(x1,x2,x3) = 140 quot_A(x1,x2,x3) = x1 + 8 if_A(x1,x2,x3) = max{86, x1 - 2, x2 - 140, x3 - 113} true_A = 90 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: pr#_A(x1,x2) = max{71, x2 - 207} s_A(x1) = max{172, x1 + 34} divides#_A(x1,x2) = 71 div#_A(x1,x2) = 71 div_A(x1,x2) = max{x1 + 168, x2 + 45} zero#_A(x1) = 71 if#_A(x1,x2,x3) = max{71, x3 - 173} eq_A(x1,x2) = max{171, x1 - 1, x2 - 245} |0|_A = 71 plus_A(x1,x2) = max{73, x1 + 1, x2} zero_A(x1) = x1 + 139 false_A = 172 divides_A(x1,x2) = max{41, x1 + 1, x2 - 140} times_A(x1,x2) = max{0, x1 - 116} quot#_A(x1,x2,x3) = 71 quot_A(x1,x2,x3) = max{71, x1 - 69, x2 - 173, x3 - 1} if_A(x1,x2,x3) = max{174, x1 - 174, x3 - 173} true_A = 214 pr#!_A(x1,x2) = max{126, x1 - 45} s!_A(x1) = 123 divides#!_A(x1,x2) = max{125, x2 - 46} div#!_A(x1,x2) = max{124, x1 - 47} div!_A(x1,x2) = max{174, x1 - 271} zero#!_A(x1) = max{27, x1 - 3} if#!_A(x1,x2,x3) = max{126, x2 - 45} eq!_A(x1,x2) = max{172, x1 - 43, x2 - 51} |0|!_A = 30 plus!_A(x1,x2) = 0 zero!_A(x1) = max{122, x1 - 1} false!_A = 0 divides!_A(x1,x2) = max{173, x1 - 84, x2 - 44} times!_A(x1,x2) = max{0, x1 - 172, x2 - 172} quot#!_A(x1,x2,x3) = max{124, x1 - 47} quot!_A(x1,x2,x3) = max{174, x1 - 139, x2 - 3} if!_A(x1,x2,x3) = max{172, x1 - 213, x2 - 71, x3 - 212} true!_A = 29 partial status: pi(pr#) = [] pi(s) = [] pi(divides#) = [] pi(div#) = [] pi(div) = [1] pi(zero#) = [] pi(if#) = [] pi(eq) = [] pi(|0|) = [] pi(plus) = [1] pi(zero) = [1] pi(false) = [] pi(divides) = [2] pi(times) = [] pi(quot#) = [] pi(quot) = [1] pi(if) = [] pi(true) = [] The following rules are removed: p1, p2, p3, p4, p10 -- SCC decomposition. 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)) p3: div#(div(x,y),z) -> div#(x,times(zero(y),z)) p4: div#(x,y) -> quot#(x,y,y) p5: quot#(x,|0|(),s(z)) -> div#(x,s(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, p4, p5} -- 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 r11, r17, r18, r19, r20, r23, r25 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: if#_A(x1,x2,x3) = x3 false_A = 0 pr#_A(x1,x2) = x2 s_A(x1) = x1 divides_A(x1,x2) = 9 div_A(x1,x2) = max{14, x1 - 14} |0|_A = 0 eq_A(x1,x2) = max{8, x1 + 6, x2 + 3} true_A = 7 pr_A(x1,x2) = max{x1 - 8, x2 + 8} if_A(x1,x2,x3) = max{x1 - 10, x2 - 7, x3 + 9} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: if#_A(x1,x2,x3) = max{29, x2, x3 - 58} false_A = 24 pr#_A(x1,x2) = max{29, x1, x2 - 58} s_A(x1) = max{57, x1 + 29} divides_A(x1,x2) = max{110, x1 - 31, x2 + 55} div_A(x1,x2) = 111 |0|_A = 111 eq_A(x1,x2) = 24 true_A = 24 pr_A(x1,x2) = max{24, x1 - 95, x2 - 141} if_A(x1,x2,x3) = max{24, x1 - 110, x2 - 95, x3 - 111} if#!_A(x1,x2,x3) = 134 false!_A = 59 pr#!_A(x1,x2) = 134 s!_A(x1) = 135 divides!_A(x1,x2) = max{x1 + 79, x2 + 166} div!_A(x1,x2) = 0 |0|!_A = 60 eq!_A(x1,x2) = max{62, x1 + 1, x2 + 34} true!_A = 166 pr!_A(x1,x2) = max{x1 + 165, x2 - 141} if!_A(x1,x2,x3) = max{x1 + 111, x2 - 95} partial status: pi(if#) = [3] pi(false) = [] pi(pr#) = [2] pi(s) = [1] pi(divides) = [] pi(div) = [] pi(|0|) = [] pi(eq) = [1, 2] pi(true) = [] pi(pr) = [2] pi(if) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: if#(false(),x,y) -> pr#(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: (no SCCs) -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: div#(div(x,y),z) -> div#(x,times(zero(y),z)) p2: div#(x,y) -> quot#(x,y,y) p3: quot#(x,|0|(),s(z)) -> div#(x,s(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, r27, r30 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: div#_A(x1,x2) = max{10, x1 + 1} div_A(x1,x2) = max{13, x1 + 2, x2 - 10} times_A(x1,x2) = max{8, x1 - 28, x2 - 4} zero_A(x1) = max{27, x1 + 21} quot#_A(x1,x2,x3) = max{10, x1 + 1} |0|_A = 6 s_A(x1) = 10 p_A(x1) = 8 quot_A(x1,x2,x3) = max{13, x2 - 5, x3 - 10} eq_A(x1,x2) = max{12, x1 - 10, x2 - 16} true_A = 11 false_A = 7 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: div#_A(x1,x2) = max{1, x1 - 49} div_A(x1,x2) = max{x1 + 48, x2 - 82} times_A(x1,x2) = 49 zero_A(x1) = max{6, x1 - 20} quot#_A(x1,x2,x3) = max{1, x1 - 49} |0|_A = 26 s_A(x1) = max{0, x1 - 23} p_A(x1) = max{27, x1 + 12} quot_A(x1,x2,x3) = max{25, x1 + 24, x2 - 132, x3 - 106} eq_A(x1,x2) = max{x1 - 27, x2 + 11} true_A = 9 false_A = 9 div#!_A(x1,x2) = x1 + 84 div!_A(x1,x2) = max{0, x1 - 49, x2 - 51} times!_A(x1,x2) = max{x1 + 22, x2 - 1} zero!_A(x1) = 0 quot#!_A(x1,x2,x3) = x1 + 84 |0|!_A = 0 s!_A(x1) = 0 p!_A(x1) = max{1, x1 - 27} quot!_A(x1,x2,x3) = max{1, x1 - 52, x2 - 78, x3 - 1} eq!_A(x1,x2) = max{72, x1 - 27, x2 - 119} true!_A = 1 false!_A = 70 partial status: pi(div#) = [1] pi(div) = [] pi(times) = [] pi(zero) = [] pi(quot#) = [1] pi(|0|) = [] pi(s) = [] pi(p) = [] pi(quot) = [] pi(eq) = [] pi(true) = [] pi(false) = [] 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)) 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: div#(x,y) -> quot#(x,y,y) p2: quot#(x,|0|(),s(z)) -> div#(x,s(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 r23 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: div#_A(x1,x2) = x2 + 12 quot#_A(x1,x2,x3) = max{11, x2 + 1} |0|_A = 36 s_A(x1) = 23 pr_A(x1,x2) = max{22, x1 - 20, x2 - 33} true_A = 21 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: div#_A(x1,x2) = max{0, x1 - 2, x2 - 5} quot#_A(x1,x2,x3) = max{0, x1 - 2, x2 - 210, x3 - 5} |0|_A = 208 s_A(x1) = max{4, x1 - 61} pr_A(x1,x2) = max{279, x1 - 229, x2 - 136} true_A = 17 div#!_A(x1,x2) = 0 quot#!_A(x1,x2,x3) = x2 + 63 |0|!_A = 4 s!_A(x1) = max{0, x1 - 270} pr!_A(x1,x2) = max{0, x1 - 491, x2 - 148} true!_A = 3 partial status: pi(div#) = [2] pi(quot#) = [2] pi(|0|) = [] pi(s) = [] pi(pr) = [] pi(true) = [] 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: 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 r11 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: times#_A(x1,x2) = x2 + 2 s_A(x1) = max{0, x1 - 50} div_A(x1,x2) = max{4, x1 - 44, x2 - 8} |0|_A = 0 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: times#_A(x1,x2) = max{0, x1 - 6} s_A(x1) = max{17, x1 + 5} div_A(x1,x2) = max{191, x1 - 291, x2 - 23} |0|_A = 95 times#!_A(x1,x2) = max{6, x1 - 6} s!_A(x1) = max{5, x1 - 1668} div!_A(x1,x2) = max{7, x1 - 710, x2 - 18} |0|!_A = 2 partial status: pi(times#) = [] pi(s) = [] pi(div) = [] 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: 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 r2 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: plus#_A(x1,x2) = 1 s_A(x1) = max{9, x1 - 70} p_A(x1) = max{163, x1 + 73} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 47, x2 - 47} s_A(x1) = max{46, x1 + 34} p_A(x1) = max{20, x1 - 30} plus#!_A(x1,x2) = max{2, x1 - 43} s!_A(x1) = max{3, x1 - 1179} p!_A(x1) = max{3, x1 - 1213} partial status: pi(plus#) = [] pi(s) = [] pi(p) = [] The following rules are removed: p1, p3 -- 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 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 s_A(x1) = max{7, x1 - 76} p_A(x1) = max{184, x1 + 179} |0|_A = 3 times_A(x1,x2) = max{x1 - 82, x2 + 12} div_A(x1,x2) = max{81, x1 + 41, x2 - 53} quot_A(x1,x2,x3) = max{4, x1 - 259, x2 - 8, x3 - 1} zero_A(x1) = max{258, x1 - 11} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 5, x2 - 5} s_A(x1) = x1 + 4 p_A(x1) = max{1, x1 - 3} |0|_A = 0 times_A(x1,x2) = max{14, x1 - 6, x2 - 2} div_A(x1,x2) = max{11, x1 - 20, x2 - 20} quot_A(x1,x2,x3) = max{3, x1 - 19, x2 - 13, x3 - 17} zero_A(x1) = max{18, x1 - 65} plus#!_A(x1,x2) = max{1, x2 - 2} s!_A(x1) = max{7, x1 - 109} p!_A(x1) = max{5, x1 - 38} |0|!_A = 4 times!_A(x1,x2) = max{10, x2 - 42} div!_A(x1,x2) = max{9, x1 - 132, x2 - 134} quot!_A(x1,x2,x3) = max{8, x1 - 129, x2 - 5, x3 - 101} zero!_A(x1) = max{0, x1 - 16} partial status: pi(plus#) = [1] pi(s) = [] pi(p) = [] pi(|0|) = [] pi(times) = [2] pi(div) = [1] pi(quot) = [] 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: 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 r11 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: eq#_A(x1,x2) = 0 s_A(x1) = max{15, x1 - 105} div_A(x1,x2) = max{13, x1 - 54, x2 - 51} |0|_A = 12 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: eq#_A(x1,x2) = max{0, x1 - 4, x2 - 4} s_A(x1) = max{15, x1 + 3} div_A(x1,x2) = max{181, x1 - 290, x2 - 19} |0|_A = 91 eq#!_A(x1,x2) = max{10, x1 - 4, x2 - 16} s!_A(x1) = max{9, x1 - 1179} div!_A(x1,x2) = max{11, x1 - 997, x2 - 299} |0|!_A = 3 partial status: pi(eq#) = [] pi(s) = [] pi(div) = [] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains.