YES We show the termination of the relative TRS R/S: 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)) S: rand(x) -> x rand(x) -> rand(s(x)) -- SCC decomposition. Consider the non-minimal 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)) r22: rand(x) -> x r23: rand(x) -> rand(s(x)) The estimated dependency graph contains the following SCCs: {p12, p15, p18} {p8, p10, p11} {p1} {p4, p6, p7} {p2} {p3} -- Reduction pair. Consider the non-minimal 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)) r22: rand(x) -> x r23: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23 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) = ((1,0),(0,0)) x1 + ((1,0),(0,0)) x2 + ((1,0),(0,0)) x3 + (1,10) false_A() = (3,0) add_A(x1,x2) = ((1,1),(1,1)) x1 + x2 + (6,9) minsort#_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(0,0)) x2 + (4,10) eq_A(x1,x2) = ((0,0),(1,1)) x1 + (3,11) min_A(x1) = ((1,1),(1,1)) x1 + (2,8) true_A() = (2,0) app_A(x1,x2) = x1 + x2 + (0,1) rm_A(x1,x2) = ((1,1),(0,0)) x1 + x2 + (1,0) nil_A() = (0,1) |0|_A() = (4,1) s_A(x1) = x1 le_A(x1,x2) = x2 + (33,10) if_min_A(x1,x2) = ((1,1),(1,1)) x2 + (1,0) if_rm_A(x1,x2,x3) = ((1,1),(0,0)) x2 + x3 + (1,0) minsort_A(x1,x2) = ((0,1),(1,1)) x1 + ((0,1),(1,1)) x2 + (5,7) if_minsort_A(x1,x2,x3) = ((0,1),(1,1)) x2 + ((0,1),(1,1)) x3 + (5,7) rand_A(x1) = x1 + (1,0) precedence: if_minsort# = false = add = minsort# = eq = min = true = app = rm = nil = |0| = s = le = if_min = if_rm = minsort = if_minsort = rand partial status: pi(if_minsort#) = [] pi(false) = [] pi(add) = [] pi(minsort#) = [] pi(eq) = [] pi(min) = [] pi(true) = [] pi(app) = [] pi(rm) = [] pi(nil) = [] pi(|0|) = [] pi(s) = [] pi(le) = [] pi(if_min) = [] pi(if_rm) = [] pi(minsort) = [] pi(if_minsort) = [] pi(rand) = [] 2. 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 + (1,1) false_A() = (30,14) add_A(x1,x2) = ((1,0),(1,0)) x1 + x2 + (28,12) minsort#_A(x1,x2) = ((0,1),(0,1)) x1 + (21,1) eq_A(x1,x2) = (32,14) min_A(x1) = (27,14) true_A() = (31,11) app_A(x1,x2) = ((1,0),(1,1)) x1 + x2 rm_A(x1,x2) = ((0,0),(0,1)) x1 + x2 + (0,2) nil_A() = (30,0) |0|_A() = (0,1) s_A(x1) = ((0,1),(0,1)) x1 le_A(x1,x2) = (57,15) if_min_A(x1,x2) = (27,14) if_rm_A(x1,x2,x3) = ((0,0),(0,1)) x2 + x3 + (0,2) minsort_A(x1,x2) = (29,0) if_minsort_A(x1,x2,x3) = (29,0) rand_A(x1) = (1,1) precedence: rm > if_rm > eq > true > app > minsort = if_minsort > le > minsort# > if_minsort# > false = add = min = nil = |0| = s = if_min = rand partial status: pi(if_minsort#) = [] pi(false) = [] pi(add) = [] pi(minsort#) = [] pi(eq) = [] pi(min) = [] pi(true) = [] pi(app) = [1, 2] pi(rm) = [2] pi(nil) = [] pi(|0|) = [] pi(s) = [] pi(le) = [] pi(if_min) = [] pi(if_rm) = [3] pi(minsort) = [] pi(if_minsort) = [] pi(rand) = [] The next rules are strictly ordered: p2, p3 We remove them from the problem. -- SCC decomposition. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: 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)) r22: rand(x) -> x r23: rand(x) -> rand(s(x)) The estimated dependency graph contains the following SCCs: (no SCCs) -- Reduction pair. Consider the non-minimal 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)) r22: rand(x) -> x r23: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23 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_rm#_A(x1,x2,x3) = ((1,0),(1,1)) x2 + ((1,1),(0,1)) x3 + (0,1) false_A() = (3,4) add_A(x1,x2) = ((0,0),(1,1)) x1 + ((0,0),(0,1)) x2 + (5,5) rm#_A(x1,x2) = ((1,0),(1,1)) x1 + ((0,1),(0,1)) x2 + (6,6) eq_A(x1,x2) = ((1,0),(0,0)) x1 + x2 + (11,6) true_A() = (3,2) |0|_A() = (4,4) s_A(x1) = x1 le_A(x1,x2) = (4,5) app_A(x1,x2) = x1 + x2 + (9,0) nil_A() = (1,0) min_A(x1) = ((1,1),(0,1)) x1 + (5,7) if_min_A(x1,x2) = x1 + ((1,1),(0,1)) x2 rm_A(x1,x2) = ((1,0),(0,0)) x1 + ((0,1),(0,1)) x2 + (2,0) if_rm_A(x1,x2,x3) = ((1,0),(0,0)) x2 + ((0,1),(0,1)) x3 + (1,0) minsort_A(x1,x2) = ((0,1),(0,1)) x1 + ((0,0),(0,1)) x2 + (6,6) if_minsort_A(x1,x2,x3) = ((0,1),(0,1)) x2 + ((0,0),(0,1)) x3 + (5,6) rand_A(x1) = x1 + (1,0) precedence: nil > if_rm > app > minsort > if_minsort > add = min = if_min > true > eq > false = s > rm > |0| > if_rm# = rm# > le > rand partial status: pi(if_rm#) = [2, 3] pi(false) = [] pi(add) = [] pi(rm#) = [1] pi(eq) = [2] pi(true) = [] pi(|0|) = [] pi(s) = [1] pi(le) = [] pi(app) = [1, 2] pi(nil) = [] pi(min) = [1] pi(if_min) = [1, 2] pi(rm) = [] pi(if_rm) = [] pi(minsort) = [] pi(if_minsort) = [] pi(rand) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: if_rm#_A(x1,x2,x3) = ((0,0),(1,0)) x3 + (2,6) false_A() = (2,3) add_A(x1,x2) = (3,9) rm#_A(x1,x2) = ((0,0),(1,0)) x1 + (6,8) eq_A(x1,x2) = ((1,1),(1,1)) x2 + (4,2) true_A() = (5,10) |0|_A() = (6,1) s_A(x1) = ((0,0),(1,1)) x1 + (1,1) le_A(x1,x2) = (2,2) app_A(x1,x2) = x2 + (4,10) nil_A() = (2,0) min_A(x1) = x1 if_min_A(x1,x2) = x2 + (1,0) rm_A(x1,x2) = (6,8) if_rm_A(x1,x2,x3) = (6,8) minsort_A(x1,x2) = (3,9) if_minsort_A(x1,x2,x3) = (3,9) rand_A(x1) = (2,1) precedence: le > if_rm# = false = eq = true = s = minsort = if_minsort = rand > app > add = nil = if_min = rm = if_rm > |0| > min > rm# partial status: pi(if_rm#) = [] pi(false) = [] pi(add) = [] pi(rm#) = [] pi(eq) = [] pi(true) = [] pi(|0|) = [] pi(s) = [] pi(le) = [] pi(app) = [2] pi(nil) = [] pi(min) = [1] pi(if_min) = [2] pi(rm) = [] pi(if_rm) = [] pi(minsort) = [] pi(if_minsort) = [] pi(rand) = [] The next rules are strictly ordered: p1, p2, p3 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the non-minimal 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)) r22: rand(x) -> x r23: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23 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) = x2 + 1 s_A(x1) = x1 eq_A(x1,x2) = max{x1 - 2, x2 + 7} |0|_A = 37 true_A = 36 false_A = 31 le_A(x1,x2) = max{50, x1 + 3, x2 + 37} app_A(x1,x2) = max{x1, x2} nil_A = 0 add_A(x1,x2) = max{13, x1 + 8, x2} min_A(x1) = max{9, x1 - 6} if_min_A(x1,x2) = max{9, x2 - 6} rm_A(x1,x2) = max{19, x1 + 8, x2} if_rm_A(x1,x2,x3) = max{x1 - 12, x2 + 8, x3} minsort_A(x1,x2) = max{x1 + 12, x2 + 12} if_minsort_A(x1,x2,x3) = max{x1 - 5, x2 + 12, x3 + 12} rand_A(x1) = x1 + 2 precedence: |0| > eq# = true = le = rm = if_rm = minsort = if_minsort > eq = nil > min = if_min = rand > false = app = add > s partial status: pi(eq#) = [2] pi(s) = [1] pi(eq) = [] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(le) = [2] pi(app) = [1, 2] pi(nil) = [] pi(add) = [] pi(min) = [] pi(if_min) = [] pi(rm) = [1] pi(if_rm) = [2] pi(minsort) = [] pi(if_minsort) = [] pi(rand) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: eq#_A(x1,x2) = 0 s_A(x1) = x1 + 5 eq_A(x1,x2) = 78 |0|_A = 0 true_A = 11 false_A = 4 le_A(x1,x2) = max{102, x2 + 97} app_A(x1,x2) = max{x1 + 62, x2 + 32} nil_A = 7 add_A(x1,x2) = 6 min_A(x1) = 21 if_min_A(x1,x2) = 21 rm_A(x1,x2) = x1 + 8 if_rm_A(x1,x2,x3) = x2 + 8 minsort_A(x1,x2) = 13 if_minsort_A(x1,x2,x3) = 13 rand_A(x1) = 1 precedence: eq# = s = eq = |0| = true = le = app = rand > false = nil = add = rm = if_rm > min = if_min > minsort = if_minsort partial status: pi(eq#) = [] pi(s) = [1] pi(eq) = [] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(le) = [] pi(app) = [] pi(nil) = [] pi(add) = [] pi(min) = [] pi(if_min) = [] pi(rm) = [1] pi(if_rm) = [2] pi(minsort) = [] pi(if_minsort) = [] pi(rand) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the non-minimal 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)) r22: rand(x) -> x r23: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23 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_min#_A(x1,x2) = ((0,1),(0,1)) x1 + ((0,1),(0,0)) x2 + (0,7) false_A() = (11,9) add_A(x1,x2) = ((0,1),(1,0)) x1 + x2 + (12,8) min#_A(x1) = ((0,1),(0,0)) x1 + (10,16) le_A(x1,x2) = ((1,0),(0,0)) x2 + (47,9) true_A() = (11,9) eq_A(x1,x2) = x1 + ((1,1),(1,0)) x2 + (1,11) |0|_A() = (12,9) s_A(x1) = x1 app_A(x1,x2) = x1 + x2 + (0,9) nil_A() = (0,1) min_A(x1) = ((1,1),(1,1)) x1 + (6,18) if_min_A(x1,x2) = ((1,1),(1,1)) x2 rm_A(x1,x2) = ((0,0),(0,1)) x1 + x2 + (0,2) if_rm_A(x1,x2,x3) = ((0,0),(0,1)) x2 + x3 + (0,2) minsort_A(x1,x2) = ((1,0),(1,1)) x1 + ((1,0),(1,1)) x2 + (13,17) if_minsort_A(x1,x2,x3) = ((1,0),(1,1)) x2 + ((1,0),(1,1)) x3 + (13,17) rand_A(x1) = x1 + (1,1) precedence: rm = if_rm > if_min# = min# = |0| = app = min = if_min > s > le > false = eq > true > add = nil = minsort = if_minsort = rand partial status: pi(if_min#) = [] pi(false) = [] pi(add) = [] pi(min#) = [] pi(le) = [] pi(true) = [] pi(eq) = [1] pi(|0|) = [] pi(s) = [1] pi(app) = [2] pi(nil) = [] pi(min) = [] pi(if_min) = [] pi(rm) = [2] pi(if_rm) = [3] pi(minsort) = [] pi(if_minsort) = [] pi(rand) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: if_min#_A(x1,x2) = (4,4) false_A() = (5,3) add_A(x1,x2) = (1,0) min#_A(x1) = (4,4) le_A(x1,x2) = (7,5) true_A() = (3,2) eq_A(x1,x2) = ((0,1),(1,0)) x1 + (4,4) |0|_A() = (3,2) s_A(x1) = x1 + (6,4) app_A(x1,x2) = (2,0) nil_A() = (1,1) min_A(x1) = (6,4) if_min_A(x1,x2) = (6,4) rm_A(x1,x2) = (3,2) if_rm_A(x1,x2,x3) = ((0,1),(0,0)) x3 + (3,1) minsort_A(x1,x2) = (1,3) if_minsort_A(x1,x2,x3) = (1,3) rand_A(x1) = (0,0) precedence: |0| > true = min = if_min > app > minsort = if_minsort > nil > if_min# = add > min# > false = le = s = rm > eq > if_rm = rand partial status: pi(if_min#) = [] pi(false) = [] pi(add) = [] pi(min#) = [] pi(le) = [] pi(true) = [] pi(eq) = [] pi(|0|) = [] pi(s) = [1] pi(app) = [] pi(nil) = [] pi(min) = [] pi(if_min) = [] pi(rm) = [] pi(if_rm) = [] pi(minsort) = [] pi(if_minsort) = [] pi(rand) = [] The next rules are strictly ordered: p2, p3 We remove them from the problem. -- SCC decomposition. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: if_min#(false(),add(n,add(m,x))) -> min#(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)) r22: rand(x) -> x r23: rand(x) -> rand(s(x)) The estimated dependency graph contains the following SCCs: (no SCCs) -- Reduction pair. Consider the non-minimal 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)) r22: rand(x) -> x r23: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23 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) = x2 + 1 s_A(x1) = x1 eq_A(x1,x2) = 32 |0|_A = 32 true_A = 20 false_A = 31 le_A(x1,x2) = max{x1 + 17, x2 + 21} app_A(x1,x2) = max{x1, x2} nil_A = 0 add_A(x1,x2) = max{x1 + 12, x2} min_A(x1) = max{8, x1 + 4} if_min_A(x1,x2) = max{x1 - 6, x2 + 4} rm_A(x1,x2) = max{x1 + 12, x2} if_rm_A(x1,x2,x3) = max{x1 - 21, x2 + 12, x3} minsort_A(x1,x2) = max{7, x1, x2} if_minsort_A(x1,x2,x3) = max{12, x2, x3} rand_A(x1) = x1 + 2 precedence: le# = |0| = le = minsort = if_minsort > rm = if_rm > nil > eq = false = app = add = min = if_min > true > rand > s partial status: pi(le#) = [2] pi(s) = [1] pi(eq) = [] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(le) = [1, 2] pi(app) = [1, 2] pi(nil) = [] pi(add) = [] pi(min) = [] pi(if_min) = [] pi(rm) = [1] pi(if_rm) = [2] pi(minsort) = [] pi(if_minsort) = [] pi(rand) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: le#_A(x1,x2) = 0 s_A(x1) = x1 + 5 eq_A(x1,x2) = 103 |0|_A = 0 true_A = 36 false_A = 4 le_A(x1,x2) = max{x1 + 123, x2 + 141} app_A(x1,x2) = max{x1 + 55, x2 + 35} nil_A = 85 add_A(x1,x2) = 34 min_A(x1) = 64 if_min_A(x1,x2) = 64 rm_A(x1,x2) = x1 + 33 if_rm_A(x1,x2,x3) = x2 + 33 minsort_A(x1,x2) = 34 if_minsort_A(x1,x2,x3) = 34 rand_A(x1) = 1 precedence: app > le# = s = eq = |0| = true = false = le = nil = rand > min = if_min > rm = if_rm > minsort = if_minsort > add partial status: pi(le#) = [] pi(s) = [1] pi(eq) = [] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(le) = [1, 2] pi(app) = [] pi(nil) = [] pi(add) = [] pi(min) = [] pi(if_min) = [] pi(rm) = [1] pi(if_rm) = [2] pi(minsort) = [] pi(if_minsort) = [] pi(rand) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the non-minimal 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)) r22: rand(x) -> x r23: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: app#_A(x1,x2) = x1 + x2 + (4,4) add_A(x1,x2) = ((1,1),(1,0)) x1 + x2 + (3,3) eq_A(x1,x2) = ((0,1),(0,0)) x1 + ((1,1),(0,0)) x2 + (0,4) |0|_A() = (0,1) true_A() = (0,0) s_A(x1) = x1 false_A() = (1,1) le_A(x1,x2) = (2,3) app_A(x1,x2) = x1 + x2 nil_A() = (0,0) min_A(x1) = ((1,1),(1,0)) x1 + (5,4) if_min_A(x1,x2) = x1 + ((1,1),(1,0)) x2 + (1,1) rm_A(x1,x2) = ((1,0),(0,0)) x1 + x2 if_rm_A(x1,x2,x3) = ((1,0),(0,0)) x2 + x3 minsort_A(x1,x2) = ((1,1),(0,1)) x1 + ((1,1),(0,1)) x2 + (4,1) if_minsort_A(x1,x2,x3) = ((1,1),(0,1)) x2 + ((1,1),(0,1)) x3 + (4,1) rand_A(x1) = x1 + (1,0) precedence: app > rm = if_rm > minsort = if_minsort > add > min = if_min > nil > eq = s > le > rand > |0| > false > true > app# partial status: pi(app#) = [1, 2] pi(add) = [] pi(eq) = [] pi(|0|) = [] pi(true) = [] pi(s) = [1] pi(false) = [] pi(le) = [] pi(app) = [1, 2] pi(nil) = [] pi(min) = [] pi(if_min) = [1] pi(rm) = [] pi(if_rm) = [] pi(minsort) = [] pi(if_minsort) = [] pi(rand) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: app#_A(x1,x2) = (2,1) add_A(x1,x2) = (2,2) eq_A(x1,x2) = (2,2) |0|_A() = (0,0) true_A() = (2,1) s_A(x1) = (0,1) false_A() = (1,2) le_A(x1,x2) = (3,2) app_A(x1,x2) = ((1,0),(1,1)) x1 + (3,1) nil_A() = (0,0) min_A(x1) = (4,2) if_min_A(x1,x2) = (5,2) rm_A(x1,x2) = (3,2) if_rm_A(x1,x2,x3) = (3,2) minsort_A(x1,x2) = (0,0) if_minsort_A(x1,x2,x3) = (0,0) rand_A(x1) = (1,1) precedence: rand > app > if_min > eq = true > false = le > add = min = rm = if_rm > |0| > app# = nil > s = minsort = if_minsort partial status: pi(app#) = [] pi(add) = [] pi(eq) = [] pi(|0|) = [] pi(true) = [] pi(s) = [] pi(false) = [] pi(le) = [] pi(app) = [1] pi(nil) = [] pi(min) = [] pi(if_min) = [] pi(rm) = [] pi(if_rm) = [] pi(minsort) = [] pi(if_minsort) = [] pi(rand) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.