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(|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: 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(y,z)) p12: div#(div(x,y),z) -> times#(y,z) p13: eq#(s(x),s(y)) -> eq#(x,y) p14: divides#(y,x) -> eq#(x,times(div(x,y),y)) p15: divides#(y,x) -> times#(div(x,y),y) p16: divides#(y,x) -> div#(x,y) p17: prime#(s(s(x))) -> pr#(s(s(x)),s(x)) p18: pr#(x,s(s(y))) -> if#(divides(s(s(y)),x),x,s(y)) p19: pr#(x,s(s(y))) -> divides#(s(s(y)),x) p20: 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(|0|(),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(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) The estimated dependency graph contains the following SCCs: {p18, p20} {p8, p9, p10, p11} {p7} {p1, p2, p4} {p13} -- 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(|0|(),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(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) The set of usable rules consists of r13, r18, r19 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: if#_A(x1,x2,x3) = max{47, x2 - 1, x3 + 15} false_A = 31 pr#_A(x1,x2) = max{33, x1 - 1, x2 - 3} s_A(x1) = max{32, x1 + 18} divides_A(x1,x2) = max{51, x1 - 2, x2} quot_A(x1,x2,x3) = max{76, x1 - 76, x2 - 76, x3 - 33} |0|_A = 75 eq_A(x1,x2) = max{52, x1 - 76} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: if#_A(x1,x2,x3) = max{16, x3 - 52} false_A = 31 pr#_A(x1,x2) = max{16, x2 - 54} s_A(x1) = max{53, x1 + 16} divides_A(x1,x2) = max{97, x1 - 1, x2 + 68} quot_A(x1,x2,x3) = max{x1 + 9, x2 - 54, x3 - 54} |0|_A = 46 eq_A(x1,x2) = max{98, x1 - 54} if#!_A(x1,x2,x3) = max{26, x3 - 30} false!_A = 19 pr#!_A(x1,x2) = max{24, x2 - 31} s!_A(x1) = 25 divides!_A(x1,x2) = max{0, x1 - 70, x2 - 54} quot!_A(x1,x2,x3) = max{25, x1 - 54, x2 - 54, x3 - 54} |0|!_A = 69 eq!_A(x1,x2) = max{26, x1 - 55} partial status: pi(if#) = [] pi(false) = [] pi(pr#) = [] pi(s) = [1] pi(divides) = [2] pi(quot) = [] pi(|0|) = [] pi(eq) = [] 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: 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: 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(|0|(),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(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) The set of usable rules consists of r4, r8, r11 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: div#_A(x1,x2) = max{8, x1} div_A(x1,x2) = max{22, x1 + 10, x2 + 14} times_A(x1,x2) = x1 + 14 quot#_A(x1,x2,x3) = max{8, x1} |0|_A = 13 s_A(x1) = x1 + 34 plus_A(x1,x2) = x2 + 20 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: div#_A(x1,x2) = 1 div_A(x1,x2) = max{116, x1 + 10, x2 - 59} times_A(x1,x2) = max{56, x1 + 11, x2 + 11} quot#_A(x1,x2,x3) = 1 |0|_A = 13 s_A(x1) = 44 plus_A(x1,x2) = max{57, x1 - 1, x2} div#!_A(x1,x2) = x1 + 131 div!_A(x1,x2) = max{70, x1 - 115, x2 - 231} times!_A(x1,x2) = 0 quot#!_A(x1,x2,x3) = x1 + 131 |0|!_A = 2 s!_A(x1) = 0 plus!_A(x1,x2) = 0 partial status: pi(div#) = [1] pi(div) = [1] pi(times) = [1] pi(quot#) = [1] pi(|0|) = [] pi(s) = [1] pi(plus) = [] The following rules are removed: p1, p4 -- 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(|0|(),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(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) 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(|0|(),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(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) The set of usable rules consists of r1 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: div#_A(x1,x2) = max{9, x2 + 7} quot#_A(x1,x2,x3) = max{8, x2 + 6} |0|_A = 29 s_A(x1) = 21 p_A(x1) = x1 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 - 42} quot#_A(x1,x2,x3) = max{0, x1 - 2, x2 - 42, x3 - 42} |0|_A = 33 s_A(x1) = max{41, x1 - 5} p_A(x1) = max{47, x1 - 34} div#!_A(x1,x2) = max{31, x2 + 4} quot#!_A(x1,x2,x3) = max{x2 - 1, x3 + 70} |0|!_A = 111 s!_A(x1) = 110 p!_A(x1) = max{1, x1 - 416} partial status: pi(div#) = [] pi(quot#) = [2] pi(|0|) = [] pi(s) = [] pi(p) = [1] 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(|0|(),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(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) The set of usable rules consists of r1, r17, r18, r19 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: times#_A(x1,x2) = x1 + 1 s_A(x1) = max{9, x1 + 3} p_A(x1) = max{46, x1 - 53} |0|_A = 36 eq_A(x1,x2) = max{14, x1 - 37, x2 - 37} true_A = 10 false_A = 4 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: times#_A(x1,x2) = 0 s_A(x1) = max{67, x1 - 7} p_A(x1) = max{83, x1 - 27} |0|_A = 26 eq_A(x1,x2) = max{9, x1 - 193, x2 - 68} true_A = 2 false_A = 2 times#!_A(x1,x2) = 3 s!_A(x1) = max{2, x1 - 213} p!_A(x1) = max{0, x1 - 205} |0|!_A = 4 eq!_A(x1,x2) = max{8, x1 - 68, x2 - 71} true!_A = 3 false!_A = 1 partial status: pi(times#) = [1] pi(s) = [1] pi(p) = [] pi(|0|) = [] pi(eq) = [] 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: 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(|0|(),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(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) The set of usable rules consists of r1, r2, r8 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: plus#_A(x1,x2) = 0 s_A(x1) = max{5, x1 - 50} p_A(x1) = max{57, x1 + 51} |0|_A = 3 times_A(x1,x2) = max{17, x1 - 75, x2 - 57} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 10, x2 - 10} s_A(x1) = max{9, x1 + 5} p_A(x1) = max{7, x1 - 4} |0|_A = 3 times_A(x1,x2) = max{11, x1 - 37, x2 - 44} plus#!_A(x1,x2) = max{4, x1 - 4} s!_A(x1) = max{6, x1 - 80} p!_A(x1) = max{7, x1 - 90} |0|!_A = 4 times!_A(x1,x2) = max{1, x1 - 108, x2 - 143} partial status: pi(plus#) = [] pi(s) = [] pi(p) = [] pi(|0|) = [] pi(times) = [] 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(|0|(),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(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) 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(|0|(),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(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) The set of usable rules consists of r1, r2, r8, 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 + 8 s_A(x1) = max{6, x1 - 33} p_A(x1) = max{42, x1 + 34} |0|_A = 5 times_A(x1,x2) = max{9, x1 - 19, x2 - 12} div_A(x1,x2) = max{7, x1 - 63, x2 - 34} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 19, x2 - 59} s_A(x1) = max{58, x1 + 18} p_A(x1) = max{41, x1 - 15} |0|_A = 1 times_A(x1,x2) = max{55, x1 - 66, x2 - 8} div_A(x1,x2) = max{56, x1 - 125, x2 - 123} plus#!_A(x1,x2) = max{1, x2 - 56} s!_A(x1) = max{4, x1 - 163} p!_A(x1) = max{3, x1 - 181} |0|!_A = 6 times!_A(x1,x2) = max{7, x1 - 59, x2 - 422} div!_A(x1,x2) = max{1, x1 - 367, x2 - 423} partial status: pi(plus#) = [1] pi(s) = [] pi(p) = [] pi(|0|) = [] pi(times) = [] pi(div) = [] 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(|0|(),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(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) The set of usable rules consists of r1 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: eq#_A(x1,x2) = x1 + 1 s_A(x1) = max{8, x1 + 2} p_A(x1) = max{32, x1 - 44} |0|_A = 31 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: eq#_A(x1,x2) = 0 s_A(x1) = max{79, x1 - 15} p_A(x1) = max{31, x1 - 11} |0|_A = 10 eq#!_A(x1,x2) = x2 + 34 s!_A(x1) = max{17, x1 + 13} p!_A(x1) = max{21, x1 - 114} |0|!_A = 20 partial status: pi(eq#) = [1] pi(s) = [1] pi(p) = [] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains.