YES We show the termination of the TRS R: eq(|0|(),|0|()) -> true() eq(|0|(),s(x)) -> false() eq(s(x),|0|()) -> false() eq(s(x),s(y)) -> eq(x,y) le(|0|(),y) -> true() le(s(x),|0|()) -> false() le(s(x),s(y)) -> le(x,y) app(nil(),y) -> y app(add(n,x),y) -> add(n,app(x,y)) min(add(n,nil())) -> n min(add(n,add(m,x))) -> if_min(le(n,m),add(n,add(m,x))) if_min(true(),add(n,add(m,x))) -> min(add(n,x)) if_min(false(),add(n,add(m,x))) -> min(add(m,x)) rm(n,nil()) -> nil() rm(n,add(m,x)) -> if_rm(eq(n,m),n,add(m,x)) if_rm(true(),n,add(m,x)) -> rm(n,x) if_rm(false(),n,add(m,x)) -> add(m,rm(n,x)) minsort(nil(),nil()) -> nil() minsort(add(n,x),y) -> if_minsort(eq(n,min(add(n,x))),add(n,x),y) if_minsort(true(),add(n,x),y) -> add(n,minsort(app(rm(n,x),y),nil())) if_minsort(false(),add(n,x),y) -> minsort(x,add(n,y)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: eq#(s(x),s(y)) -> eq#(x,y) p2: le#(s(x),s(y)) -> le#(x,y) p3: app#(add(n,x),y) -> app#(x,y) p4: min#(add(n,add(m,x))) -> if_min#(le(n,m),add(n,add(m,x))) p5: min#(add(n,add(m,x))) -> le#(n,m) p6: if_min#(true(),add(n,add(m,x))) -> min#(add(n,x)) p7: if_min#(false(),add(n,add(m,x))) -> min#(add(m,x)) p8: rm#(n,add(m,x)) -> if_rm#(eq(n,m),n,add(m,x)) p9: rm#(n,add(m,x)) -> eq#(n,m) p10: if_rm#(true(),n,add(m,x)) -> rm#(n,x) p11: if_rm#(false(),n,add(m,x)) -> rm#(n,x) p12: minsort#(add(n,x),y) -> if_minsort#(eq(n,min(add(n,x))),add(n,x),y) p13: minsort#(add(n,x),y) -> eq#(n,min(add(n,x))) p14: minsort#(add(n,x),y) -> min#(add(n,x)) p15: if_minsort#(true(),add(n,x),y) -> minsort#(app(rm(n,x),y),nil()) p16: if_minsort#(true(),add(n,x),y) -> app#(rm(n,x),y) p17: if_minsort#(true(),add(n,x),y) -> rm#(n,x) p18: if_minsort#(false(),add(n,x),y) -> minsort#(x,add(n,y)) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: min(add(n,nil())) -> n r11: min(add(n,add(m,x))) -> if_min(le(n,m),add(n,add(m,x))) r12: if_min(true(),add(n,add(m,x))) -> min(add(n,x)) r13: if_min(false(),add(n,add(m,x))) -> min(add(m,x)) r14: rm(n,nil()) -> nil() r15: rm(n,add(m,x)) -> if_rm(eq(n,m),n,add(m,x)) r16: if_rm(true(),n,add(m,x)) -> rm(n,x) r17: if_rm(false(),n,add(m,x)) -> add(m,rm(n,x)) r18: minsort(nil(),nil()) -> nil() r19: minsort(add(n,x),y) -> if_minsort(eq(n,min(add(n,x))),add(n,x),y) r20: if_minsort(true(),add(n,x),y) -> add(n,minsort(app(rm(n,x),y),nil())) r21: if_minsort(false(),add(n,x),y) -> minsort(x,add(n,y)) The estimated dependency graph contains the following SCCs: {p12, p15, p18} {p8, p10, p11} {p1} {p4, p6, p7} {p2} {p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: if_minsort#(false(),add(n,x),y) -> minsort#(x,add(n,y)) p2: minsort#(add(n,x),y) -> if_minsort#(eq(n,min(add(n,x))),add(n,x),y) p3: if_minsort#(true(),add(n,x),y) -> minsort#(app(rm(n,x),y),nil()) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: min(add(n,nil())) -> n r11: min(add(n,add(m,x))) -> if_min(le(n,m),add(n,add(m,x))) r12: if_min(true(),add(n,add(m,x))) -> min(add(n,x)) r13: if_min(false(),add(n,add(m,x))) -> min(add(m,x)) r14: rm(n,nil()) -> nil() r15: rm(n,add(m,x)) -> if_rm(eq(n,m),n,add(m,x)) r16: if_rm(true(),n,add(m,x)) -> rm(n,x) r17: if_rm(false(),n,add(m,x)) -> add(m,rm(n,x)) r18: minsort(nil(),nil()) -> nil() r19: minsort(add(n,x),y) -> if_minsort(eq(n,min(add(n,x))),add(n,x),y) r20: if_minsort(true(),add(n,x),y) -> add(n,minsort(app(rm(n,x),y),nil())) r21: if_minsort(false(),add(n,x),y) -> minsort(x,add(n,y)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: if_minsort#_A(x1,x2,x3) = ((0,1),(0,0)) x1 + ((0,1),(0,1)) x2 + ((0,1),(0,1)) x3 + (1,5) false_A() = (1,2) add_A(x1,x2) = ((0,1),(1,1)) x1 + ((0,1),(0,1)) x2 + (0,4) minsort#_A(x1,x2) = ((0,1),(0,1)) x1 + ((0,1),(0,1)) x2 + (3,5) eq_A(x1,x2) = (1,2) min_A(x1) = ((0,1),(1,0)) x1 + (2,9) true_A() = (1,1) app_A(x1,x2) = x1 + ((1,1),(0,1)) x2 rm_A(x1,x2) = ((1,1),(1,0)) x1 + ((0,1),(0,1)) x2 + (0,1) nil_A() = (0,1) le_A(x1,x2) = ((0,0),(1,1)) x1 + ((0,0),(1,1)) x2 + (3,9) |0|_A() = (2,2) s_A(x1) = ((1,0),(1,1)) x1 + (2,2) if_min_A(x1,x2) = ((0,1),(1,0)) x2 + (1,5) if_rm_A(x1,x2,x3) = ((0,1),(1,0)) x1 + ((1,1),(1,0)) x2 + x3 + (1,0) precedence: |0| > rm = if_rm > if_minsort# = minsort# > eq > true > add = app > min > nil > le = if_min > false > s partial status: pi(if_minsort#) = [] pi(false) = [] pi(add) = [] pi(minsort#) = [] pi(eq) = [] pi(min) = [] pi(true) = [] pi(app) = [1, 2] pi(rm) = [] pi(nil) = [] pi(le) = [] pi(|0|) = [] pi(s) = [1] pi(if_min) = [] pi(if_rm) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: if_minsort#_A(x1,x2,x3) = (0,2) false_A() = (3,0) add_A(x1,x2) = (5,3) minsort#_A(x1,x2) = (0,2) eq_A(x1,x2) = (6,5) min_A(x1) = (2,4) true_A() = (0,1) app_A(x1,x2) = (6,4) rm_A(x1,x2) = (4,4) nil_A() = (1,3) le_A(x1,x2) = (7,0) |0|_A() = (1,0) s_A(x1) = ((1,1),(1,1)) x1 + (7,5) if_min_A(x1,x2) = (1,4) if_rm_A(x1,x2,x3) = (4,4) precedence: rm = if_min = if_rm > false > le = s > eq = app > add = min > true > nil > |0| > if_minsort# = minsort# partial status: pi(if_minsort#) = [] pi(false) = [] pi(add) = [] pi(minsort#) = [] pi(eq) = [] pi(min) = [] pi(true) = [] pi(app) = [] pi(rm) = [] pi(nil) = [] pi(le) = [] pi(|0|) = [] pi(s) = [1] pi(if_min) = [] pi(if_rm) = [] The next rules are strictly ordered: p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: if_minsort#(false(),add(n,x),y) -> minsort#(x,add(n,y)) p2: minsort#(add(n,x),y) -> if_minsort#(eq(n,min(add(n,x))),add(n,x),y) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: min(add(n,nil())) -> n r11: min(add(n,add(m,x))) -> if_min(le(n,m),add(n,add(m,x))) r12: if_min(true(),add(n,add(m,x))) -> min(add(n,x)) r13: if_min(false(),add(n,add(m,x))) -> min(add(m,x)) r14: rm(n,nil()) -> nil() r15: rm(n,add(m,x)) -> if_rm(eq(n,m),n,add(m,x)) r16: if_rm(true(),n,add(m,x)) -> rm(n,x) r17: if_rm(false(),n,add(m,x)) -> add(m,rm(n,x)) r18: minsort(nil(),nil()) -> nil() r19: minsort(add(n,x),y) -> if_minsort(eq(n,min(add(n,x))),add(n,x),y) r20: if_minsort(true(),add(n,x),y) -> add(n,minsort(app(rm(n,x),y),nil())) r21: if_minsort(false(),add(n,x),y) -> minsort(x,add(n,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: if_minsort#(false(),add(n,x),y) -> minsort#(x,add(n,y)) p2: minsort#(add(n,x),y) -> if_minsort#(eq(n,min(add(n,x))),add(n,x),y) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: min(add(n,nil())) -> n r11: min(add(n,add(m,x))) -> if_min(le(n,m),add(n,add(m,x))) r12: if_min(true(),add(n,add(m,x))) -> min(add(n,x)) r13: if_min(false(),add(n,add(m,x))) -> min(add(m,x)) r14: rm(n,nil()) -> nil() r15: rm(n,add(m,x)) -> if_rm(eq(n,m),n,add(m,x)) r16: if_rm(true(),n,add(m,x)) -> rm(n,x) r17: if_rm(false(),n,add(m,x)) -> add(m,rm(n,x)) r18: minsort(nil(),nil()) -> nil() r19: minsort(add(n,x),y) -> if_minsort(eq(n,min(add(n,x))),add(n,x),y) r20: if_minsort(true(),add(n,x),y) -> add(n,minsort(app(rm(n,x),y),nil())) r21: if_minsort(false(),add(n,x),y) -> minsort(x,add(n,y)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r10, r11, r12, r13 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: if_minsort#_A(x1,x2,x3) = max{51, x1 - 2, x2 + 38, x3 + 24} false_A = 16 add_A(x1,x2) = max{13, x1 + 12, x2} minsort#_A(x1,x2) = max{x1 + 38, x2 + 24} eq_A(x1,x2) = max{x1 + 52, x2 + 10} min_A(x1) = max{1, x1} le_A(x1,x2) = max{x1 + 11, x2 + 2} |0|_A = 17 true_A = 1 s_A(x1) = max{8, x1 + 7} if_min_A(x1,x2) = max{x1 + 1, x2} nil_A = 0 precedence: eq > add > min = le > false = |0| = s = if_min = nil > if_minsort# = minsort# = true partial status: pi(if_minsort#) = [2] pi(false) = [] pi(add) = [1, 2] pi(minsort#) = [1] pi(eq) = [] pi(min) = [1] pi(le) = [1, 2] pi(|0|) = [] pi(true) = [] pi(s) = [1] pi(if_min) = [1, 2] pi(nil) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: if_minsort#_A(x1,x2,x3) = max{11, x2 - 6} false_A = 32 add_A(x1,x2) = max{23, x1 + 21, x2 + 17} minsort#_A(x1,x2) = max{10, x1 + 1} eq_A(x1,x2) = 25 min_A(x1) = max{6, x1 - 14} le_A(x1,x2) = max{4, x1 + 2} |0|_A = 25 true_A = 26 s_A(x1) = x1 + 33 if_min_A(x1,x2) = max{21, x2 - 14} nil_A = 0 precedence: nil > eq = true > min = if_min > if_minsort# = |0| = s > false = add = minsort# = le partial status: pi(if_minsort#) = [] pi(false) = [] pi(add) = [1] pi(minsort#) = [1] pi(eq) = [] pi(min) = [] pi(le) = [] pi(|0|) = [] pi(true) = [] pi(s) = [1] pi(if_min) = [] pi(nil) = [] The next rules are strictly ordered: p1, p2 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: if_rm#(false(),n,add(m,x)) -> rm#(n,x) p2: rm#(n,add(m,x)) -> if_rm#(eq(n,m),n,add(m,x)) p3: if_rm#(true(),n,add(m,x)) -> rm#(n,x) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: min(add(n,nil())) -> n r11: min(add(n,add(m,x))) -> if_min(le(n,m),add(n,add(m,x))) r12: if_min(true(),add(n,add(m,x))) -> min(add(n,x)) r13: if_min(false(),add(n,add(m,x))) -> min(add(m,x)) r14: rm(n,nil()) -> nil() r15: rm(n,add(m,x)) -> if_rm(eq(n,m),n,add(m,x)) r16: if_rm(true(),n,add(m,x)) -> rm(n,x) r17: if_rm(false(),n,add(m,x)) -> add(m,rm(n,x)) r18: minsort(nil(),nil()) -> nil() r19: minsort(add(n,x),y) -> if_minsort(eq(n,min(add(n,x))),add(n,x),y) r20: if_minsort(true(),add(n,x),y) -> add(n,minsort(app(rm(n,x),y),nil())) r21: if_minsort(false(),add(n,x),y) -> minsort(x,add(n,y)) The set of usable rules consists of r1, r2, r3, r4 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: if_rm#_A(x1,x2,x3) = max{x1 + 4, x2 + 18, x3} false_A = 7 add_A(x1,x2) = max{x1, x2 + 9} rm#_A(x1,x2) = max{x1 + 18, x2 + 9} eq_A(x1,x2) = max{x1 + 14, x2 + 4} true_A = 9 |0|_A = 6 s_A(x1) = x1 + 8 precedence: false = eq = true > add > if_rm# = rm# = |0| = s partial status: pi(if_rm#) = [3] pi(false) = [] pi(add) = [1] pi(rm#) = [2] pi(eq) = [] pi(true) = [] pi(|0|) = [] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: if_rm#_A(x1,x2,x3) = x3 false_A = 6 add_A(x1,x2) = max{4, x1 + 2} rm#_A(x1,x2) = max{1, x2} eq_A(x1,x2) = 5 true_A = 6 |0|_A = 0 s_A(x1) = x1 + 7 precedence: false = add = true = s > eq > if_rm# = rm# = |0| partial status: pi(if_rm#) = [] pi(false) = [] pi(add) = [1] pi(rm#) = [2] pi(eq) = [] pi(true) = [] pi(|0|) = [] pi(s) = [1] The next rules are strictly ordered: p1, p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: rm#(n,add(m,x)) -> if_rm#(eq(n,m),n,add(m,x)) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: min(add(n,nil())) -> n r11: min(add(n,add(m,x))) -> if_min(le(n,m),add(n,add(m,x))) r12: if_min(true(),add(n,add(m,x))) -> min(add(n,x)) r13: if_min(false(),add(n,add(m,x))) -> min(add(m,x)) r14: rm(n,nil()) -> nil() r15: rm(n,add(m,x)) -> if_rm(eq(n,m),n,add(m,x)) r16: if_rm(true(),n,add(m,x)) -> rm(n,x) r17: if_rm(false(),n,add(m,x)) -> add(m,rm(n,x)) r18: minsort(nil(),nil()) -> nil() r19: minsort(add(n,x),y) -> if_minsort(eq(n,min(add(n,x))),add(n,x),y) r20: if_minsort(true(),add(n,x),y) -> add(n,minsort(app(rm(n,x),y),nil())) r21: if_minsort(false(),add(n,x),y) -> minsort(x,add(n,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: eq#(s(x),s(y)) -> eq#(x,y) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: min(add(n,nil())) -> n r11: min(add(n,add(m,x))) -> if_min(le(n,m),add(n,add(m,x))) r12: if_min(true(),add(n,add(m,x))) -> min(add(n,x)) r13: if_min(false(),add(n,add(m,x))) -> min(add(m,x)) r14: rm(n,nil()) -> nil() r15: rm(n,add(m,x)) -> if_rm(eq(n,m),n,add(m,x)) r16: if_rm(true(),n,add(m,x)) -> rm(n,x) r17: if_rm(false(),n,add(m,x)) -> add(m,rm(n,x)) r18: minsort(nil(),nil()) -> nil() r19: minsort(add(n,x),y) -> if_minsort(eq(n,min(add(n,x))),add(n,x),y) r20: if_minsort(true(),add(n,x),y) -> add(n,minsort(app(rm(n,x),y),nil())) r21: if_minsort(false(),add(n,x),y) -> minsort(x,add(n,y)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: eq#_A(x1,x2) = max{2, x1 - 1, x2 + 1} s_A(x1) = max{1, x1} precedence: eq# = s partial status: pi(eq#) = [2] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: eq#_A(x1,x2) = 0 s_A(x1) = max{2, x1} precedence: eq# = s partial status: pi(eq#) = [] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: if_min#(false(),add(n,add(m,x))) -> min#(add(m,x)) p2: min#(add(n,add(m,x))) -> if_min#(le(n,m),add(n,add(m,x))) p3: if_min#(true(),add(n,add(m,x))) -> min#(add(n,x)) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: min(add(n,nil())) -> n r11: min(add(n,add(m,x))) -> if_min(le(n,m),add(n,add(m,x))) r12: if_min(true(),add(n,add(m,x))) -> min(add(n,x)) r13: if_min(false(),add(n,add(m,x))) -> min(add(m,x)) r14: rm(n,nil()) -> nil() r15: rm(n,add(m,x)) -> if_rm(eq(n,m),n,add(m,x)) r16: if_rm(true(),n,add(m,x)) -> rm(n,x) r17: if_rm(false(),n,add(m,x)) -> add(m,rm(n,x)) r18: minsort(nil(),nil()) -> nil() r19: minsort(add(n,x),y) -> if_minsort(eq(n,min(add(n,x))),add(n,x),y) r20: if_minsort(true(),add(n,x),y) -> add(n,minsort(app(rm(n,x),y),nil())) r21: if_minsort(false(),add(n,x),y) -> minsort(x,add(n,y)) The set of usable rules consists of r5, r6, r7 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: if_min#_A(x1,x2) = max{x1 + 5, x2} false_A = 4 add_A(x1,x2) = max{x1 + 9, x2 + 3} min#_A(x1) = x1 le_A(x1,x2) = x2 + 2 true_A = 1 |0|_A = 5 s_A(x1) = x1 + 8 precedence: if_min# = false = add = min# = le = true = |0| = s partial status: pi(if_min#) = [] pi(false) = [] pi(add) = [] pi(min#) = [] pi(le) = [] pi(true) = [] pi(|0|) = [] pi(s) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: if_min#_A(x1,x2) = 15 false_A = 18 add_A(x1,x2) = 19 min#_A(x1) = max{14, x1 - 4} le_A(x1,x2) = 13 true_A = 22 |0|_A = 17 s_A(x1) = x1 + 19 precedence: if_min# = false = add = min# = le = true = |0| = s partial status: pi(if_min#) = [] pi(false) = [] pi(add) = [] pi(min#) = [] pi(le) = [] pi(true) = [] pi(|0|) = [] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: min#(add(n,add(m,x))) -> if_min#(le(n,m),add(n,add(m,x))) p2: if_min#(true(),add(n,add(m,x))) -> min#(add(n,x)) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: min(add(n,nil())) -> n r11: min(add(n,add(m,x))) -> if_min(le(n,m),add(n,add(m,x))) r12: if_min(true(),add(n,add(m,x))) -> min(add(n,x)) r13: if_min(false(),add(n,add(m,x))) -> min(add(m,x)) r14: rm(n,nil()) -> nil() r15: rm(n,add(m,x)) -> if_rm(eq(n,m),n,add(m,x)) r16: if_rm(true(),n,add(m,x)) -> rm(n,x) r17: if_rm(false(),n,add(m,x)) -> add(m,rm(n,x)) r18: minsort(nil(),nil()) -> nil() r19: minsort(add(n,x),y) -> if_minsort(eq(n,min(add(n,x))),add(n,x),y) r20: if_minsort(true(),add(n,x),y) -> add(n,minsort(app(rm(n,x),y),nil())) r21: if_minsort(false(),add(n,x),y) -> minsort(x,add(n,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: min#(add(n,add(m,x))) -> if_min#(le(n,m),add(n,add(m,x))) p2: if_min#(true(),add(n,add(m,x))) -> min#(add(n,x)) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: min(add(n,nil())) -> n r11: min(add(n,add(m,x))) -> if_min(le(n,m),add(n,add(m,x))) r12: if_min(true(),add(n,add(m,x))) -> min(add(n,x)) r13: if_min(false(),add(n,add(m,x))) -> min(add(m,x)) r14: rm(n,nil()) -> nil() r15: rm(n,add(m,x)) -> if_rm(eq(n,m),n,add(m,x)) r16: if_rm(true(),n,add(m,x)) -> rm(n,x) r17: if_rm(false(),n,add(m,x)) -> add(m,rm(n,x)) r18: minsort(nil(),nil()) -> nil() r19: minsort(add(n,x),y) -> if_minsort(eq(n,min(add(n,x))),add(n,x),y) r20: if_minsort(true(),add(n,x),y) -> add(n,minsort(app(rm(n,x),y),nil())) r21: if_minsort(false(),add(n,x),y) -> minsort(x,add(n,y)) The set of usable rules consists of r5, r6, r7 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: min#_A(x1) = max{11, x1 + 5} add_A(x1,x2) = max{17, x2 + 7} if_min#_A(x1,x2) = max{18, x2 - 2} le_A(x1,x2) = max{x1, x2 + 54} true_A = 1 |0|_A = 2 s_A(x1) = max{58, x1} false_A = 57 precedence: add = if_min# > min# = le = true > s = false > |0| partial status: pi(min#) = [1] pi(add) = [2] pi(if_min#) = [] pi(le) = [1, 2] pi(true) = [] pi(|0|) = [] pi(s) = [1] pi(false) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: min#_A(x1) = x1 + 5 add_A(x1,x2) = x2 if_min#_A(x1,x2) = 5 le_A(x1,x2) = 7 true_A = 8 |0|_A = 7 s_A(x1) = x1 + 12 false_A = 11 precedence: true = s = false > min# = add = if_min# = le = |0| partial status: pi(min#) = [1] pi(add) = [2] pi(if_min#) = [] pi(le) = [] pi(true) = [] pi(|0|) = [] pi(s) = [1] pi(false) = [] The next rules are strictly ordered: p1, p2 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: le#(s(x),s(y)) -> le#(x,y) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: min(add(n,nil())) -> n r11: min(add(n,add(m,x))) -> if_min(le(n,m),add(n,add(m,x))) r12: if_min(true(),add(n,add(m,x))) -> min(add(n,x)) r13: if_min(false(),add(n,add(m,x))) -> min(add(m,x)) r14: rm(n,nil()) -> nil() r15: rm(n,add(m,x)) -> if_rm(eq(n,m),n,add(m,x)) r16: if_rm(true(),n,add(m,x)) -> rm(n,x) r17: if_rm(false(),n,add(m,x)) -> add(m,rm(n,x)) r18: minsort(nil(),nil()) -> nil() r19: minsort(add(n,x),y) -> if_minsort(eq(n,min(add(n,x))),add(n,x),y) r20: if_minsort(true(),add(n,x),y) -> add(n,minsort(app(rm(n,x),y),nil())) r21: if_minsort(false(),add(n,x),y) -> minsort(x,add(n,y)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: le#_A(x1,x2) = max{2, x1 - 1, x2 + 1} s_A(x1) = max{1, x1} precedence: le# = s partial status: pi(le#) = [2] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: le#_A(x1,x2) = 0 s_A(x1) = max{2, x1} precedence: le# = s partial status: pi(le#) = [] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(add(n,x),y) -> app#(x,y) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: min(add(n,nil())) -> n r11: min(add(n,add(m,x))) -> if_min(le(n,m),add(n,add(m,x))) r12: if_min(true(),add(n,add(m,x))) -> min(add(n,x)) r13: if_min(false(),add(n,add(m,x))) -> min(add(m,x)) r14: rm(n,nil()) -> nil() r15: rm(n,add(m,x)) -> if_rm(eq(n,m),n,add(m,x)) r16: if_rm(true(),n,add(m,x)) -> rm(n,x) r17: if_rm(false(),n,add(m,x)) -> add(m,rm(n,x)) r18: minsort(nil(),nil()) -> nil() r19: minsort(add(n,x),y) -> if_minsort(eq(n,min(add(n,x))),add(n,x),y) r20: if_minsort(true(),add(n,x),y) -> add(n,minsort(app(rm(n,x),y),nil())) r21: if_minsort(false(),add(n,x),y) -> minsort(x,add(n,y)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{x1 + 1, x2} add_A(x1,x2) = max{x1 - 1, x2} precedence: app# = add partial status: pi(app#) = [1, 2] pi(add) = [2] 2. weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{x1 - 1, x2 + 1} add_A(x1,x2) = x2 precedence: app# = add partial status: pi(app#) = [] pi(add) = [2] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.