YES We show the termination of the TRS R: times(x,|0|()) -> |0|() times(x,s(y)) -> plus(times(x,y),x) plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) plus(zero(),y) -> y plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) id(x) -> x if(true(),x,y) -> x if(false(),x,y) -> y not(x) -> if(x,false(),true()) gt(s(x),zero()) -> true() gt(zero(),y) -> false() gt(s(x),s(y)) -> gt(x,y) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: times#(x,s(y)) -> plus#(times(x,y),x) p2: times#(x,s(y)) -> times#(x,y) p3: plus#(s(x),s(y)) -> plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) p4: plus#(s(x),s(y)) -> if#(gt(x,y),x,y) p5: plus#(s(x),s(y)) -> gt#(x,y) p6: plus#(s(x),s(y)) -> if#(not(gt(x,y)),id(x),id(y)) p7: plus#(s(x),s(y)) -> not#(gt(x,y)) p8: plus#(s(x),s(y)) -> id#(x) p9: plus#(s(x),s(y)) -> id#(y) p10: plus#(s(x),x) -> plus#(if(gt(x,x),id(x),id(x)),s(x)) p11: plus#(s(x),x) -> if#(gt(x,x),id(x),id(x)) p12: plus#(s(x),x) -> gt#(x,x) p13: plus#(s(x),x) -> id#(x) p14: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),y,s(y))) p15: plus#(id(x),s(y)) -> if#(gt(s(y),y),y,s(y)) p16: plus#(id(x),s(y)) -> gt#(s(y),y) p17: not#(x) -> if#(x,false(),true()) p18: gt#(s(x),s(y)) -> gt#(x,y) and R consists of: r1: times(x,|0|()) -> |0|() r2: times(x,s(y)) -> plus(times(x,y),x) r3: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r4: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r5: plus(zero(),y) -> y r6: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r7: id(x) -> x r8: if(true(),x,y) -> x r9: if(false(),x,y) -> y r10: not(x) -> if(x,false(),true()) r11: gt(s(x),zero()) -> true() r12: gt(zero(),y) -> false() r13: gt(s(x),s(y)) -> gt(x,y) The estimated dependency graph contains the following SCCs: {p2} {p3, p10, p14} {p18} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: times#(x,s(y)) -> times#(x,y) and R consists of: r1: times(x,|0|()) -> |0|() r2: times(x,s(y)) -> plus(times(x,y),x) r3: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r4: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r5: plus(zero(),y) -> y r6: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r7: id(x) -> x r8: if(true(),x,y) -> x r9: if(false(),x,y) -> y r10: not(x) -> if(x,false(),true()) r11: gt(s(x),zero()) -> true() r12: gt(zero(),y) -> false() r13: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: times#_A(x1,x2) = x2 s_A(x1) = x1 + 8 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: times#_A(x1,x2) = max{0, x2 - 1} s_A(x1) = max{52, x1} times#!_A(x1,x2) = max{5, x2 - 53} s!_A(x1) = max{11, x1 + 4} partial status: pi(times#) = [] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: plus#(s(x),s(y)) -> plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) p2: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),y,s(y))) p3: plus#(s(x),x) -> plus#(if(gt(x,x),id(x),id(x)),s(x)) and R consists of: r1: times(x,|0|()) -> |0|() r2: times(x,s(y)) -> plus(times(x,y),x) r3: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r4: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r5: plus(zero(),y) -> y r6: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r7: id(x) -> x r8: if(true(),x,y) -> x r9: if(false(),x,y) -> y r10: not(x) -> if(x,false(),true()) r11: gt(s(x),zero()) -> true() r12: gt(zero(),y) -> false() r13: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of r7, r8, r9, r10, r11, r12, r13 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: plus#_A(x1,x2) = 3 s_A(x1) = x1 + 4 if_A(x1,x2,x3) = x1 + x2 + x3 + 3 gt_A(x1,x2) = x2 + 2 not_A(x1) = x1 + 10 id_A(x1) = x1 + 6 true_A() = 5 false_A() = 1 zero_A() = 6 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 7, x2 - 7} s_A(x1) = x1 + 6 if_A(x1,x2,x3) = max{x1 - 59, x2, x3} gt_A(x1,x2) = max{52, x1 - 13, x2 - 7} not_A(x1) = max{30, x1 - 59} id_A(x1) = max{1, x1} true_A = 30 false_A = 1 zero_A = 2 plus#!_A(x1,x2) = max{x1 + 6, x2 + 4} s!_A(x1) = 0 if!_A(x1,x2,x3) = max{x1 - 39, x2 + 81, x3 - 16} gt!_A(x1,x2) = max{3, x1 - 1, x2 - 7} not!_A(x1) = max{13, x1 - 53} id!_A(x1) = max{1, x1 - 81} true!_A = 4 false!_A = 2 zero!_A = 5 partial status: pi(plus#) = [] pi(s) = [] pi(if) = [] pi(gt) = [2] pi(not) = [1] pi(id) = [1] pi(true) = [] pi(false) = [] pi(zero) = [] The following rules are removed: p1, p3 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),y,s(y))) and R consists of: r1: times(x,|0|()) -> |0|() r2: times(x,s(y)) -> plus(times(x,y),x) r3: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r4: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r5: plus(zero(),y) -> y r6: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r7: id(x) -> x r8: if(true(),x,y) -> x r9: if(false(),x,y) -> y r10: not(x) -> if(x,false(),true()) r11: gt(s(x),zero()) -> true() r12: gt(zero(),y) -> false() r13: gt(s(x),s(y)) -> gt(x,y) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: plus#(id(x),s(y)) -> plus#(x,if(gt(s(y),y),y,s(y))) and R consists of: r1: times(x,|0|()) -> |0|() r2: times(x,s(y)) -> plus(times(x,y),x) r3: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r4: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r5: plus(zero(),y) -> y r6: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r7: id(x) -> x r8: if(true(),x,y) -> x r9: if(false(),x,y) -> y r10: not(x) -> if(x,false(),true()) r11: gt(s(x),zero()) -> true() r12: gt(zero(),y) -> false() r13: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: plus#_A(x1,x2) = x1 id_A(x1) = x1 + 9 s_A(x1) = 4 if_A(x1,x2,x3) = 2 gt_A(x1,x2) = x2 + 8 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 3} id_A(x1) = max{2, x1} s_A(x1) = x1 + 28 if_A(x1,x2,x3) = max{13, x1 - 39, x2 - 36, x3 - 64} gt_A(x1,x2) = max{x1 - 25, x2 + 3} plus#!_A(x1,x2) = max{1, x1 - 1} id!_A(x1) = max{62, x1 - 92} s!_A(x1) = max{5, x1 + 3} if!_A(x1,x2,x3) = max{2, x1 - 1, x2 - 96, x3 - 66} gt!_A(x1,x2) = max{25, x1 - 1, x2 - 94} partial status: pi(plus#) = [] pi(id) = [1] pi(s) = [] pi(if) = [] pi(gt) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: gt#(s(x),s(y)) -> gt#(x,y) and R consists of: r1: times(x,|0|()) -> |0|() r2: times(x,s(y)) -> plus(times(x,y),x) r3: plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) r4: plus(s(x),x) -> plus(if(gt(x,x),id(x),id(x)),s(x)) r5: plus(zero(),y) -> y r6: plus(id(x),s(y)) -> s(plus(x,if(gt(s(y),y),y,s(y)))) r7: id(x) -> x r8: if(true(),x,y) -> x r9: if(false(),x,y) -> y r10: not(x) -> if(x,false(),true()) r11: gt(s(x),zero()) -> true() r12: gt(zero(),y) -> false() r13: gt(s(x),s(y)) -> gt(x,y) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: gt#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 5 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: gt#_A(x1,x2) = max{0, x1 - 103, x2 - 103} s_A(x1) = max{113, x1 + 102} gt#!_A(x1,x2) = max{1, x1 - 457, x2 - 458} s!_A(x1) = max{20, x1 - 457} partial status: pi(gt#) = [2] pi(s) = [] The following rules are removed: p1 Then no dependency pair remains.