YES(O(1),O(n^3)) We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^3)). Strict Trs: { #equal(@x, @y) -> #eq(@x, @y) , *(@x, @y) -> #mult(@x, @y) , -(@x, @y) -> #sub(@x, @y) , div(@x, @y) -> #div(@x, @y) , eratos(@l) -> eratos#1(@l) , eratos#1(::(@x, @xs)) -> ::(@x, eratos(filter(@x, @xs))) , eratos#1(nil()) -> nil() , filter(@p, @l) -> filter#1(@l, @p) , filter#1(::(@x, @xs), @p) -> filter#2(filter(@p, @xs), @p, @x) , filter#1(nil(), @p) -> nil() , filter#2(@xs', @p, @x) -> filter#3(#equal(mod(@x, @p), #0()), @x, @xs') , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , filter#3(#false(), @x, @xs') -> ::(@x, @xs') , filter#3(#true(), @x, @xs') -> @xs' } Weak Trs: { #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(#0(), #0()) -> #true() , #eq(#0(), #s(@y)) -> #false() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#s(@x)) -> #pos(#s(@x)) , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #negative(#0()) -> #0() , #negative(#s(@x)) -> #neg(#s(@x)) , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^3)) We use the processor 'matrix interpretation of dimension 3' to orient following rules strictly. Trs: { eratos#1(nil()) -> nil() } The induced complexity on above rules (modulo remaining rules) is YES(?,O(n^3)) . These rules are moved into the corresponding weak component(s). Sub-proof: ---------- The following argument positions are usable: Uargs(#equal) = {1}, Uargs(*) = {2}, Uargs(-) = {2}, Uargs(eratos) = {1}, Uargs(::) = {2}, Uargs(filter#2) = {1}, Uargs(filter#3) = {1}, Uargs(#s) = {1}, Uargs(#neg) = {1}, Uargs(#pred) = {1}, Uargs(#pos) = {1}, Uargs(#succ) = {1}, Uargs(#and) = {1, 2}, Uargs(#positive) = {1}, Uargs(#negative) = {1}, Uargs(#natadd) = {2}, Uargs(#natdiv') = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [1 0 0] [1 0 1] [0] [#equal](x1, x2) = [0 0 0] x1 + [1 1 0] x2 + [0] [0 0 0] [1 1 1] [0] [0 0 0] [0] [#eq](x1, x2) = [1 0 0] x2 + [0] [1 0 0] [0] [1 0 0] [0] [*](x1, x2) = [0 0 0] x2 + [0] [0 0 0] [0] [0] [#mult](x1, x2) = [0] [0] [1 0 0] [1 0 0] [0] [-](x1, x2) = [0 1 0] x1 + [0 1 1] x2 + [0] [0 0 1] [0 1 1] [0] [1 0 0] [1 0 0] [0] [#sub](x1, x2) = [0 1 0] x1 + [0 1 1] x2 + [0] [0 0 1] [0 1 1] [0] [0 0 1] [0] [div](x1, x2) = [1 0 0] x1 + [0] [1 0 0] [0] [0 0 1] [0] [#div](x1, x2) = [1 0 0] x1 + [0] [1 0 0] [0] [1 1 1] [1] [eratos](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 1 1] [1] [eratos#1](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [0 0 0] [1 0 0] [0] [::](x1, x2) = [1 0 0] x1 + [0 1 1] x2 + [0] [1 0 1] [0 0 1] [0] [1 0 1] [0] [filter](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [0] [nil] = [0] [0] [1 0 1] [0] [filter#1](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 0 1] [0] [filter#2](x1, x2, x3) = [0 1 1] x1 + [1 0 0] x3 + [0] [0 0 1] [1 0 1] [0] [1 0 1] [0] [mod](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [0] [#0] = [0] [0] [1 0 1] [0 0 0] [1 0 0] [0] [filter#3](x1, x2, x3) = [0 1 1] x1 + [1 0 0] x2 + [0 1 1] x3 + [0] [0 0 1] [1 0 1] [0 0 1] [0] [0] [#false] = [0] [0] [0] [#true] = [0] [0] [1 0 0] [0] [#add](x1, x2) = [0 1 0] x2 + [0] [0 1 1] [0] [1 0 0] [0] [#s](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#neg](x1) = [1 1 0] x1 + [0] [1 0 0] [0] [1 0 0] [0] [#pred](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#pos](x1) = [1 1 0] x1 + [0] [1 0 0] [0] [1 0 0] [0] [#succ](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 0 0] [0] [#and](x1, x2) = [1 0 0] x1 + [0 0 0] x2 + [0] [0 0 0] [0 0 0] [0] [0] [#divByZero] = [0] [0] [1 0 0] [0] [#natdiv](x1, x2) = [0 0 0] x1 + [0] [0 0 0] [0] [1 0 1] [0] [#positive](x1) = [1 1 1] x1 + [0] [1 1 1] [0] [1 0 1] [0] [#negative](x1) = [1 1 1] x1 + [0] [1 0 0] [0] [1 0 0] [0] [#divsub](x1, x2) = [0 1 1] x1 + [0] [0 1 1] [0] [0] [#underflow] = [0] [0] [0] [#natmult](x1, x2) = [0] [0] [1 0 0] [0] [#natadd](x1, x2) = [0 1 0] x2 + [0] [1 1 1] [0] [1 0 0] [0] [#natdiv'](x1, x2) = [0 0 0] x1 + [0] [0 0 0] [0] [1 0 0] [0 0 0] [0] [#natsub](x1, x2) = [1 1 0] x1 + [1 0 0] x2 + [0] [1 0 1] [1 0 0] [0] This order satisfies following ordering constraints [#equal(@x, @y)] = [1 0 0] [1 0 1] [0] [0 0 0] @x + [1 1 0] @y + [0] [0 0 0] [1 1 1] [0] >= [0 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] = [#eq(@x, @y)] [#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0 0 0] [0] [1 0 0] @y_2 + [0] [1 0 0] [0] >= [0] [0] [0] = [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))] [#eq(::(@x_1, @x_2), nil())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(nil(), ::(@y_1, @y_2))] = [0 0 0] [0] [1 0 0] @y_2 + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(nil(), nil())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #s(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#0(), #neg(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#0(), #pos(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#s(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#s(@x), #s(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] >= [0 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#neg(@x), #neg(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] >= [0 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #pos(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #neg(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #pos(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] >= [0 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] = [#eq(@x, @y)] [*(@x, @y)] = [1 0 0] [0] [0 0 0] @y + [0] [0 0 0] [0] >= [0] [0] [0] = [#mult(@x, @y)] [#mult(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#0(), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#0(), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#neg(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#neg(@x), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#pos(#natmult(@x, @y))] [#mult(#neg(@x), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#pos(@x), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#pos(#natmult(@x, @y))] [-(@x, @y)] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 1 1] @y + [0] [0 0 1] [0 1 1] [0] >= [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 1 1] @y + [0] [0 0 1] [0 1 1] [0] = [#sub(@x, @y)] [#sub(@x, #0())] = [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#sub(@x, #neg(@y))] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [2 1 0] @y + [0] [0 0 1] [2 1 0] [0] >= [1 0 0] [0] [1 1 0] @y + [0] [2 1 0] [0] = [#add(@x, #pos(@y))] [#sub(@x, #pos(@y))] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [2 1 0] @y + [0] [0 0 1] [2 1 0] [0] >= [1 0 0] [0] [1 1 0] @y + [0] [2 1 0] [0] = [#add(@x, #neg(@y))] [div(@x, @y)] = [0 0 1] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [0 0 1] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#div(@x, @y)] [#div(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#0(), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#div(#0(), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#div(#neg(@x), #0())] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#neg(@x), #neg(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#positive(#natdiv(@x, @y))] [#div(#neg(@x), #pos(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #0())] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#pos(@x), #neg(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #pos(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#positive(#natdiv(@x, @y))] [eratos(@l)] = [1 1 1] [1] [0 1 0] @l + [0] [0 0 1] [0] >= [1 1 1] [1] [0 1 0] @l + [0] [0 0 1] [0] = [eratos#1(@l)] [eratos#1(::(@x, @xs))] = [2 0 1] [1 1 2] [1] [1 0 0] @x + [0 1 1] @xs + [0] [1 0 1] [0 0 1] [0] >= [0 0 0] [1 1 2] [1] [1 0 0] @x + [0 1 1] @xs + [0] [1 0 1] [0 0 1] [0] = [::(@x, eratos(filter(@x, @xs)))] [eratos#1(nil())] = [1] [0] [0] > [0] [0] [0] = [nil()] [filter(@p, @l)] = [1 0 1] [0] [0 1 0] @l + [0] [0 0 1] [0] >= [1 0 1] [0] [0 1 0] @l + [0] [0 0 1] [0] = [filter#1(@l, @p)] [filter#1(::(@x, @xs), @p)] = [1 0 1] [1 0 1] [0] [1 0 0] @x + [0 1 1] @xs + [0] [1 0 1] [0 0 1] [0] >= [1 0 1] [1 0 1] [0] [1 0 0] @x + [0 1 1] @xs + [0] [1 0 1] [0 0 1] [0] = [filter#2(filter(@p, @xs), @p, @x)] [filter#1(nil(), @p)] = [0] [0] [0] >= [0] [0] [0] = [nil()] [filter#2(@xs', @p, @x)] = [1 0 1] [1 0 0] [0] [1 0 0] @x + [0 1 1] @xs' + [0] [1 0 1] [0 0 1] [0] >= [1 0 1] [1 0 0] [0] [1 0 0] @x + [0 1 1] @xs' + [0] [1 0 1] [0 0 1] [0] = [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')] [mod(@x, @y)] = [1 0 1] [0] [0 1 0] @x + [0] [0 0 1] [0] >= [1 0 1] [0] [0 1 0] @x + [0] [0 0 1] [0] = [-(@x, *(@y, div(@x, @y)))] [filter#3(#false(), @x, @xs')] = [0 0 0] [1 0 0] [0] [1 0 0] @x + [0 1 1] @xs' + [0] [1 0 1] [0 0 1] [0] >= [0 0 0] [1 0 0] [0] [1 0 0] @x + [0 1 1] @xs' + [0] [1 0 1] [0 0 1] [0] = [::(@x, @xs')] [filter#3(#true(), @x, @xs')] = [0 0 0] [1 0 0] [0] [1 0 0] @x + [0 1 1] @xs' + [0] [1 0 1] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @xs' + [0] [0 0 1] [0] = [@xs'] [#add(#0(), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#add(#neg(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#pred(@y)] [#add(#neg(#s(#s(@x))), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 1 1] [0] = [#pred(#add(#pos(#s(@x)), @y))] [#add(#pos(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#succ(@y)] [#add(#pos(#s(#s(@x))), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 1 1] [0] = [#succ(#add(#pos(#s(@x)), @y))] [#pred(#0())] = [0] [0] [0] >= [0] [0] [0] = [#neg(#s(#0()))] [#pred(#neg(#s(@x)))] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [0] = [#neg(#s(#s(@x)))] [#pred(#pos(#s(#0())))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#pred(#pos(#s(#s(@x))))] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [0] = [#pos(#s(@x))] [#succ(#0())] = [0] [0] [0] >= [0] [0] [0] = [#pos(#s(#0()))] [#succ(#neg(#s(#0())))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#succ(#neg(#s(#s(@x))))] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [0] = [#neg(#s(@x))] [#succ(#pos(#s(@x)))] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [0] = [#pos(#s(#s(@x)))] [#and(#false(), #false())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#false(), #true())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#true(), #false())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#true(), #true())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#natdiv(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#divByZero()] [#natdiv(#0(), #s(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#natdiv(#s(@x), #0())] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#natdiv(#s(@x), #s(@y))] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] = [#natdiv'(#divsub(@x, @y), #s(@y))] [#positive(#0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#positive(#s(@x))] = [1 0 1] [0] [1 1 1] @x + [0] [1 1 1] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [0] = [#pos(#s(@x))] [#positive(#neg(@x))] = [2 0 0] [0] [3 1 0] @x + [0] [3 1 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [0] = [#neg(@x)] [#positive(#pos(@x))] = [2 0 0] [0] [3 1 0] @x + [0] [3 1 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [0] = [#pos(@x)] [#negative(#0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#negative(#s(@x))] = [1 0 1] [0] [1 1 1] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [0] = [#neg(#s(@x))] [#negative(#neg(@x))] = [2 0 0] [0] [3 1 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [0] = [#pos(@x)] [#negative(#pos(@x))] = [2 0 0] [0] [3 1 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [0] = [#neg(@x)] [#divsub(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#divsub(#0(), #s(@y))] = [0] [0] [0] >= [0] [0] [0] = [#underflow()] [#divsub(#s(@x), #0())] = [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [#s(@x)] [#divsub(#s(@x), #s(@y))] = [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] = [#divsub(@x, @y)] [#natmult(#0(), @y)] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#natmult(#s(@x), @y)] = [0] [0] [0] >= [0] [0] [0] = [#natadd(@y, #natmult(@x, @y))] [#natadd(#0(), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [1 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#natadd(#s(@x), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [1 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [1 1 1] [0] = [#s(#natadd(@x, @y))] [#natdiv'(#0(), @y)] = [0] [0] [0] >= [0] [0] [0] = [#s(#0())] [#natdiv'(#s(@x), @y)] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] = [#s(#natdiv(#s(@x), @y))] [#natdiv'(#underflow(), @y)] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#natsub(@x, #0())] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#natsub(#s(@x), #s(@y))] = [1 0 0] [0 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [1 0 0] [0] >= [1 0 0] [0 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [1 0 0] [0] = [#natsub(@x, @y)] We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^3)). Strict Trs: { #equal(@x, @y) -> #eq(@x, @y) , *(@x, @y) -> #mult(@x, @y) , -(@x, @y) -> #sub(@x, @y) , div(@x, @y) -> #div(@x, @y) , eratos(@l) -> eratos#1(@l) , eratos#1(::(@x, @xs)) -> ::(@x, eratos(filter(@x, @xs))) , filter(@p, @l) -> filter#1(@l, @p) , filter#1(::(@x, @xs), @p) -> filter#2(filter(@p, @xs), @p, @x) , filter#1(nil(), @p) -> nil() , filter#2(@xs', @p, @x) -> filter#3(#equal(mod(@x, @p), #0()), @x, @xs') , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , filter#3(#false(), @x, @xs') -> ::(@x, @xs') , filter#3(#true(), @x, @xs') -> @xs' } Weak Trs: { #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(#0(), #0()) -> #true() , #eq(#0(), #s(@y)) -> #false() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , eratos#1(nil()) -> nil() , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#s(@x)) -> #pos(#s(@x)) , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #negative(#0()) -> #0() , #negative(#s(@x)) -> #neg(#s(@x)) , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^3)) We use the processor 'matrix interpretation of dimension 3' to orient following rules strictly. Trs: { filter#1(nil(), @p) -> nil() } The induced complexity on above rules (modulo remaining rules) is YES(?,O(n^3)) . These rules are moved into the corresponding weak component(s). Sub-proof: ---------- The following argument positions are usable: Uargs(#equal) = {1}, Uargs(*) = {2}, Uargs(-) = {2}, Uargs(eratos) = {1}, Uargs(::) = {2}, Uargs(filter#2) = {1}, Uargs(filter#3) = {1}, Uargs(#s) = {1}, Uargs(#neg) = {1}, Uargs(#pred) = {1}, Uargs(#pos) = {1}, Uargs(#succ) = {1}, Uargs(#and) = {1, 2}, Uargs(#positive) = {1}, Uargs(#negative) = {1}, Uargs(#natadd) = {2}, Uargs(#natdiv') = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [1 0 0] [0 1 1] [0] [#equal](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [0] [1 0 0] [1 1 0] [0] [0 0 1] [0] [#eq](x1, x2) = [0 0 0] x2 + [0] [1 0 0] [0] [1 0 0] [0] [*](x1, x2) = [0 0 0] x2 + [0] [0 0 0] [0] [0] [#mult](x1, x2) = [0] [0] [1 0 0] [1 0 0] [0] [-](x1, x2) = [0 1 0] x1 + [0 1 0] x2 + [0] [0 0 1] [0 0 1] [0] [1 0 0] [1 0 0] [0] [#sub](x1, x2) = [0 1 0] x1 + [0 1 0] x2 + [0] [0 0 1] [0 0 1] [0] [0 1 0] [0] [div](x1, x2) = [1 0 0] x1 + [0] [1 0 0] [0] [0 1 0] [0] [#div](x1, x2) = [1 0 0] x1 + [0] [1 0 0] [0] [1 1 1] [1] [eratos](x1) = [0 1 0] x1 + [0] [0 1 1] [0] [1 1 1] [1] [eratos#1](x1) = [0 1 0] x1 + [0] [0 1 1] [0] [0 0 0] [1 0 0] [0] [::](x1, x2) = [1 1 0] x1 + [0 1 0] x2 + [0] [0 0 1] [0 1 1] [0] [1 1 0] [0] [filter](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [0] [nil] = [1] [1] [1 1 0] [0] [filter#1](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 1 0] [0] [filter#2](x1, x2, x3) = [0 1 0] x1 + [1 1 0] x3 + [0] [0 1 1] [0 0 1] [0] [1 1 0] [0] [mod](x1, x2) = [0 1 0] x1 + [0] [1 1 1] [0] [0] [#0] = [0] [0] [1 1 0] [0 0 0] [1 0 0] [0] [filter#3](x1, x2, x3) = [0 0 0] x1 + [1 1 0] x2 + [0 1 0] x3 + [0] [0 1 0] [0 0 1] [0 1 1] [0] [0] [#false] = [0] [0] [0] [#true] = [0] [0] [1 0 0] [0] [#add](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [1 0 0] [0] [#s](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#neg](x1) = [1 0 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#pred](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#pos](x1) = [1 0 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#succ](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 0 0] [0] [#and](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [0] [0 0 0] [0 0 0] [0] [0] [#divByZero] = [0] [0] [1 0 0] [0] [#natdiv](x1, x2) = [0 0 0] x1 + [0] [0 0 0] [0] [1 0 0] [0] [#positive](x1) = [1 0 0] x1 + [0] [1 0 1] [0] [1 0 0] [0] [#negative](x1) = [1 0 0] x1 + [0] [1 0 1] [0] [1 0 0] [0] [#divsub](x1, x2) = [0 1 1] x1 + [0] [0 1 1] [0] [0] [#underflow] = [0] [0] [0] [#natmult](x1, x2) = [0] [0] [1 0 0] [0] [#natadd](x1, x2) = [0 1 1] x2 + [0] [1 1 1] [0] [1 0 0] [0] [#natdiv'](x1, x2) = [0 0 0] x1 + [0] [0 0 0] [0] [1 0 0] [0 0 0] [0] [#natsub](x1, x2) = [1 1 0] x1 + [1 0 0] x2 + [0] [1 0 1] [1 0 0] [0] This order satisfies following ordering constraints [#equal(@x, @y)] = [1 0 0] [0 1 1] [0] [0 0 0] @x + [0 0 0] @y + [0] [1 0 0] [1 1 0] [0] >= [0 0 1] [0] [0 0 0] @y + [0] [1 0 0] [0] = [#eq(@x, @y)] [#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0 0 1] [0 1 1] [0] [0 0 0] @y_1 + [0 0 0] @y_2 + [0] [0 0 0] [1 0 0] [0] >= [0 0 1] [0 0 1] [0] [0 0 0] @y_1 + [0 0 0] @y_2 + [0] [0 0 0] [0 0 0] [0] = [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))] [#eq(::(@x_1, @x_2), nil())] = [1] [0] [0] > [0] [0] [0] = [#false()] [#eq(nil(), ::(@y_1, @y_2))] = [0 0 1] [0 1 1] [0] [0 0 0] @y_1 + [0 0 0] @y_2 + [0] [0 0 0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(nil(), nil())] = [1] [0] [0] > [0] [0] [0] = [#true()] [#eq(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #s(@y))] = [0 0 1] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#0(), #neg(@y))] = [0 0 1] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#0(), #pos(@y))] = [0 0 1] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#s(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#s(@x), #s(@y))] = [0 0 1] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0 0 1] [0] [0 0 0] @y + [0] [1 0 0] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#neg(@x), #neg(@y))] = [0 0 1] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0 0 1] [0] [0 0 0] @y + [0] [1 0 0] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #pos(@y))] = [0 0 1] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #neg(@y))] = [0 0 1] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #pos(@y))] = [0 0 1] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0 0 1] [0] [0 0 0] @y + [0] [1 0 0] [0] = [#eq(@x, @y)] [*(@x, @y)] = [1 0 0] [0] [0 0 0] @y + [0] [0 0 0] [0] >= [0] [0] [0] = [#mult(@x, @y)] [#mult(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#0(), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#0(), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#neg(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#neg(@x), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#pos(#natmult(@x, @y))] [#mult(#neg(@x), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#pos(@x), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#pos(#natmult(@x, @y))] [-(@x, @y)] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 1 0] @y + [0] [0 0 1] [0 0 1] [0] >= [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 1 0] @y + [0] [0 0 1] [0 0 1] [0] = [#sub(@x, @y)] [#sub(@x, #0())] = [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#sub(@x, #neg(@y))] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [1 0 0] @y + [0] [0 0 1] [0 0 1] [0] >= [1 0 0] [0] [1 0 0] @y + [0] [0 0 1] [0] = [#add(@x, #pos(@y))] [#sub(@x, #pos(@y))] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [1 0 0] @y + [0] [0 0 1] [0 0 1] [0] >= [1 0 0] [0] [1 0 0] @y + [0] [0 0 1] [0] = [#add(@x, #neg(@y))] [div(@x, @y)] = [0 1 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [0 1 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#div(@x, @y)] [#div(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#0(), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#div(#0(), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#div(#neg(@x), #0())] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#neg(@x), #neg(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#positive(#natdiv(@x, @y))] [#div(#neg(@x), #pos(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #0())] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#pos(@x), #neg(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #pos(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#positive(#natdiv(@x, @y))] [eratos(@l)] = [1 1 1] [1] [0 1 0] @l + [0] [0 1 1] [0] >= [1 1 1] [1] [0 1 0] @l + [0] [0 1 1] [0] = [eratos#1(@l)] [eratos#1(::(@x, @xs))] = [1 1 1] [1 2 1] [1] [1 1 0] @x + [0 1 0] @xs + [0] [1 1 1] [0 2 1] [0] >= [0 0 0] [1 2 1] [1] [1 1 0] @x + [0 1 0] @xs + [0] [0 0 1] [0 2 1] [0] = [::(@x, eratos(filter(@x, @xs)))] [eratos#1(nil())] = [3] [1] [2] > [0] [1] [1] = [nil()] [filter(@p, @l)] = [1 1 0] [0] [0 1 0] @l + [0] [0 0 1] [0] >= [1 1 0] [0] [0 1 0] @l + [0] [0 0 1] [0] = [filter#1(@l, @p)] [filter#1(::(@x, @xs), @p)] = [1 1 0] [1 1 0] [0] [1 1 0] @x + [0 1 0] @xs + [0] [0 0 1] [0 1 1] [0] >= [1 1 0] [1 1 0] [0] [1 1 0] @x + [0 1 0] @xs + [0] [0 0 1] [0 1 1] [0] = [filter#2(filter(@p, @xs), @p, @x)] [filter#1(nil(), @p)] = [1] [1] [1] > [0] [1] [1] = [nil()] [filter#2(@xs', @p, @x)] = [1 1 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [0] [0 0 1] [0 1 1] [0] >= [1 1 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [0] [0 0 1] [0 1 1] [0] = [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')] [mod(@x, @y)] = [1 1 0] [0] [0 1 0] @x + [0] [1 1 1] [0] >= [1 1 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [-(@x, *(@y, div(@x, @y)))] [filter#3(#false(), @x, @xs')] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [0] [0 0 1] [0 1 1] [0] >= [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [0] [0 0 1] [0 1 1] [0] = [::(@x, @xs')] [filter#3(#true(), @x, @xs')] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [0] [0 0 1] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @xs' + [0] [0 0 1] [0] = [@xs'] [#add(#0(), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#add(#neg(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#pred(@y)] [#add(#neg(#s(#s(@x))), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#pred(#add(#pos(#s(@x)), @y))] [#add(#pos(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#succ(@y)] [#add(#pos(#s(#s(@x))), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#succ(#add(#pos(#s(@x)), @y))] [#pred(#0())] = [0] [0] [0] >= [0] [0] [0] = [#neg(#s(#0()))] [#pred(#neg(#s(@x)))] = [1 0 0] [0] [1 0 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 1] [0] = [#neg(#s(#s(@x)))] [#pred(#pos(#s(#0())))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#pred(#pos(#s(#s(@x))))] = [1 0 0] [0] [1 0 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 1] [0] = [#pos(#s(@x))] [#succ(#0())] = [0] [0] [0] >= [0] [0] [0] = [#pos(#s(#0()))] [#succ(#neg(#s(#0())))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#succ(#neg(#s(#s(@x))))] = [1 0 0] [0] [1 0 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 1] [0] = [#neg(#s(@x))] [#succ(#pos(#s(@x)))] = [1 0 0] [0] [1 0 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 1] [0] = [#pos(#s(#s(@x)))] [#and(#false(), #false())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#false(), #true())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#true(), #false())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#true(), #true())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#natdiv(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#divByZero()] [#natdiv(#0(), #s(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#natdiv(#s(@x), #0())] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#natdiv(#s(@x), #s(@y))] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] = [#natdiv'(#divsub(@x, @y), #s(@y))] [#positive(#0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#positive(#s(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 1] [0] = [#pos(#s(@x))] [#positive(#neg(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 1] [0] = [#neg(@x)] [#positive(#pos(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 1] [0] = [#pos(@x)] [#negative(#0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#negative(#s(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 1] [0] = [#neg(#s(@x))] [#negative(#neg(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 1] [0] = [#pos(@x)] [#negative(#pos(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 1] [0] = [#neg(@x)] [#divsub(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#divsub(#0(), #s(@y))] = [0] [0] [0] >= [0] [0] [0] = [#underflow()] [#divsub(#s(@x), #0())] = [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [#s(@x)] [#divsub(#s(@x), #s(@y))] = [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] = [#divsub(@x, @y)] [#natmult(#0(), @y)] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#natmult(#s(@x), @y)] = [0] [0] [0] >= [0] [0] [0] = [#natadd(@y, #natmult(@x, @y))] [#natadd(#0(), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [1 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#natadd(#s(@x), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [1 1 1] [0] >= [1 0 0] [0] [0 1 1] @y + [0] [1 1 1] [0] = [#s(#natadd(@x, @y))] [#natdiv'(#0(), @y)] = [0] [0] [0] >= [0] [0] [0] = [#s(#0())] [#natdiv'(#s(@x), @y)] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] = [#s(#natdiv(#s(@x), @y))] [#natdiv'(#underflow(), @y)] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#natsub(@x, #0())] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#natsub(#s(@x), #s(@y))] = [1 0 0] [0 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [1 0 0] [0] >= [1 0 0] [0 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [1 0 0] [0] = [#natsub(@x, @y)] We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^3)). Strict Trs: { #equal(@x, @y) -> #eq(@x, @y) , *(@x, @y) -> #mult(@x, @y) , -(@x, @y) -> #sub(@x, @y) , div(@x, @y) -> #div(@x, @y) , eratos(@l) -> eratos#1(@l) , eratos#1(::(@x, @xs)) -> ::(@x, eratos(filter(@x, @xs))) , filter(@p, @l) -> filter#1(@l, @p) , filter#1(::(@x, @xs), @p) -> filter#2(filter(@p, @xs), @p, @x) , filter#2(@xs', @p, @x) -> filter#3(#equal(mod(@x, @p), #0()), @x, @xs') , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , filter#3(#false(), @x, @xs') -> ::(@x, @xs') , filter#3(#true(), @x, @xs') -> @xs' } Weak Trs: { #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(#0(), #0()) -> #true() , #eq(#0(), #s(@y)) -> #false() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , eratos#1(nil()) -> nil() , filter#1(nil(), @p) -> nil() , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#s(@x)) -> #pos(#s(@x)) , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #negative(#0()) -> #0() , #negative(#s(@x)) -> #neg(#s(@x)) , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^3)) We use the processor 'matrix interpretation of dimension 3' to orient following rules strictly. Trs: { eratos#1(::(@x, @xs)) -> ::(@x, eratos(filter(@x, @xs))) , filter#1(::(@x, @xs), @p) -> filter#2(filter(@p, @xs), @p, @x) , filter#3(#true(), @x, @xs') -> @xs' } The induced complexity on above rules (modulo remaining rules) is YES(?,O(n^3)) . These rules are moved into the corresponding weak component(s). Sub-proof: ---------- The following argument positions are usable: Uargs(#equal) = {1}, Uargs(*) = {2}, Uargs(-) = {2}, Uargs(eratos) = {1}, Uargs(::) = {2}, Uargs(filter#2) = {1}, Uargs(filter#3) = {1}, Uargs(#s) = {1}, Uargs(#neg) = {1}, Uargs(#pred) = {1}, Uargs(#pos) = {1}, Uargs(#succ) = {1}, Uargs(#and) = {1, 2}, Uargs(#positive) = {1}, Uargs(#negative) = {1}, Uargs(#natadd) = {2}, Uargs(#natdiv') = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [1 0 0] [1 0 0] [0] [#equal](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [0] [0 1 1] [1 1 0] [0] [0 0 0] [0 0 0] [0] [#eq](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [0] [0 1 0] [1 1 0] [0] [0 0 0] [1 0 0] [0] [*](x1, x2) = [0 1 0] x1 + [0 0 0] x2 + [1] [0 0 0] [0 0 1] [0] [0 0 0] [0 0 0] [0] [#mult](x1, x2) = [0 1 0] x1 + [0 0 0] x2 + [1] [0 0 0] [0 0 1] [0] [1 0 0] [1 0 0] [0] [-](x1, x2) = [0 1 0] x1 + [0 1 1] x2 + [0] [0 0 1] [0 1 1] [0] [1 0 0] [1 0 0] [0] [#sub](x1, x2) = [0 1 0] x1 + [0 1 1] x2 + [0] [0 0 1] [0 1 1] [0] [0 1 0] [0 0 0] [0] [div](x1, x2) = [1 1 0] x1 + [0 0 1] x2 + [1] [1 0 0] [0 0 1] [0] [0 1 0] [0 0 0] [0] [#div](x1, x2) = [1 0 0] x1 + [0 0 1] x2 + [1] [1 0 0] [0 0 1] [0] [1 1 1] [0] [eratos](x1) = [0 1 0] x1 + [1] [0 1 1] [0] [1 1 1] [0] [eratos#1](x1) = [0 1 0] x1 + [1] [0 1 1] [0] [0 0 0] [1 0 0] [1] [::](x1, x2) = [1 1 0] x1 + [0 1 0] x2 + [1] [0 1 0] [0 1 1] [0] [1 1 0] [0] [filter](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [0] [nil] = [0] [0] [1 1 0] [0] [filter#1](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 1 0] [1] [filter#2](x1, x2, x3) = [0 1 0] x1 + [1 1 0] x3 + [1] [0 1 1] [0 1 0] [0] [1 1 0] [0 0 0] [0] [mod](x1, x2) = [1 1 0] x1 + [0 1 1] x2 + [1] [1 0 1] [0 1 1] [1] [0] [#0] = [1] [1] [1 0 0] [0 0 0] [1 0 0] [1] [filter#3](x1, x2, x3) = [0 1 0] x1 + [1 1 0] x2 + [0 1 0] x3 + [1] [0 0 0] [0 1 0] [0 1 1] [0] [0] [#false] = [0] [1] [0] [#true] = [0] [0] [1 0 0] [1 0 0] [0] [#add](x1, x2) = [0 1 0] x1 + [0 1 0] x2 + [0] [0 0 0] [0 0 1] [0] [1 0 0] [0] [#s](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#neg](x1) = [1 1 0] x1 + [1] [1 0 0] [1] [1 0 0] [0] [#pred](x1) = [0 1 0] x1 + [1] [0 0 1] [0] [1 0 0] [0] [#pos](x1) = [1 1 0] x1 + [0] [1 0 0] [1] [1 0 0] [0] [#succ](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 0 0] [0] [#and](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [0] [0 0 0] [0 0 0] [1] [0] [#divByZero] = [0] [0] [1 0 0] [0 0 0] [0] [#natdiv](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [1] [0 0 1] [0 1 1] [0] [1 0 0] [0] [#positive](x1) = [1 1 0] x1 + [0] [1 0 0] [1] [1 0 0] [0] [#negative](x1) = [1 1 0] x1 + [1] [1 0 0] [1] [1 0 0] [0] [#divsub](x1, x2) = [0 1 1] x1 + [0] [0 0 1] [0] [0] [#underflow] = [0] [1] [0 0 0] [0 0 0] [0] [#natmult](x1, x2) = [0 1 0] x1 + [0 0 0] x2 + [0] [0 0 0] [0 0 1] [1] [1 0 0] [0] [#natadd](x1, x2) = [1 1 0] x2 + [0] [1 0 1] [0] [1 0 0] [0 0 0] [0] [#natdiv'](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [1] [0 0 1] [0 1 1] [0] [1 0 0] [1 0 0] [0] [#natsub](x1, x2) = [1 1 0] x1 + [1 0 0] x2 + [0] [1 0 1] [1 0 0] [0] This order satisfies following ordering constraints [#equal(@x, @y)] = [1 0 0] [1 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [0 1 1] [1 1 0] [0] >= [0 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [0 1 0] [1 1 0] [0] = [#eq(@x, @y)] [#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0 0 0] [0 0 0] [0 0 0] [0 0 0] [0] [0 0 0] @x_1 + [0 0 0] @x_2 + [0 0 0] @y_1 + [0 0 0] @y_2 + [0] [1 1 0] [0 1 0] [1 1 0] [1 1 0] [3] >= [0] [0] [1] = [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))] [#eq(::(@x_1, @x_2), nil())] = [0 0 0] [0 0 0] [0] [0 0 0] @x_1 + [0 0 0] @x_2 + [0] [1 1 0] [0 1 0] [1] >= [0] [0] [1] = [#false()] [#eq(nil(), ::(@y_1, @y_2))] = [0 0 0] [0 0 0] [0] [0 0 0] @y_1 + [0 0 0] @y_2 + [0] [1 1 0] [1 1 0] [2] >= [0] [0] [1] = [#false()] [#eq(nil(), nil())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #0())] = [0] [0] [2] >= [0] [0] [0] = [#true()] [#eq(#0(), #s(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 1 0] [1] >= [0] [0] [1] = [#false()] [#eq(#0(), #neg(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [2 1 0] [2] >= [0] [0] [1] = [#false()] [#eq(#0(), #pos(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [2 1 0] [1] >= [0] [0] [1] = [#false()] [#eq(#s(@x), #0())] = [0 0 0] [0] [0 0 0] @x + [0] [0 1 0] [1] >= [0] [0] [1] = [#false()] [#eq(#s(@x), #s(@y))] = [0 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [0 1 0] [1 1 0] [0] >= [0 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [0 1 0] [1 1 0] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #0())] = [0 0 0] [0] [0 0 0] @x + [0] [1 1 0] [2] >= [0] [0] [1] = [#false()] [#eq(#neg(@x), #neg(@y))] = [0 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [1 1 0] [2 1 0] [2] >= [0 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [0 1 0] [1 1 0] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #pos(@y))] = [0 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [1 1 0] [2 1 0] [1] >= [0] [0] [1] = [#false()] [#eq(#pos(@x), #0())] = [0 0 0] [0] [0 0 0] @x + [0] [1 1 0] [1] >= [0] [0] [1] = [#false()] [#eq(#pos(@x), #neg(@y))] = [0 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [1 1 0] [2 1 0] [1] >= [0] [0] [1] = [#false()] [#eq(#pos(@x), #pos(@y))] = [0 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [1 1 0] [2 1 0] [0] >= [0 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [0 1 0] [1 1 0] [0] = [#eq(@x, @y)] [*(@x, @y)] = [0 0 0] [1 0 0] [0] [0 1 0] @x + [0 0 0] @y + [1] [0 0 0] [0 0 1] [0] >= [0 0 0] [0 0 0] [0] [0 1 0] @x + [0 0 0] @y + [1] [0 0 0] [0 0 1] [0] = [#mult(@x, @y)] [#mult(#0(), #0())] = [0] [2] [1] >= [0] [1] [1] = [#0()] [#mult(#0(), #neg(@y))] = [0 0 0] [0] [0 0 0] @y + [2] [1 0 0] [1] >= [0] [1] [1] = [#0()] [#mult(#0(), #pos(@y))] = [0 0 0] [0] [0 0 0] @y + [2] [1 0 0] [1] >= [0] [1] [1] = [#0()] [#mult(#neg(@x), #0())] = [0 0 0] [0] [1 1 0] @x + [2] [0 0 0] [1] >= [0] [1] [1] = [#0()] [#mult(#neg(@x), #neg(@y))] = [0 0 0] [0 0 0] [0] [1 1 0] @x + [0 0 0] @y + [2] [0 0 0] [1 0 0] [1] >= [0 0 0] [0] [0 1 0] @x + [0] [0 0 0] [1] = [#pos(#natmult(@x, @y))] [#mult(#neg(@x), #pos(@y))] = [0 0 0] [0 0 0] [0] [1 1 0] @x + [0 0 0] @y + [2] [0 0 0] [1 0 0] [1] >= [0 0 0] [0] [0 1 0] @x + [1] [0 0 0] [1] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #0())] = [0 0 0] [0] [1 1 0] @x + [1] [0 0 0] [1] >= [0] [1] [1] = [#0()] [#mult(#pos(@x), #neg(@y))] = [0 0 0] [0 0 0] [0] [1 1 0] @x + [0 0 0] @y + [1] [0 0 0] [1 0 0] [1] >= [0 0 0] [0] [0 1 0] @x + [1] [0 0 0] [1] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #pos(@y))] = [0 0 0] [0 0 0] [0] [1 1 0] @x + [0 0 0] @y + [1] [0 0 0] [1 0 0] [1] >= [0 0 0] [0] [0 1 0] @x + [0] [0 0 0] [1] = [#pos(#natmult(@x, @y))] [-(@x, @y)] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 1 1] @y + [0] [0 0 1] [0 1 1] [0] >= [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 1 1] @y + [0] [0 0 1] [0 1 1] [0] = [#sub(@x, @y)] [#sub(@x, #0())] = [1 0 0] [0] [0 1 0] @x + [2] [0 0 1] [2] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#sub(@x, #neg(@y))] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [2 1 0] @y + [2] [0 0 1] [2 1 0] [2] >= [1 0 0] [1 0 0] [0] [0 1 0] @x + [1 1 0] @y + [0] [0 0 0] [1 0 0] [1] = [#add(@x, #pos(@y))] [#sub(@x, #pos(@y))] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [2 1 0] @y + [1] [0 0 1] [2 1 0] [1] >= [1 0 0] [1 0 0] [0] [0 1 0] @x + [1 1 0] @y + [1] [0 0 0] [1 0 0] [1] = [#add(@x, #neg(@y))] [div(@x, @y)] = [0 1 0] [0 0 0] [0] [1 1 0] @x + [0 0 1] @y + [1] [1 0 0] [0 0 1] [0] >= [0 1 0] [0 0 0] [0] [1 0 0] @x + [0 0 1] @y + [1] [1 0 0] [0 0 1] [0] = [#div(@x, @y)] [#div(#0(), #0())] = [1] [2] [1] > [0] [0] [0] = [#divByZero()] [#div(#0(), #neg(@y))] = [0 0 0] [1] [1 0 0] @y + [2] [1 0 0] [1] > [0] [1] [1] = [#0()] [#div(#0(), #pos(@y))] = [0 0 0] [1] [1 0 0] @y + [2] [1 0 0] [1] > [0] [1] [1] = [#0()] [#div(#neg(@x), #0())] = [1 1 0] [1] [1 0 0] @x + [2] [1 0 0] [1] > [0] [0] [0] = [#divByZero()] [#div(#neg(@x), #neg(@y))] = [1 1 0] [0 0 0] [1] [1 0 0] @x + [1 0 0] @y + [2] [1 0 0] [1 0 0] [1] > [1 0 0] [0] [1 0 0] @x + [1] [1 0 0] [1] = [#positive(#natdiv(@x, @y))] [#div(#neg(@x), #pos(@y))] = [1 1 0] [0 0 0] [1] [1 0 0] @x + [1 0 0] @y + [2] [1 0 0] [1 0 0] [1] > [1 0 0] [0] [1 0 0] @x + [2] [1 0 0] [1] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #0())] = [1 1 0] [0] [1 0 0] @x + [2] [1 0 0] [1] >= [0] [0] [0] = [#divByZero()] [#div(#pos(@x), #neg(@y))] = [1 1 0] [0 0 0] [0] [1 0 0] @x + [1 0 0] @y + [2] [1 0 0] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [2] [1 0 0] [1] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #pos(@y))] = [1 1 0] [0 0 0] [0] [1 0 0] @x + [1 0 0] @y + [2] [1 0 0] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [1] [1 0 0] [1] = [#positive(#natdiv(@x, @y))] [eratos(@l)] = [1 1 1] [0] [0 1 0] @l + [1] [0 1 1] [0] >= [1 1 1] [0] [0 1 0] @l + [1] [0 1 1] [0] = [eratos#1(@l)] [eratos#1(::(@x, @xs))] = [1 2 0] [1 2 1] [2] [1 1 0] @x + [0 1 0] @xs + [2] [1 2 0] [0 2 1] [1] > [0 0 0] [1 2 1] [1] [1 1 0] @x + [0 1 0] @xs + [2] [0 1 0] [0 2 1] [1] = [::(@x, eratos(filter(@x, @xs)))] [eratos#1(nil())] = [0] [1] [0] >= [0] [0] [0] = [nil()] [filter(@p, @l)] = [1 1 0] [0] [0 1 0] @l + [0] [0 0 1] [0] >= [1 1 0] [0] [0 1 0] @l + [0] [0 0 1] [0] = [filter#1(@l, @p)] [filter#1(::(@x, @xs), @p)] = [1 1 0] [1 1 0] [2] [1 1 0] @x + [0 1 0] @xs + [1] [0 1 0] [0 1 1] [0] > [1 1 0] [1 1 0] [1] [1 1 0] @x + [0 1 0] @xs + [1] [0 1 0] [0 1 1] [0] = [filter#2(filter(@p, @xs), @p, @x)] [filter#1(nil(), @p)] = [0] [0] [0] >= [0] [0] [0] = [nil()] [filter#2(@xs', @p, @x)] = [1 1 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [0] >= [1 1 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [0] = [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')] [mod(@x, @y)] = [1 1 0] [0 0 0] [0] [1 1 0] @x + [0 1 1] @y + [1] [1 0 1] [0 1 1] [1] >= [1 1 0] [0 0 0] [0] [1 1 0] @x + [0 1 1] @y + [1] [1 0 1] [0 1 1] [1] = [-(@x, *(@y, div(@x, @y)))] [filter#3(#false(), @x, @xs')] = [0 0 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [0] >= [0 0 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [0] = [::(@x, @xs')] [filter#3(#true(), @x, @xs')] = [0 0 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [0] > [1 0 0] [0] [0 1 0] @xs' + [0] [0 0 1] [0] = [@xs'] [#add(#0(), @y)] = [1 0 0] [0] [0 1 0] @y + [1] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#add(#neg(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [2] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [1] [0 0 1] [0] = [#pred(@y)] [#add(#neg(#s(#s(@x))), @y)] = [1 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @y + [1] [0 0 0] [0 0 1] [0] >= [1 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @y + [1] [0 0 0] [0 0 1] [0] = [#pred(#add(#pos(#s(@x)), @y))] [#add(#pos(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [1] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#succ(@y)] [#add(#pos(#s(#s(@x))), @y)] = [1 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @y + [0] [0 0 0] [0 0 1] [0] >= [1 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @y + [0] [0 0 0] [0 0 1] [0] = [#succ(#add(#pos(#s(@x)), @y))] [#pred(#0())] = [0] [2] [1] >= [0] [2] [1] = [#neg(#s(#0()))] [#pred(#neg(#s(@x)))] = [1 0 0] [0] [1 1 0] @x + [2] [1 0 0] [1] >= [1 0 0] [0] [1 1 0] @x + [1] [1 0 0] [1] = [#neg(#s(#s(@x)))] [#pred(#pos(#s(#0())))] = [0] [2] [1] >= [0] [1] [1] = [#0()] [#pred(#pos(#s(#s(@x))))] = [1 0 0] [0] [1 1 0] @x + [1] [1 0 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [1] = [#pos(#s(@x))] [#succ(#0())] = [0] [1] [1] >= [0] [1] [1] = [#pos(#s(#0()))] [#succ(#neg(#s(#0())))] = [0] [2] [1] >= [0] [1] [1] = [#0()] [#succ(#neg(#s(#s(@x))))] = [1 0 0] [0] [1 1 0] @x + [1] [1 0 0] [1] >= [1 0 0] [0] [1 1 0] @x + [1] [1 0 0] [1] = [#neg(#s(@x))] [#succ(#pos(#s(@x)))] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [1] = [#pos(#s(#s(@x)))] [#and(#false(), #false())] = [0] [0] [1] >= [0] [0] [1] = [#false()] [#and(#false(), #true())] = [0] [0] [1] >= [0] [0] [1] = [#false()] [#and(#true(), #false())] = [0] [0] [1] >= [0] [0] [1] = [#false()] [#and(#true(), #true())] = [0] [0] [1] >= [0] [0] [0] = [#true()] [#natdiv(#0(), #0())] = [0] [1] [3] >= [0] [0] [0] = [#divByZero()] [#natdiv(#0(), #s(@y))] = [0 0 0] [0] [0 0 0] @y + [1] [0 1 1] [1] >= [0] [1] [1] = [#0()] [#natdiv(#s(@x), #0())] = [1 0 0] [0] [0 0 0] @x + [1] [0 0 1] [2] >= [0] [0] [0] = [#divByZero()] [#natdiv(#s(@x), #s(@y))] = [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [1] [0 0 1] [0 1 1] [0] >= [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [1] [0 0 1] [0 1 1] [0] = [#natdiv'(#divsub(@x, @y), #s(@y))] [#positive(#0())] = [0] [1] [1] >= [0] [1] [1] = [#0()] [#positive(#s(@x))] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [1] = [#pos(#s(@x))] [#positive(#neg(@x))] = [1 0 0] [0] [2 1 0] @x + [1] [1 0 0] [1] >= [1 0 0] [0] [1 1 0] @x + [1] [1 0 0] [1] = [#neg(@x)] [#positive(#pos(@x))] = [1 0 0] [0] [2 1 0] @x + [0] [1 0 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [1] = [#pos(@x)] [#negative(#0())] = [0] [2] [1] >= [0] [1] [1] = [#0()] [#negative(#s(@x))] = [1 0 0] [0] [1 1 0] @x + [1] [1 0 0] [1] >= [1 0 0] [0] [1 1 0] @x + [1] [1 0 0] [1] = [#neg(#s(@x))] [#negative(#neg(@x))] = [1 0 0] [0] [2 1 0] @x + [2] [1 0 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [1] = [#pos(@x)] [#negative(#pos(@x))] = [1 0 0] [0] [2 1 0] @x + [1] [1 0 0] [1] >= [1 0 0] [0] [1 1 0] @x + [1] [1 0 0] [1] = [#neg(@x)] [#divsub(#0(), #0())] = [0] [2] [1] >= [0] [1] [1] = [#0()] [#divsub(#0(), #s(@y))] = [0] [2] [1] >= [0] [0] [1] = [#underflow()] [#divsub(#s(@x), #0())] = [1 0 0] [0] [0 1 1] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [#s(@x)] [#divsub(#s(@x), #s(@y))] = [1 0 0] [0] [0 1 1] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 1] @x + [0] [0 0 1] [0] = [#divsub(@x, @y)] [#natmult(#0(), @y)] = [0 0 0] [0] [0 0 0] @y + [1] [0 0 1] [1] >= [0] [1] [1] = [#0()] [#natmult(#s(@x), @y)] = [0 0 0] [0 0 0] [0] [0 1 0] @x + [0 0 0] @y + [0] [0 0 0] [0 0 1] [1] >= [0 0 0] [0 0 0] [0] [0 1 0] @x + [0 0 0] @y + [0] [0 0 0] [0 0 1] [1] = [#natadd(@y, #natmult(@x, @y))] [#natadd(#0(), @y)] = [1 0 0] [0] [1 1 0] @y + [0] [1 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#natadd(#s(@x), @y)] = [1 0 0] [0] [1 1 0] @y + [0] [1 0 1] [0] >= [1 0 0] [0] [1 1 0] @y + [0] [1 0 1] [0] = [#s(#natadd(@x, @y))] [#natdiv'(#0(), @y)] = [0 0 0] [0] [0 0 0] @y + [1] [0 1 1] [1] >= [0] [1] [1] = [#s(#0())] [#natdiv'(#s(@x), @y)] = [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [1] [0 0 1] [0 1 1] [0] >= [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [1] [0 0 1] [0 1 1] [0] = [#s(#natdiv(#s(@x), @y))] [#natdiv'(#underflow(), @y)] = [0 0 0] [0] [0 0 0] @y + [1] [0 1 1] [1] >= [0] [1] [1] = [#0()] [#natsub(@x, #0())] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#natsub(#s(@x), #s(@y))] = [1 0 0] [1 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [1 0 0] [0] >= [1 0 0] [1 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [1 0 0] [0] = [#natsub(@x, @y)] We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^3)). Strict Trs: { #equal(@x, @y) -> #eq(@x, @y) , *(@x, @y) -> #mult(@x, @y) , -(@x, @y) -> #sub(@x, @y) , div(@x, @y) -> #div(@x, @y) , eratos(@l) -> eratos#1(@l) , filter(@p, @l) -> filter#1(@l, @p) , filter#2(@xs', @p, @x) -> filter#3(#equal(mod(@x, @p), #0()), @x, @xs') , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , filter#3(#false(), @x, @xs') -> ::(@x, @xs') } Weak Trs: { #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(#0(), #0()) -> #true() , #eq(#0(), #s(@y)) -> #false() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , eratos#1(::(@x, @xs)) -> ::(@x, eratos(filter(@x, @xs))) , eratos#1(nil()) -> nil() , filter#1(::(@x, @xs), @p) -> filter#2(filter(@p, @xs), @p, @x) , filter#1(nil(), @p) -> nil() , filter#3(#true(), @x, @xs') -> @xs' , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#s(@x)) -> #pos(#s(@x)) , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #negative(#0()) -> #0() , #negative(#s(@x)) -> #neg(#s(@x)) , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^3)) We use the processor 'matrix interpretation of dimension 3' to orient following rules strictly. Trs: { eratos(@l) -> eratos#1(@l) } The induced complexity on above rules (modulo remaining rules) is YES(?,O(n^3)) . These rules are moved into the corresponding weak component(s). Sub-proof: ---------- The following argument positions are usable: Uargs(#equal) = {1}, Uargs(*) = {2}, Uargs(-) = {2}, Uargs(eratos) = {1}, Uargs(::) = {2}, Uargs(filter#2) = {1}, Uargs(filter#3) = {1}, Uargs(#s) = {1}, Uargs(#neg) = {1}, Uargs(#pred) = {1}, Uargs(#pos) = {1}, Uargs(#succ) = {1}, Uargs(#and) = {1, 2}, Uargs(#positive) = {1}, Uargs(#negative) = {1}, Uargs(#natadd) = {2}, Uargs(#natdiv') = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [1 0 0] [0 0 0] [0] [#equal](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [0] [0 0 0] [1 1 1] [0] [0 0 0] [0] [#eq](x1, x2) = [0 0 0] x2 + [0] [1 0 0] [0] [1 0 0] [0] [*](x1, x2) = [0 0 0] x2 + [0] [0 0 0] [0] [0] [#mult](x1, x2) = [0] [0] [1 0 0] [1 1 1] [0] [-](x1, x2) = [0 1 1] x1 + [0 1 0] x2 + [0] [0 0 1] [0 0 1] [0] [1 0 0] [1 0 0] [0] [#sub](x1, x2) = [0 1 0] x1 + [0 1 0] x2 + [0] [0 0 1] [0 0 1] [0] [0 0 1] [0] [div](x1, x2) = [1 0 1] x1 + [1] [1 0 1] [1] [0 0 1] [0] [#div](x1, x2) = [1 0 0] x1 + [0] [0 0 1] [0] [1 1 1] [1] [eratos](x1) = [0 1 1] x1 + [0] [0 0 1] [0] [1 1 1] [0] [eratos#1](x1) = [0 1 1] x1 + [0] [0 0 1] [0] [0 0 0] [1 0 0] [0] [::](x1, x2) = [0 0 1] x1 + [0 1 1] x2 + [1] [1 0 1] [0 0 1] [1] [1 0 1] [0] [filter](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [0] [nil] = [0] [0] [1 0 1] [0] [filter#1](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 0 1] [0] [filter#2](x1, x2, x3) = [0 1 1] x1 + [0 0 1] x3 + [1] [0 0 1] [1 0 1] [1] [1 0 1] [0] [mod](x1, x2) = [0 1 1] x1 + [0] [0 0 1] [0] [0] [#0] = [0] [0] [1 1 1] [0 0 0] [1 0 0] [0] [filter#3](x1, x2, x3) = [0 0 0] x1 + [0 0 1] x2 + [0 1 1] x3 + [1] [0 0 0] [1 0 1] [0 0 1] [1] [0] [#false] = [0] [0] [0] [#true] = [0] [0] [1 0 0] [0] [#add](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [1 0 0] [0] [#s](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#neg](x1) = [0 0 0] x1 + [0] [1 0 0] [0] [1 0 0] [0] [#pred](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#pos](x1) = [0 0 0] x1 + [0] [1 0 0] [0] [1 0 0] [0] [#succ](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 0 0] [0] [#and](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [0] [0 0 0] [0 0 0] [0] [0] [#divByZero] = [0] [0] [1 0 0] [0] [#natdiv](x1, x2) = [0 0 0] x1 + [0] [0 0 0] [0] [1 0 1] [0] [#positive](x1) = [1 0 0] x1 + [0] [1 1 1] [0] [1 0 1] [0] [#negative](x1) = [1 0 0] x1 + [0] [1 1 1] [0] [1 0 0] [0] [#divsub](x1, x2) = [0 1 1] x1 + [0] [0 1 1] [0] [0] [#underflow] = [0] [0] [0] [#natmult](x1, x2) = [0] [0] [1 0 0] [0] [#natadd](x1, x2) = [0 1 1] x2 + [0] [0 1 1] [0] [1 0 0] [0] [#natdiv'](x1, x2) = [0 0 0] x1 + [0] [0 0 0] [0] [1 0 0] [1 0 0] [0] [#natsub](x1, x2) = [1 1 0] x1 + [1 0 0] x2 + [0] [1 0 1] [1 0 0] [0] This order satisfies following ordering constraints [#equal(@x, @y)] = [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [0 0 0] [1 1 1] [0] >= [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [0] = [#eq(@x, @y)] [#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0 0 0] [0] [0 0 0] @y_2 + [0] [1 0 0] [0] >= [0] [0] [0] = [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))] [#eq(::(@x_1, @x_2), nil())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(nil(), ::(@y_1, @y_2))] = [0 0 0] [0] [0 0 0] @y_2 + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(nil(), nil())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #s(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#0(), #neg(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#0(), #pos(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#s(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#s(@x), #s(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#neg(@x), #neg(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #pos(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #neg(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #pos(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [0] >= [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [0] = [#eq(@x, @y)] [*(@x, @y)] = [1 0 0] [0] [0 0 0] @y + [0] [0 0 0] [0] >= [0] [0] [0] = [#mult(@x, @y)] [#mult(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#0(), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#0(), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#neg(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#neg(@x), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#pos(#natmult(@x, @y))] [#mult(#neg(@x), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#pos(@x), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#pos(#natmult(@x, @y))] [-(@x, @y)] = [1 0 0] [1 1 1] [0] [0 1 1] @x + [0 1 0] @y + [0] [0 0 1] [0 0 1] [0] >= [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 1 0] @y + [0] [0 0 1] [0 0 1] [0] = [#sub(@x, @y)] [#sub(@x, #0())] = [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#sub(@x, #neg(@y))] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 0 0] @y + [0] [0 0 1] [1 0 0] [0] >= [1 0 0] [0] [0 0 0] @y + [0] [1 0 0] [0] = [#add(@x, #pos(@y))] [#sub(@x, #pos(@y))] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 0 0] @y + [0] [0 0 1] [1 0 0] [0] >= [1 0 0] [0] [0 0 0] @y + [0] [1 0 0] [0] = [#add(@x, #neg(@y))] [div(@x, @y)] = [0 0 1] [0] [1 0 1] @x + [1] [1 0 1] [1] >= [0 0 1] [0] [1 0 0] @x + [0] [0 0 1] [0] = [#div(@x, @y)] [#div(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#0(), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#div(#0(), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#div(#neg(@x), #0())] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#neg(@x), #neg(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#positive(#natdiv(@x, @y))] [#div(#neg(@x), #pos(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #0())] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#pos(@x), #neg(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #pos(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#positive(#natdiv(@x, @y))] [eratos(@l)] = [1 1 1] [1] [0 1 1] @l + [0] [0 0 1] [0] > [1 1 1] [0] [0 1 1] @l + [0] [0 0 1] [0] = [eratos#1(@l)] [eratos#1(::(@x, @xs))] = [1 0 2] [1 1 2] [2] [1 0 2] @x + [0 1 2] @xs + [2] [1 0 1] [0 0 1] [1] > [0 0 0] [1 1 2] [1] [0 0 1] @x + [0 1 2] @xs + [1] [1 0 1] [0 0 1] [1] = [::(@x, eratos(filter(@x, @xs)))] [eratos#1(nil())] = [0] [0] [0] >= [0] [0] [0] = [nil()] [filter(@p, @l)] = [1 0 1] [0] [0 1 0] @l + [0] [0 0 1] [0] >= [1 0 1] [0] [0 1 0] @l + [0] [0 0 1] [0] = [filter#1(@l, @p)] [filter#1(::(@x, @xs), @p)] = [1 0 1] [1 0 1] [1] [0 0 1] @x + [0 1 1] @xs + [1] [1 0 1] [0 0 1] [1] > [1 0 1] [1 0 1] [0] [0 0 1] @x + [0 1 1] @xs + [1] [1 0 1] [0 0 1] [1] = [filter#2(filter(@p, @xs), @p, @x)] [filter#1(nil(), @p)] = [0] [0] [0] >= [0] [0] [0] = [nil()] [filter#2(@xs', @p, @x)] = [1 0 1] [1 0 0] [0] [0 0 1] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [1] >= [1 0 1] [1 0 0] [0] [0 0 1] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [1] = [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')] [mod(@x, @y)] = [1 0 1] [0] [0 1 1] @x + [0] [0 0 1] [0] >= [1 0 1] [0] [0 1 1] @x + [0] [0 0 1] [0] = [-(@x, *(@y, div(@x, @y)))] [filter#3(#false(), @x, @xs')] = [0 0 0] [1 0 0] [0] [0 0 1] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [1] >= [0 0 0] [1 0 0] [0] [0 0 1] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [1] = [::(@x, @xs')] [filter#3(#true(), @x, @xs')] = [0 0 0] [1 0 0] [0] [0 0 1] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [1] >= [1 0 0] [0] [0 1 0] @xs' + [0] [0 0 1] [0] = [@xs'] [#add(#0(), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#add(#neg(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#pred(@y)] [#add(#neg(#s(#s(@x))), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#pred(#add(#pos(#s(@x)), @y))] [#add(#pos(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#succ(@y)] [#add(#pos(#s(#s(@x))), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#succ(#add(#pos(#s(@x)), @y))] [#pred(#0())] = [0] [0] [0] >= [0] [0] [0] = [#neg(#s(#0()))] [#pred(#neg(#s(@x)))] = [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [0] = [#neg(#s(#s(@x)))] [#pred(#pos(#s(#0())))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#pred(#pos(#s(#s(@x))))] = [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [0] = [#pos(#s(@x))] [#succ(#0())] = [0] [0] [0] >= [0] [0] [0] = [#pos(#s(#0()))] [#succ(#neg(#s(#0())))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#succ(#neg(#s(#s(@x))))] = [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [0] = [#neg(#s(@x))] [#succ(#pos(#s(@x)))] = [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [0] = [#pos(#s(#s(@x)))] [#and(#false(), #false())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#false(), #true())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#true(), #false())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#true(), #true())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#natdiv(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#divByZero()] [#natdiv(#0(), #s(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#natdiv(#s(@x), #0())] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#natdiv(#s(@x), #s(@y))] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] = [#natdiv'(#divsub(@x, @y), #s(@y))] [#positive(#0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#positive(#s(@x))] = [1 0 1] [0] [1 0 0] @x + [0] [1 1 1] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [0] = [#pos(#s(@x))] [#positive(#neg(@x))] = [2 0 0] [0] [1 0 0] @x + [0] [2 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [0] = [#neg(@x)] [#positive(#pos(@x))] = [2 0 0] [0] [1 0 0] @x + [0] [2 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [0] = [#pos(@x)] [#negative(#0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#negative(#s(@x))] = [1 0 1] [0] [1 0 0] @x + [0] [1 1 1] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [0] = [#neg(#s(@x))] [#negative(#neg(@x))] = [2 0 0] [0] [1 0 0] @x + [0] [2 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [0] = [#pos(@x)] [#negative(#pos(@x))] = [2 0 0] [0] [1 0 0] @x + [0] [2 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [0] = [#neg(@x)] [#divsub(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#divsub(#0(), #s(@y))] = [0] [0] [0] >= [0] [0] [0] = [#underflow()] [#divsub(#s(@x), #0())] = [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [#s(@x)] [#divsub(#s(@x), #s(@y))] = [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] = [#divsub(@x, @y)] [#natmult(#0(), @y)] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#natmult(#s(@x), @y)] = [0] [0] [0] >= [0] [0] [0] = [#natadd(@y, #natmult(@x, @y))] [#natadd(#0(), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#natadd(#s(@x), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] = [#s(#natadd(@x, @y))] [#natdiv'(#0(), @y)] = [0] [0] [0] >= [0] [0] [0] = [#s(#0())] [#natdiv'(#s(@x), @y)] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] = [#s(#natdiv(#s(@x), @y))] [#natdiv'(#underflow(), @y)] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#natsub(@x, #0())] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#natsub(#s(@x), #s(@y))] = [1 0 0] [1 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [1 0 0] [0] >= [1 0 0] [1 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [1 0 0] [0] = [#natsub(@x, @y)] We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^3)). Strict Trs: { #equal(@x, @y) -> #eq(@x, @y) , *(@x, @y) -> #mult(@x, @y) , -(@x, @y) -> #sub(@x, @y) , div(@x, @y) -> #div(@x, @y) , filter(@p, @l) -> filter#1(@l, @p) , filter#2(@xs', @p, @x) -> filter#3(#equal(mod(@x, @p), #0()), @x, @xs') , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , filter#3(#false(), @x, @xs') -> ::(@x, @xs') } Weak Trs: { #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(#0(), #0()) -> #true() , #eq(#0(), #s(@y)) -> #false() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , eratos(@l) -> eratos#1(@l) , eratos#1(::(@x, @xs)) -> ::(@x, eratos(filter(@x, @xs))) , eratos#1(nil()) -> nil() , filter#1(::(@x, @xs), @p) -> filter#2(filter(@p, @xs), @p, @x) , filter#1(nil(), @p) -> nil() , filter#3(#true(), @x, @xs') -> @xs' , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#s(@x)) -> #pos(#s(@x)) , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #negative(#0()) -> #0() , #negative(#s(@x)) -> #neg(#s(@x)) , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^3)) We use the processor 'matrix interpretation of dimension 3' to orient following rules strictly. Trs: { filter#2(@xs', @p, @x) -> filter#3(#equal(mod(@x, @p), #0()), @x, @xs') } The induced complexity on above rules (modulo remaining rules) is YES(?,O(n^3)) . These rules are moved into the corresponding weak component(s). Sub-proof: ---------- The following argument positions are usable: Uargs(#equal) = {1}, Uargs(*) = {2}, Uargs(-) = {2}, Uargs(eratos) = {1}, Uargs(::) = {2}, Uargs(filter#2) = {1}, Uargs(filter#3) = {1}, Uargs(#s) = {1}, Uargs(#neg) = {1}, Uargs(#pred) = {1}, Uargs(#pos) = {1}, Uargs(#succ) = {1}, Uargs(#and) = {1, 2}, Uargs(#positive) = {1}, Uargs(#negative) = {1}, Uargs(#natadd) = {2}, Uargs(#natdiv') = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [1 0 0] [0 0 0] [0] [#equal](x1, x2) = [1 1 1] x1 + [0 1 0] x2 + [0] [0 0 0] [0 0 0] [0] [0] [#eq](x1, x2) = [0] [0] [0 0 0] [1 0 1] [0] [*](x1, x2) = [0 1 0] x1 + [0 0 1] x2 + [1] [0 0 0] [0 1 1] [0] [0 0 0] [1 0 1] [0] [#mult](x1, x2) = [0 1 0] x1 + [0 0 1] x2 + [1] [0 0 0] [0 0 0] [0] [1 0 0] [1 0 0] [0] [-](x1, x2) = [0 1 0] x1 + [0 1 0] x2 + [0] [0 0 1] [0 0 0] [0] [1 0 0] [1 0 0] [0] [#sub](x1, x2) = [0 1 0] x1 + [0 1 0] x2 + [0] [0 0 1] [0 0 0] [0] [0 1 0] [0] [div](x1, x2) = [1 0 0] x1 + [1] [0 0 0] [0] [0 1 0] [0] [#div](x1, x2) = [1 0 0] x1 + [1] [0 0 0] [0] [1 0 1] [0] [eratos](x1) = [0 1 0] x1 + [0] [0 0 1] [1] [1 0 1] [0] [eratos#1](x1) = [0 1 0] x1 + [0] [0 0 1] [1] [0 0 0] [1 0 0] [0] [::](x1, x2) = [1 1 0] x1 + [0 1 0] x2 + [1] [0 0 0] [0 1 1] [1] [1 1 0] [1] [filter](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [0] [nil] = [0] [0] [1 1 0] [1] [filter#1](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 1 0] [1] [filter#2](x1, x2, x3) = [0 1 0] x1 + [1 1 0] x3 + [1] [0 1 1] [0 0 0] [1] [1 1 0] [0 0 0] [0] [mod](x1, x2) = [1 1 0] x1 + [0 1 0] x2 + [1] [1 0 1] [0 0 0] [0] [0] [#0] = [1] [0] [1 0 1] [0 0 0] [1 0 0] [0] [filter#3](x1, x2, x3) = [0 0 0] x1 + [1 1 0] x2 + [0 1 0] x3 + [1] [0 0 1] [0 0 0] [0 1 1] [1] [0] [#false] = [0] [0] [0] [#true] = [0] [0] [1 0 0] [0] [#add](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [1 0 0] [0] [#s](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#neg](x1) = [1 1 0] x1 + [0] [0 0 0] [0] [1 0 0] [0] [#pred](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#pos](x1) = [1 1 0] x1 + [0] [0 0 0] [0] [1 0 0] [0] [#succ](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 0 0] [0] [#and](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [0] [0 0 0] [0 0 0] [0] [0] [#divByZero] = [0] [0] [1 0 0] [0] [#natdiv](x1, x2) = [0 0 0] x1 + [1] [0 0 0] [0] [1 0 0] [0] [#positive](x1) = [1 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#negative](x1) = [1 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#divsub](x1, x2) = [0 1 1] x1 + [0] [0 1 1] [0] [0] [#underflow] = [0] [0] [0 0 0] [0] [#natmult](x1, x2) = [0 1 0] x1 + [0] [0 0 0] [0] [1 0 0] [0] [#natadd](x1, x2) = [0 1 1] x2 + [0] [0 0 1] [0] [1 0 0] [0] [#natdiv'](x1, x2) = [0 0 0] x1 + [1] [0 0 0] [0] [1 0 0] [1 0 0] [0] [#natsub](x1, x2) = [1 1 0] x1 + [0 0 0] x2 + [0] [1 0 1] [1 0 0] [0] This order satisfies following ordering constraints [#equal(@x, @y)] = [1 0 0] [0 0 0] [0] [1 1 1] @x + [0 1 0] @y + [0] [0 0 0] [0 0 0] [0] >= [0] [0] [0] = [#eq(@x, @y)] [#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0] [0] [0] >= [0] [0] [0] = [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))] [#eq(::(@x_1, @x_2), nil())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(nil(), ::(@y_1, @y_2))] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(nil(), nil())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #s(@y))] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#0(), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#0(), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#s(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#s(@x), #s(@y))] = [0] [0] [0] >= [0] [0] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#neg(@x), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#eq(@x, @y)] [*(@x, @y)] = [0 0 0] [1 0 1] [0] [0 1 0] @x + [0 0 1] @y + [1] [0 0 0] [0 1 1] [0] >= [0 0 0] [1 0 1] [0] [0 1 0] @x + [0 0 1] @y + [1] [0 0 0] [0 0 0] [0] = [#mult(@x, @y)] [#mult(#0(), #0())] = [0] [2] [0] >= [0] [1] [0] = [#0()] [#mult(#0(), #neg(@y))] = [1 0 0] [0] [0 0 0] @y + [2] [0 0 0] [0] >= [0] [1] [0] = [#0()] [#mult(#0(), #pos(@y))] = [1 0 0] [0] [0 0 0] @y + [2] [0 0 0] [0] >= [0] [1] [0] = [#0()] [#mult(#neg(@x), #0())] = [0 0 0] [0] [1 1 0] @x + [1] [0 0 0] [0] >= [0] [1] [0] = [#0()] [#mult(#neg(@x), #neg(@y))] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 0 0] @y + [1] [0 0 0] [0 0 0] [0] >= [0 0 0] [0] [0 1 0] @x + [0] [0 0 0] [0] = [#pos(#natmult(@x, @y))] [#mult(#neg(@x), #pos(@y))] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 0 0] @y + [1] [0 0 0] [0 0 0] [0] >= [0 0 0] [0] [0 1 0] @x + [0] [0 0 0] [0] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #0())] = [0 0 0] [0] [1 1 0] @x + [1] [0 0 0] [0] >= [0] [1] [0] = [#0()] [#mult(#pos(@x), #neg(@y))] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 0 0] @y + [1] [0 0 0] [0 0 0] [0] >= [0 0 0] [0] [0 1 0] @x + [0] [0 0 0] [0] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #pos(@y))] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 0 0] @y + [1] [0 0 0] [0 0 0] [0] >= [0 0 0] [0] [0 1 0] @x + [0] [0 0 0] [0] = [#pos(#natmult(@x, @y))] [-(@x, @y)] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 1 0] @y + [0] [0 0 1] [0 0 0] [0] >= [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 1 0] @y + [0] [0 0 1] [0 0 0] [0] = [#sub(@x, @y)] [#sub(@x, #0())] = [1 0 0] [0] [0 1 0] @x + [1] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#sub(@x, #neg(@y))] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [1 1 0] @y + [0] [0 0 1] [0 0 0] [0] >= [1 0 0] [0] [1 1 0] @y + [0] [0 0 0] [0] = [#add(@x, #pos(@y))] [#sub(@x, #pos(@y))] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [1 1 0] @y + [0] [0 0 1] [0 0 0] [0] >= [1 0 0] [0] [1 1 0] @y + [0] [0 0 0] [0] = [#add(@x, #neg(@y))] [div(@x, @y)] = [0 1 0] [0] [1 0 0] @x + [1] [0 0 0] [0] >= [0 1 0] [0] [1 0 0] @x + [1] [0 0 0] [0] = [#div(@x, @y)] [#div(#0(), #0())] = [1] [1] [0] > [0] [0] [0] = [#divByZero()] [#div(#0(), #neg(@y))] = [1] [1] [0] > [0] [1] [0] = [#0()] [#div(#0(), #pos(@y))] = [1] [1] [0] > [0] [1] [0] = [#0()] [#div(#neg(@x), #0())] = [1 1 0] [0] [1 0 0] @x + [1] [0 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#neg(@x), #neg(@y))] = [1 1 0] [0] [1 0 0] @x + [1] [0 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [1] [0 0 0] [0] = [#positive(#natdiv(@x, @y))] [#div(#neg(@x), #pos(@y))] = [1 1 0] [0] [1 0 0] @x + [1] [0 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [1] [0 0 0] [0] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #0())] = [1 1 0] [0] [1 0 0] @x + [1] [0 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#pos(@x), #neg(@y))] = [1 1 0] [0] [1 0 0] @x + [1] [0 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [1] [0 0 0] [0] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #pos(@y))] = [1 1 0] [0] [1 0 0] @x + [1] [0 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [1] [0 0 0] [0] = [#positive(#natdiv(@x, @y))] [eratos(@l)] = [1 0 1] [0] [0 1 0] @l + [0] [0 0 1] [1] >= [1 0 1] [0] [0 1 0] @l + [0] [0 0 1] [1] = [eratos#1(@l)] [eratos#1(::(@x, @xs))] = [0 0 0] [1 1 1] [1] [1 1 0] @x + [0 1 0] @xs + [1] [0 0 0] [0 1 1] [2] >= [0 0 0] [1 1 1] [1] [1 1 0] @x + [0 1 0] @xs + [1] [0 0 0] [0 1 1] [2] = [::(@x, eratos(filter(@x, @xs)))] [eratos#1(nil())] = [0] [0] [1] >= [0] [0] [0] = [nil()] [filter(@p, @l)] = [1 1 0] [1] [0 1 0] @l + [0] [0 0 1] [0] >= [1 1 0] [1] [0 1 0] @l + [0] [0 0 1] [0] = [filter#1(@l, @p)] [filter#1(::(@x, @xs), @p)] = [1 1 0] [1 1 0] [2] [1 1 0] @x + [0 1 0] @xs + [1] [0 0 0] [0 1 1] [1] >= [1 1 0] [1 1 0] [2] [1 1 0] @x + [0 1 0] @xs + [1] [0 0 0] [0 1 1] [1] = [filter#2(filter(@p, @xs), @p, @x)] [filter#1(nil(), @p)] = [1] [0] [0] > [0] [0] [0] = [nil()] [filter#2(@xs', @p, @x)] = [1 1 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [0 0 0] [0 1 1] [1] > [1 1 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [0 0 0] [0 1 1] [1] = [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')] [mod(@x, @y)] = [1 1 0] [0 0 0] [0] [1 1 0] @x + [0 1 0] @y + [1] [1 0 1] [0 0 0] [0] >= [1 1 0] [0 0 0] [0] [0 1 0] @x + [0 1 0] @y + [1] [0 0 1] [0 0 0] [0] = [-(@x, *(@y, div(@x, @y)))] [filter#3(#false(), @x, @xs')] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [0 0 0] [0 1 1] [1] >= [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [0 0 0] [0 1 1] [1] = [::(@x, @xs')] [filter#3(#true(), @x, @xs')] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [0 0 0] [0 1 1] [1] >= [1 0 0] [0] [0 1 0] @xs' + [0] [0 0 1] [0] = [@xs'] [#add(#0(), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#add(#neg(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#pred(@y)] [#add(#neg(#s(#s(@x))), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#pred(#add(#pos(#s(@x)), @y))] [#add(#pos(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#succ(@y)] [#add(#pos(#s(#s(@x))), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#succ(#add(#pos(#s(@x)), @y))] [#pred(#0())] = [0] [1] [0] >= [0] [1] [0] = [#neg(#s(#0()))] [#pred(#neg(#s(@x)))] = [1 0 0] [0] [1 1 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [0 0 0] [0] = [#neg(#s(#s(@x)))] [#pred(#pos(#s(#0())))] = [0] [1] [0] >= [0] [1] [0] = [#0()] [#pred(#pos(#s(#s(@x))))] = [1 0 0] [0] [1 1 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [0 0 0] [0] = [#pos(#s(@x))] [#succ(#0())] = [0] [1] [0] >= [0] [1] [0] = [#pos(#s(#0()))] [#succ(#neg(#s(#0())))] = [0] [1] [0] >= [0] [1] [0] = [#0()] [#succ(#neg(#s(#s(@x))))] = [1 0 0] [0] [1 1 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [0 0 0] [0] = [#neg(#s(@x))] [#succ(#pos(#s(@x)))] = [1 0 0] [0] [1 1 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [0 0 0] [0] = [#pos(#s(#s(@x)))] [#and(#false(), #false())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#false(), #true())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#true(), #false())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#true(), #true())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#natdiv(#0(), #0())] = [0] [1] [0] >= [0] [0] [0] = [#divByZero()] [#natdiv(#0(), #s(@y))] = [0] [1] [0] >= [0] [1] [0] = [#0()] [#natdiv(#s(@x), #0())] = [1 0 0] [0] [0 0 0] @x + [1] [0 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#natdiv(#s(@x), #s(@y))] = [1 0 0] [0] [0 0 0] @x + [1] [0 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [1] [0 0 0] [0] = [#natdiv'(#divsub(@x, @y), #s(@y))] [#positive(#0())] = [0] [1] [0] >= [0] [1] [0] = [#0()] [#positive(#s(@x))] = [1 0 0] [0] [1 1 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [0 0 0] [0] = [#pos(#s(@x))] [#positive(#neg(@x))] = [1 0 0] [0] [2 1 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [0 0 0] [0] = [#neg(@x)] [#positive(#pos(@x))] = [1 0 0] [0] [2 1 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [0 0 0] [0] = [#pos(@x)] [#negative(#0())] = [0] [1] [0] >= [0] [1] [0] = [#0()] [#negative(#s(@x))] = [1 0 0] [0] [1 1 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [0 0 0] [0] = [#neg(#s(@x))] [#negative(#neg(@x))] = [1 0 0] [0] [2 1 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [0 0 0] [0] = [#pos(@x)] [#negative(#pos(@x))] = [1 0 0] [0] [2 1 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [1 1 0] @x + [0] [0 0 0] [0] = [#neg(@x)] [#divsub(#0(), #0())] = [0] [1] [1] >= [0] [1] [0] = [#0()] [#divsub(#0(), #s(@y))] = [0] [1] [1] >= [0] [0] [0] = [#underflow()] [#divsub(#s(@x), #0())] = [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [#s(@x)] [#divsub(#s(@x), #s(@y))] = [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] = [#divsub(@x, @y)] [#natmult(#0(), @y)] = [0] [1] [0] >= [0] [1] [0] = [#0()] [#natmult(#s(@x), @y)] = [0 0 0] [0] [0 1 0] @x + [0] [0 0 0] [0] >= [0 0 0] [0] [0 1 0] @x + [0] [0 0 0] [0] = [#natadd(@y, #natmult(@x, @y))] [#natadd(#0(), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#natadd(#s(@x), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 1] @y + [0] [0 0 1] [0] = [#s(#natadd(@x, @y))] [#natdiv'(#0(), @y)] = [0] [1] [0] >= [0] [1] [0] = [#s(#0())] [#natdiv'(#s(@x), @y)] = [1 0 0] [0] [0 0 0] @x + [1] [0 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [1] [0 0 0] [0] = [#s(#natdiv(#s(@x), @y))] [#natdiv'(#underflow(), @y)] = [0] [1] [0] >= [0] [1] [0] = [#0()] [#natsub(@x, #0())] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#natsub(#s(@x), #s(@y))] = [1 0 0] [1 0 0] [0] [1 1 0] @x + [0 0 0] @y + [0] [1 0 1] [1 0 0] [0] >= [1 0 0] [1 0 0] [0] [1 1 0] @x + [0 0 0] @y + [0] [1 0 1] [1 0 0] [0] = [#natsub(@x, @y)] We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^3)). Strict Trs: { #equal(@x, @y) -> #eq(@x, @y) , *(@x, @y) -> #mult(@x, @y) , -(@x, @y) -> #sub(@x, @y) , div(@x, @y) -> #div(@x, @y) , filter(@p, @l) -> filter#1(@l, @p) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , filter#3(#false(), @x, @xs') -> ::(@x, @xs') } Weak Trs: { #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(#0(), #0()) -> #true() , #eq(#0(), #s(@y)) -> #false() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , eratos(@l) -> eratos#1(@l) , eratos#1(::(@x, @xs)) -> ::(@x, eratos(filter(@x, @xs))) , eratos#1(nil()) -> nil() , filter#1(::(@x, @xs), @p) -> filter#2(filter(@p, @xs), @p, @x) , filter#1(nil(), @p) -> nil() , filter#2(@xs', @p, @x) -> filter#3(#equal(mod(@x, @p), #0()), @x, @xs') , filter#3(#true(), @x, @xs') -> @xs' , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#s(@x)) -> #pos(#s(@x)) , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #negative(#0()) -> #0() , #negative(#s(@x)) -> #neg(#s(@x)) , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^3)) We use the processor 'matrix interpretation of dimension 3' to orient following rules strictly. Trs: { #equal(@x, @y) -> #eq(@x, @y) } The induced complexity on above rules (modulo remaining rules) is YES(?,O(n^3)) . These rules are moved into the corresponding weak component(s). Sub-proof: ---------- The following argument positions are usable: Uargs(#equal) = {1}, Uargs(*) = {2}, Uargs(-) = {2}, Uargs(eratos) = {1}, Uargs(::) = {2}, Uargs(filter#2) = {1}, Uargs(filter#3) = {1}, Uargs(#s) = {1}, Uargs(#neg) = {1}, Uargs(#pred) = {1}, Uargs(#pos) = {1}, Uargs(#succ) = {1}, Uargs(#and) = {1, 2}, Uargs(#positive) = {1}, Uargs(#negative) = {1}, Uargs(#natadd) = {2}, Uargs(#natdiv') = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [1 0 0] [1 1 0] [1] [#equal](x1, x2) = [1 0 0] x1 + [0 0 0] x2 + [0] [1 1 0] [1 0 0] [1] [0 0 0] [0] [#eq](x1, x2) = [0 0 0] x2 + [0] [1 0 0] [1] [1 0 0] [0] [*](x1, x2) = [0 0 0] x2 + [0] [0 0 0] [0] [0] [#mult](x1, x2) = [0] [0] [1 0 0] [1 0 0] [0] [-](x1, x2) = [0 1 0] x1 + [0 1 0] x2 + [0] [0 0 1] [0 0 1] [0] [1 0 0] [1 0 0] [0] [#sub](x1, x2) = [0 1 0] x1 + [0 1 0] x2 + [0] [0 0 1] [0 0 1] [0] [0 1 0] [0] [div](x1, x2) = [1 0 0] x1 + [0] [1 0 0] [0] [0 1 0] [0] [#div](x1, x2) = [1 0 0] x1 + [0] [1 0 0] [0] [1 1 1] [1] [eratos](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 1 1] [1] [eratos#1](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [0 0 0] [1 0 0] [0] [::](x1, x2) = [1 1 0] x1 + [0 1 0] x2 + [1] [0 1 1] [0 1 1] [0] [1 1 0] [1] [filter](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [0] [nil] = [0] [0] [1 1 0] [1] [filter#1](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 1 0] [1] [filter#2](x1, x2, x3) = [0 1 0] x1 + [1 1 0] x3 + [1] [0 1 1] [0 1 1] [0] [1 1 0] [0] [mod](x1, x2) = [1 1 1] x1 + [0] [1 0 1] [0] [0] [#0] = [0] [0] [1 0 0] [0 0 0] [1 0 0] [0] [filter#3](x1, x2, x3) = [0 0 0] x1 + [1 1 0] x2 + [0 1 0] x3 + [1] [0 0 0] [0 1 1] [0 1 1] [0] [0] [#false] = [0] [1] [0] [#true] = [0] [0] [1 0 0] [0] [#add](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [1 0 0] [0] [#s](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#neg](x1) = [1 0 0] x1 + [0] [1 0 0] [0] [1 0 0] [0] [#pred](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#pos](x1) = [1 0 0] x1 + [0] [1 0 0] [0] [1 0 0] [0] [#succ](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 0 0] [0] [#and](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [0] [0 0 0] [0 0 0] [1] [0] [#divByZero] = [0] [0] [1 0 0] [0] [#natdiv](x1, x2) = [0 0 0] x1 + [0] [0 0 0] [0] [1 0 0] [0] [#positive](x1) = [1 0 0] x1 + [0] [1 0 0] [0] [1 0 0] [0] [#negative](x1) = [1 0 0] x1 + [0] [1 0 0] [0] [1 0 0] [0] [#divsub](x1, x2) = [0 1 1] x1 + [0] [0 1 1] [0] [0] [#underflow] = [0] [0] [0] [#natmult](x1, x2) = [0] [0] [1 0 0] [0] [#natadd](x1, x2) = [0 1 1] x2 + [0] [0 1 1] [0] [1 0 0] [0] [#natdiv'](x1, x2) = [0 0 0] x1 + [0] [0 0 0] [0] [1 0 0] [1 0 0] [0] [#natsub](x1, x2) = [1 1 0] x1 + [1 0 0] x2 + [0] [1 0 1] [1 0 0] [0] This order satisfies following ordering constraints [#equal(@x, @y)] = [1 0 0] [1 1 0] [1] [1 0 0] @x + [0 0 0] @y + [0] [1 1 0] [1 0 0] [1] > [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] = [#eq(@x, @y)] [#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0 0 0] [0] [0 0 0] @y_2 + [0] [1 0 0] [1] >= [0] [0] [1] = [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))] [#eq(::(@x_1, @x_2), nil())] = [0] [0] [1] >= [0] [0] [1] = [#false()] [#eq(nil(), ::(@y_1, @y_2))] = [0 0 0] [0] [0 0 0] @y_2 + [0] [1 0 0] [1] >= [0] [0] [1] = [#false()] [#eq(nil(), nil())] = [0] [0] [1] >= [0] [0] [0] = [#true()] [#eq(#0(), #0())] = [0] [0] [1] >= [0] [0] [0] = [#true()] [#eq(#0(), #s(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] >= [0] [0] [1] = [#false()] [#eq(#0(), #neg(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] >= [0] [0] [1] = [#false()] [#eq(#0(), #pos(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] >= [0] [0] [1] = [#false()] [#eq(#s(@x), #0())] = [0] [0] [1] >= [0] [0] [1] = [#false()] [#eq(#s(@x), #s(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] >= [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] = [#eq(@x, @y)] [#eq(#neg(@x), #0())] = [0] [0] [1] >= [0] [0] [1] = [#false()] [#eq(#neg(@x), #neg(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] >= [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] = [#eq(@x, @y)] [#eq(#neg(@x), #pos(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] >= [0] [0] [1] = [#false()] [#eq(#pos(@x), #0())] = [0] [0] [1] >= [0] [0] [1] = [#false()] [#eq(#pos(@x), #neg(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] >= [0] [0] [1] = [#false()] [#eq(#pos(@x), #pos(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] >= [0 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] = [#eq(@x, @y)] [*(@x, @y)] = [1 0 0] [0] [0 0 0] @y + [0] [0 0 0] [0] >= [0] [0] [0] = [#mult(@x, @y)] [#mult(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#0(), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#0(), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#neg(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#neg(@x), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#pos(#natmult(@x, @y))] [#mult(#neg(@x), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#pos(@x), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#pos(#natmult(@x, @y))] [-(@x, @y)] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 1 0] @y + [0] [0 0 1] [0 0 1] [0] >= [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 1 0] @y + [0] [0 0 1] [0 0 1] [0] = [#sub(@x, @y)] [#sub(@x, #0())] = [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#sub(@x, #neg(@y))] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [1 0 0] @y + [0] [0 0 1] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] = [#add(@x, #pos(@y))] [#sub(@x, #pos(@y))] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [1 0 0] @y + [0] [0 0 1] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] = [#add(@x, #neg(@y))] [div(@x, @y)] = [0 1 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [0 1 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#div(@x, @y)] [#div(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#0(), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#div(#0(), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#div(#neg(@x), #0())] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#neg(@x), #neg(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#positive(#natdiv(@x, @y))] [#div(#neg(@x), #pos(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #0())] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#pos(@x), #neg(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #pos(@y))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#positive(#natdiv(@x, @y))] [eratos(@l)] = [1 1 1] [1] [0 1 0] @l + [0] [0 0 1] [0] >= [1 1 1] [1] [0 1 0] @l + [0] [0 0 1] [0] = [eratos#1(@l)] [eratos#1(::(@x, @xs))] = [1 2 1] [1 2 1] [2] [1 1 0] @x + [0 1 0] @xs + [1] [0 1 1] [0 1 1] [0] >= [0 0 0] [1 2 1] [2] [1 1 0] @x + [0 1 0] @xs + [1] [0 1 1] [0 1 1] [0] = [::(@x, eratos(filter(@x, @xs)))] [eratos#1(nil())] = [1] [0] [0] > [0] [0] [0] = [nil()] [filter(@p, @l)] = [1 1 0] [1] [0 1 0] @l + [0] [0 0 1] [0] >= [1 1 0] [1] [0 1 0] @l + [0] [0 0 1] [0] = [filter#1(@l, @p)] [filter#1(::(@x, @xs), @p)] = [1 1 0] [1 1 0] [2] [1 1 0] @x + [0 1 0] @xs + [1] [0 1 1] [0 1 1] [0] >= [1 1 0] [1 1 0] [2] [1 1 0] @x + [0 1 0] @xs + [1] [0 1 1] [0 1 1] [0] = [filter#2(filter(@p, @xs), @p, @x)] [filter#1(nil(), @p)] = [1] [0] [0] > [0] [0] [0] = [nil()] [filter#2(@xs', @p, @x)] = [1 1 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 1] [0 1 1] [0] >= [1 1 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 1] [0 1 1] [0] = [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')] [mod(@x, @y)] = [1 1 0] [0] [1 1 1] @x + [0] [1 0 1] [0] >= [1 1 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [-(@x, *(@y, div(@x, @y)))] [filter#3(#false(), @x, @xs')] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 1] [0 1 1] [0] >= [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 1] [0 1 1] [0] = [::(@x, @xs')] [filter#3(#true(), @x, @xs')] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 1] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @xs' + [0] [0 0 1] [0] = [@xs'] [#add(#0(), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#add(#neg(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#pred(@y)] [#add(#neg(#s(#s(@x))), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#pred(#add(#pos(#s(@x)), @y))] [#add(#pos(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#succ(@y)] [#add(#pos(#s(#s(@x))), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#succ(#add(#pos(#s(@x)), @y))] [#pred(#0())] = [0] [0] [0] >= [0] [0] [0] = [#neg(#s(#0()))] [#pred(#neg(#s(@x)))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#neg(#s(#s(@x)))] [#pred(#pos(#s(#0())))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#pred(#pos(#s(#s(@x))))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#pos(#s(@x))] [#succ(#0())] = [0] [0] [0] >= [0] [0] [0] = [#pos(#s(#0()))] [#succ(#neg(#s(#0())))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#succ(#neg(#s(#s(@x))))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#neg(#s(@x))] [#succ(#pos(#s(@x)))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#pos(#s(#s(@x)))] [#and(#false(), #false())] = [0] [0] [1] >= [0] [0] [1] = [#false()] [#and(#false(), #true())] = [0] [0] [1] >= [0] [0] [1] = [#false()] [#and(#true(), #false())] = [0] [0] [1] >= [0] [0] [1] = [#false()] [#and(#true(), #true())] = [0] [0] [1] >= [0] [0] [0] = [#true()] [#natdiv(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#divByZero()] [#natdiv(#0(), #s(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#natdiv(#s(@x), #0())] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#natdiv(#s(@x), #s(@y))] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] = [#natdiv'(#divsub(@x, @y), #s(@y))] [#positive(#0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#positive(#s(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#pos(#s(@x))] [#positive(#neg(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#neg(@x)] [#positive(#pos(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#pos(@x)] [#negative(#0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#negative(#s(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#neg(#s(@x))] [#negative(#neg(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#pos(@x)] [#negative(#pos(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#neg(@x)] [#divsub(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#divsub(#0(), #s(@y))] = [0] [0] [0] >= [0] [0] [0] = [#underflow()] [#divsub(#s(@x), #0())] = [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [#s(@x)] [#divsub(#s(@x), #s(@y))] = [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] = [#divsub(@x, @y)] [#natmult(#0(), @y)] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#natmult(#s(@x), @y)] = [0] [0] [0] >= [0] [0] [0] = [#natadd(@y, #natmult(@x, @y))] [#natadd(#0(), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#natadd(#s(@x), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] = [#s(#natadd(@x, @y))] [#natdiv'(#0(), @y)] = [0] [0] [0] >= [0] [0] [0] = [#s(#0())] [#natdiv'(#s(@x), @y)] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] = [#s(#natdiv(#s(@x), @y))] [#natdiv'(#underflow(), @y)] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#natsub(@x, #0())] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#natsub(#s(@x), #s(@y))] = [1 0 0] [1 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [1 0 0] [0] >= [1 0 0] [1 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [1 0 0] [0] = [#natsub(@x, @y)] We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^3)). Strict Trs: { *(@x, @y) -> #mult(@x, @y) , -(@x, @y) -> #sub(@x, @y) , div(@x, @y) -> #div(@x, @y) , filter(@p, @l) -> filter#1(@l, @p) , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , filter#3(#false(), @x, @xs') -> ::(@x, @xs') } Weak Trs: { #equal(@x, @y) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(#0(), #0()) -> #true() , #eq(#0(), #s(@y)) -> #false() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , eratos(@l) -> eratos#1(@l) , eratos#1(::(@x, @xs)) -> ::(@x, eratos(filter(@x, @xs))) , eratos#1(nil()) -> nil() , filter#1(::(@x, @xs), @p) -> filter#2(filter(@p, @xs), @p, @x) , filter#1(nil(), @p) -> nil() , filter#2(@xs', @p, @x) -> filter#3(#equal(mod(@x, @p), #0()), @x, @xs') , filter#3(#true(), @x, @xs') -> @xs' , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#s(@x)) -> #pos(#s(@x)) , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #negative(#0()) -> #0() , #negative(#s(@x)) -> #neg(#s(@x)) , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^3)) We use the processor 'matrix interpretation of dimension 3' to orient following rules strictly. Trs: { mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) } The induced complexity on above rules (modulo remaining rules) is YES(?,O(n^3)) . These rules are moved into the corresponding weak component(s). Sub-proof: ---------- The following argument positions are usable: Uargs(#equal) = {1}, Uargs(*) = {2}, Uargs(-) = {2}, Uargs(eratos) = {1}, Uargs(::) = {2}, Uargs(filter#2) = {1}, Uargs(filter#3) = {1}, Uargs(#s) = {1}, Uargs(#neg) = {1}, Uargs(#pred) = {1}, Uargs(#pos) = {1}, Uargs(#succ) = {1}, Uargs(#and) = {1, 2}, Uargs(#positive) = {1}, Uargs(#negative) = {1}, Uargs(#natadd) = {2}, Uargs(#natdiv') = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [1 0 0] [0 0 0] [0] [#equal](x1, x2) = [0 0 1] x1 + [1 0 0] x2 + [0] [0 0 0] [0 0 0] [0] [0 0 0] [0] [#eq](x1, x2) = [1 0 0] x2 + [0] [0 0 0] [0] [1 0 0] [0] [*](x1, x2) = [0 0 0] x2 + [0] [0 0 0] [0] [0] [#mult](x1, x2) = [0] [0] [1 0 0] [1 0 0] [0] [-](x1, x2) = [0 1 0] x1 + [0 1 1] x2 + [0] [0 0 1] [0 1 1] [0] [1 0 0] [1 0 0] [0] [#sub](x1, x2) = [0 1 0] x1 + [0 1 1] x2 + [0] [0 0 1] [0 1 1] [0] [0 1 0] [0 0 0] [0] [div](x1, x2) = [0 1 0] x1 + [0 0 0] x2 + [0] [1 1 1] [1 1 1] [1] [0 1 0] [0 0 0] [0] [#div](x1, x2) = [0 1 0] x1 + [0 0 0] x2 + [0] [1 0 0] [1 1 1] [0] [1 0 1] [1] [eratos](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 1] [1] [eratos#1](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [0 0 0] [1 0 0] [0] [::](x1, x2) = [1 1 0] x1 + [0 1 0] x2 + [1] [1 0 1] [0 1 1] [1] [0 1 0] [0] [filter](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [0] [nil] = [0] [0] [0 1 0] [0] [filter#1](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 1 0] [1] [filter#2](x1, x2, x3) = [0 1 0] x1 + [1 1 0] x3 + [1] [0 1 1] [1 0 1] [1] [1 1 0] [1] [mod](x1, x2) = [0 1 1] x1 + [0] [0 0 1] [0] [0] [#0] = [0] [0] [1 0 0] [0 0 0] [1 0 0] [0] [filter#3](x1, x2, x3) = [0 0 0] x1 + [1 1 0] x2 + [0 1 0] x3 + [1] [0 0 1] [1 0 1] [0 1 1] [1] [0] [#false] = [0] [0] [0] [#true] = [0] [0] [1 0 0] [0] [#add](x1, x2) = [0 1 1] x2 + [0] [0 1 1] [0] [1 0 0] [0] [#s](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#neg](x1) = [1 0 0] x1 + [0] [0 0 0] [0] [1 0 0] [0] [#pred](x1) = [0 1 0] x1 + [0] [0 1 0] [0] [1 0 0] [0] [#pos](x1) = [1 0 0] x1 + [0] [0 0 0] [0] [1 0 0] [0] [#succ](x1) = [0 1 0] x1 + [0] [0 1 0] [0] [1 0 0] [1 0 0] [0] [#and](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [0] [0 0 0] [0 0 0] [0] [0] [#divByZero] = [0] [0] [1 0 0] [0 0 0] [0] [#natdiv](x1, x2) = [0 0 0] x1 + [0 1 1] x2 + [0] [0 0 0] [0 1 1] [0] [1 0 0] [0] [#positive](x1) = [1 0 0] x1 + [0] [1 0 0] [0] [1 0 0] [0] [#negative](x1) = [1 0 0] x1 + [0] [1 0 0] [0] [1 0 0] [0] [#divsub](x1, x2) = [0 1 1] x1 + [0] [0 1 1] [0] [0] [#underflow] = [0] [0] [0] [#natmult](x1, x2) = [0] [0] [1 0 0] [0] [#natadd](x1, x2) = [0 1 1] x2 + [0] [0 1 1] [0] [1 0 0] [0 0 0] [0] [#natdiv'](x1, x2) = [0 0 0] x1 + [0 1 1] x2 + [0] [0 0 0] [0 1 1] [0] [1 0 0] [1 0 0] [0] [#natsub](x1, x2) = [1 1 0] x1 + [1 0 0] x2 + [0] [1 0 1] [1 0 0] [0] This order satisfies following ordering constraints [#equal(@x, @y)] = [1 0 0] [0 0 0] [0] [0 0 1] @x + [1 0 0] @y + [0] [0 0 0] [0 0 0] [0] >= [0 0 0] [0] [1 0 0] @y + [0] [0 0 0] [0] = [#eq(@x, @y)] [#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0 0 0] [0] [1 0 0] @y_2 + [0] [0 0 0] [0] >= [0] [0] [0] = [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))] [#eq(::(@x_1, @x_2), nil())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(nil(), ::(@y_1, @y_2))] = [0 0 0] [0] [1 0 0] @y_2 + [0] [0 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(nil(), nil())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #s(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [0 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#0(), #neg(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [0 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#0(), #pos(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [0 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#s(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#s(@x), #s(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [0 0 0] [0] >= [0 0 0] [0] [1 0 0] @y + [0] [0 0 0] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#neg(@x), #neg(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [0 0 0] [0] >= [0 0 0] [0] [1 0 0] @y + [0] [0 0 0] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #pos(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [0 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #neg(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [0 0 0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #pos(@y))] = [0 0 0] [0] [1 0 0] @y + [0] [0 0 0] [0] >= [0 0 0] [0] [1 0 0] @y + [0] [0 0 0] [0] = [#eq(@x, @y)] [*(@x, @y)] = [1 0 0] [0] [0 0 0] @y + [0] [0 0 0] [0] >= [0] [0] [0] = [#mult(@x, @y)] [#mult(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#0(), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#0(), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#neg(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#neg(@x), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#pos(#natmult(@x, @y))] [#mult(#neg(@x), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#pos(@x), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#pos(#natmult(@x, @y))] [-(@x, @y)] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 1 1] @y + [0] [0 0 1] [0 1 1] [0] >= [1 0 0] [1 0 0] [0] [0 1 0] @x + [0 1 1] @y + [0] [0 0 1] [0 1 1] [0] = [#sub(@x, @y)] [#sub(@x, #0())] = [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#sub(@x, #neg(@y))] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [1 0 0] @y + [0] [0 0 1] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] = [#add(@x, #pos(@y))] [#sub(@x, #pos(@y))] = [1 0 0] [1 0 0] [0] [0 1 0] @x + [1 0 0] @y + [0] [0 0 1] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @y + [0] [1 0 0] [0] = [#add(@x, #neg(@y))] [div(@x, @y)] = [0 1 0] [0 0 0] [0] [0 1 0] @x + [0 0 0] @y + [0] [1 1 1] [1 1 1] [1] >= [0 1 0] [0 0 0] [0] [0 1 0] @x + [0 0 0] @y + [0] [1 0 0] [1 1 1] [0] = [#div(@x, @y)] [#div(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#0(), #neg(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [2 0 0] [0] >= [0] [0] [0] = [#0()] [#div(#0(), #pos(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [2 0 0] [0] >= [0] [0] [0] = [#0()] [#div(#neg(@x), #0())] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#neg(@x), #neg(@y))] = [1 0 0] [0 0 0] [0] [1 0 0] @x + [0 0 0] @y + [0] [1 0 0] [2 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#positive(#natdiv(@x, @y))] [#div(#neg(@x), #pos(@y))] = [1 0 0] [0 0 0] [0] [1 0 0] @x + [0 0 0] @y + [0] [1 0 0] [2 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #0())] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#div(#pos(@x), #neg(@y))] = [1 0 0] [0 0 0] [0] [1 0 0] @x + [0 0 0] @y + [0] [1 0 0] [2 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #pos(@y))] = [1 0 0] [0 0 0] [0] [1 0 0] @x + [0 0 0] @y + [0] [1 0 0] [2 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] = [#positive(#natdiv(@x, @y))] [eratos(@l)] = [1 0 1] [1] [0 1 0] @l + [0] [0 0 1] [0] >= [1 0 1] [1] [0 1 0] @l + [0] [0 0 1] [0] = [eratos#1(@l)] [eratos#1(::(@x, @xs))] = [1 0 1] [1 1 1] [2] [1 1 0] @x + [0 1 0] @xs + [1] [1 0 1] [0 1 1] [1] > [0 0 0] [0 1 1] [1] [1 1 0] @x + [0 1 0] @xs + [1] [1 0 1] [0 1 1] [1] = [::(@x, eratos(filter(@x, @xs)))] [eratos#1(nil())] = [1] [0] [0] > [0] [0] [0] = [nil()] [filter(@p, @l)] = [0 1 0] [0] [0 1 0] @l + [0] [0 0 1] [0] >= [0 1 0] [0] [0 1 0] @l + [0] [0 0 1] [0] = [filter#1(@l, @p)] [filter#1(::(@x, @xs), @p)] = [1 1 0] [0 1 0] [1] [1 1 0] @x + [0 1 0] @xs + [1] [1 0 1] [0 1 1] [1] >= [1 1 0] [0 1 0] [1] [1 1 0] @x + [0 1 0] @xs + [1] [1 0 1] [0 1 1] [1] = [filter#2(filter(@p, @xs), @p, @x)] [filter#1(nil(), @p)] = [0] [0] [0] >= [0] [0] [0] = [nil()] [filter#2(@xs', @p, @x)] = [1 1 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [1 0 1] [0 1 1] [1] >= [1 1 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [1 0 1] [0 1 1] [1] = [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')] [mod(@x, @y)] = [1 1 0] [1] [0 1 1] @x + [0] [0 0 1] [0] > [1 1 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [-(@x, *(@y, div(@x, @y)))] [filter#3(#false(), @x, @xs')] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [1 0 1] [0 1 1] [1] >= [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [1 0 1] [0 1 1] [1] = [::(@x, @xs')] [filter#3(#true(), @x, @xs')] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [1 0 1] [0 1 1] [1] >= [1 0 0] [0] [0 1 0] @xs' + [0] [0 0 1] [0] = [@xs'] [#add(#0(), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#add(#neg(#s(#0())), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 1 0] [0] = [#pred(@y)] [#add(#neg(#s(#s(@x))), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] = [#pred(#add(#pos(#s(@x)), @y))] [#add(#pos(#s(#0())), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 1 0] [0] = [#succ(@y)] [#add(#pos(#s(#s(@x))), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] = [#succ(#add(#pos(#s(@x)), @y))] [#pred(#0())] = [0] [0] [0] >= [0] [0] [0] = [#neg(#s(#0()))] [#pred(#neg(#s(@x)))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 0] [0] = [#neg(#s(#s(@x)))] [#pred(#pos(#s(#0())))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#pred(#pos(#s(#s(@x))))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 0] [0] = [#pos(#s(@x))] [#succ(#0())] = [0] [0] [0] >= [0] [0] [0] = [#pos(#s(#0()))] [#succ(#neg(#s(#0())))] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#succ(#neg(#s(#s(@x))))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 0] [0] = [#neg(#s(@x))] [#succ(#pos(#s(@x)))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 0] [0] = [#pos(#s(#s(@x)))] [#and(#false(), #false())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#false(), #true())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#true(), #false())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#true(), #true())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#natdiv(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#divByZero()] [#natdiv(#0(), #s(@y))] = [0 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] >= [0] [0] [0] = [#0()] [#natdiv(#s(@x), #0())] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [0] >= [0] [0] [0] = [#divByZero()] [#natdiv(#s(@x), #s(@y))] = [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 1 1] @y + [0] [0 0 0] [0 1 1] [0] >= [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 1 1] @y + [0] [0 0 0] [0 1 1] [0] = [#natdiv'(#divsub(@x, @y), #s(@y))] [#positive(#0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#positive(#s(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 0] [0] = [#pos(#s(@x))] [#positive(#neg(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 0] [0] = [#neg(@x)] [#positive(#pos(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 0] [0] = [#pos(@x)] [#negative(#0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#negative(#s(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 0] [0] = [#neg(#s(@x))] [#negative(#neg(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 0] [0] = [#pos(@x)] [#negative(#pos(@x))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [0] >= [1 0 0] [0] [1 0 0] @x + [0] [0 0 0] [0] = [#neg(@x)] [#divsub(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#divsub(#0(), #s(@y))] = [0] [0] [0] >= [0] [0] [0] = [#underflow()] [#divsub(#s(@x), #0())] = [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [#s(@x)] [#divsub(#s(@x), #s(@y))] = [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 1] @x + [0] [0 1 1] [0] = [#divsub(@x, @y)] [#natmult(#0(), @y)] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#natmult(#s(@x), @y)] = [0] [0] [0] >= [0] [0] [0] = [#natadd(@y, #natmult(@x, @y))] [#natadd(#0(), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#natadd(#s(@x), @y)] = [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] = [#s(#natadd(@x, @y))] [#natdiv'(#0(), @y)] = [0 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] >= [0] [0] [0] = [#s(#0())] [#natdiv'(#s(@x), @y)] = [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 1 1] @y + [0] [0 0 0] [0 1 1] [0] >= [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 1 1] @y + [0] [0 0 0] [0 1 1] [0] = [#s(#natdiv(#s(@x), @y))] [#natdiv'(#underflow(), @y)] = [0 0 0] [0] [0 1 1] @y + [0] [0 1 1] [0] >= [0] [0] [0] = [#0()] [#natsub(@x, #0())] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#natsub(#s(@x), #s(@y))] = [1 0 0] [1 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [1 0 0] [0] >= [1 0 0] [1 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [1 0 0] [0] = [#natsub(@x, @y)] We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^3)). Strict Trs: { *(@x, @y) -> #mult(@x, @y) , -(@x, @y) -> #sub(@x, @y) , div(@x, @y) -> #div(@x, @y) , filter(@p, @l) -> filter#1(@l, @p) , filter#3(#false(), @x, @xs') -> ::(@x, @xs') } Weak Trs: { #equal(@x, @y) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(#0(), #0()) -> #true() , #eq(#0(), #s(@y)) -> #false() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , eratos(@l) -> eratos#1(@l) , eratos#1(::(@x, @xs)) -> ::(@x, eratos(filter(@x, @xs))) , eratos#1(nil()) -> nil() , filter#1(::(@x, @xs), @p) -> filter#2(filter(@p, @xs), @p, @x) , filter#1(nil(), @p) -> nil() , filter#2(@xs', @p, @x) -> filter#3(#equal(mod(@x, @p), #0()), @x, @xs') , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , filter#3(#true(), @x, @xs') -> @xs' , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#s(@x)) -> #pos(#s(@x)) , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #negative(#0()) -> #0() , #negative(#s(@x)) -> #neg(#s(@x)) , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^3)) We use the processor 'matrix interpretation of dimension 3' to orient following rules strictly. Trs: { div(@x, @y) -> #div(@x, @y) } The induced complexity on above rules (modulo remaining rules) is YES(?,O(n^3)) . These rules are moved into the corresponding weak component(s). Sub-proof: ---------- The following argument positions are usable: Uargs(#equal) = {1}, Uargs(*) = {2}, Uargs(-) = {2}, Uargs(eratos) = {1}, Uargs(::) = {2}, Uargs(filter#2) = {1}, Uargs(filter#3) = {1}, Uargs(#s) = {1}, Uargs(#neg) = {1}, Uargs(#pred) = {1}, Uargs(#pos) = {1}, Uargs(#succ) = {1}, Uargs(#and) = {1, 2}, Uargs(#positive) = {1}, Uargs(#negative) = {1}, Uargs(#natadd) = {2}, Uargs(#natdiv') = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [1 0 0] [0] [#equal](x1, x2) = [0 0 0] x1 + [1] [1 1 1] [0] [0] [#eq](x1, x2) = [1] [0] [1 0 0] [0] [*](x1, x2) = [0 0 0] x2 + [0] [0 1 1] [0] [1 0 0] [0] [#mult](x1, x2) = [0 0 0] x2 + [0] [0 0 1] [0] [1 0 0] [1 1 0] [0] [-](x1, x2) = [0 1 0] x1 + [0 1 0] x2 + [1] [0 0 1] [0 1 0] [1] [1 0 0] [1 1 0] [0] [#sub](x1, x2) = [0 1 0] x1 + [0 1 0] x2 + [1] [0 0 1] [0 1 0] [1] [0 0 1] [0 0 0] [1] [div](x1, x2) = [1 0 1] x1 + [0 0 1] x2 + [1] [0 0 1] [0 0 0] [0] [0 0 1] [0] [#div](x1, x2) = [1 0 0] x1 + [1] [0 0 1] [0] [1 1 0] [0] [eratos](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 1 0] [0] [eratos#1](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [0 0 0] [1 0 0] [0] [::](x1, x2) = [0 0 1] x1 + [0 1 1] x2 + [1] [1 0 1] [0 0 1] [1] [0 0 1] [0] [filter](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [0] [nil] = [1] [0] [0 0 1] [0] [filter#1](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 0 1] [1] [filter#2](x1, x2, x3) = [0 1 1] x1 + [0 0 1] x3 + [1] [0 0 1] [1 0 1] [1] [1 0 1] [1] [mod](x1, x2) = [0 1 0] x1 + [1] [1 0 1] [1] [0] [#0] = [0] [1] [1 0 0] [0 0 0] [1 0 0] [0] [filter#3](x1, x2, x3) = [0 0 0] x1 + [0 0 1] x2 + [0 1 1] x3 + [1] [0 1 0] [1 0 1] [0 0 1] [0] [0] [#false] = [1] [0] [0] [#true] = [0] [0] [1 0 0] [1 0 0] [0] [#add](x1, x2) = [0 1 0] x1 + [0 1 0] x2 + [0] [0 0 0] [0 0 1] [0] [1 0 0] [0] [#s](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#neg](x1) = [1 0 0] x1 + [0] [1 0 0] [1] [1 0 0] [0] [#pred](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#pos](x1) = [1 0 0] x1 + [0] [1 0 0] [1] [1 0 0] [0] [#succ](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 0 0] [0] [#and](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [1] [0 0 0] [0 0 0] [0] [0] [#divByZero] = [0] [0] [1 0 0] [0] [#natdiv](x1, x2) = [0 0 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#positive](x1) = [1 1 0] x1 + [0] [1 1 0] [1] [1 1 0] [0] [#negative](x1) = [1 0 0] x1 + [1] [1 0 0] [1] [1 0 0] [0] [#divsub](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [0] [#underflow] = [0] [1] [0 0 0] [0] [#natmult](x1, x2) = [0 0 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#natadd](x1, x2) = [1 1 0] x2 + [0] [1 1 1] [0] [1 0 0] [0] [#natdiv'](x1, x2) = [0 0 0] x1 + [0] [0 0 1] [0] [1 0 0] [0 0 1] [0] [#natsub](x1, x2) = [1 1 0] x1 + [0 0 0] x2 + [0] [1 0 1] [0 1 1] [0] This order satisfies following ordering constraints [#equal(@x, @y)] = [1 0 0] [0] [0 0 0] @x + [1] [1 1 1] [0] >= [0] [1] [0] = [#eq(@x, @y)] [#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0] [1] [0] >= [0] [1] [0] = [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))] [#eq(::(@x_1, @x_2), nil())] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(nil(), ::(@y_1, @y_2))] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(nil(), nil())] = [0] [1] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #0())] = [0] [1] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #s(@y))] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#0(), #neg(@y))] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#0(), #pos(@y))] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#s(@x), #0())] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#s(@x), #s(@y))] = [0] [1] [0] >= [0] [1] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #0())] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#neg(@x), #neg(@y))] = [0] [1] [0] >= [0] [1] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #pos(@y))] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#pos(@x), #0())] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#pos(@x), #neg(@y))] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#pos(@x), #pos(@y))] = [0] [1] [0] >= [0] [1] [0] = [#eq(@x, @y)] [*(@x, @y)] = [1 0 0] [0] [0 0 0] @y + [0] [0 1 1] [0] >= [1 0 0] [0] [0 0 0] @y + [0] [0 0 1] [0] = [#mult(@x, @y)] [#mult(#0(), #0())] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#mult(#0(), #neg(@y))] = [1 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] >= [0] [0] [1] = [#0()] [#mult(#0(), #pos(@y))] = [1 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] >= [0] [0] [1] = [#0()] [#mult(#neg(@x), #0())] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#mult(#neg(@x), #neg(@y))] = [1 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] >= [0] [0] [1] = [#pos(#natmult(@x, @y))] [#mult(#neg(@x), #pos(@y))] = [1 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] >= [0] [0] [1] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #0())] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#mult(#pos(@x), #neg(@y))] = [1 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] >= [0] [0] [1] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #pos(@y))] = [1 0 0] [0] [0 0 0] @y + [0] [1 0 0] [1] >= [0] [0] [1] = [#pos(#natmult(@x, @y))] [-(@x, @y)] = [1 0 0] [1 1 0] [0] [0 1 0] @x + [0 1 0] @y + [1] [0 0 1] [0 1 0] [1] >= [1 0 0] [1 1 0] [0] [0 1 0] @x + [0 1 0] @y + [1] [0 0 1] [0 1 0] [1] = [#sub(@x, @y)] [#sub(@x, #0())] = [1 0 0] [0] [0 1 0] @x + [1] [0 0 1] [1] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#sub(@x, #neg(@y))] = [1 0 0] [2 0 0] [0] [0 1 0] @x + [1 0 0] @y + [1] [0 0 1] [1 0 0] [1] >= [1 0 0] [1 0 0] [0] [0 1 0] @x + [1 0 0] @y + [0] [0 0 0] [1 0 0] [1] = [#add(@x, #pos(@y))] [#sub(@x, #pos(@y))] = [1 0 0] [2 0 0] [0] [0 1 0] @x + [1 0 0] @y + [1] [0 0 1] [1 0 0] [1] >= [1 0 0] [1 0 0] [0] [0 1 0] @x + [1 0 0] @y + [0] [0 0 0] [1 0 0] [1] = [#add(@x, #neg(@y))] [div(@x, @y)] = [0 0 1] [0 0 0] [1] [1 0 1] @x + [0 0 1] @y + [1] [0 0 1] [0 0 0] [0] > [0 0 1] [0] [1 0 0] @x + [1] [0 0 1] [0] = [#div(@x, @y)] [#div(#0(), #0())] = [1] [1] [1] > [0] [0] [0] = [#divByZero()] [#div(#0(), #neg(@y))] = [1] [1] [1] > [0] [0] [1] = [#0()] [#div(#0(), #pos(@y))] = [1] [1] [1] > [0] [0] [1] = [#0()] [#div(#neg(@x), #0())] = [1 0 0] [1] [1 0 0] @x + [1] [1 0 0] [1] > [0] [0] [0] = [#divByZero()] [#div(#neg(@x), #neg(@y))] = [1 0 0] [1] [1 0 0] @x + [1] [1 0 0] [1] > [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#positive(#natdiv(@x, @y))] [#div(#neg(@x), #pos(@y))] = [1 0 0] [1] [1 0 0] @x + [1] [1 0 0] [1] > [1 0 0] [0] [1 0 0] @x + [1] [1 0 0] [1] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #0())] = [1 0 0] [1] [1 0 0] @x + [1] [1 0 0] [1] > [0] [0] [0] = [#divByZero()] [#div(#pos(@x), #neg(@y))] = [1 0 0] [1] [1 0 0] @x + [1] [1 0 0] [1] > [1 0 0] [0] [1 0 0] @x + [1] [1 0 0] [1] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #pos(@y))] = [1 0 0] [1] [1 0 0] @x + [1] [1 0 0] [1] > [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#positive(#natdiv(@x, @y))] [eratos(@l)] = [1 1 0] [0] [0 1 0] @l + [0] [0 0 1] [0] >= [1 1 0] [0] [0 1 0] @l + [0] [0 0 1] [0] = [eratos#1(@l)] [eratos#1(::(@x, @xs))] = [0 0 1] [1 1 1] [1] [0 0 1] @x + [0 1 1] @xs + [1] [1 0 1] [0 0 1] [1] > [0 0 0] [0 1 1] [0] [0 0 1] @x + [0 1 1] @xs + [1] [1 0 1] [0 0 1] [1] = [::(@x, eratos(filter(@x, @xs)))] [eratos#1(nil())] = [1] [1] [0] > [0] [1] [0] = [nil()] [filter(@p, @l)] = [0 0 1] [0] [0 1 0] @l + [0] [0 0 1] [0] >= [0 0 1] [0] [0 1 0] @l + [0] [0 0 1] [0] = [filter#1(@l, @p)] [filter#1(::(@x, @xs), @p)] = [1 0 1] [0 0 1] [1] [0 0 1] @x + [0 1 1] @xs + [1] [1 0 1] [0 0 1] [1] >= [1 0 1] [0 0 1] [1] [0 0 1] @x + [0 1 1] @xs + [1] [1 0 1] [0 0 1] [1] = [filter#2(filter(@p, @xs), @p, @x)] [filter#1(nil(), @p)] = [0] [1] [0] >= [0] [1] [0] = [nil()] [filter#2(@xs', @p, @x)] = [1 0 1] [1 0 0] [1] [0 0 1] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [1] >= [1 0 1] [1 0 0] [1] [0 0 1] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [1] = [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')] [mod(@x, @y)] = [1 0 1] [1] [0 1 0] @x + [1] [1 0 1] [1] >= [1 0 1] [1] [0 1 0] @x + [1] [0 0 1] [1] = [-(@x, *(@y, div(@x, @y)))] [filter#3(#false(), @x, @xs')] = [0 0 0] [1 0 0] [0] [0 0 1] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [1] >= [0 0 0] [1 0 0] [0] [0 0 1] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [1] = [::(@x, @xs')] [filter#3(#true(), @x, @xs')] = [0 0 0] [1 0 0] [0] [0 0 1] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @xs' + [0] [0 0 1] [0] = [@xs'] [#add(#0(), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#add(#neg(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#pred(@y)] [#add(#neg(#s(#s(@x))), @y)] = [1 0 0] [1 0 0] [0] [1 0 0] @x + [0 1 0] @y + [0] [0 0 0] [0 0 1] [0] >= [1 0 0] [1 0 0] [0] [1 0 0] @x + [0 1 0] @y + [0] [0 0 0] [0 0 1] [0] = [#pred(#add(#pos(#s(@x)), @y))] [#add(#pos(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#succ(@y)] [#add(#pos(#s(#s(@x))), @y)] = [1 0 0] [1 0 0] [0] [1 0 0] @x + [0 1 0] @y + [0] [0 0 0] [0 0 1] [0] >= [1 0 0] [1 0 0] [0] [1 0 0] @x + [0 1 0] @y + [0] [0 0 0] [0 0 1] [0] = [#succ(#add(#pos(#s(@x)), @y))] [#pred(#0())] = [0] [0] [1] >= [0] [0] [1] = [#neg(#s(#0()))] [#pred(#neg(#s(@x)))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#neg(#s(#s(@x)))] [#pred(#pos(#s(#0())))] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#pred(#pos(#s(#s(@x))))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#pos(#s(@x))] [#succ(#0())] = [0] [0] [1] >= [0] [0] [1] = [#pos(#s(#0()))] [#succ(#neg(#s(#0())))] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#succ(#neg(#s(#s(@x))))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#neg(#s(@x))] [#succ(#pos(#s(@x)))] = [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#pos(#s(#s(@x)))] [#and(#false(), #false())] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#and(#false(), #true())] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#and(#true(), #false())] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#and(#true(), #true())] = [0] [1] [0] >= [0] [0] [0] = [#true()] [#natdiv(#0(), #0())] = [0] [0] [1] >= [0] [0] [0] = [#divByZero()] [#natdiv(#0(), #s(@y))] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#natdiv(#s(@x), #0())] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 1] [0] >= [0] [0] [0] = [#divByZero()] [#natdiv(#s(@x), #s(@y))] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [0 0 1] [0] = [#natdiv'(#divsub(@x, @y), #s(@y))] [#positive(#0())] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#positive(#s(@x))] = [1 0 0] [0] [1 1 0] @x + [0] [1 1 0] [1] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#pos(#s(@x))] [#positive(#neg(@x))] = [1 0 0] [0] [2 0 0] @x + [0] [2 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#neg(@x)] [#positive(#pos(@x))] = [1 0 0] [0] [2 0 0] @x + [0] [2 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#pos(@x)] [#negative(#0())] = [0] [1] [1] >= [0] [0] [1] = [#0()] [#negative(#s(@x))] = [1 1 0] [0] [1 0 0] @x + [1] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#neg(#s(@x))] [#negative(#neg(@x))] = [2 0 0] [0] [1 0 0] @x + [1] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#pos(@x)] [#negative(#pos(@x))] = [2 0 0] [0] [1 0 0] @x + [1] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#neg(@x)] [#divsub(#0(), #0())] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#divsub(#0(), #s(@y))] = [0] [0] [1] >= [0] [0] [1] = [#underflow()] [#divsub(#s(@x), #0())] = [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [#s(@x)] [#divsub(#s(@x), #s(@y))] = [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [#divsub(@x, @y)] [#natmult(#0(), @y)] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#natmult(#s(@x), @y)] = [0 0 0] [0] [0 0 0] @x + [0] [0 0 1] [0] >= [0 0 0] [0] [0 0 0] @x + [0] [0 0 1] [0] = [#natadd(@y, #natmult(@x, @y))] [#natadd(#0(), @y)] = [1 0 0] [0] [1 1 0] @y + [0] [1 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#natadd(#s(@x), @y)] = [1 0 0] [0] [1 1 0] @y + [0] [1 1 1] [0] >= [1 0 0] [0] [1 1 0] @y + [0] [1 1 1] [0] = [#s(#natadd(@x, @y))] [#natdiv'(#0(), @y)] = [0] [0] [1] >= [0] [0] [1] = [#s(#0())] [#natdiv'(#s(@x), @y)] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [0 0 0] @x + [0] [0 0 1] [0] = [#s(#natdiv(#s(@x), @y))] [#natdiv'(#underflow(), @y)] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#natsub(@x, #0())] = [1 0 0] [1] [1 1 0] @x + [0] [1 0 1] [1] > [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#natsub(#s(@x), #s(@y))] = [1 0 0] [0 0 1] [0] [1 1 0] @x + [0 0 0] @y + [0] [1 0 1] [0 1 1] [0] >= [1 0 0] [0 0 1] [0] [1 1 0] @x + [0 0 0] @y + [0] [1 0 1] [0 1 1] [0] = [#natsub(@x, @y)] We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^3)). Strict Trs: { *(@x, @y) -> #mult(@x, @y) , -(@x, @y) -> #sub(@x, @y) , filter(@p, @l) -> filter#1(@l, @p) , filter#3(#false(), @x, @xs') -> ::(@x, @xs') } Weak Trs: { #equal(@x, @y) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(#0(), #0()) -> #true() , #eq(#0(), #s(@y)) -> #false() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , eratos(@l) -> eratos#1(@l) , eratos#1(::(@x, @xs)) -> ::(@x, eratos(filter(@x, @xs))) , eratos#1(nil()) -> nil() , filter#1(::(@x, @xs), @p) -> filter#2(filter(@p, @xs), @p, @x) , filter#1(nil(), @p) -> nil() , filter#2(@xs', @p, @x) -> filter#3(#equal(mod(@x, @p), #0()), @x, @xs') , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , filter#3(#true(), @x, @xs') -> @xs' , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#s(@x)) -> #pos(#s(@x)) , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #negative(#0()) -> #0() , #negative(#s(@x)) -> #neg(#s(@x)) , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^3)) We use the processor 'matrix interpretation of dimension 3' to orient following rules strictly. Trs: { *(@x, @y) -> #mult(@x, @y) } The induced complexity on above rules (modulo remaining rules) is YES(?,O(n^3)) . These rules are moved into the corresponding weak component(s). Sub-proof: ---------- The following argument positions are usable: Uargs(#equal) = {1}, Uargs(*) = {2}, Uargs(-) = {2}, Uargs(eratos) = {1}, Uargs(::) = {2}, Uargs(filter#2) = {1}, Uargs(filter#3) = {1}, Uargs(#s) = {1}, Uargs(#neg) = {1}, Uargs(#pred) = {1}, Uargs(#pos) = {1}, Uargs(#succ) = {1}, Uargs(#and) = {1, 2}, Uargs(#positive) = {1}, Uargs(#negative) = {1}, Uargs(#natadd) = {2}, Uargs(#natdiv') = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [1 0 0] [0 0 0] [0] [#equal](x1, x2) = [1 1 0] x1 + [0 0 1] x2 + [1] [1 1 0] [0 1 1] [1] [0] [#eq](x1, x2) = [1] [1] [0 0 0] [1 0 0] [1] [*](x1, x2) = [0 1 0] x1 + [0 0 0] x2 + [1] [1 0 1] [0 0 0] [0] [0 0 0] [1 0 0] [0] [#mult](x1, x2) = [0 1 0] x1 + [0 0 0] x2 + [1] [1 0 1] [0 0 0] [0] [1 0 0] [1 0 0] [0] [-](x1, x2) = [1 1 1] x1 + [0 1 1] x2 + [0] [0 0 1] [0 1 1] [0] [1 0 0] [1 0 0] [0] [#sub](x1, x2) = [1 1 1] x1 + [0 1 1] x2 + [0] [0 0 1] [0 1 1] [0] [0 1 0] [0 0 0] [0] [div](x1, x2) = [0 1 1] x1 + [0 0 1] x2 + [0] [0 0 1] [0 0 0] [0] [0 1 0] [0 0 0] [0] [#div](x1, x2) = [0 1 1] x1 + [0 0 1] x2 + [0] [0 0 1] [0 0 0] [0] [1 0 1] [0] [eratos](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 1] [0] [eratos#1](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [0 0 0] [1 0 0] [0] [::](x1, x2) = [1 1 0] x1 + [0 1 0] x2 + [1] [0 1 0] [0 1 1] [1] [1 1 0] [1] [filter](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [1] [nil] = [0] [0] [1 1 0] [1] [filter#1](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 1 0] [1] [filter#2](x1, x2, x3) = [0 1 0] x1 + [1 1 0] x3 + [1] [0 1 1] [0 1 0] [1] [1 1 0] [0 0 0] [1] [mod](x1, x2) = [1 1 1] x1 + [1 1 1] x2 + [1] [1 0 1] [1 1 1] [1] [0] [#0] = [1] [1] [1 0 0] [0 0 0] [1 0 0] [0] [filter#3](x1, x2, x3) = [0 0 0] x1 + [1 1 0] x2 + [0 1 0] x3 + [1] [0 0 0] [0 1 0] [0 1 1] [1] [0] [#false] = [1] [1] [0] [#true] = [1] [1] [0 0 0] [1 0 0] [0] [#add](x1, x2) = [1 0 1] x1 + [0 1 0] x2 + [1] [0 0 0] [1 0 1] [1] [1 0 0] [0] [#s](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#neg](x1) = [1 0 0] x1 + [1] [0 0 0] [1] [1 0 0] [0] [#pred](x1) = [0 1 0] x1 + [0] [1 0 0] [1] [1 0 0] [0] [#pos](x1) = [1 0 0] x1 + [1] [0 0 0] [1] [1 0 0] [0] [#succ](x1) = [0 1 0] x1 + [0] [1 0 0] [1] [1 0 0] [1 0 0] [0] [#and](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [1] [0 0 0] [0 1 0] [0] [0] [#divByZero] = [0] [0] [1 0 0] [0] [#natdiv](x1, x2) = [0 0 0] x1 + [1] [0 0 0] [1] [1 0 0] [1] [#positive](x1) = [1 1 1] x1 + [1] [0 0 0] [1] [1 0 0] [1] [#negative](x1) = [1 1 1] x1 + [1] [0 0 0] [1] [1 0 0] [0] [#divsub](x1, x2) = [0 1 0] x1 + [0] [0 1 1] [0] [0] [#underflow] = [0] [0] [0 0 0] [0] [#natmult](x1, x2) = [0 0 1] x1 + [0] [0 0 0] [1] [1 0 0] [0] [#natadd](x1, x2) = [1 1 0] x2 + [0] [0 0 1] [0] [1 0 0] [0] [#natdiv'](x1, x2) = [0 0 0] x1 + [1] [0 0 0] [1] [1 0 0] [1 0 0] [0] [#natsub](x1, x2) = [1 1 0] x1 + [1 0 0] x2 + [0] [1 0 1] [1 0 0] [0] This order satisfies following ordering constraints [#equal(@x, @y)] = [1 0 0] [0 0 0] [0] [1 1 0] @x + [0 0 1] @y + [1] [1 1 0] [0 1 1] [1] >= [0] [1] [1] = [#eq(@x, @y)] [#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0] [1] [1] >= [0] [1] [1] = [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))] [#eq(::(@x_1, @x_2), nil())] = [0] [1] [1] >= [0] [1] [1] = [#false()] [#eq(nil(), ::(@y_1, @y_2))] = [0] [1] [1] >= [0] [1] [1] = [#false()] [#eq(nil(), nil())] = [0] [1] [1] >= [0] [1] [1] = [#true()] [#eq(#0(), #0())] = [0] [1] [1] >= [0] [1] [1] = [#true()] [#eq(#0(), #s(@y))] = [0] [1] [1] >= [0] [1] [1] = [#false()] [#eq(#0(), #neg(@y))] = [0] [1] [1] >= [0] [1] [1] = [#false()] [#eq(#0(), #pos(@y))] = [0] [1] [1] >= [0] [1] [1] = [#false()] [#eq(#s(@x), #0())] = [0] [1] [1] >= [0] [1] [1] = [#false()] [#eq(#s(@x), #s(@y))] = [0] [1] [1] >= [0] [1] [1] = [#eq(@x, @y)] [#eq(#neg(@x), #0())] = [0] [1] [1] >= [0] [1] [1] = [#false()] [#eq(#neg(@x), #neg(@y))] = [0] [1] [1] >= [0] [1] [1] = [#eq(@x, @y)] [#eq(#neg(@x), #pos(@y))] = [0] [1] [1] >= [0] [1] [1] = [#false()] [#eq(#pos(@x), #0())] = [0] [1] [1] >= [0] [1] [1] = [#false()] [#eq(#pos(@x), #neg(@y))] = [0] [1] [1] >= [0] [1] [1] = [#false()] [#eq(#pos(@x), #pos(@y))] = [0] [1] [1] >= [0] [1] [1] = [#eq(@x, @y)] [*(@x, @y)] = [0 0 0] [1 0 0] [1] [0 1 0] @x + [0 0 0] @y + [1] [1 0 1] [0 0 0] [0] > [0 0 0] [1 0 0] [0] [0 1 0] @x + [0 0 0] @y + [1] [1 0 1] [0 0 0] [0] = [#mult(@x, @y)] [#mult(#0(), #0())] = [0] [2] [1] >= [0] [1] [1] = [#0()] [#mult(#0(), #neg(@y))] = [1 0 0] [0] [0 0 0] @y + [2] [0 0 0] [1] >= [0] [1] [1] = [#0()] [#mult(#0(), #pos(@y))] = [1 0 0] [0] [0 0 0] @y + [2] [0 0 0] [1] >= [0] [1] [1] = [#0()] [#mult(#neg(@x), #0())] = [0 0 0] [0] [1 0 0] @x + [2] [1 0 0] [1] >= [0] [1] [1] = [#0()] [#mult(#neg(@x), #neg(@y))] = [0 0 0] [1 0 0] [0] [1 0 0] @x + [0 0 0] @y + [2] [1 0 0] [0 0 0] [1] >= [0] [1] [1] = [#pos(#natmult(@x, @y))] [#mult(#neg(@x), #pos(@y))] = [0 0 0] [1 0 0] [0] [1 0 0] @x + [0 0 0] @y + [2] [1 0 0] [0 0 0] [1] >= [0] [1] [1] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #0())] = [0 0 0] [0] [1 0 0] @x + [2] [1 0 0] [1] >= [0] [1] [1] = [#0()] [#mult(#pos(@x), #neg(@y))] = [0 0 0] [1 0 0] [0] [1 0 0] @x + [0 0 0] @y + [2] [1 0 0] [0 0 0] [1] >= [0] [1] [1] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #pos(@y))] = [0 0 0] [1 0 0] [0] [1 0 0] @x + [0 0 0] @y + [2] [1 0 0] [0 0 0] [1] >= [0] [1] [1] = [#pos(#natmult(@x, @y))] [-(@x, @y)] = [1 0 0] [1 0 0] [0] [1 1 1] @x + [0 1 1] @y + [0] [0 0 1] [0 1 1] [0] >= [1 0 0] [1 0 0] [0] [1 1 1] @x + [0 1 1] @y + [0] [0 0 1] [0 1 1] [0] = [#sub(@x, @y)] [#sub(@x, #0())] = [1 0 0] [0] [1 1 1] @x + [2] [0 0 1] [2] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#sub(@x, #neg(@y))] = [1 0 0] [1 0 0] [0] [1 1 1] @x + [1 0 0] @y + [2] [0 0 1] [1 0 0] [2] >= [0 0 0] [1 0 0] [0] [1 0 1] @x + [1 0 0] @y + [2] [0 0 0] [1 0 0] [2] = [#add(@x, #pos(@y))] [#sub(@x, #pos(@y))] = [1 0 0] [1 0 0] [0] [1 1 1] @x + [1 0 0] @y + [2] [0 0 1] [1 0 0] [2] >= [0 0 0] [1 0 0] [0] [1 0 1] @x + [1 0 0] @y + [2] [0 0 0] [1 0 0] [2] = [#add(@x, #neg(@y))] [div(@x, @y)] = [0 1 0] [0 0 0] [0] [0 1 1] @x + [0 0 1] @y + [0] [0 0 1] [0 0 0] [0] >= [0 1 0] [0 0 0] [0] [0 1 1] @x + [0 0 1] @y + [0] [0 0 1] [0 0 0] [0] = [#div(@x, @y)] [#div(#0(), #0())] = [1] [3] [1] > [0] [0] [0] = [#divByZero()] [#div(#0(), #neg(@y))] = [1] [3] [1] > [0] [1] [1] = [#0()] [#div(#0(), #pos(@y))] = [1] [3] [1] > [0] [1] [1] = [#0()] [#div(#neg(@x), #0())] = [1 0 0] [1] [1 0 0] @x + [3] [0 0 0] [1] > [0] [0] [0] = [#divByZero()] [#div(#neg(@x), #neg(@y))] = [1 0 0] [1] [1 0 0] @x + [3] [0 0 0] [1] >= [1 0 0] [1] [1 0 0] @x + [3] [0 0 0] [1] = [#positive(#natdiv(@x, @y))] [#div(#neg(@x), #pos(@y))] = [1 0 0] [1] [1 0 0] @x + [3] [0 0 0] [1] >= [1 0 0] [1] [1 0 0] @x + [3] [0 0 0] [1] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #0())] = [1 0 0] [1] [1 0 0] @x + [3] [0 0 0] [1] > [0] [0] [0] = [#divByZero()] [#div(#pos(@x), #neg(@y))] = [1 0 0] [1] [1 0 0] @x + [3] [0 0 0] [1] >= [1 0 0] [1] [1 0 0] @x + [3] [0 0 0] [1] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #pos(@y))] = [1 0 0] [1] [1 0 0] @x + [3] [0 0 0] [1] >= [1 0 0] [1] [1 0 0] @x + [3] [0 0 0] [1] = [#positive(#natdiv(@x, @y))] [eratos(@l)] = [1 0 1] [0] [0 1 0] @l + [0] [0 0 1] [0] >= [1 0 1] [0] [0 1 0] @l + [0] [0 0 1] [0] = [eratos#1(@l)] [eratos#1(::(@x, @xs))] = [0 1 0] [1 1 1] [1] [1 1 0] @x + [0 1 0] @xs + [1] [0 1 0] [0 1 1] [1] >= [0 0 0] [1 1 1] [1] [1 1 0] @x + [0 1 0] @xs + [1] [0 1 0] [0 1 1] [1] = [::(@x, eratos(filter(@x, @xs)))] [eratos#1(nil())] = [1] [0] [0] >= [1] [0] [0] = [nil()] [filter(@p, @l)] = [1 1 0] [1] [0 1 0] @l + [0] [0 0 1] [0] >= [1 1 0] [1] [0 1 0] @l + [0] [0 0 1] [0] = [filter#1(@l, @p)] [filter#1(::(@x, @xs), @p)] = [1 1 0] [1 1 0] [2] [1 1 0] @x + [0 1 0] @xs + [1] [0 1 0] [0 1 1] [1] >= [1 1 0] [1 1 0] [2] [1 1 0] @x + [0 1 0] @xs + [1] [0 1 0] [0 1 1] [1] = [filter#2(filter(@p, @xs), @p, @x)] [filter#1(nil(), @p)] = [2] [0] [0] > [1] [0] [0] = [nil()] [filter#2(@xs', @p, @x)] = [1 1 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [1] >= [1 1 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [1] = [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')] [mod(@x, @y)] = [1 1 0] [0 0 0] [1] [1 1 1] @x + [1 1 1] @y + [1] [1 0 1] [1 1 1] [1] >= [1 1 0] [0 0 0] [1] [1 1 1] @x + [1 1 1] @y + [1] [0 0 1] [1 1 1] [1] = [-(@x, *(@y, div(@x, @y)))] [filter#3(#false(), @x, @xs')] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [1] >= [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [1] = [::(@x, @xs')] [filter#3(#true(), @x, @xs')] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [1] >= [1 0 0] [0] [0 1 0] @xs' + [0] [0 0 1] [0] = [@xs'] [#add(#0(), @y)] = [1 0 0] [0] [0 1 0] @y + [2] [1 0 1] [1] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#add(#neg(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [2] [1 0 1] [1] >= [1 0 0] [0] [0 1 0] @y + [0] [1 0 0] [1] = [#pred(@y)] [#add(#neg(#s(#s(@x))), @y)] = [0 0 0] [1 0 0] [0] [1 0 0] @x + [0 1 0] @y + [2] [0 0 0] [1 0 1] [1] >= [0 0 0] [1 0 0] [0] [1 0 0] @x + [0 1 0] @y + [2] [0 0 0] [1 0 0] [1] = [#pred(#add(#pos(#s(@x)), @y))] [#add(#pos(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [2] [1 0 1] [1] >= [1 0 0] [0] [0 1 0] @y + [0] [1 0 0] [1] = [#succ(@y)] [#add(#pos(#s(#s(@x))), @y)] = [0 0 0] [1 0 0] [0] [1 0 0] @x + [0 1 0] @y + [2] [0 0 0] [1 0 1] [1] >= [0 0 0] [1 0 0] [0] [1 0 0] @x + [0 1 0] @y + [2] [0 0 0] [1 0 0] [1] = [#succ(#add(#pos(#s(@x)), @y))] [#pred(#0())] = [0] [1] [1] >= [0] [1] [1] = [#neg(#s(#0()))] [#pred(#neg(#s(@x)))] = [1 0 0] [0] [1 0 0] @x + [1] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [1] [0 0 0] [1] = [#neg(#s(#s(@x)))] [#pred(#pos(#s(#0())))] = [0] [1] [1] >= [0] [1] [1] = [#0()] [#pred(#pos(#s(#s(@x))))] = [1 0 0] [0] [1 0 0] @x + [1] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [1] [0 0 0] [1] = [#pos(#s(@x))] [#succ(#0())] = [0] [1] [1] >= [0] [1] [1] = [#pos(#s(#0()))] [#succ(#neg(#s(#0())))] = [0] [1] [1] >= [0] [1] [1] = [#0()] [#succ(#neg(#s(#s(@x))))] = [1 0 0] [0] [1 0 0] @x + [1] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [1] [0 0 0] [1] = [#neg(#s(@x))] [#succ(#pos(#s(@x)))] = [1 0 0] [0] [1 0 0] @x + [1] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [1] [0 0 0] [1] = [#pos(#s(#s(@x)))] [#and(#false(), #false())] = [0] [1] [1] >= [0] [1] [1] = [#false()] [#and(#false(), #true())] = [0] [1] [1] >= [0] [1] [1] = [#false()] [#and(#true(), #false())] = [0] [1] [1] >= [0] [1] [1] = [#false()] [#and(#true(), #true())] = [0] [1] [1] >= [0] [1] [1] = [#true()] [#natdiv(#0(), #0())] = [0] [1] [1] >= [0] [0] [0] = [#divByZero()] [#natdiv(#0(), #s(@y))] = [0] [1] [1] >= [0] [1] [1] = [#0()] [#natdiv(#s(@x), #0())] = [1 0 0] [0] [0 0 0] @x + [1] [0 0 0] [1] >= [0] [0] [0] = [#divByZero()] [#natdiv(#s(@x), #s(@y))] = [1 0 0] [0] [0 0 0] @x + [1] [0 0 0] [1] >= [1 0 0] [0] [0 0 0] @x + [1] [0 0 0] [1] = [#natdiv'(#divsub(@x, @y), #s(@y))] [#positive(#0())] = [1] [3] [1] > [0] [1] [1] = [#0()] [#positive(#s(@x))] = [1 0 0] [1] [1 1 1] @x + [1] [0 0 0] [1] > [1 0 0] [0] [1 0 0] @x + [1] [0 0 0] [1] = [#pos(#s(@x))] [#positive(#neg(@x))] = [1 0 0] [1] [2 0 0] @x + [3] [0 0 0] [1] > [1 0 0] [0] [1 0 0] @x + [1] [0 0 0] [1] = [#neg(@x)] [#positive(#pos(@x))] = [1 0 0] [1] [2 0 0] @x + [3] [0 0 0] [1] > [1 0 0] [0] [1 0 0] @x + [1] [0 0 0] [1] = [#pos(@x)] [#negative(#0())] = [1] [3] [1] > [0] [1] [1] = [#0()] [#negative(#s(@x))] = [1 0 0] [1] [1 1 1] @x + [1] [0 0 0] [1] > [1 0 0] [0] [1 0 0] @x + [1] [0 0 0] [1] = [#neg(#s(@x))] [#negative(#neg(@x))] = [1 0 0] [1] [2 0 0] @x + [3] [0 0 0] [1] > [1 0 0] [0] [1 0 0] @x + [1] [0 0 0] [1] = [#pos(@x)] [#negative(#pos(@x))] = [1 0 0] [1] [2 0 0] @x + [3] [0 0 0] [1] > [1 0 0] [0] [1 0 0] @x + [1] [0 0 0] [1] = [#neg(@x)] [#divsub(#0(), #0())] = [0] [1] [2] >= [0] [1] [1] = [#0()] [#divsub(#0(), #s(@y))] = [0] [1] [2] >= [0] [0] [0] = [#underflow()] [#divsub(#s(@x), #0())] = [1 0 0] [0] [0 1 0] @x + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [#s(@x)] [#divsub(#s(@x), #s(@y))] = [1 0 0] [0] [0 1 0] @x + [0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 1 1] [0] = [#divsub(@x, @y)] [#natmult(#0(), @y)] = [0] [1] [1] >= [0] [1] [1] = [#0()] [#natmult(#s(@x), @y)] = [0 0 0] [0] [0 0 1] @x + [0] [0 0 0] [1] >= [0 0 0] [0] [0 0 1] @x + [0] [0 0 0] [1] = [#natadd(@y, #natmult(@x, @y))] [#natadd(#0(), @y)] = [1 0 0] [0] [1 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#natadd(#s(@x), @y)] = [1 0 0] [0] [1 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [1 1 0] @y + [0] [0 0 1] [0] = [#s(#natadd(@x, @y))] [#natdiv'(#0(), @y)] = [0] [1] [1] >= [0] [1] [1] = [#s(#0())] [#natdiv'(#s(@x), @y)] = [1 0 0] [0] [0 0 0] @x + [1] [0 0 0] [1] >= [1 0 0] [0] [0 0 0] @x + [1] [0 0 0] [1] = [#s(#natdiv(#s(@x), @y))] [#natdiv'(#underflow(), @y)] = [0] [1] [1] >= [0] [1] [1] = [#0()] [#natsub(@x, #0())] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#natsub(#s(@x), #s(@y))] = [1 0 0] [1 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [1 0 0] [0] >= [1 0 0] [1 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [1 0 0] [0] = [#natsub(@x, @y)] We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^3)). Strict Trs: { -(@x, @y) -> #sub(@x, @y) , filter(@p, @l) -> filter#1(@l, @p) , filter#3(#false(), @x, @xs') -> ::(@x, @xs') } Weak Trs: { #equal(@x, @y) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(#0(), #0()) -> #true() , #eq(#0(), #s(@y)) -> #false() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , eratos(@l) -> eratos#1(@l) , eratos#1(::(@x, @xs)) -> ::(@x, eratos(filter(@x, @xs))) , eratos#1(nil()) -> nil() , filter#1(::(@x, @xs), @p) -> filter#2(filter(@p, @xs), @p, @x) , filter#1(nil(), @p) -> nil() , filter#2(@xs', @p, @x) -> filter#3(#equal(mod(@x, @p), #0()), @x, @xs') , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , filter#3(#true(), @x, @xs') -> @xs' , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#s(@x)) -> #pos(#s(@x)) , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #negative(#0()) -> #0() , #negative(#s(@x)) -> #neg(#s(@x)) , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^3)) We use the processor 'matrix interpretation of dimension 3' to orient following rules strictly. Trs: { filter(@p, @l) -> filter#1(@l, @p) } The induced complexity on above rules (modulo remaining rules) is YES(?,O(n^3)) . These rules are moved into the corresponding weak component(s). Sub-proof: ---------- The following argument positions are usable: Uargs(#equal) = {1}, Uargs(*) = {2}, Uargs(-) = {2}, Uargs(eratos) = {1}, Uargs(::) = {2}, Uargs(filter#2) = {1}, Uargs(filter#3) = {1}, Uargs(#s) = {1}, Uargs(#neg) = {1}, Uargs(#pred) = {1}, Uargs(#pos) = {1}, Uargs(#succ) = {1}, Uargs(#and) = {1, 2}, Uargs(#positive) = {1}, Uargs(#negative) = {1}, Uargs(#natadd) = {2}, Uargs(#natdiv') = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [1 0 0] [0 1 0] [0] [#equal](x1, x2) = [0 0 0] x1 + [0 1 0] x2 + [1] [1 0 1] [1 1 1] [0] [0] [#eq](x1, x2) = [1] [0] [0 0 0] [1 0 0] [0] [*](x1, x2) = [0 0 0] x1 + [0 1 0] x2 + [0] [0 0 1] [0 0 0] [1] [0 0 0] [1 0 0] [0] [#mult](x1, x2) = [0 0 0] x1 + [0 1 0] x2 + [0] [0 0 1] [0 0 0] [1] [1 0 0] [1 0 0] [0] [-](x1, x2) = [1 1 1] x1 + [0 1 1] x2 + [0] [0 1 1] [0 1 1] [0] [1 0 0] [1 0 0] [0] [#sub](x1, x2) = [0 1 1] x1 + [0 1 1] x2 + [0] [0 1 1] [0 1 1] [0] [0 0 1] [0 0 0] [0] [div](x1, x2) = [0 0 0] x1 + [0 1 0] x2 + [0] [1 0 0] [0 1 1] [1] [0 0 1] [0 0 0] [0] [#div](x1, x2) = [0 0 0] x1 + [0 1 0] x2 + [0] [1 0 0] [0 1 1] [1] [1 1 1] [0] [eratos](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 1 1] [0] [eratos#1](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [0 0 0] [1 0 0] [1] [::](x1, x2) = [1 1 0] x1 + [0 1 1] x2 + [1] [1 0 1] [0 0 1] [1] [1 0 1] [1] [filter](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [0] [nil] = [0] [1] [1 0 1] [0] [filter#1](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 0 1] [1] [filter#2](x1, x2, x3) = [0 1 1] x1 + [1 1 0] x3 + [1] [0 0 1] [1 0 1] [1] [1 0 1] [0 0 0] [0] [mod](x1, x2) = [1 1 1] x1 + [0 1 1] x2 + [1] [0 1 1] [0 1 1] [1] [0] [#0] = [0] [1] [1 1 0] [0 0 0] [1 0 0] [0] [filter#3](x1, x2, x3) = [0 0 0] x1 + [1 1 0] x2 + [0 1 1] x3 + [1] [0 0 0] [1 0 1] [0 0 1] [1] [0] [#false] = [1] [0] [0] [#true] = [0] [0] [1 0 0] [1 0 0] [0] [#add](x1, x2) = [0 1 1] x1 + [1 1 0] x2 + [0] [0 1 1] [0 0 1] [0] [1 0 0] [0] [#s](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#neg](x1) = [0 0 0] x1 + [1] [1 0 0] [1] [1 0 0] [0] [#pred](x1) = [1 0 0] x1 + [1] [0 0 1] [1] [1 0 0] [0] [#pos](x1) = [0 0 0] x1 + [1] [1 0 0] [0] [1 0 0] [0] [#succ](x1) = [1 0 0] x1 + [1] [0 0 1] [0] [1 0 0] [1 0 0] [0] [#and](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [1] [0 0 0] [0 0 0] [0] [0] [#divByZero] = [0] [0] [1 0 0] [0] [#natdiv](x1, x2) = [0 0 0] x1 + [0] [0 0 0] [1] [1 0 0] [0] [#positive](x1) = [0 0 0] x1 + [1] [1 1 1] [0] [1 0 0] [0] [#negative](x1) = [0 0 0] x1 + [1] [1 1 1] [1] [1 0 0] [0 0 0] [0] [#divsub](x1, x2) = [0 1 0] x1 + [0 0 0] x2 + [0] [0 0 1] [0 1 1] [0] [0] [#underflow] = [0] [0] [0 0 0] [0] [#natmult](x1, x2) = [0 0 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#natadd](x1, x2) = [1 1 0] x2 + [0] [1 0 1] [0] [1 0 0] [0] [#natdiv'](x1, x2) = [0 0 0] x1 + [0] [0 0 0] [1] [1 0 0] [1 0 0] [0] [#natsub](x1, x2) = [1 1 0] x1 + [1 0 0] x2 + [0] [1 0 1] [0 1 1] [0] This order satisfies following ordering constraints [#equal(@x, @y)] = [1 0 0] [0 1 0] [0] [0 0 0] @x + [0 1 0] @y + [1] [1 0 1] [1 1 1] [0] >= [0] [1] [0] = [#eq(@x, @y)] [#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0] [1] [0] >= [0] [1] [0] = [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))] [#eq(::(@x_1, @x_2), nil())] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(nil(), ::(@y_1, @y_2))] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(nil(), nil())] = [0] [1] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #0())] = [0] [1] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #s(@y))] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#0(), #neg(@y))] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#0(), #pos(@y))] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#s(@x), #0())] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#s(@x), #s(@y))] = [0] [1] [0] >= [0] [1] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #0())] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#neg(@x), #neg(@y))] = [0] [1] [0] >= [0] [1] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #pos(@y))] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#pos(@x), #0())] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#pos(@x), #neg(@y))] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#eq(#pos(@x), #pos(@y))] = [0] [1] [0] >= [0] [1] [0] = [#eq(@x, @y)] [*(@x, @y)] = [0 0 0] [1 0 0] [0] [0 0 0] @x + [0 1 0] @y + [0] [0 0 1] [0 0 0] [1] >= [0 0 0] [1 0 0] [0] [0 0 0] @x + [0 1 0] @y + [0] [0 0 1] [0 0 0] [1] = [#mult(@x, @y)] [#mult(#0(), #0())] = [0] [0] [2] >= [0] [0] [1] = [#0()] [#mult(#0(), #neg(@y))] = [1 0 0] [0] [0 0 0] @y + [1] [0 0 0] [2] >= [0] [0] [1] = [#0()] [#mult(#0(), #pos(@y))] = [1 0 0] [0] [0 0 0] @y + [1] [0 0 0] [2] >= [0] [0] [1] = [#0()] [#mult(#neg(@x), #0())] = [0 0 0] [0] [0 0 0] @x + [0] [1 0 0] [2] >= [0] [0] [1] = [#0()] [#mult(#neg(@x), #neg(@y))] = [0 0 0] [1 0 0] [0] [0 0 0] @x + [0 0 0] @y + [1] [1 0 0] [0 0 0] [2] >= [0] [1] [0] = [#pos(#natmult(@x, @y))] [#mult(#neg(@x), #pos(@y))] = [0 0 0] [1 0 0] [0] [0 0 0] @x + [0 0 0] @y + [1] [1 0 0] [0 0 0] [2] >= [0] [1] [1] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #0())] = [0 0 0] [0] [0 0 0] @x + [0] [1 0 0] [1] >= [0] [0] [1] = [#0()] [#mult(#pos(@x), #neg(@y))] = [0 0 0] [1 0 0] [0] [0 0 0] @x + [0 0 0] @y + [1] [1 0 0] [0 0 0] [1] >= [0] [1] [1] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #pos(@y))] = [0 0 0] [1 0 0] [0] [0 0 0] @x + [0 0 0] @y + [1] [1 0 0] [0 0 0] [1] >= [0] [1] [0] = [#pos(#natmult(@x, @y))] [-(@x, @y)] = [1 0 0] [1 0 0] [0] [1 1 1] @x + [0 1 1] @y + [0] [0 1 1] [0 1 1] [0] >= [1 0 0] [1 0 0] [0] [0 1 1] @x + [0 1 1] @y + [0] [0 1 1] [0 1 1] [0] = [#sub(@x, @y)] [#sub(@x, #0())] = [1 0 0] [0] [0 1 1] @x + [1] [0 1 1] [1] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#sub(@x, #neg(@y))] = [1 0 0] [1 0 0] [0] [0 1 1] @x + [1 0 0] @y + [2] [0 1 1] [1 0 0] [2] >= [1 0 0] [1 0 0] [0] [0 1 1] @x + [1 0 0] @y + [1] [0 1 1] [1 0 0] [0] = [#add(@x, #pos(@y))] [#sub(@x, #pos(@y))] = [1 0 0] [1 0 0] [0] [0 1 1] @x + [1 0 0] @y + [1] [0 1 1] [1 0 0] [1] >= [1 0 0] [1 0 0] [0] [0 1 1] @x + [1 0 0] @y + [1] [0 1 1] [1 0 0] [1] = [#add(@x, #neg(@y))] [div(@x, @y)] = [0 0 1] [0 0 0] [0] [0 0 0] @x + [0 1 0] @y + [0] [1 0 0] [0 1 1] [1] >= [0 0 1] [0 0 0] [0] [0 0 0] @x + [0 1 0] @y + [0] [1 0 0] [0 1 1] [1] = [#div(@x, @y)] [#div(#0(), #0())] = [1] [0] [2] > [0] [0] [0] = [#divByZero()] [#div(#0(), #neg(@y))] = [0 0 0] [1] [0 0 0] @y + [1] [1 0 0] [3] > [0] [0] [1] = [#0()] [#div(#0(), #pos(@y))] = [0 0 0] [1] [0 0 0] @y + [1] [1 0 0] [2] > [0] [0] [1] = [#0()] [#div(#neg(@x), #0())] = [1 0 0] [1] [0 0 0] @x + [0] [1 0 0] [2] > [0] [0] [0] = [#divByZero()] [#div(#neg(@x), #neg(@y))] = [1 0 0] [0 0 0] [1] [0 0 0] @x + [0 0 0] @y + [1] [1 0 0] [1 0 0] [3] > [1 0 0] [0] [0 0 0] @x + [1] [1 0 0] [1] = [#positive(#natdiv(@x, @y))] [#div(#neg(@x), #pos(@y))] = [1 0 0] [0 0 0] [1] [0 0 0] @x + [0 0 0] @y + [1] [1 0 0] [1 0 0] [2] > [1 0 0] [0] [0 0 0] @x + [1] [1 0 0] [2] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #0())] = [1 0 0] [0] [0 0 0] @x + [0] [1 0 0] [2] >= [0] [0] [0] = [#divByZero()] [#div(#pos(@x), #neg(@y))] = [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [1] [1 0 0] [1 0 0] [3] >= [1 0 0] [0] [0 0 0] @x + [1] [1 0 0] [2] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #pos(@y))] = [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [1] [1 0 0] [1 0 0] [2] >= [1 0 0] [0] [0 0 0] @x + [1] [1 0 0] [1] = [#positive(#natdiv(@x, @y))] [eratos(@l)] = [1 1 1] [0] [0 1 0] @l + [0] [0 0 1] [0] >= [1 1 1] [0] [0 1 0] @l + [0] [0 0 1] [0] = [eratos#1(@l)] [eratos#1(::(@x, @xs))] = [2 1 1] [1 1 2] [3] [1 1 0] @x + [0 1 1] @xs + [1] [1 0 1] [0 0 1] [1] > [0 0 0] [1 1 2] [2] [1 1 0] @x + [0 1 1] @xs + [1] [1 0 1] [0 0 1] [1] = [::(@x, eratos(filter(@x, @xs)))] [eratos#1(nil())] = [1] [0] [1] > [0] [0] [1] = [nil()] [filter(@p, @l)] = [1 0 1] [1] [0 1 0] @l + [0] [0 0 1] [0] > [1 0 1] [0] [0 1 0] @l + [0] [0 0 1] [0] = [filter#1(@l, @p)] [filter#1(::(@x, @xs), @p)] = [1 0 1] [1 0 1] [2] [1 1 0] @x + [0 1 1] @xs + [1] [1 0 1] [0 0 1] [1] >= [1 0 1] [1 0 1] [2] [1 1 0] @x + [0 1 1] @xs + [1] [1 0 1] [0 0 1] [1] = [filter#2(filter(@p, @xs), @p, @x)] [filter#1(nil(), @p)] = [1] [0] [1] > [0] [0] [1] = [nil()] [filter#2(@xs', @p, @x)] = [1 0 1] [1 0 0] [1] [1 1 0] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [1] >= [1 0 1] [1 0 0] [1] [1 1 0] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [1] = [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')] [mod(@x, @y)] = [1 0 1] [0 0 0] [0] [1 1 1] @x + [0 1 1] @y + [1] [0 1 1] [0 1 1] [1] >= [1 0 1] [0 0 0] [0] [1 1 1] @x + [0 1 1] @y + [1] [0 1 1] [0 1 1] [1] = [-(@x, *(@y, div(@x, @y)))] [filter#3(#false(), @x, @xs')] = [0 0 0] [1 0 0] [1] [1 1 0] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [1] >= [0 0 0] [1 0 0] [1] [1 1 0] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [1] = [::(@x, @xs')] [filter#3(#true(), @x, @xs')] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 1] @xs' + [1] [1 0 1] [0 0 1] [1] >= [1 0 0] [0] [0 1 0] @xs' + [0] [0 0 1] [0] = [@xs'] [#add(#0(), @y)] = [1 0 0] [0] [1 1 0] @y + [1] [0 0 1] [1] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#add(#neg(#s(#0())), @y)] = [1 0 0] [0] [1 1 0] @y + [2] [0 0 1] [2] >= [1 0 0] [0] [1 0 0] @y + [1] [0 0 1] [1] = [#pred(@y)] [#add(#neg(#s(#s(@x))), @y)] = [1 0 0] [1 0 0] [0] [1 0 0] @x + [1 1 0] @y + [2] [1 0 0] [0 0 1] [2] >= [1 0 0] [1 0 0] [0] [1 0 0] @x + [1 0 0] @y + [1] [1 0 0] [0 0 1] [2] = [#pred(#add(#pos(#s(@x)), @y))] [#add(#pos(#s(#0())), @y)] = [1 0 0] [0] [1 1 0] @y + [1] [0 0 1] [1] >= [1 0 0] [0] [1 0 0] @y + [1] [0 0 1] [0] = [#succ(@y)] [#add(#pos(#s(#s(@x))), @y)] = [1 0 0] [1 0 0] [0] [1 0 0] @x + [1 1 0] @y + [1] [1 0 0] [0 0 1] [1] >= [1 0 0] [1 0 0] [0] [1 0 0] @x + [1 0 0] @y + [1] [1 0 0] [0 0 1] [1] = [#succ(#add(#pos(#s(@x)), @y))] [#pred(#0())] = [0] [1] [2] >= [0] [1] [1] = [#neg(#s(#0()))] [#pred(#neg(#s(@x)))] = [1 0 0] [0] [1 0 0] @x + [1] [1 0 0] [2] >= [1 0 0] [0] [0 0 0] @x + [1] [1 0 0] [1] = [#neg(#s(#s(@x)))] [#pred(#pos(#s(#0())))] = [0] [1] [1] >= [0] [0] [1] = [#0()] [#pred(#pos(#s(#s(@x))))] = [1 0 0] [0] [1 0 0] @x + [1] [1 0 0] [1] >= [1 0 0] [0] [0 0 0] @x + [1] [1 0 0] [0] = [#pos(#s(@x))] [#succ(#0())] = [0] [1] [1] >= [0] [1] [0] = [#pos(#s(#0()))] [#succ(#neg(#s(#0())))] = [0] [1] [1] >= [0] [0] [1] = [#0()] [#succ(#neg(#s(#s(@x))))] = [1 0 0] [0] [1 0 0] @x + [1] [1 0 0] [1] >= [1 0 0] [0] [0 0 0] @x + [1] [1 0 0] [1] = [#neg(#s(@x))] [#succ(#pos(#s(@x)))] = [1 0 0] [0] [1 0 0] @x + [1] [1 0 0] [0] >= [1 0 0] [0] [0 0 0] @x + [1] [1 0 0] [0] = [#pos(#s(#s(@x)))] [#and(#false(), #false())] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#and(#false(), #true())] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#and(#true(), #false())] = [0] [1] [0] >= [0] [1] [0] = [#false()] [#and(#true(), #true())] = [0] [1] [0] >= [0] [0] [0] = [#true()] [#natdiv(#0(), #0())] = [0] [0] [1] >= [0] [0] [0] = [#divByZero()] [#natdiv(#0(), #s(@y))] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#natdiv(#s(@x), #0())] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [1] >= [0] [0] [0] = [#divByZero()] [#natdiv(#s(@x), #s(@y))] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [1] >= [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [1] = [#natdiv'(#divsub(@x, @y), #s(@y))] [#positive(#0())] = [0] [1] [1] >= [0] [0] [1] = [#0()] [#positive(#s(@x))] = [1 0 0] [0] [0 0 0] @x + [1] [1 1 1] [0] >= [1 0 0] [0] [0 0 0] @x + [1] [1 0 0] [0] = [#pos(#s(@x))] [#positive(#neg(@x))] = [1 0 0] [0] [0 0 0] @x + [1] [2 0 0] [2] >= [1 0 0] [0] [0 0 0] @x + [1] [1 0 0] [1] = [#neg(@x)] [#positive(#pos(@x))] = [1 0 0] [0] [0 0 0] @x + [1] [2 0 0] [1] >= [1 0 0] [0] [0 0 0] @x + [1] [1 0 0] [0] = [#pos(@x)] [#negative(#0())] = [0] [1] [2] >= [0] [0] [1] = [#0()] [#negative(#s(@x))] = [1 0 0] [0] [0 0 0] @x + [1] [1 1 1] [1] >= [1 0 0] [0] [0 0 0] @x + [1] [1 0 0] [1] = [#neg(#s(@x))] [#negative(#neg(@x))] = [1 0 0] [0] [0 0 0] @x + [1] [2 0 0] [3] >= [1 0 0] [0] [0 0 0] @x + [1] [1 0 0] [0] = [#pos(@x)] [#negative(#pos(@x))] = [1 0 0] [0] [0 0 0] @x + [1] [2 0 0] [2] >= [1 0 0] [0] [0 0 0] @x + [1] [1 0 0] [1] = [#neg(@x)] [#divsub(#0(), #0())] = [0] [0] [2] >= [0] [0] [1] = [#0()] [#divsub(#0(), #s(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [0 1 1] [1] >= [0] [0] [0] = [#underflow()] [#divsub(#s(@x), #0())] = [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [1] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [#s(@x)] [#divsub(#s(@x), #s(@y))] = [1 0 0] [0 0 0] [0] [0 1 0] @x + [0 0 0] @y + [0] [0 0 1] [0 1 1] [0] >= [1 0 0] [0 0 0] [0] [0 1 0] @x + [0 0 0] @y + [0] [0 0 1] [0 1 1] [0] = [#divsub(@x, @y)] [#natmult(#0(), @y)] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#natmult(#s(@x), @y)] = [0 0 0] [0] [0 0 0] @x + [0] [0 0 1] [0] >= [0 0 0] [0] [0 0 0] @x + [0] [0 0 1] [0] = [#natadd(@y, #natmult(@x, @y))] [#natadd(#0(), @y)] = [1 0 0] [0] [1 1 0] @y + [0] [1 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#natadd(#s(@x), @y)] = [1 0 0] [0] [1 1 0] @y + [0] [1 0 1] [0] >= [1 0 0] [0] [1 1 0] @y + [0] [1 0 1] [0] = [#s(#natadd(@x, @y))] [#natdiv'(#0(), @y)] = [0] [0] [1] >= [0] [0] [1] = [#s(#0())] [#natdiv'(#s(@x), @y)] = [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [1] >= [1 0 0] [0] [0 0 0] @x + [0] [0 0 0] [1] = [#s(#natdiv(#s(@x), @y))] [#natdiv'(#underflow(), @y)] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#natsub(@x, #0())] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 1] [1] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#natsub(#s(@x), #s(@y))] = [1 0 0] [1 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [0 1 1] [0] >= [1 0 0] [1 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [0 1 1] [0] = [#natsub(@x, @y)] We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^3)). Strict Trs: { -(@x, @y) -> #sub(@x, @y) , filter#3(#false(), @x, @xs') -> ::(@x, @xs') } Weak Trs: { #equal(@x, @y) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(#0(), #0()) -> #true() , #eq(#0(), #s(@y)) -> #false() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , eratos(@l) -> eratos#1(@l) , eratos#1(::(@x, @xs)) -> ::(@x, eratos(filter(@x, @xs))) , eratos#1(nil()) -> nil() , filter(@p, @l) -> filter#1(@l, @p) , filter#1(::(@x, @xs), @p) -> filter#2(filter(@p, @xs), @p, @x) , filter#1(nil(), @p) -> nil() , filter#2(@xs', @p, @x) -> filter#3(#equal(mod(@x, @p), #0()), @x, @xs') , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , filter#3(#true(), @x, @xs') -> @xs' , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#s(@x)) -> #pos(#s(@x)) , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #negative(#0()) -> #0() , #negative(#s(@x)) -> #neg(#s(@x)) , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^3)) We use the processor 'matrix interpretation of dimension 3' to orient following rules strictly. Trs: { filter#3(#false(), @x, @xs') -> ::(@x, @xs') } The induced complexity on above rules (modulo remaining rules) is YES(?,O(n^3)) . These rules are moved into the corresponding weak component(s). Sub-proof: ---------- The following argument positions are usable: Uargs(#equal) = {1}, Uargs(*) = {2}, Uargs(-) = {2}, Uargs(eratos) = {1}, Uargs(::) = {2}, Uargs(filter#2) = {1}, Uargs(filter#3) = {1}, Uargs(#s) = {1}, Uargs(#neg) = {1}, Uargs(#pred) = {1}, Uargs(#pos) = {1}, Uargs(#succ) = {1}, Uargs(#and) = {1, 2}, Uargs(#positive) = {1}, Uargs(#negative) = {1}, Uargs(#natadd) = {2}, Uargs(#natdiv') = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [1 0 0] [1 1 0] [1] [#equal](x1, x2) = [0 1 0] x1 + [1 0 0] x2 + [1] [0 0 0] [0 1 0] [1] [0 1 0] [1] [#eq](x1, x2) = [1 0 0] x2 + [1] [0 1 0] [1] [0 0 0] [1 0 0] [0] [*](x1, x2) = [0 1 1] x1 + [0 0 0] x2 + [0] [0 0 0] [0 1 1] [0] [0 0 0] [0 0 0] [0] [#mult](x1, x2) = [0 1 1] x1 + [0 0 0] x2 + [0] [0 0 0] [0 0 1] [0] [1 0 0] [1 0 0] [0] [-](x1, x2) = [1 1 1] x1 + [0 1 0] x2 + [1] [0 0 1] [0 1 1] [0] [1 0 0] [1 0 0] [0] [#sub](x1, x2) = [1 1 1] x1 + [0 1 0] x2 + [1] [0 0 1] [0 1 1] [0] [0 1 0] [0] [div](x1, x2) = [0 1 0] x1 + [0] [1 0 0] [1] [0 1 0] [0] [#div](x1, x2) = [0 1 0] x1 + [0] [1 0 0] [1] [1 0 1] [0] [eratos](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 1] [0] [eratos#1](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [0 0 0] [1 0 0] [0] [::](x1, x2) = [1 1 0] x1 + [0 1 0] x2 + [1] [0 1 0] [0 1 1] [1] [1 1 0] [0] [filter](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [0] [nil] = [0] [0] [1 1 0] [0] [filter#1](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 1 0] [1] [filter#2](x1, x2, x3) = [0 1 0] x1 + [1 1 0] x3 + [1] [0 1 1] [0 1 0] [1] [1 1 0] [0 0 0] [0] [mod](x1, x2) = [1 1 1] x1 + [0 1 1] x2 + [1] [1 1 1] [0 1 1] [1] [0] [#0] = [0] [1] [1 0 0] [0 0 0] [1 0 0] [0] [filter#3](x1, x2, x3) = [0 0 0] x1 + [1 1 0] x2 + [0 1 0] x3 + [1] [0 0 1] [0 1 0] [0 1 1] [0] [1] [#false] = [1] [1] [0] [#true] = [0] [0] [1 0 0] [1 0 0] [0] [#add](x1, x2) = [1 0 1] x1 + [0 1 0] x2 + [0] [0 0 0] [1 0 1] [0] [1 0 0] [0] [#s](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#neg](x1) = [1 1 0] x1 + [0] [1 1 0] [1] [1 0 0] [0] [#pred](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#pos](x1) = [1 1 0] x1 + [0] [1 0 0] [1] [1 0 0] [0] [#succ](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 0 0] [0] [#and](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [1] [0 1 0] [1 0 0] [0] [0] [#divByZero] = [0] [0] [1 0 0] [0 0 0] [0] [#natdiv](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [0] [1 1 1] [0 0 1] [0] [1 1 0] [0] [#positive](x1) = [1 1 0] x1 + [0] [1 1 0] [1] [1 0 0] [0] [#negative](x1) = [1 1 0] x1 + [0] [1 1 0] [1] [1 0 0] [0] [#divsub](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [0] [#underflow] = [0] [1] [0] [#natmult](x1, x2) = [0] [1] [1 0 0] [0] [#natadd](x1, x2) = [1 1 0] x2 + [0] [0 0 1] [0] [1 0 0] [0 0 0] [0] [#natdiv'](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [0] [1 1 1] [0 0 1] [0] [1 0 0] [1 0 0] [0] [#natsub](x1, x2) = [1 1 0] x1 + [1 0 0] x2 + [0] [1 0 1] [0 1 1] [0] This order satisfies following ordering constraints [#equal(@x, @y)] = [1 0 0] [1 1 0] [1] [0 1 0] @x + [1 0 0] @y + [1] [0 0 0] [0 1 0] [1] >= [0 1 0] [1] [1 0 0] @y + [1] [0 1 0] [1] = [#eq(@x, @y)] [#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [1 1 0] [0 1 0] [2] [0 0 0] @y_1 + [1 0 0] @y_2 + [1] [1 1 0] [0 1 0] [2] >= [0 1 0] [0 1 0] [2] [0 0 0] @y_1 + [0 0 0] @y_2 + [1] [1 0 0] [0 1 0] [2] = [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))] [#eq(::(@x_1, @x_2), nil())] = [1] [1] [1] >= [1] [1] [1] = [#false()] [#eq(nil(), ::(@y_1, @y_2))] = [1 1 0] [0 1 0] [2] [0 0 0] @y_1 + [1 0 0] @y_2 + [1] [1 1 0] [0 1 0] [2] > [1] [1] [1] = [#false()] [#eq(nil(), nil())] = [1] [1] [1] > [0] [0] [0] = [#true()] [#eq(#0(), #0())] = [1] [1] [1] > [0] [0] [0] = [#true()] [#eq(#0(), #s(@y))] = [0 1 0] [1] [1 0 0] @y + [1] [0 1 0] [1] >= [1] [1] [1] = [#false()] [#eq(#0(), #neg(@y))] = [1 1 0] [1] [1 0 0] @y + [1] [1 1 0] [1] >= [1] [1] [1] = [#false()] [#eq(#0(), #pos(@y))] = [1 1 0] [1] [1 0 0] @y + [1] [1 1 0] [1] >= [1] [1] [1] = [#false()] [#eq(#s(@x), #0())] = [1] [1] [1] >= [1] [1] [1] = [#false()] [#eq(#s(@x), #s(@y))] = [0 1 0] [1] [1 0 0] @y + [1] [0 1 0] [1] >= [0 1 0] [1] [1 0 0] @y + [1] [0 1 0] [1] = [#eq(@x, @y)] [#eq(#neg(@x), #0())] = [1] [1] [1] >= [1] [1] [1] = [#false()] [#eq(#neg(@x), #neg(@y))] = [1 1 0] [1] [1 0 0] @y + [1] [1 1 0] [1] >= [0 1 0] [1] [1 0 0] @y + [1] [0 1 0] [1] = [#eq(@x, @y)] [#eq(#neg(@x), #pos(@y))] = [1 1 0] [1] [1 0 0] @y + [1] [1 1 0] [1] >= [1] [1] [1] = [#false()] [#eq(#pos(@x), #0())] = [1] [1] [1] >= [1] [1] [1] = [#false()] [#eq(#pos(@x), #neg(@y))] = [1 1 0] [1] [1 0 0] @y + [1] [1 1 0] [1] >= [1] [1] [1] = [#false()] [#eq(#pos(@x), #pos(@y))] = [1 1 0] [1] [1 0 0] @y + [1] [1 1 0] [1] >= [0 1 0] [1] [1 0 0] @y + [1] [0 1 0] [1] = [#eq(@x, @y)] [*(@x, @y)] = [0 0 0] [1 0 0] [0] [0 1 1] @x + [0 0 0] @y + [0] [0 0 0] [0 1 1] [0] >= [0 0 0] [0 0 0] [0] [0 1 1] @x + [0 0 0] @y + [0] [0 0 0] [0 0 1] [0] = [#mult(@x, @y)] [#mult(#0(), #0())] = [0] [1] [1] >= [0] [0] [1] = [#0()] [#mult(#0(), #neg(@y))] = [0 0 0] [0] [0 0 0] @y + [1] [1 1 0] [1] >= [0] [0] [1] = [#0()] [#mult(#0(), #pos(@y))] = [0 0 0] [0] [0 0 0] @y + [1] [1 0 0] [1] >= [0] [0] [1] = [#0()] [#mult(#neg(@x), #0())] = [0 0 0] [0] [2 2 0] @x + [1] [0 0 0] [1] >= [0] [0] [1] = [#0()] [#mult(#neg(@x), #neg(@y))] = [0 0 0] [0 0 0] [0] [2 2 0] @x + [0 0 0] @y + [1] [0 0 0] [1 1 0] [1] >= [0] [0] [1] = [#pos(#natmult(@x, @y))] [#mult(#neg(@x), #pos(@y))] = [0 0 0] [0 0 0] [0] [2 2 0] @x + [0 0 0] @y + [1] [0 0 0] [1 0 0] [1] >= [0] [0] [1] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #0())] = [0 0 0] [0] [2 1 0] @x + [1] [0 0 0] [1] >= [0] [0] [1] = [#0()] [#mult(#pos(@x), #neg(@y))] = [0 0 0] [0 0 0] [0] [2 1 0] @x + [0 0 0] @y + [1] [0 0 0] [1 1 0] [1] >= [0] [0] [1] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #pos(@y))] = [0 0 0] [0 0 0] [0] [2 1 0] @x + [0 0 0] @y + [1] [0 0 0] [1 0 0] [1] >= [0] [0] [1] = [#pos(#natmult(@x, @y))] [-(@x, @y)] = [1 0 0] [1 0 0] [0] [1 1 1] @x + [0 1 0] @y + [1] [0 0 1] [0 1 1] [0] >= [1 0 0] [1 0 0] [0] [1 1 1] @x + [0 1 0] @y + [1] [0 0 1] [0 1 1] [0] = [#sub(@x, @y)] [#sub(@x, #0())] = [1 0 0] [0] [1 1 1] @x + [1] [0 0 1] [1] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#sub(@x, #neg(@y))] = [1 0 0] [1 0 0] [0] [1 1 1] @x + [1 1 0] @y + [1] [0 0 1] [2 2 0] [1] >= [1 0 0] [1 0 0] [0] [1 0 1] @x + [1 1 0] @y + [0] [0 0 0] [2 0 0] [1] = [#add(@x, #pos(@y))] [#sub(@x, #pos(@y))] = [1 0 0] [1 0 0] [0] [1 1 1] @x + [1 1 0] @y + [1] [0 0 1] [2 1 0] [1] >= [1 0 0] [1 0 0] [0] [1 0 1] @x + [1 1 0] @y + [0] [0 0 0] [2 1 0] [1] = [#add(@x, #neg(@y))] [div(@x, @y)] = [0 1 0] [0] [0 1 0] @x + [0] [1 0 0] [1] >= [0 1 0] [0] [0 1 0] @x + [0] [1 0 0] [1] = [#div(@x, @y)] [#div(#0(), #0())] = [0] [0] [1] >= [0] [0] [0] = [#divByZero()] [#div(#0(), #neg(@y))] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#div(#0(), #pos(@y))] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#div(#neg(@x), #0())] = [1 1 0] [0] [1 1 0] @x + [0] [1 0 0] [1] >= [0] [0] [0] = [#divByZero()] [#div(#neg(@x), #neg(@y))] = [1 1 0] [0] [1 1 0] @x + [0] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#positive(#natdiv(@x, @y))] [#div(#neg(@x), #pos(@y))] = [1 1 0] [0] [1 1 0] @x + [0] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #0())] = [1 1 0] [0] [1 1 0] @x + [0] [1 0 0] [1] >= [0] [0] [0] = [#divByZero()] [#div(#pos(@x), #neg(@y))] = [1 1 0] [0] [1 1 0] @x + [0] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #pos(@y))] = [1 1 0] [0] [1 1 0] @x + [0] [1 0 0] [1] >= [1 0 0] [0] [1 0 0] @x + [0] [1 0 0] [1] = [#positive(#natdiv(@x, @y))] [eratos(@l)] = [1 0 1] [0] [0 1 0] @l + [0] [0 0 1] [0] >= [1 0 1] [0] [0 1 0] @l + [0] [0 0 1] [0] = [eratos#1(@l)] [eratos#1(::(@x, @xs))] = [0 1 0] [1 1 1] [1] [1 1 0] @x + [0 1 0] @xs + [1] [0 1 0] [0 1 1] [1] > [0 0 0] [1 1 1] [0] [1 1 0] @x + [0 1 0] @xs + [1] [0 1 0] [0 1 1] [1] = [::(@x, eratos(filter(@x, @xs)))] [eratos#1(nil())] = [0] [0] [0] >= [0] [0] [0] = [nil()] [filter(@p, @l)] = [1 1 0] [0] [0 1 0] @l + [0] [0 0 1] [0] >= [1 1 0] [0] [0 1 0] @l + [0] [0 0 1] [0] = [filter#1(@l, @p)] [filter#1(::(@x, @xs), @p)] = [1 1 0] [1 1 0] [1] [1 1 0] @x + [0 1 0] @xs + [1] [0 1 0] [0 1 1] [1] >= [1 1 0] [1 1 0] [1] [1 1 0] @x + [0 1 0] @xs + [1] [0 1 0] [0 1 1] [1] = [filter#2(filter(@p, @xs), @p, @x)] [filter#1(nil(), @p)] = [0] [0] [0] >= [0] [0] [0] = [nil()] [filter#2(@xs', @p, @x)] = [1 1 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [1] >= [1 1 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [1] = [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')] [mod(@x, @y)] = [1 1 0] [0 0 0] [0] [1 1 1] @x + [0 1 1] @y + [1] [1 1 1] [0 1 1] [1] >= [1 1 0] [0 0 0] [0] [1 1 1] @x + [0 1 1] @y + [1] [1 1 1] [0 1 1] [1] = [-(@x, *(@y, div(@x, @y)))] [filter#3(#false(), @x, @xs')] = [0 0 0] [1 0 0] [1] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [1] > [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [1] = [::(@x, @xs')] [filter#3(#true(), @x, @xs')] = [0 0 0] [1 0 0] [0] [1 1 0] @x + [0 1 0] @xs' + [1] [0 1 0] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @xs' + [0] [0 0 1] [0] = [@xs'] [#add(#0(), @y)] = [1 0 0] [0] [0 1 0] @y + [1] [1 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#add(#neg(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [1] [1 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#pred(@y)] [#add(#neg(#s(#s(@x))), @y)] = [1 0 0] [1 0 0] [0] [2 1 0] @x + [0 1 0] @y + [1] [0 0 0] [1 0 1] [0] >= [1 0 0] [1 0 0] [0] [2 0 0] @x + [0 1 0] @y + [1] [0 0 0] [1 0 1] [0] = [#pred(#add(#pos(#s(@x)), @y))] [#add(#pos(#s(#0())), @y)] = [1 0 0] [0] [0 1 0] @y + [1] [1 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [#succ(@y)] [#add(#pos(#s(#s(@x))), @y)] = [1 0 0] [1 0 0] [0] [2 0 0] @x + [0 1 0] @y + [1] [0 0 0] [1 0 1] [0] >= [1 0 0] [1 0 0] [0] [2 0 0] @x + [0 1 0] @y + [1] [0 0 0] [1 0 1] [0] = [#succ(#add(#pos(#s(@x)), @y))] [#pred(#0())] = [0] [0] [1] >= [0] [0] [1] = [#neg(#s(#0()))] [#pred(#neg(#s(@x)))] = [1 0 0] [0] [1 1 0] @x + [0] [1 1 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 1 0] [1] = [#neg(#s(#s(@x)))] [#pred(#pos(#s(#0())))] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#pred(#pos(#s(#s(@x))))] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [1] = [#pos(#s(@x))] [#succ(#0())] = [0] [0] [1] >= [0] [0] [1] = [#pos(#s(#0()))] [#succ(#neg(#s(#0())))] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#succ(#neg(#s(#s(@x))))] = [1 0 0] [0] [1 1 0] @x + [0] [1 1 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 1 0] [1] = [#neg(#s(@x))] [#succ(#pos(#s(@x)))] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [1] = [#pos(#s(#s(@x)))] [#and(#false(), #false())] = [2] [1] [2] > [1] [1] [1] = [#false()] [#and(#false(), #true())] = [1] [1] [1] >= [1] [1] [1] = [#false()] [#and(#true(), #false())] = [1] [1] [1] >= [1] [1] [1] = [#false()] [#and(#true(), #true())] = [0] [1] [0] >= [0] [0] [0] = [#true()] [#natdiv(#0(), #0())] = [0] [0] [2] >= [0] [0] [0] = [#divByZero()] [#natdiv(#0(), #s(@y))] = [0 0 0] [0] [0 0 0] @y + [0] [0 0 1] [1] >= [0] [0] [1] = [#0()] [#natdiv(#s(@x), #0())] = [1 0 0] [0] [0 0 0] @x + [0] [1 1 1] [1] >= [0] [0] [0] = [#divByZero()] [#natdiv(#s(@x), #s(@y))] = [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [1 1 1] [0 0 1] [0] >= [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [1 1 1] [0 0 1] [0] = [#natdiv'(#divsub(@x, @y), #s(@y))] [#positive(#0())] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#positive(#s(@x))] = [1 1 0] [0] [1 1 0] @x + [0] [1 1 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [1] = [#pos(#s(@x))] [#positive(#neg(@x))] = [2 1 0] [0] [2 1 0] @x + [0] [2 1 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 1 0] [1] = [#neg(@x)] [#positive(#pos(@x))] = [2 1 0] [0] [2 1 0] @x + [0] [2 1 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [1] = [#pos(@x)] [#negative(#0())] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#negative(#s(@x))] = [1 0 0] [0] [1 1 0] @x + [0] [1 1 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 1 0] [1] = [#neg(#s(@x))] [#negative(#neg(@x))] = [1 0 0] [0] [2 1 0] @x + [0] [2 1 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 0 0] [1] = [#pos(@x)] [#negative(#pos(@x))] = [1 0 0] [0] [2 1 0] @x + [0] [2 1 0] [1] >= [1 0 0] [0] [1 1 0] @x + [0] [1 1 0] [1] = [#neg(@x)] [#divsub(#0(), #0())] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#divsub(#0(), #s(@y))] = [0] [0] [1] >= [0] [0] [1] = [#underflow()] [#divsub(#s(@x), #0())] = [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [#s(@x)] [#divsub(#s(@x), #s(@y))] = [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [#divsub(@x, @y)] [#natmult(#0(), @y)] = [0] [0] [1] >= [0] [0] [1] = [#0()] [#natmult(#s(@x), @y)] = [0] [0] [1] >= [0] [0] [1] = [#natadd(@y, #natmult(@x, @y))] [#natadd(#0(), @y)] = [1 0 0] [0] [1 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#natadd(#s(@x), @y)] = [1 0 0] [0] [1 1 0] @y + [0] [0 0 1] [0] >= [1 0 0] [0] [1 1 0] @y + [0] [0 0 1] [0] = [#s(#natadd(@x, @y))] [#natdiv'(#0(), @y)] = [0 0 0] [0] [0 0 0] @y + [0] [0 0 1] [1] >= [0] [0] [1] = [#s(#0())] [#natdiv'(#s(@x), @y)] = [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [1 1 1] [0 0 1] [0] >= [1 0 0] [0 0 0] [0] [0 0 0] @x + [0 0 0] @y + [0] [1 1 1] [0 0 1] [0] = [#s(#natdiv(#s(@x), @y))] [#natdiv'(#underflow(), @y)] = [0 0 0] [0] [0 0 0] @y + [0] [0 0 1] [1] >= [0] [0] [1] = [#0()] [#natsub(@x, #0())] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 1] [1] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#natsub(#s(@x), #s(@y))] = [1 0 0] [1 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [0 1 1] [0] >= [1 0 0] [1 0 0] [0] [1 1 0] @x + [1 0 0] @y + [0] [1 0 1] [0 1 1] [0] = [#natsub(@x, @y)] We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^3)). Strict Trs: { -(@x, @y) -> #sub(@x, @y) } Weak Trs: { #equal(@x, @y) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(#0(), #0()) -> #true() , #eq(#0(), #s(@y)) -> #false() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , eratos(@l) -> eratos#1(@l) , eratos#1(::(@x, @xs)) -> ::(@x, eratos(filter(@x, @xs))) , eratos#1(nil()) -> nil() , filter(@p, @l) -> filter#1(@l, @p) , filter#1(::(@x, @xs), @p) -> filter#2(filter(@p, @xs), @p, @x) , filter#1(nil(), @p) -> nil() , filter#2(@xs', @p, @x) -> filter#3(#equal(mod(@x, @p), #0()), @x, @xs') , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , filter#3(#false(), @x, @xs') -> ::(@x, @xs') , filter#3(#true(), @x, @xs') -> @xs' , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#s(@x)) -> #pos(#s(@x)) , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #negative(#0()) -> #0() , #negative(#s(@x)) -> #neg(#s(@x)) , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^3)) We use the processor 'matrix interpretation of dimension 3' to orient following rules strictly. Trs: { -(@x, @y) -> #sub(@x, @y) } The induced complexity on above rules (modulo remaining rules) is YES(?,O(n^3)) . These rules are moved into the corresponding weak component(s). Sub-proof: ---------- The following argument positions are usable: Uargs(#equal) = {1}, Uargs(*) = {2}, Uargs(-) = {2}, Uargs(eratos) = {1}, Uargs(::) = {2}, Uargs(filter#2) = {1}, Uargs(filter#3) = {1}, Uargs(#s) = {1}, Uargs(#neg) = {1}, Uargs(#pred) = {1}, Uargs(#pos) = {1}, Uargs(#succ) = {1}, Uargs(#and) = {1, 2}, Uargs(#positive) = {1}, Uargs(#negative) = {1}, Uargs(#natadd) = {2}, Uargs(#natdiv') = {1} TcT has computed following constructor-based matrix interpretation satisfying not(EDA). [1 0 0] [0] [#equal](x1, x2) = [0 0 0] x1 + [0] [1 1 1] [0] [0] [#eq](x1, x2) = [0] [0] [0 0 0] [1 0 0] [0] [*](x1, x2) = [0 1 0] x1 + [0 0 0] x2 + [0] [0 0 0] [0 0 0] [0] [0 0 0] [1 0 0] [0] [#mult](x1, x2) = [0 1 0] x1 + [0 0 0] x2 + [0] [0 0 0] [0 0 0] [0] [1 0 0] [1 0 1] [1] [-](x1, x2) = [1 1 1] x1 + [0 1 1] x2 + [1] [1 1 1] [0 1 1] [1] [1 0 0] [1 0 1] [0] [#sub](x1, x2) = [1 1 1] x1 + [0 1 1] x2 + [1] [1 1 1] [0 1 1] [1] [0 0 1] [0 0 0] [0] [div](x1, x2) = [1 1 1] x1 + [0 0 0] x2 + [1] [0 1 0] [0 1 1] [0] [0 0 1] [0 0 0] [0] [#div](x1, x2) = [0 1 1] x1 + [0 0 0] x2 + [1] [0 1 0] [0 0 1] [0] [1 1 0] [1] [eratos](x1) = [0 1 1] x1 + [0] [0 0 1] [1] [1 1 0] [1] [eratos#1](x1) = [0 1 1] x1 + [0] [0 0 1] [1] [0 0 0] [1 0 0] [0] [::](x1, x2) = [0 0 0] x1 + [0 1 1] x2 + [0] [1 0 1] [0 0 1] [1] [1 0 1] [0] [filter](x1, x2) = [0 1 0] x2 + [0] [0 0 1] [0] [0] [nil] = [0] [1] [1 0 1] [0] [filter#1](x1, x2) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [1 0 1] [1] [filter#2](x1, x2, x3) = [0 1 1] x1 + [0 0 0] x3 + [0] [0 0 1] [1 0 1] [1] [1 0 1] [0 0 0] [1] [mod](x1, x2) = [1 1 1] x1 + [0 1 0] x2 + [1] [1 1 1] [0 1 0] [1] [0] [#0] = [0] [0] [1 1 0] [0 0 0] [1 0 0] [0] [filter#3](x1, x2, x3) = [0 0 0] x1 + [0 0 0] x2 + [0 1 1] x3 + [0] [0 0 0] [1 0 1] [0 0 1] [1] [0] [#false] = [0] [0] [0] [#true] = [0] [0] [0 0 0] [1 0 0] [0] [#add](x1, x2) = [1 1 1] x1 + [0 1 1] x2 + [1] [1 1 1] [0 1 1] [0] [1 0 0] [0] [#s](x1) = [0 1 0] x1 + [0] [0 0 1] [0] [1 0 0] [0] [#neg](x1) = [1 0 1] x1 + [1] [1 0 1] [0] [1 0 0] [0] [#pred](x1) = [0 0 1] x1 + [1] [0 0 1] [0] [1 0 0] [0] [#pos](x1) = [1 0 1] x1 + [1] [1 0 1] [0] [1 0 0] [0] [#succ](x1) = [0 0 1] x1 + [1] [0 0 1] [0] [1 0 0] [1 0 0] [0] [#and](x1, x2) = [0 0 0] x1 + [0 0 0] x2 + [0] [0 0 0] [0 0 0] [0] [0] [#divByZero] = [0] [0] [1 0 1] [0] [#natdiv](x1, x2) = [1 0 0] x1 + [1] [0 0 0] [1] [1 0 0] [0] [#positive](x1) = [1 0 1] x1 + [1] [1 0 1] [0] [1 0 0] [0] [#negative](x1) = [1 0 1] x1 + [1] [1 0 1] [0] [1 0 0] [0] [#divsub](x1, x2) = [0 1 1] x1 + [1] [0 0 1] [0] [0] [#underflow] = [0] [0] [0] [#natmult](x1, x2) = [0] [0] [1 0 0] [0] [#natadd](x1, x2) = [1 1 1] x2 + [0] [1 1 1] [0] [1 0 1] [0] [#natdiv'](x1, x2) = [1 0 0] x1 + [1] [0 0 0] [1] [1 0 0] [0 0 1] [0] [#natsub](x1, x2) = [1 1 0] x1 + [0 0 1] x2 + [0] [1 0 1] [1 0 0] [0] This order satisfies following ordering constraints [#equal(@x, @y)] = [1 0 0] [0] [0 0 0] @x + [0] [1 1 1] [0] >= [0] [0] [0] = [#eq(@x, @y)] [#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0] [0] [0] >= [0] [0] [0] = [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))] [#eq(::(@x_1, @x_2), nil())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(nil(), ::(@y_1, @y_2))] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(nil(), nil())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#eq(#0(), #s(@y))] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#0(), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#0(), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#s(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#s(@x), #s(@y))] = [0] [0] [0] >= [0] [0] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#neg(@x), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#eq(@x, @y)] [#eq(#neg(@x), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #0())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #neg(@y))] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#eq(#pos(@x), #pos(@y))] = [0] [0] [0] >= [0] [0] [0] = [#eq(@x, @y)] [*(@x, @y)] = [0 0 0] [1 0 0] [0] [0 1 0] @x + [0 0 0] @y + [0] [0 0 0] [0 0 0] [0] >= [0 0 0] [1 0 0] [0] [0 1 0] @x + [0 0 0] @y + [0] [0 0 0] [0 0 0] [0] = [#mult(@x, @y)] [#mult(#0(), #0())] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#mult(#0(), #neg(@y))] = [1 0 0] [0] [0 0 0] @y + [0] [0 0 0] [0] >= [0] [0] [0] = [#0()] [#mult(#0(), #pos(@y))] = [1 0 0] [0] [0 0 0] @y + [0] [0 0 0] [0] >= [0] [0] [0] = [#0()] [#mult(#neg(@x), #0())] = [0 0 0] [0] [1 0 1] @x + [1] [0 0 0] [0] >= [0] [0] [0] = [#0()] [#mult(#neg(@x), #neg(@y))] = [0 0 0] [1 0 0] [0] [1 0 1] @x + [0 0 0] @y + [1] [0 0 0] [0 0 0] [0] >= [0] [1] [0] = [#pos(#natmult(@x, @y))] [#mult(#neg(@x), #pos(@y))] = [0 0 0] [1 0 0] [0] [1 0 1] @x + [0 0 0] @y + [1] [0 0 0] [0 0 0] [0] >= [0] [1] [0] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #0())] = [0 0 0] [0] [1 0 1] @x + [1] [0 0 0] [0] >= [0] [0] [0] = [#0()] [#mult(#pos(@x), #neg(@y))] = [0 0 0] [1 0 0] [0] [1 0 1] @x + [0 0 0] @y + [1] [0 0 0] [0 0 0] [0] >= [0] [1] [0] = [#neg(#natmult(@x, @y))] [#mult(#pos(@x), #pos(@y))] = [0 0 0] [1 0 0] [0] [1 0 1] @x + [0 0 0] @y + [1] [0 0 0] [0 0 0] [0] >= [0] [1] [0] = [#pos(#natmult(@x, @y))] [-(@x, @y)] = [1 0 0] [1 0 1] [1] [1 1 1] @x + [0 1 1] @y + [1] [1 1 1] [0 1 1] [1] > [1 0 0] [1 0 1] [0] [1 1 1] @x + [0 1 1] @y + [1] [1 1 1] [0 1 1] [1] = [#sub(@x, @y)] [#sub(@x, #0())] = [1 0 0] [0] [1 1 1] @x + [1] [1 1 1] [1] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#sub(@x, #neg(@y))] = [1 0 0] [2 0 1] [0] [1 1 1] @x + [2 0 2] @y + [2] [1 1 1] [2 0 2] [2] >= [0 0 0] [1 0 0] [0] [1 1 1] @x + [2 0 2] @y + [2] [1 1 1] [2 0 2] [1] = [#add(@x, #pos(@y))] [#sub(@x, #pos(@y))] = [1 0 0] [2 0 1] [0] [1 1 1] @x + [2 0 2] @y + [2] [1 1 1] [2 0 2] [2] >= [0 0 0] [1 0 0] [0] [1 1 1] @x + [2 0 2] @y + [2] [1 1 1] [2 0 2] [1] = [#add(@x, #neg(@y))] [div(@x, @y)] = [0 0 1] [0 0 0] [0] [1 1 1] @x + [0 0 0] @y + [1] [0 1 0] [0 1 1] [0] >= [0 0 1] [0 0 0] [0] [0 1 1] @x + [0 0 0] @y + [1] [0 1 0] [0 0 1] [0] = [#div(@x, @y)] [#div(#0(), #0())] = [0] [1] [0] >= [0] [0] [0] = [#divByZero()] [#div(#0(), #neg(@y))] = [0 0 0] [0] [0 0 0] @y + [1] [1 0 1] [0] >= [0] [0] [0] = [#0()] [#div(#0(), #pos(@y))] = [0 0 0] [0] [0 0 0] @y + [1] [1 0 1] [0] >= [0] [0] [0] = [#0()] [#div(#neg(@x), #0())] = [1 0 1] [0] [2 0 2] @x + [2] [1 0 1] [1] >= [0] [0] [0] = [#divByZero()] [#div(#neg(@x), #neg(@y))] = [1 0 1] [0 0 0] [0] [2 0 2] @x + [0 0 0] @y + [2] [1 0 1] [1 0 1] [1] >= [1 0 1] [0] [1 0 1] @x + [2] [1 0 1] [1] = [#positive(#natdiv(@x, @y))] [#div(#neg(@x), #pos(@y))] = [1 0 1] [0 0 0] [0] [2 0 2] @x + [0 0 0] @y + [2] [1 0 1] [1 0 1] [1] >= [1 0 1] [0] [1 0 1] @x + [2] [1 0 1] [1] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #0())] = [1 0 1] [0] [2 0 2] @x + [2] [1 0 1] [1] >= [0] [0] [0] = [#divByZero()] [#div(#pos(@x), #neg(@y))] = [1 0 1] [0 0 0] [0] [2 0 2] @x + [0 0 0] @y + [2] [1 0 1] [1 0 1] [1] >= [1 0 1] [0] [1 0 1] @x + [2] [1 0 1] [1] = [#negative(#natdiv(@x, @y))] [#div(#pos(@x), #pos(@y))] = [1 0 1] [0 0 0] [0] [2 0 2] @x + [0 0 0] @y + [2] [1 0 1] [1 0 1] [1] >= [1 0 1] [0] [1 0 1] @x + [2] [1 0 1] [1] = [#positive(#natdiv(@x, @y))] [eratos(@l)] = [1 1 0] [1] [0 1 1] @l + [0] [0 0 1] [1] >= [1 1 0] [1] [0 1 1] @l + [0] [0 0 1] [1] = [eratos#1(@l)] [eratos#1(::(@x, @xs))] = [0 0 0] [1 1 1] [1] [1 0 1] @x + [0 1 2] @xs + [1] [1 0 1] [0 0 1] [2] >= [0 0 0] [1 1 1] [1] [0 0 0] @x + [0 1 2] @xs + [1] [1 0 1] [0 0 1] [2] = [::(@x, eratos(filter(@x, @xs)))] [eratos#1(nil())] = [1] [1] [2] > [0] [0] [1] = [nil()] [filter(@p, @l)] = [1 0 1] [0] [0 1 0] @l + [0] [0 0 1] [0] >= [1 0 1] [0] [0 1 0] @l + [0] [0 0 1] [0] = [filter#1(@l, @p)] [filter#1(::(@x, @xs), @p)] = [1 0 1] [1 0 1] [1] [0 0 0] @x + [0 1 1] @xs + [0] [1 0 1] [0 0 1] [1] >= [1 0 1] [1 0 1] [1] [0 0 0] @x + [0 1 1] @xs + [0] [1 0 1] [0 0 1] [1] = [filter#2(filter(@p, @xs), @p, @x)] [filter#1(nil(), @p)] = [1] [0] [1] > [0] [0] [1] = [nil()] [filter#2(@xs', @p, @x)] = [1 0 1] [1 0 0] [1] [0 0 0] @x + [0 1 1] @xs' + [0] [1 0 1] [0 0 1] [1] >= [1 0 1] [1 0 0] [1] [0 0 0] @x + [0 1 1] @xs' + [0] [1 0 1] [0 0 1] [1] = [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')] [mod(@x, @y)] = [1 0 1] [0 0 0] [1] [1 1 1] @x + [0 1 0] @y + [1] [1 1 1] [0 1 0] [1] >= [1 0 1] [0 0 0] [1] [1 1 1] @x + [0 1 0] @y + [1] [1 1 1] [0 1 0] [1] = [-(@x, *(@y, div(@x, @y)))] [filter#3(#false(), @x, @xs')] = [0 0 0] [1 0 0] [0] [0 0 0] @x + [0 1 1] @xs' + [0] [1 0 1] [0 0 1] [1] >= [0 0 0] [1 0 0] [0] [0 0 0] @x + [0 1 1] @xs' + [0] [1 0 1] [0 0 1] [1] = [::(@x, @xs')] [filter#3(#true(), @x, @xs')] = [0 0 0] [1 0 0] [0] [0 0 0] @x + [0 1 1] @xs' + [0] [1 0 1] [0 0 1] [1] >= [1 0 0] [0] [0 1 0] @xs' + [0] [0 0 1] [0] = [@xs'] [#add(#0(), @y)] = [1 0 0] [0] [0 1 1] @y + [1] [0 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#add(#neg(#s(#0())), @y)] = [1 0 0] [0] [0 1 1] @y + [2] [0 1 1] [1] >= [1 0 0] [0] [0 0 1] @y + [1] [0 0 1] [0] = [#pred(@y)] [#add(#neg(#s(#s(@x))), @y)] = [0 0 0] [1 0 0] [0] [3 0 2] @x + [0 1 1] @y + [2] [3 0 2] [0 1 1] [1] >= [0 0 0] [1 0 0] [0] [3 0 2] @x + [0 1 1] @y + [2] [3 0 2] [0 1 1] [1] = [#pred(#add(#pos(#s(@x)), @y))] [#add(#pos(#s(#0())), @y)] = [1 0 0] [0] [0 1 1] @y + [2] [0 1 1] [1] >= [1 0 0] [0] [0 0 1] @y + [1] [0 0 1] [0] = [#succ(@y)] [#add(#pos(#s(#s(@x))), @y)] = [0 0 0] [1 0 0] [0] [3 0 2] @x + [0 1 1] @y + [2] [3 0 2] [0 1 1] [1] >= [0 0 0] [1 0 0] [0] [3 0 2] @x + [0 1 1] @y + [2] [3 0 2] [0 1 1] [1] = [#succ(#add(#pos(#s(@x)), @y))] [#pred(#0())] = [0] [1] [0] >= [0] [1] [0] = [#neg(#s(#0()))] [#pred(#neg(#s(@x)))] = [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] >= [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] = [#neg(#s(#s(@x)))] [#pred(#pos(#s(#0())))] = [0] [1] [0] >= [0] [0] [0] = [#0()] [#pred(#pos(#s(#s(@x))))] = [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] >= [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] = [#pos(#s(@x))] [#succ(#0())] = [0] [1] [0] >= [0] [1] [0] = [#pos(#s(#0()))] [#succ(#neg(#s(#0())))] = [0] [1] [0] >= [0] [0] [0] = [#0()] [#succ(#neg(#s(#s(@x))))] = [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] >= [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] = [#neg(#s(@x))] [#succ(#pos(#s(@x)))] = [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] >= [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] = [#pos(#s(#s(@x)))] [#and(#false(), #false())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#false(), #true())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#true(), #false())] = [0] [0] [0] >= [0] [0] [0] = [#false()] [#and(#true(), #true())] = [0] [0] [0] >= [0] [0] [0] = [#true()] [#natdiv(#0(), #0())] = [0] [1] [1] >= [0] [0] [0] = [#divByZero()] [#natdiv(#0(), #s(@y))] = [0] [1] [1] >= [0] [0] [0] = [#0()] [#natdiv(#s(@x), #0())] = [1 0 1] [0] [1 0 0] @x + [1] [0 0 0] [1] >= [0] [0] [0] = [#divByZero()] [#natdiv(#s(@x), #s(@y))] = [1 0 1] [0] [1 0 0] @x + [1] [0 0 0] [1] >= [1 0 1] [0] [1 0 0] @x + [1] [0 0 0] [1] = [#natdiv'(#divsub(@x, @y), #s(@y))] [#positive(#0())] = [0] [1] [0] >= [0] [0] [0] = [#0()] [#positive(#s(@x))] = [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] >= [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] = [#pos(#s(@x))] [#positive(#neg(@x))] = [1 0 0] [0] [2 0 1] @x + [1] [2 0 1] [0] >= [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] = [#neg(@x)] [#positive(#pos(@x))] = [1 0 0] [0] [2 0 1] @x + [1] [2 0 1] [0] >= [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] = [#pos(@x)] [#negative(#0())] = [0] [1] [0] >= [0] [0] [0] = [#0()] [#negative(#s(@x))] = [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] >= [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] = [#neg(#s(@x))] [#negative(#neg(@x))] = [1 0 0] [0] [2 0 1] @x + [1] [2 0 1] [0] >= [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] = [#pos(@x)] [#negative(#pos(@x))] = [1 0 0] [0] [2 0 1] @x + [1] [2 0 1] [0] >= [1 0 0] [0] [1 0 1] @x + [1] [1 0 1] [0] = [#neg(@x)] [#divsub(#0(), #0())] = [0] [1] [0] >= [0] [0] [0] = [#0()] [#divsub(#0(), #s(@y))] = [0] [1] [0] >= [0] [0] [0] = [#underflow()] [#divsub(#s(@x), #0())] = [1 0 0] [0] [0 1 1] @x + [1] [0 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [#s(@x)] [#divsub(#s(@x), #s(@y))] = [1 0 0] [0] [0 1 1] @x + [1] [0 0 1] [0] >= [1 0 0] [0] [0 1 1] @x + [1] [0 0 1] [0] = [#divsub(@x, @y)] [#natmult(#0(), @y)] = [0] [0] [0] >= [0] [0] [0] = [#0()] [#natmult(#s(@x), @y)] = [0] [0] [0] >= [0] [0] [0] = [#natadd(@y, #natmult(@x, @y))] [#natadd(#0(), @y)] = [1 0 0] [0] [1 1 1] @y + [0] [1 1 1] [0] >= [1 0 0] [0] [0 1 0] @y + [0] [0 0 1] [0] = [@y] [#natadd(#s(@x), @y)] = [1 0 0] [0] [1 1 1] @y + [0] [1 1 1] [0] >= [1 0 0] [0] [1 1 1] @y + [0] [1 1 1] [0] = [#s(#natadd(@x, @y))] [#natdiv'(#0(), @y)] = [0] [1] [1] >= [0] [0] [0] = [#s(#0())] [#natdiv'(#s(@x), @y)] = [1 0 1] [0] [1 0 0] @x + [1] [0 0 0] [1] >= [1 0 1] [0] [1 0 0] @x + [1] [0 0 0] [1] = [#s(#natdiv(#s(@x), @y))] [#natdiv'(#underflow(), @y)] = [0] [1] [1] >= [0] [0] [0] = [#0()] [#natsub(@x, #0())] = [1 0 0] [0] [1 1 0] @x + [0] [1 0 1] [0] >= [1 0 0] [0] [0 1 0] @x + [0] [0 0 1] [0] = [@x] [#natsub(#s(@x), #s(@y))] = [1 0 0] [0 0 1] [0] [1 1 0] @x + [0 0 1] @y + [0] [1 0 1] [1 0 0] [0] >= [1 0 0] [0 0 1] [0] [1 1 0] @x + [0 0 1] @y + [0] [1 0 1] [1 0 0] [0] = [#natsub(@x, @y)] We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Weak Trs: { #equal(@x, @y) -> #eq(@x, @y) , #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) -> #and(#eq(@x_1, @y_1), #eq(@x_2, @y_2)) , #eq(::(@x_1, @x_2), nil()) -> #false() , #eq(nil(), ::(@y_1, @y_2)) -> #false() , #eq(nil(), nil()) -> #true() , #eq(#0(), #0()) -> #true() , #eq(#0(), #s(@y)) -> #false() , #eq(#0(), #neg(@y)) -> #false() , #eq(#0(), #pos(@y)) -> #false() , #eq(#s(@x), #0()) -> #false() , #eq(#s(@x), #s(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #0()) -> #false() , #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y) , #eq(#neg(@x), #pos(@y)) -> #false() , #eq(#pos(@x), #0()) -> #false() , #eq(#pos(@x), #neg(@y)) -> #false() , #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y) , *(@x, @y) -> #mult(@x, @y) , #mult(#0(), #0()) -> #0() , #mult(#0(), #neg(@y)) -> #0() , #mult(#0(), #pos(@y)) -> #0() , #mult(#neg(@x), #0()) -> #0() , #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y)) , #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #0()) -> #0() , #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y)) , #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y)) , -(@x, @y) -> #sub(@x, @y) , #sub(@x, #0()) -> @x , #sub(@x, #neg(@y)) -> #add(@x, #pos(@y)) , #sub(@x, #pos(@y)) -> #add(@x, #neg(@y)) , div(@x, @y) -> #div(@x, @y) , #div(#0(), #0()) -> #divByZero() , #div(#0(), #neg(@y)) -> #0() , #div(#0(), #pos(@y)) -> #0() , #div(#neg(@x), #0()) -> #divByZero() , #div(#neg(@x), #neg(@y)) -> #positive(#natdiv(@x, @y)) , #div(#neg(@x), #pos(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #0()) -> #divByZero() , #div(#pos(@x), #neg(@y)) -> #negative(#natdiv(@x, @y)) , #div(#pos(@x), #pos(@y)) -> #positive(#natdiv(@x, @y)) , eratos(@l) -> eratos#1(@l) , eratos#1(::(@x, @xs)) -> ::(@x, eratos(filter(@x, @xs))) , eratos#1(nil()) -> nil() , filter(@p, @l) -> filter#1(@l, @p) , filter#1(::(@x, @xs), @p) -> filter#2(filter(@p, @xs), @p, @x) , filter#1(nil(), @p) -> nil() , filter#2(@xs', @p, @x) -> filter#3(#equal(mod(@x, @p), #0()), @x, @xs') , mod(@x, @y) -> -(@x, *(@y, div(@x, @y))) , filter#3(#false(), @x, @xs') -> ::(@x, @xs') , filter#3(#true(), @x, @xs') -> @xs' , #add(#0(), @y) -> @y , #add(#neg(#s(#0())), @y) -> #pred(@y) , #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y)) , #add(#pos(#s(#0())), @y) -> #succ(@y) , #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y)) , #pred(#0()) -> #neg(#s(#0())) , #pred(#neg(#s(@x))) -> #neg(#s(#s(@x))) , #pred(#pos(#s(#0()))) -> #0() , #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) , #succ(#0()) -> #pos(#s(#0())) , #succ(#neg(#s(#0()))) -> #0() , #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x)) , #succ(#pos(#s(@x))) -> #pos(#s(#s(@x))) , #and(#false(), #false()) -> #false() , #and(#false(), #true()) -> #false() , #and(#true(), #false()) -> #false() , #and(#true(), #true()) -> #true() , #natdiv(#0(), #0()) -> #divByZero() , #natdiv(#0(), #s(@y)) -> #0() , #natdiv(#s(@x), #0()) -> #divByZero() , #natdiv(#s(@x), #s(@y)) -> #natdiv'(#divsub(@x, @y), #s(@y)) , #positive(#0()) -> #0() , #positive(#s(@x)) -> #pos(#s(@x)) , #positive(#neg(@x)) -> #neg(@x) , #positive(#pos(@x)) -> #pos(@x) , #negative(#0()) -> #0() , #negative(#s(@x)) -> #neg(#s(@x)) , #negative(#neg(@x)) -> #pos(@x) , #negative(#pos(@x)) -> #neg(@x) , #divsub(#0(), #0()) -> #0() , #divsub(#0(), #s(@y)) -> #underflow() , #divsub(#s(@x), #0()) -> #s(@x) , #divsub(#s(@x), #s(@y)) -> #divsub(@x, @y) , #natmult(#0(), @y) -> #0() , #natmult(#s(@x), @y) -> #natadd(@y, #natmult(@x, @y)) , #natadd(#0(), @y) -> @y , #natadd(#s(@x), @y) -> #s(#natadd(@x, @y)) , #natdiv'(#0(), @y) -> #s(#0()) , #natdiv'(#s(@x), @y) -> #s(#natdiv(#s(@x), @y)) , #natdiv'(#underflow(), @y) -> #0() , #natsub(@x, #0()) -> @x , #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) } Obligation: innermost runtime complexity Answer: YES(O(1),O(1)) Empty rules are trivially bounded Hurray, we answered YES(O(1),O(n^3))