YES TRS: eq(0(),0()) -> true() eq(0(),s(Y)) -> 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) min(cons(0(),nil())) -> 0() min(cons(s(N),nil())) -> s(N) min(cons(N,cons(M,L))) -> ifmin(le(N,M),cons(N,cons(M,L))) ifmin(true(),cons(N,cons(M,L))) -> min(cons(N,L)) ifmin(false(),cons(N,cons(M,L))) -> min(cons(M,L)) replace(N,M,nil()) -> nil() replace(N,M,cons(K,L)) -> ifrepl(eq(N,K),N,M,cons(K,L)) ifrepl(true(),N,M,cons(K,L)) -> cons(M,L) ifrepl(false(),N,M,cons(K,L)) -> cons(K,replace(N,M,L)) selsort(nil()) -> nil() selsort(cons(N,L)) -> ifselsort(eq(N,min(cons(N,L))),cons(N,L)) ifselsort(true(),cons(N,L)) -> cons(N,selsort(L)) ifselsort(false(),cons(N,L)) -> cons(min(cons(N,L)),selsort(replace(min(cons(N,L)),N,L))) max/plus interpretations on N: eq_A(x1,x2) = max{8, 47, 1} eq#_A(x1,x2) = max{43, 1, 94} 0_A = 2 0#_A = 43 true_A = 47 true#_A = 41 s_A(x1) = max{0, -1} s#_A(x1) = max{52, -1} false_A = 41 false#_A = 0 le_A(x1,x2) = max{47, 40, -1} le#_A(x1,x2) = max{43, -1, 42} min_A(x1) = max{10, 1} min#_A(x1) = max{44, 48} cons_A(x1,x2) = max{4, 22, 40 + x2} cons#_A(x1,x2) = max{47, 51, 48} nil_A = 1 nil#_A = 47 ifmin_A(x1,x2) = max{10, -38 + x1, 9} ifmin#_A(x1,x2) = max{43, 48, 43} replace_A(x1,x2,x3) = max{0, -8, -7, x3} replace#_A(x1,x2,x3) = max{56, 2, 44, 54 + x3} ifrepl_A(x1,x2,x3,x4) = max{32, -8 + x1, -7, 32, x4} ifrepl#_A(x1,x2,x3,x4) = max{94, 2 + x1, 57, 55, 54 + x4} selsort_A(x1) = max{9, 18 + x1} selsort#_A(x1) = max{46, 58 + x1} ifselsort_A(x1,x2) = max{41, 49, 18 + x2} ifselsort#_A(x1,x2) = max{49, 12 + x1, 41 + x2} precedence: selsort > s = ifselsort > min > le = ifmin = replace > eq = cons = nil = ifrepl > false > 0 > true