tct
YES(O(1),O(n^2))
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
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, *(@x, 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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We add following dependency tuples
Strict DPs:
{ #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)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, eratos#1^#(nil()) -> c_7()
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
, filter#1^#(nil(), @p) -> c_10()
, filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
, filter#3^#(#false(), @x, @xs') -> c_13()
, filter#3^#(#true(), @x, @xs') -> c_14()
, mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y)) }
Weak DPs:
{ #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_16()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
, #eq^#(nil(), nil()) -> c_18()
, #eq^#(#0(), #0()) -> c_19()
, #eq^#(#0(), #s(@y)) -> c_20()
, #eq^#(#0(), #neg(@y)) -> c_21()
, #eq^#(#0(), #pos(@y)) -> c_22()
, #eq^#(#s(@x), #0()) -> c_23()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #0()) -> c_25()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_27()
, #eq^#(#pos(@x), #0()) -> c_28()
, #eq^#(#pos(@x), #neg(@y)) -> c_29()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #mult^#(#0(), #0()) -> c_31()
, #mult^#(#0(), #neg(@y)) -> c_32()
, #mult^#(#0(), #pos(@y)) -> c_33()
, #mult^#(#neg(@x), #0()) -> c_34()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_37()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #sub^#(@x, #0()) -> c_40()
, #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y))
, #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y))
, #div^#(#0(), #0()) -> c_43()
, #div^#(#0(), #neg(@y)) -> c_44()
, #div^#(#0(), #pos(@y)) -> c_45()
, #div^#(#neg(@x), #0()) -> c_46()
, #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #0()) -> c_49()
, #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, #and^#(#false(), #false()) -> c_65()
, #and^#(#false(), #true()) -> c_66()
, #and^#(#true(), #false()) -> c_67()
, #and^#(#true(), #true()) -> c_68()
, #natmult^#(#0(), @y) -> c_71()
, #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #add^#(#0(), @y) -> c_52()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natdiv^#(#0(), #0()) -> c_69()
, #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#0()) -> c_57()
, #pred^#(#neg(#s(@x))) -> c_58()
, #pred^#(#pos(#s(#0()))) -> c_59()
, #pred^#(#pos(#s(#s(@x)))) -> c_60()
, #succ^#(#0()) -> c_61()
, #succ^#(#neg(#s(#0()))) -> c_62()
, #succ^#(#neg(#s(#s(@x)))) -> c_63()
, #succ^#(#pos(#s(@x))) -> c_64()
, #natsub^#(@x, #0()) -> c_73()
, #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) }
and replace the set of basic marked basic terms accordingly.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ #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)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, eratos#1^#(nil()) -> c_7()
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
, filter#1^#(nil(), @p) -> c_10()
, filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
, filter#3^#(#false(), @x, @xs') -> c_13()
, filter#3^#(#true(), @x, @xs') -> c_14()
, mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y)) }
Weak DPs:
{ #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_16()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
, #eq^#(nil(), nil()) -> c_18()
, #eq^#(#0(), #0()) -> c_19()
, #eq^#(#0(), #s(@y)) -> c_20()
, #eq^#(#0(), #neg(@y)) -> c_21()
, #eq^#(#0(), #pos(@y)) -> c_22()
, #eq^#(#s(@x), #0()) -> c_23()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #0()) -> c_25()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_27()
, #eq^#(#pos(@x), #0()) -> c_28()
, #eq^#(#pos(@x), #neg(@y)) -> c_29()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #mult^#(#0(), #0()) -> c_31()
, #mult^#(#0(), #neg(@y)) -> c_32()
, #mult^#(#0(), #pos(@y)) -> c_33()
, #mult^#(#neg(@x), #0()) -> c_34()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_37()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #sub^#(@x, #0()) -> c_40()
, #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y))
, #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y))
, #div^#(#0(), #0()) -> c_43()
, #div^#(#0(), #neg(@y)) -> c_44()
, #div^#(#0(), #pos(@y)) -> c_45()
, #div^#(#neg(@x), #0()) -> c_46()
, #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #0()) -> c_49()
, #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, #and^#(#false(), #false()) -> c_65()
, #and^#(#false(), #true()) -> c_66()
, #and^#(#true(), #false()) -> c_67()
, #and^#(#true(), #true()) -> c_68()
, #natmult^#(#0(), @y) -> c_71()
, #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #add^#(#0(), @y) -> c_52()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natdiv^#(#0(), #0()) -> c_69()
, #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#0()) -> c_57()
, #pred^#(#neg(#s(@x))) -> c_58()
, #pred^#(#pos(#s(#0()))) -> c_59()
, #pred^#(#pos(#s(#s(@x)))) -> c_60()
, #succ^#(#0()) -> c_61()
, #succ^#(#neg(#s(#0()))) -> c_62()
, #succ^#(#neg(#s(#s(@x)))) -> c_63()
, #succ^#(#pos(#s(@x))) -> c_64()
, #natsub^#(@x, #0()) -> c_73()
, #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :15
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :27
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :25
-->_1 #eq^#(#s(@x), #0()) -> c_23() :23
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :22
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :21
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :20
-->_1 #eq^#(#0(), #0()) -> c_19() :19
-->_1 #eq^#(nil(), nil()) -> c_18() :18
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :17
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :16
2: *^#(@x, @y) -> #mult^#(@x, @y)
-->_1 #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y) :39
-->_1 #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y) :38
-->_1 #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y) :36
-->_1 #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y) :35
-->_1 #mult^#(#pos(@x), #0()) -> c_37() :37
-->_1 #mult^#(#neg(@x), #0()) -> c_34() :34
-->_1 #mult^#(#0(), #pos(@y)) -> c_33() :33
-->_1 #mult^#(#0(), #neg(@y)) -> c_32() :32
-->_1 #mult^#(#0(), #0()) -> c_31() :31
3: -^#(@x, @y) -> #sub^#(@x, @y)
-->_1 #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y)) :42
-->_1 #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y)) :41
-->_1 #sub^#(@x, #0()) -> c_40() :40
4: div^#(@x, @y) -> #div^#(@x, @y)
-->_1 #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y) :51
-->_1 #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y) :50
-->_1 #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y) :48
-->_1 #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y) :47
-->_1 #div^#(#pos(@x), #0()) -> c_49() :49
-->_1 #div^#(#neg(@x), #0()) -> c_46() :46
-->_1 #div^#(#0(), #pos(@y)) -> c_45() :45
-->_1 #div^#(#0(), #neg(@y)) -> c_44() :44
-->_1 #div^#(#0(), #0()) -> c_43() :43
5: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :6
-->_1 eratos#1^#(nil()) -> c_7() :7
6: eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :8
-->_1 eratos^#(@l) -> eratos#1^#(@l) :5
7: eratos#1^#(nil()) -> c_7()
8: filter^#(@p, @l) -> filter#1^#(@l, @p)
-->_1 filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs)) :9
-->_1 filter#1^#(nil(), @p) -> c_10() :10
9: filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
-->_1 filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p)) :11
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :8
10: filter#1^#(nil(), @p) -> c_10()
11: filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
-->_3 mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y)) :14
-->_1 filter#3^#(#true(), @x, @xs') -> c_14() :13
-->_1 filter#3^#(#false(), @x, @xs') -> c_13() :12
-->_2 #equal^#(@x, @y) -> #eq^#(@x, @y) :1
12: filter#3^#(#false(), @x, @xs') -> c_13()
13: filter#3^#(#true(), @x, @xs') -> c_14()
14: mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
-->_3 div^#(@x, @y) -> #div^#(@x, @y) :4
-->_1 -^#(@x, @y) -> #sub^#(@x, @y) :3
-->_2 *^#(@x, @y) -> #mult^#(@x, @y) :2
15: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :24
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :24
-->_1 #and^#(#true(), #true()) -> c_68() :55
-->_1 #and^#(#true(), #false()) -> c_67() :54
-->_1 #and^#(#false(), #true()) -> c_66() :53
-->_1 #and^#(#false(), #false()) -> c_65() :52
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_29() :29
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_29() :29
-->_3 #eq^#(#pos(@x), #0()) -> c_28() :28
-->_2 #eq^#(#pos(@x), #0()) -> c_28() :28
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_27() :27
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_27() :27
-->_3 #eq^#(#neg(@x), #0()) -> c_25() :25
-->_2 #eq^#(#neg(@x), #0()) -> c_25() :25
-->_3 #eq^#(#s(@x), #0()) -> c_23() :23
-->_2 #eq^#(#s(@x), #0()) -> c_23() :23
-->_3 #eq^#(#0(), #pos(@y)) -> c_22() :22
-->_2 #eq^#(#0(), #pos(@y)) -> c_22() :22
-->_3 #eq^#(#0(), #neg(@y)) -> c_21() :21
-->_2 #eq^#(#0(), #neg(@y)) -> c_21() :21
-->_3 #eq^#(#0(), #s(@y)) -> c_20() :20
-->_2 #eq^#(#0(), #s(@y)) -> c_20() :20
-->_3 #eq^#(#0(), #0()) -> c_19() :19
-->_2 #eq^#(#0(), #0()) -> c_19() :19
-->_3 #eq^#(nil(), nil()) -> c_18() :18
-->_2 #eq^#(nil(), nil()) -> c_18() :18
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :17
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :17
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :16
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :16
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :15
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :15
16: #eq^#(::(@x_1, @x_2), nil()) -> c_16()
17: #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
18: #eq^#(nil(), nil()) -> c_18()
19: #eq^#(#0(), #0()) -> c_19()
20: #eq^#(#0(), #s(@y)) -> c_20()
21: #eq^#(#0(), #neg(@y)) -> c_21()
22: #eq^#(#0(), #pos(@y)) -> c_22()
23: #eq^#(#s(@x), #0()) -> c_23()
24: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :27
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :25
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(#s(@x), #0()) -> c_23() :23
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :22
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :21
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :20
-->_1 #eq^#(#0(), #0()) -> c_19() :19
-->_1 #eq^#(nil(), nil()) -> c_18() :18
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :17
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :16
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :15
25: #eq^#(#neg(@x), #0()) -> c_25()
26: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :27
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :25
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(#s(@x), #0()) -> c_23() :23
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :22
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :21
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :20
-->_1 #eq^#(#0(), #0()) -> c_19() :19
-->_1 #eq^#(nil(), nil()) -> c_18() :18
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :17
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :16
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :15
27: #eq^#(#neg(@x), #pos(@y)) -> c_27()
28: #eq^#(#pos(@x), #0()) -> c_28()
29: #eq^#(#pos(@x), #neg(@y)) -> c_29()
30: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :27
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :25
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(#s(@x), #0()) -> c_23() :23
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :22
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :21
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :20
-->_1 #eq^#(#0(), #0()) -> c_19() :19
-->_1 #eq^#(nil(), nil()) -> c_18() :18
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :17
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :16
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :15
31: #mult^#(#0(), #0()) -> c_31()
32: #mult^#(#0(), #neg(@y)) -> c_32()
33: #mult^#(#0(), #pos(@y)) -> c_33()
34: #mult^#(#neg(@x), #0()) -> c_34()
35: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
36: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
37: #mult^#(#pos(@x), #0()) -> c_37()
38: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
39: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
40: #sub^#(@x, #0()) -> c_40()
41: #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :60
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :59
-->_1 #add^#(#0(), @y) -> c_52() :58
42: #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :60
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :59
-->_1 #add^#(#0(), @y) -> c_52() :58
43: #div^#(#0(), #0()) -> c_43()
44: #div^#(#0(), #neg(@y)) -> c_44()
45: #div^#(#0(), #pos(@y)) -> c_45()
46: #div^#(#neg(@x), #0()) -> c_46()
47: #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
48: #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
49: #div^#(#pos(@x), #0()) -> c_49()
50: #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
51: #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
52: #and^#(#false(), #false()) -> c_65()
53: #and^#(#false(), #true()) -> c_66()
54: #and^#(#true(), #false()) -> c_67()
55: #and^#(#true(), #true()) -> c_68()
56: #natmult^#(#0(), @y) -> c_71()
57: #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_2 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_2 #natmult^#(#0(), @y) -> c_71() :56
58: #add^#(#0(), @y) -> c_52()
59: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_60() :68
-->_1 #pred^#(#pos(#s(#0()))) -> c_59() :67
-->_1 #pred^#(#neg(#s(@x))) -> c_58() :66
-->_1 #pred^#(#0()) -> c_57() :65
60: #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_60() :68
-->_1 #pred^#(#pos(#s(#0()))) -> c_59() :67
-->_1 #pred^#(#neg(#s(@x))) -> c_58() :66
-->_1 #pred^#(#0()) -> c_57() :65
61: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_64() :72
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_63() :71
-->_1 #succ^#(#neg(#s(#0()))) -> c_62() :70
-->_1 #succ^#(#0()) -> c_61() :69
62: #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_64() :72
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_63() :71
-->_1 #succ^#(#neg(#s(#0()))) -> c_62() :70
-->_1 #succ^#(#0()) -> c_61() :69
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
63: #natdiv^#(#0(), #0()) -> c_69()
64: #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
-->_2 #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) :74
-->_2 #natsub^#(@x, #0()) -> c_73() :73
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
65: #pred^#(#0()) -> c_57()
66: #pred^#(#neg(#s(@x))) -> c_58()
67: #pred^#(#pos(#s(#0()))) -> c_59()
68: #pred^#(#pos(#s(#s(@x)))) -> c_60()
69: #succ^#(#0()) -> c_61()
70: #succ^#(#neg(#s(#0()))) -> c_62()
71: #succ^#(#neg(#s(#s(@x)))) -> c_63()
72: #succ^#(#pos(#s(@x))) -> c_64()
73: #natsub^#(@x, #0()) -> c_73()
74: #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y)
-->_1 #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) :74
-->_1 #natsub^#(@x, #0()) -> c_73() :73
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {7} and add Pre({7}) = {5} to the strict component.
- We remove {10} and add Pre({10}) = {8} to the strict component.
- We remove {12} and add Pre({12}) = {11} to the strict component.
- We remove {13} and add Pre({13}) = {11} to the strict component.
- We remove {4} and add Pre({4}) = {14} to the strict component.
- We remove {3} and add Pre({3}) = {14} to the strict component.
- We remove {2} and add Pre({2}) = {14} to the strict component.
- We remove {1} and add Pre({1}) = {11} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
, filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
, mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y)) }
Weak DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_16()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
, #eq^#(nil(), nil()) -> c_18()
, #eq^#(#0(), #0()) -> c_19()
, #eq^#(#0(), #s(@y)) -> c_20()
, #eq^#(#0(), #neg(@y)) -> c_21()
, #eq^#(#0(), #pos(@y)) -> c_22()
, #eq^#(#s(@x), #0()) -> c_23()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #0()) -> c_25()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_27()
, #eq^#(#pos(@x), #0()) -> c_28()
, #eq^#(#pos(@x), #neg(@y)) -> c_29()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, *^#(@x, @y) -> #mult^#(@x, @y)
, #mult^#(#0(), #0()) -> c_31()
, #mult^#(#0(), #neg(@y)) -> c_32()
, #mult^#(#0(), #pos(@y)) -> c_33()
, #mult^#(#neg(@x), #0()) -> c_34()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_37()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, -^#(@x, @y) -> #sub^#(@x, @y)
, #sub^#(@x, #0()) -> c_40()
, #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()) -> c_43()
, #div^#(#0(), #neg(@y)) -> c_44()
, #div^#(#0(), #pos(@y)) -> c_45()
, #div^#(#neg(@x), #0()) -> c_46()
, #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #0()) -> c_49()
, #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, eratos#1^#(nil()) -> c_7()
, filter#1^#(nil(), @p) -> c_10()
, filter#3^#(#false(), @x, @xs') -> c_13()
, filter#3^#(#true(), @x, @xs') -> c_14()
, #and^#(#false(), #false()) -> c_65()
, #and^#(#false(), #true()) -> c_66()
, #and^#(#true(), #false()) -> c_67()
, #and^#(#true(), #true()) -> c_68()
, #natmult^#(#0(), @y) -> c_71()
, #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #add^#(#0(), @y) -> c_52()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natdiv^#(#0(), #0()) -> c_69()
, #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#0()) -> c_57()
, #pred^#(#neg(#s(@x))) -> c_58()
, #pred^#(#pos(#s(#0()))) -> c_59()
, #pred^#(#pos(#s(#s(@x)))) -> c_60()
, #succ^#(#0()) -> c_61()
, #succ^#(#neg(#s(#0()))) -> c_62()
, #succ^#(#neg(#s(#s(@x)))) -> c_63()
, #succ^#(#pos(#s(@x))) -> c_64()
, #natsub^#(@x, #0()) -> c_73()
, #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :2
-->_1 eratos#1^#(nil()) -> c_7() :48
2: eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
3: filter^#(@p, @l) -> filter#1^#(@l, @p)
-->_1 filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs)) :4
-->_1 filter#1^#(nil(), @p) -> c_10() :49
4: filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
-->_1 filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p)) :5
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
5: filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
-->_2 #equal^#(@x, @y) -> #eq^#(@x, @y) :7
-->_3 mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y)) :6
-->_1 filter#3^#(#true(), @x, @xs') -> c_14() :51
-->_1 filter#3^#(#false(), @x, @xs') -> c_13() :50
6: mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
-->_3 div^#(@x, @y) -> #div^#(@x, @y) :38
-->_1 -^#(@x, @y) -> #sub^#(@x, @y) :34
-->_2 *^#(@x, @y) -> #mult^#(@x, @y) :24
7: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :19
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :17
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :8
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :22
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :21
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :20
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :18
-->_1 #eq^#(#s(@x), #0()) -> c_23() :16
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :15
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :14
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :13
-->_1 #eq^#(#0(), #0()) -> c_19() :12
-->_1 #eq^#(nil(), nil()) -> c_18() :11
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :10
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :9
8: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :23
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :23
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :19
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :19
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :17
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :17
-->_1 #and^#(#true(), #true()) -> c_68() :55
-->_1 #and^#(#true(), #false()) -> c_67() :54
-->_1 #and^#(#false(), #true()) -> c_66() :53
-->_1 #and^#(#false(), #false()) -> c_65() :52
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_29() :22
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_29() :22
-->_3 #eq^#(#pos(@x), #0()) -> c_28() :21
-->_2 #eq^#(#pos(@x), #0()) -> c_28() :21
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_27() :20
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_27() :20
-->_3 #eq^#(#neg(@x), #0()) -> c_25() :18
-->_2 #eq^#(#neg(@x), #0()) -> c_25() :18
-->_3 #eq^#(#s(@x), #0()) -> c_23() :16
-->_2 #eq^#(#s(@x), #0()) -> c_23() :16
-->_3 #eq^#(#0(), #pos(@y)) -> c_22() :15
-->_2 #eq^#(#0(), #pos(@y)) -> c_22() :15
-->_3 #eq^#(#0(), #neg(@y)) -> c_21() :14
-->_2 #eq^#(#0(), #neg(@y)) -> c_21() :14
-->_3 #eq^#(#0(), #s(@y)) -> c_20() :13
-->_2 #eq^#(#0(), #s(@y)) -> c_20() :13
-->_3 #eq^#(#0(), #0()) -> c_19() :12
-->_2 #eq^#(#0(), #0()) -> c_19() :12
-->_3 #eq^#(nil(), nil()) -> c_18() :11
-->_2 #eq^#(nil(), nil()) -> c_18() :11
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :10
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :10
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :9
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :9
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :8
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :8
9: #eq^#(::(@x_1, @x_2), nil()) -> c_16()
10: #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
11: #eq^#(nil(), nil()) -> c_18()
12: #eq^#(#0(), #0()) -> c_19()
13: #eq^#(#0(), #s(@y)) -> c_20()
14: #eq^#(#0(), #neg(@y)) -> c_21()
15: #eq^#(#0(), #pos(@y)) -> c_22()
16: #eq^#(#s(@x), #0()) -> c_23()
17: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :19
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :22
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :21
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :20
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :18
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :17
-->_1 #eq^#(#s(@x), #0()) -> c_23() :16
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :15
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :14
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :13
-->_1 #eq^#(#0(), #0()) -> c_19() :12
-->_1 #eq^#(nil(), nil()) -> c_18() :11
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :10
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :9
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :8
18: #eq^#(#neg(@x), #0()) -> c_25()
19: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :22
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :21
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :20
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :19
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :18
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :17
-->_1 #eq^#(#s(@x), #0()) -> c_23() :16
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :15
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :14
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :13
-->_1 #eq^#(#0(), #0()) -> c_19() :12
-->_1 #eq^#(nil(), nil()) -> c_18() :11
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :10
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :9
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :8
20: #eq^#(#neg(@x), #pos(@y)) -> c_27()
21: #eq^#(#pos(@x), #0()) -> c_28()
22: #eq^#(#pos(@x), #neg(@y)) -> c_29()
23: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :22
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :21
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :20
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :19
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :18
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :17
-->_1 #eq^#(#s(@x), #0()) -> c_23() :16
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :15
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :14
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :13
-->_1 #eq^#(#0(), #0()) -> c_19() :12
-->_1 #eq^#(nil(), nil()) -> c_18() :11
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :10
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :9
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :8
24: *^#(@x, @y) -> #mult^#(@x, @y)
-->_1 #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y) :33
-->_1 #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y) :32
-->_1 #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y) :30
-->_1 #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y) :29
-->_1 #mult^#(#pos(@x), #0()) -> c_37() :31
-->_1 #mult^#(#neg(@x), #0()) -> c_34() :28
-->_1 #mult^#(#0(), #pos(@y)) -> c_33() :27
-->_1 #mult^#(#0(), #neg(@y)) -> c_32() :26
-->_1 #mult^#(#0(), #0()) -> c_31() :25
25: #mult^#(#0(), #0()) -> c_31()
26: #mult^#(#0(), #neg(@y)) -> c_32()
27: #mult^#(#0(), #pos(@y)) -> c_33()
28: #mult^#(#neg(@x), #0()) -> c_34()
29: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
30: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
31: #mult^#(#pos(@x), #0()) -> c_37()
32: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
33: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
34: -^#(@x, @y) -> #sub^#(@x, @y)
-->_1 #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y)) :37
-->_1 #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y)) :36
-->_1 #sub^#(@x, #0()) -> c_40() :35
35: #sub^#(@x, #0()) -> c_40()
36: #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :60
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :59
-->_1 #add^#(#0(), @y) -> c_52() :58
37: #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :60
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :59
-->_1 #add^#(#0(), @y) -> c_52() :58
38: div^#(@x, @y) -> #div^#(@x, @y)
-->_1 #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y) :47
-->_1 #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y) :46
-->_1 #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y) :44
-->_1 #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y) :43
-->_1 #div^#(#pos(@x), #0()) -> c_49() :45
-->_1 #div^#(#neg(@x), #0()) -> c_46() :42
-->_1 #div^#(#0(), #pos(@y)) -> c_45() :41
-->_1 #div^#(#0(), #neg(@y)) -> c_44() :40
-->_1 #div^#(#0(), #0()) -> c_43() :39
39: #div^#(#0(), #0()) -> c_43()
40: #div^#(#0(), #neg(@y)) -> c_44()
41: #div^#(#0(), #pos(@y)) -> c_45()
42: #div^#(#neg(@x), #0()) -> c_46()
43: #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
44: #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
45: #div^#(#pos(@x), #0()) -> c_49()
46: #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
47: #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
48: eratos#1^#(nil()) -> c_7()
49: filter#1^#(nil(), @p) -> c_10()
50: filter#3^#(#false(), @x, @xs') -> c_13()
51: filter#3^#(#true(), @x, @xs') -> c_14()
52: #and^#(#false(), #false()) -> c_65()
53: #and^#(#false(), #true()) -> c_66()
54: #and^#(#true(), #false()) -> c_67()
55: #and^#(#true(), #true()) -> c_68()
56: #natmult^#(#0(), @y) -> c_71()
57: #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_2 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_2 #natmult^#(#0(), @y) -> c_71() :56
58: #add^#(#0(), @y) -> c_52()
59: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_60() :68
-->_1 #pred^#(#pos(#s(#0()))) -> c_59() :67
-->_1 #pred^#(#neg(#s(@x))) -> c_58() :66
-->_1 #pred^#(#0()) -> c_57() :65
60: #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_60() :68
-->_1 #pred^#(#pos(#s(#0()))) -> c_59() :67
-->_1 #pred^#(#neg(#s(@x))) -> c_58() :66
-->_1 #pred^#(#0()) -> c_57() :65
61: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_64() :72
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_63() :71
-->_1 #succ^#(#neg(#s(#0()))) -> c_62() :70
-->_1 #succ^#(#0()) -> c_61() :69
62: #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_64() :72
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_63() :71
-->_1 #succ^#(#neg(#s(#0()))) -> c_62() :70
-->_1 #succ^#(#0()) -> c_61() :69
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
63: #natdiv^#(#0(), #0()) -> c_69()
64: #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
-->_2 #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) :74
-->_2 #natsub^#(@x, #0()) -> c_73() :73
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
65: #pred^#(#0()) -> c_57()
66: #pred^#(#neg(#s(@x))) -> c_58()
67: #pred^#(#pos(#s(#0()))) -> c_59()
68: #pred^#(#pos(#s(#s(@x)))) -> c_60()
69: #succ^#(#0()) -> c_61()
70: #succ^#(#neg(#s(#0()))) -> c_62()
71: #succ^#(#neg(#s(#s(@x)))) -> c_63()
72: #succ^#(#pos(#s(@x))) -> c_64()
73: #natsub^#(@x, #0()) -> c_73()
74: #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y)
-->_1 #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) :74
-->_1 #natsub^#(@x, #0()) -> c_73() :73
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {6} and add Pre({6}) = {5} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
, filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p)) }
Weak DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_16()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
, #eq^#(nil(), nil()) -> c_18()
, #eq^#(#0(), #0()) -> c_19()
, #eq^#(#0(), #s(@y)) -> c_20()
, #eq^#(#0(), #neg(@y)) -> c_21()
, #eq^#(#0(), #pos(@y)) -> c_22()
, #eq^#(#s(@x), #0()) -> c_23()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #0()) -> c_25()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_27()
, #eq^#(#pos(@x), #0()) -> c_28()
, #eq^#(#pos(@x), #neg(@y)) -> c_29()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, *^#(@x, @y) -> #mult^#(@x, @y)
, #mult^#(#0(), #0()) -> c_31()
, #mult^#(#0(), #neg(@y)) -> c_32()
, #mult^#(#0(), #pos(@y)) -> c_33()
, #mult^#(#neg(@x), #0()) -> c_34()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_37()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, -^#(@x, @y) -> #sub^#(@x, @y)
, #sub^#(@x, #0()) -> c_40()
, #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()) -> c_43()
, #div^#(#0(), #neg(@y)) -> c_44()
, #div^#(#0(), #pos(@y)) -> c_45()
, #div^#(#neg(@x), #0()) -> c_46()
, #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #0()) -> c_49()
, #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, eratos#1^#(nil()) -> c_7()
, filter#1^#(nil(), @p) -> c_10()
, filter#3^#(#false(), @x, @xs') -> c_13()
, filter#3^#(#true(), @x, @xs') -> c_14()
, mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, #and^#(#false(), #false()) -> c_65()
, #and^#(#false(), #true()) -> c_66()
, #and^#(#true(), #false()) -> c_67()
, #and^#(#true(), #true()) -> c_68()
, #natmult^#(#0(), @y) -> c_71()
, #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #add^#(#0(), @y) -> c_52()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natdiv^#(#0(), #0()) -> c_69()
, #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#0()) -> c_57()
, #pred^#(#neg(#s(@x))) -> c_58()
, #pred^#(#pos(#s(#0()))) -> c_59()
, #pred^#(#pos(#s(#s(@x)))) -> c_60()
, #succ^#(#0()) -> c_61()
, #succ^#(#neg(#s(#0()))) -> c_62()
, #succ^#(#neg(#s(#s(@x)))) -> c_63()
, #succ^#(#pos(#s(@x))) -> c_64()
, #natsub^#(@x, #0()) -> c_73()
, #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :2
-->_1 eratos#1^#(nil()) -> c_7() :47
2: eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
3: filter^#(@p, @l) -> filter#1^#(@l, @p)
-->_1 filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs)) :4
-->_1 filter#1^#(nil(), @p) -> c_10() :48
4: filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
-->_1 filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p)) :5
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
5: filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
-->_3 mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y)) :51
-->_2 #equal^#(@x, @y) -> #eq^#(@x, @y) :6
-->_1 filter#3^#(#true(), @x, @xs') -> c_14() :50
-->_1 filter#3^#(#false(), @x, @xs') -> c_13() :49
6: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :22
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :18
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :16
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :7
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :21
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :20
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :19
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :17
-->_1 #eq^#(#s(@x), #0()) -> c_23() :15
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :14
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :13
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :12
-->_1 #eq^#(#0(), #0()) -> c_19() :11
-->_1 #eq^#(nil(), nil()) -> c_18() :10
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :9
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :8
7: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :22
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :22
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :18
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :18
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :16
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :16
-->_1 #and^#(#true(), #true()) -> c_68() :55
-->_1 #and^#(#true(), #false()) -> c_67() :54
-->_1 #and^#(#false(), #true()) -> c_66() :53
-->_1 #and^#(#false(), #false()) -> c_65() :52
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_29() :21
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_29() :21
-->_3 #eq^#(#pos(@x), #0()) -> c_28() :20
-->_2 #eq^#(#pos(@x), #0()) -> c_28() :20
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_27() :19
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_27() :19
-->_3 #eq^#(#neg(@x), #0()) -> c_25() :17
-->_2 #eq^#(#neg(@x), #0()) -> c_25() :17
-->_3 #eq^#(#s(@x), #0()) -> c_23() :15
-->_2 #eq^#(#s(@x), #0()) -> c_23() :15
-->_3 #eq^#(#0(), #pos(@y)) -> c_22() :14
-->_2 #eq^#(#0(), #pos(@y)) -> c_22() :14
-->_3 #eq^#(#0(), #neg(@y)) -> c_21() :13
-->_2 #eq^#(#0(), #neg(@y)) -> c_21() :13
-->_3 #eq^#(#0(), #s(@y)) -> c_20() :12
-->_2 #eq^#(#0(), #s(@y)) -> c_20() :12
-->_3 #eq^#(#0(), #0()) -> c_19() :11
-->_2 #eq^#(#0(), #0()) -> c_19() :11
-->_3 #eq^#(nil(), nil()) -> c_18() :10
-->_2 #eq^#(nil(), nil()) -> c_18() :10
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :9
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :9
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :8
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :8
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :7
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :7
8: #eq^#(::(@x_1, @x_2), nil()) -> c_16()
9: #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
10: #eq^#(nil(), nil()) -> c_18()
11: #eq^#(#0(), #0()) -> c_19()
12: #eq^#(#0(), #s(@y)) -> c_20()
13: #eq^#(#0(), #neg(@y)) -> c_21()
14: #eq^#(#0(), #pos(@y)) -> c_22()
15: #eq^#(#s(@x), #0()) -> c_23()
16: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :22
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :18
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :21
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :20
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :19
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :17
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :16
-->_1 #eq^#(#s(@x), #0()) -> c_23() :15
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :14
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :13
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :12
-->_1 #eq^#(#0(), #0()) -> c_19() :11
-->_1 #eq^#(nil(), nil()) -> c_18() :10
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :9
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :8
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :7
17: #eq^#(#neg(@x), #0()) -> c_25()
18: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :22
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :21
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :20
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :19
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :18
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :17
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :16
-->_1 #eq^#(#s(@x), #0()) -> c_23() :15
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :14
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :13
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :12
-->_1 #eq^#(#0(), #0()) -> c_19() :11
-->_1 #eq^#(nil(), nil()) -> c_18() :10
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :9
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :8
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :7
19: #eq^#(#neg(@x), #pos(@y)) -> c_27()
20: #eq^#(#pos(@x), #0()) -> c_28()
21: #eq^#(#pos(@x), #neg(@y)) -> c_29()
22: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :22
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :21
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :20
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :19
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :18
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :17
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :16
-->_1 #eq^#(#s(@x), #0()) -> c_23() :15
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :14
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :13
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :12
-->_1 #eq^#(#0(), #0()) -> c_19() :11
-->_1 #eq^#(nil(), nil()) -> c_18() :10
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :9
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :8
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :7
23: *^#(@x, @y) -> #mult^#(@x, @y)
-->_1 #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y) :32
-->_1 #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y) :31
-->_1 #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y) :29
-->_1 #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y) :28
-->_1 #mult^#(#pos(@x), #0()) -> c_37() :30
-->_1 #mult^#(#neg(@x), #0()) -> c_34() :27
-->_1 #mult^#(#0(), #pos(@y)) -> c_33() :26
-->_1 #mult^#(#0(), #neg(@y)) -> c_32() :25
-->_1 #mult^#(#0(), #0()) -> c_31() :24
24: #mult^#(#0(), #0()) -> c_31()
25: #mult^#(#0(), #neg(@y)) -> c_32()
26: #mult^#(#0(), #pos(@y)) -> c_33()
27: #mult^#(#neg(@x), #0()) -> c_34()
28: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
29: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
30: #mult^#(#pos(@x), #0()) -> c_37()
31: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
32: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
33: -^#(@x, @y) -> #sub^#(@x, @y)
-->_1 #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y)) :36
-->_1 #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y)) :35
-->_1 #sub^#(@x, #0()) -> c_40() :34
34: #sub^#(@x, #0()) -> c_40()
35: #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :60
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :59
-->_1 #add^#(#0(), @y) -> c_52() :58
36: #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :60
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :59
-->_1 #add^#(#0(), @y) -> c_52() :58
37: div^#(@x, @y) -> #div^#(@x, @y)
-->_1 #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y) :46
-->_1 #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y) :45
-->_1 #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y) :43
-->_1 #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y) :42
-->_1 #div^#(#pos(@x), #0()) -> c_49() :44
-->_1 #div^#(#neg(@x), #0()) -> c_46() :41
-->_1 #div^#(#0(), #pos(@y)) -> c_45() :40
-->_1 #div^#(#0(), #neg(@y)) -> c_44() :39
-->_1 #div^#(#0(), #0()) -> c_43() :38
38: #div^#(#0(), #0()) -> c_43()
39: #div^#(#0(), #neg(@y)) -> c_44()
40: #div^#(#0(), #pos(@y)) -> c_45()
41: #div^#(#neg(@x), #0()) -> c_46()
42: #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
43: #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
44: #div^#(#pos(@x), #0()) -> c_49()
45: #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
46: #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
47: eratos#1^#(nil()) -> c_7()
48: filter#1^#(nil(), @p) -> c_10()
49: filter#3^#(#false(), @x, @xs') -> c_13()
50: filter#3^#(#true(), @x, @xs') -> c_14()
51: mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
-->_3 div^#(@x, @y) -> #div^#(@x, @y) :37
-->_1 -^#(@x, @y) -> #sub^#(@x, @y) :33
-->_2 *^#(@x, @y) -> #mult^#(@x, @y) :23
52: #and^#(#false(), #false()) -> c_65()
53: #and^#(#false(), #true()) -> c_66()
54: #and^#(#true(), #false()) -> c_67()
55: #and^#(#true(), #true()) -> c_68()
56: #natmult^#(#0(), @y) -> c_71()
57: #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_2 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_2 #natmult^#(#0(), @y) -> c_71() :56
58: #add^#(#0(), @y) -> c_52()
59: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_60() :68
-->_1 #pred^#(#pos(#s(#0()))) -> c_59() :67
-->_1 #pred^#(#neg(#s(@x))) -> c_58() :66
-->_1 #pred^#(#0()) -> c_57() :65
60: #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_60() :68
-->_1 #pred^#(#pos(#s(#0()))) -> c_59() :67
-->_1 #pred^#(#neg(#s(@x))) -> c_58() :66
-->_1 #pred^#(#0()) -> c_57() :65
61: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_64() :72
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_63() :71
-->_1 #succ^#(#neg(#s(#0()))) -> c_62() :70
-->_1 #succ^#(#0()) -> c_61() :69
62: #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_64() :72
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_63() :71
-->_1 #succ^#(#neg(#s(#0()))) -> c_62() :70
-->_1 #succ^#(#0()) -> c_61() :69
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
63: #natdiv^#(#0(), #0()) -> c_69()
64: #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
-->_2 #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) :74
-->_2 #natsub^#(@x, #0()) -> c_73() :73
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
65: #pred^#(#0()) -> c_57()
66: #pred^#(#neg(#s(@x))) -> c_58()
67: #pred^#(#pos(#s(#0()))) -> c_59()
68: #pred^#(#pos(#s(#s(@x)))) -> c_60()
69: #succ^#(#0()) -> c_61()
70: #succ^#(#neg(#s(#0()))) -> c_62()
71: #succ^#(#neg(#s(#s(@x)))) -> c_63()
72: #succ^#(#pos(#s(@x))) -> c_64()
73: #natsub^#(@x, #0()) -> c_73()
74: #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y)
-->_1 #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) :74
-->_1 #natsub^#(@x, #0()) -> c_73() :73
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {4} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs)) }
Weak DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_16()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
, #eq^#(nil(), nil()) -> c_18()
, #eq^#(#0(), #0()) -> c_19()
, #eq^#(#0(), #s(@y)) -> c_20()
, #eq^#(#0(), #neg(@y)) -> c_21()
, #eq^#(#0(), #pos(@y)) -> c_22()
, #eq^#(#s(@x), #0()) -> c_23()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #0()) -> c_25()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_27()
, #eq^#(#pos(@x), #0()) -> c_28()
, #eq^#(#pos(@x), #neg(@y)) -> c_29()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, *^#(@x, @y) -> #mult^#(@x, @y)
, #mult^#(#0(), #0()) -> c_31()
, #mult^#(#0(), #neg(@y)) -> c_32()
, #mult^#(#0(), #pos(@y)) -> c_33()
, #mult^#(#neg(@x), #0()) -> c_34()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_37()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, -^#(@x, @y) -> #sub^#(@x, @y)
, #sub^#(@x, #0()) -> c_40()
, #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()) -> c_43()
, #div^#(#0(), #neg(@y)) -> c_44()
, #div^#(#0(), #pos(@y)) -> c_45()
, #div^#(#neg(@x), #0()) -> c_46()
, #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #0()) -> c_49()
, #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, eratos#1^#(nil()) -> c_7()
, filter#1^#(nil(), @p) -> c_10()
, filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
, filter#3^#(#false(), @x, @xs') -> c_13()
, filter#3^#(#true(), @x, @xs') -> c_14()
, mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, #and^#(#false(), #false()) -> c_65()
, #and^#(#false(), #true()) -> c_66()
, #and^#(#true(), #false()) -> c_67()
, #and^#(#true(), #true()) -> c_68()
, #natmult^#(#0(), @y) -> c_71()
, #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #add^#(#0(), @y) -> c_52()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natdiv^#(#0(), #0()) -> c_69()
, #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#0()) -> c_57()
, #pred^#(#neg(#s(@x))) -> c_58()
, #pred^#(#pos(#s(#0()))) -> c_59()
, #pred^#(#pos(#s(#s(@x)))) -> c_60()
, #succ^#(#0()) -> c_61()
, #succ^#(#neg(#s(#0()))) -> c_62()
, #succ^#(#neg(#s(#s(@x)))) -> c_63()
, #succ^#(#pos(#s(@x))) -> c_64()
, #natsub^#(@x, #0()) -> c_73()
, #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the the dependency graph
->1:{1,2}
|
|->3:{3,4}
| |
| |->4:{47} Weak SCC
| |
| `->5:{48} Weak SCC
| |
| |->6:{5} Weak SCC
| | |
| | |->12:{7} Weak SCC
| | |
| | |->13:{8} Weak SCC
| | |
| | |->14:{9} Weak SCC
| | |
| | |->15:{10} Weak SCC
| | |
| | |->16:{11} Weak SCC
| | |
| | |->17:{12} Weak SCC
| | |
| | |->18:{13} Weak SCC
| | |
| | |->19:{14} Weak SCC
| | |
| | |->20:{16} Weak SCC
| | |
| | |->21:{18} Weak SCC
| | |
| | |->22:{19} Weak SCC
| | |
| | |->23:{20} Weak SCC
| | |
| | `->7:{21,17,15,6} Weak SCC
| | |
| | |->12:{7} Weak SCC
| | |
| | |->13:{8} Weak SCC
| | |
| | |->14:{9} Weak SCC
| | |
| | |->15:{10} Weak SCC
| | |
| | |->16:{11} Weak SCC
| | |
| | |->17:{12} Weak SCC
| | |
| | |->18:{13} Weak SCC
| | |
| | |->19:{14} Weak SCC
| | |
| | |->20:{16} Weak SCC
| | |
| | |->21:{18} Weak SCC
| | |
| | |->22:{19} Weak SCC
| | |
| | |->23:{20} Weak SCC
| | |
| | |->8:{52} Weak SCC
| | |
| | |->9:{53} Weak SCC
| | |
| | |->10:{54} Weak SCC
| | |
| | `->11:{55} Weak SCC
| |
| |->24:{49} Weak SCC
| |
| |->25:{50} Weak SCC
| |
| `->26:{51} Weak SCC
| |
| |->27:{22} Weak SCC
| | |
| | |->28:{23} Weak SCC
| | |
| | |->29:{24} Weak SCC
| | |
| | |->30:{25} Weak SCC
| | |
| | |->31:{26} Weak SCC
| | |
| | |->33:{27} Weak SCC
| | | |
| | | |->38:{56} Weak SCC
| | | |
| | | `->37:{57} Weak SCC
| | | |
| | | |->38:{56} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69} Weak SCC
| | | | |
| | | | |->53:{70} Weak SCC
| | | | |
| | | | |->54:{71} Weak SCC
| | | | |
| | | | `->55:{72} Weak SCC
| | | |
| | | `->50:{62} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69}
Weak SCC
| | | | |
| | | | |->53:{70}
Weak SCC
| | | | |
| | | | |->54:{71}
Weak SCC
| | | | |
| | | | `->55:{72}
Weak SCC
| | | |
| | | |->52:{69} Weak SCC
| | | |
| | | |->53:{70} Weak SCC
| | | |
| | | |->54:{71} Weak SCC
| | | |
| | | `->55:{72} Weak SCC
| | |
| | |->34:{28} Weak SCC
| | | |
| | | |->38:{56} Weak SCC
| | | |
| | | `->37:{57} Weak SCC
| | | |
| | | |->38:{56} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69} Weak SCC
| | | | |
| | | | |->53:{70} Weak SCC
| | | | |
| | | | |->54:{71} Weak SCC
| | | | |
| | | | `->55:{72} Weak SCC
| | | |
| | | `->50:{62} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69}
Weak SCC
| | | | |
| | | | |->53:{70}
Weak SCC
| | | | |
| | | | |->54:{71}
Weak SCC
| | | | |
| | | | `->55:{72}
Weak SCC
| | | |
| | | |->52:{69} Weak SCC
| | | |
| | | |->53:{70} Weak SCC
| | | |
| | | |->54:{71} Weak SCC
| | | |
| | | `->55:{72} Weak SCC
| | |
| | |->32:{29} Weak SCC
| | |
| | |->35:{30} Weak SCC
| | | |
| | | |->38:{56} Weak SCC
| | | |
| | | `->37:{57} Weak SCC
| | | |
| | | |->38:{56} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69} Weak SCC
| | | | |
| | | | |->53:{70} Weak SCC
| | | | |
| | | | |->54:{71} Weak SCC
| | | | |
| | | | `->55:{72} Weak SCC
| | | |
| | | `->50:{62} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69}
Weak SCC
| | | | |
| | | | |->53:{70}
Weak SCC
| | | | |
| | | | |->54:{71}
Weak SCC
| | | | |
| | | | `->55:{72}
Weak SCC
| | | |
| | | |->52:{69} Weak SCC
| | | |
| | | |->53:{70} Weak SCC
| | | |
| | | |->54:{71} Weak SCC
| | | |
| | | `->55:{72} Weak SCC
| | |
| | `->36:{31} Weak SCC
| | |
| | |->38:{56} Weak SCC
| | |
| | `->37:{57} Weak SCC
| | |
| | |->38:{56} Weak SCC
| | |
| | |->51:{61} Weak SCC
| | | |
| | | |->52:{69} Weak SCC
| | | |
| | | |->53:{70} Weak SCC
| | | |
| | | |->54:{71} Weak SCC
| | | |
| | | `->55:{72} Weak SCC
| | |
| | `->50:{62} Weak SCC
| | |
| | |->51:{61} Weak SCC
| | | |
| | | |->52:{69}
Weak SCC
| | | |
| | | |->53:{70}
Weak SCC
| | | |
| | | |->54:{71}
Weak SCC
| | | |
| | | `->55:{72}
Weak SCC
| | |
| | |->52:{69} Weak SCC
| | |
| | |->53:{70} Weak SCC
| | |
| | |->54:{71} Weak SCC
| | |
| | `->55:{72} Weak SCC
| |
| |->39:{32} Weak SCC
| | |
| | |->40:{33} Weak SCC
| | |
| | |->41:{34} Weak SCC
| | | |
| | | |->43:{58} Weak SCC
| | | |
| | | |->44:{59} Weak SCC
| | | | |
| | | | |->46:{65} Weak SCC
| | | | |
| | | | |->47:{66} Weak SCC
| | | | |
| | | | |->48:{67} Weak SCC
| | | | |
| | | | `->49:{68} Weak SCC
| | | |
| | | |->45:{60} Weak SCC
| | | | |
| | | | |->51:{61} Weak SCC
| | | | | |
| | | | | |->52:{69} Weak SCC
| | | | | |
| | | | | |->53:{70} Weak SCC
| | | | | |
| | | | | |->54:{71} Weak SCC
| | | | | |
| | | | | `->55:{72} Weak SCC
| | | | |
| | | | |->50:{62} Weak SCC
| | | | | |
| | | | | |->51:{61} Weak SCC
| | | | | | |
| | | | | | |->52:{69}
Weak SCC
| | | | | | |
| | | | | | |->53:{70}
Weak SCC
| | | | | | |
| | | | | | |->54:{71}
Weak SCC
| | | | | | |
| | | | | | `->55:{72}
Weak SCC
| | | | | |
| | | | | |->52:{69} Weak SCC
| | | | | |
| | | | | |->53:{70} Weak SCC
| | | | | |
| | | | | |->54:{71} Weak SCC
| | | | | |
| | | | | `->55:{72} Weak SCC
| | | | |
| | | | |->46:{65} Weak SCC
| | | | |
| | | | |->47:{66} Weak SCC
| | | | |
| | | | |->48:{67} Weak SCC
| | | | |
| | | | `->49:{68} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69} Weak SCC
| | | | |
| | | | |->53:{70} Weak SCC
| | | | |
| | | | |->54:{71} Weak SCC
| | | | |
| | | | `->55:{72} Weak SCC
| | | |
| | | `->50:{62} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69} Weak SCC
| | | | |
| | | | |->53:{70} Weak SCC
| | | | |
| | | | |->54:{71} Weak SCC
| | | | |
| | | | `->55:{72} Weak SCC
| | | |
| | | |->52:{69} Weak SCC
| | | |
| | | |->53:{70} Weak SCC
| | | |
| | | |->54:{71} Weak SCC
| | | |
| | | `->55:{72} Weak SCC
| | |
| | `->42:{35} Weak SCC
| | |
| | |->43:{58} Weak SCC
| | |
| | |->44:{59} Weak SCC
| | | |
| | | |->46:{65} Weak SCC
| | | |
| | | |->47:{66} Weak SCC
| | | |
| | | |->48:{67} Weak SCC
| | | |
| | | `->49:{68} Weak SCC
| | |
| | |->45:{60} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69} Weak SCC
| | | | |
| | | | |->53:{70} Weak SCC
| | | | |
| | | | |->54:{71} Weak SCC
| | | | |
| | | | `->55:{72} Weak SCC
| | | |
| | | |->50:{62} Weak SCC
| | | | |
| | | | |->51:{61} Weak SCC
| | | | | |
| | | | | |->52:{69}
Weak SCC
| | | | | |
| | | | | |->53:{70}
Weak SCC
| | | | | |
| | | | | |->54:{71}
Weak SCC
| | | | | |
| | | | | `->55:{72}
Weak SCC
| | | | |
| | | | |->52:{69} Weak SCC
| | | | |
| | | | |->53:{70} Weak SCC
| | | | |
| | | | |->54:{71} Weak SCC
| | | | |
| | | | `->55:{72} Weak SCC
| | | |
| | | |->46:{65} Weak SCC
| | | |
| | | |->47:{66} Weak SCC
| | | |
| | | |->48:{67} Weak SCC
| | | |
| | | `->49:{68} Weak SCC
| | |
| | |->51:{61} Weak SCC
| | | |
| | | |->52:{69} Weak SCC
| | | |
| | | |->53:{70} Weak SCC
| | | |
| | | |->54:{71} Weak SCC
| | | |
| | | `->55:{72} Weak SCC
| | |
| | `->50:{62} Weak SCC
| | |
| | |->51:{61} Weak SCC
| | | |
| | | |->52:{69} Weak SCC
| | | |
| | | |->53:{70} Weak SCC
| | | |
| | | |->54:{71} Weak SCC
| | | |
| | | `->55:{72} Weak SCC
| | |
| | |->52:{69} Weak SCC
| | |
| | |->53:{70} Weak SCC
| | |
| | |->54:{71} Weak SCC
| | |
| | `->55:{72} Weak SCC
| |
| `->56:{36} Weak SCC
| |
| |->57:{37} Weak SCC
| |
| |->58:{38} Weak SCC
| |
| |->59:{39} Weak SCC
| |
| |->60:{40} Weak SCC
| |
| |->62:{41} Weak SCC
| | |
| | |->66:{63} Weak SCC
| | |
| | `->67:{64} Weak SCC
| | |
| | |->69:{73} Weak SCC
| | |
| | `->68:{74} Weak SCC
| | |
| | `->69:{73} Weak SCC
| |
| |->63:{42} Weak SCC
| | |
| | |->66:{63} Weak SCC
| | |
| | `->67:{64} Weak SCC
| | |
| | |->69:{73} Weak SCC
| | |
| | `->68:{74} Weak SCC
| | |
| | `->69:{73} Weak SCC
| |
| |->61:{43} Weak SCC
| |
| |->64:{44} Weak SCC
| | |
| | |->66:{63} Weak SCC
| | |
| | `->67:{64} Weak SCC
| | |
| | |->69:{73} Weak SCC
| | |
| | `->68:{74} Weak SCC
| | |
| | `->69:{73} Weak SCC
| |
| `->65:{45} Weak SCC
| |
| |->66:{63} Weak SCC
| |
| `->67:{64} Weak SCC
| |
| |->69:{73} Weak SCC
| |
| `->68:{74} Weak SCC
| |
| `->69:{73} Weak SCC
|
`->2:{46} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: eratos^#(@l) -> eratos#1^#(@l)
, 2: eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, 3: filter^#(@p, @l) -> filter#1^#(@l, @p)
, 4: filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs)) }
Weak DPs:
{ 5: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 6: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 7: #eq^#(::(@x_1, @x_2), nil()) -> c_16()
, 8: #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
, 9: #eq^#(nil(), nil()) -> c_18()
, 10: #eq^#(#0(), #0()) -> c_19()
, 11: #eq^#(#0(), #s(@y)) -> c_20()
, 12: #eq^#(#0(), #neg(@y)) -> c_21()
, 13: #eq^#(#0(), #pos(@y)) -> c_22()
, 14: #eq^#(#s(@x), #0()) -> c_23()
, 15: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 16: #eq^#(#neg(@x), #0()) -> c_25()
, 17: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 18: #eq^#(#neg(@x), #pos(@y)) -> c_27()
, 19: #eq^#(#pos(@x), #0()) -> c_28()
, 20: #eq^#(#pos(@x), #neg(@y)) -> c_29()
, 21: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 22: *^#(@x, @y) -> #mult^#(@x, @y)
, 23: #mult^#(#0(), #0()) -> c_31()
, 24: #mult^#(#0(), #neg(@y)) -> c_32()
, 25: #mult^#(#0(), #pos(@y)) -> c_33()
, 26: #mult^#(#neg(@x), #0()) -> c_34()
, 27: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 28: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 29: #mult^#(#pos(@x), #0()) -> c_37()
, 30: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 31: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 32: -^#(@x, @y) -> #sub^#(@x, @y)
, 33: #sub^#(@x, #0()) -> c_40()
, 34: #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y))
, 35: #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y))
, 36: div^#(@x, @y) -> #div^#(@x, @y)
, 37: #div^#(#0(), #0()) -> c_43()
, 38: #div^#(#0(), #neg(@y)) -> c_44()
, 39: #div^#(#0(), #pos(@y)) -> c_45()
, 40: #div^#(#neg(@x), #0()) -> c_46()
, 41: #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, 42: #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, 43: #div^#(#pos(@x), #0()) -> c_49()
, 44: #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, 45: #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, 46: eratos#1^#(nil()) -> c_7()
, 47: filter#1^#(nil(), @p) -> c_10()
, 48: filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
, 49: filter#3^#(#false(), @x, @xs') -> c_13()
, 50: filter#3^#(#true(), @x, @xs') -> c_14()
, 51: mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, 52: #and^#(#false(), #false()) -> c_65()
, 53: #and^#(#false(), #true()) -> c_66()
, 54: #and^#(#true(), #false()) -> c_67()
, 55: #and^#(#true(), #true()) -> c_68()
, 56: #natmult^#(#0(), @y) -> c_71()
, 57: #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, 58: #add^#(#0(), @y) -> c_52()
, 59: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 60: #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 61: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 62: #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 63: #natdiv^#(#0(), #0()) -> c_69()
, 64: #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, 65: #pred^#(#0()) -> c_57()
, 66: #pred^#(#neg(#s(@x))) -> c_58()
, 67: #pred^#(#pos(#s(#0()))) -> c_59()
, 68: #pred^#(#pos(#s(#s(@x)))) -> c_60()
, 69: #succ^#(#0()) -> c_61()
, 70: #succ^#(#neg(#s(#0()))) -> c_62()
, 71: #succ^#(#neg(#s(#s(@x)))) -> c_63()
, 72: #succ^#(#pos(#s(@x))) -> c_64()
, 73: #natsub^#(@x, #0()) -> c_73()
, 74: #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 46: eratos#1^#(nil()) -> c_7()
, 47: filter#1^#(nil(), @p) -> c_10()
, 48: filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
, 5: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 21: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 17: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 15: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 6: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 52: #and^#(#false(), #false()) -> c_65()
, 53: #and^#(#false(), #true()) -> c_66()
, 54: #and^#(#true(), #false()) -> c_67()
, 55: #and^#(#true(), #true()) -> c_68()
, 7: #eq^#(::(@x_1, @x_2), nil()) -> c_16()
, 8: #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
, 9: #eq^#(nil(), nil()) -> c_18()
, 10: #eq^#(#0(), #0()) -> c_19()
, 11: #eq^#(#0(), #s(@y)) -> c_20()
, 12: #eq^#(#0(), #neg(@y)) -> c_21()
, 13: #eq^#(#0(), #pos(@y)) -> c_22()
, 14: #eq^#(#s(@x), #0()) -> c_23()
, 16: #eq^#(#neg(@x), #0()) -> c_25()
, 18: #eq^#(#neg(@x), #pos(@y)) -> c_27()
, 19: #eq^#(#pos(@x), #0()) -> c_28()
, 20: #eq^#(#pos(@x), #neg(@y)) -> c_29()
, 49: filter#3^#(#false(), @x, @xs') -> c_13()
, 50: filter#3^#(#true(), @x, @xs') -> c_14()
, 51: mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, 22: *^#(@x, @y) -> #mult^#(@x, @y)
, 23: #mult^#(#0(), #0()) -> c_31()
, 24: #mult^#(#0(), #neg(@y)) -> c_32()
, 25: #mult^#(#0(), #pos(@y)) -> c_33()
, 26: #mult^#(#neg(@x), #0()) -> c_34()
, 29: #mult^#(#pos(@x), #0()) -> c_37()
, 27: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 28: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 30: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 31: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 57: #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, 56: #natmult^#(#0(), @y) -> c_71()
, 32: -^#(@x, @y) -> #sub^#(@x, @y)
, 33: #sub^#(@x, #0()) -> c_40()
, 34: #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y))
, 35: #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y))
, 58: #add^#(#0(), @y) -> c_52()
, 59: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 60: #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 65: #pred^#(#0()) -> c_57()
, 66: #pred^#(#neg(#s(@x))) -> c_58()
, 67: #pred^#(#pos(#s(#0()))) -> c_59()
, 68: #pred^#(#pos(#s(#s(@x)))) -> c_60()
, 62: #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 61: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 69: #succ^#(#0()) -> c_61()
, 70: #succ^#(#neg(#s(#0()))) -> c_62()
, 71: #succ^#(#neg(#s(#s(@x)))) -> c_63()
, 72: #succ^#(#pos(#s(@x))) -> c_64()
, 36: div^#(@x, @y) -> #div^#(@x, @y)
, 37: #div^#(#0(), #0()) -> c_43()
, 38: #div^#(#0(), #neg(@y)) -> c_44()
, 39: #div^#(#0(), #pos(@y)) -> c_45()
, 40: #div^#(#neg(@x), #0()) -> c_46()
, 43: #div^#(#pos(@x), #0()) -> c_49()
, 41: #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, 42: #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, 44: #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, 45: #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, 63: #natdiv^#(#0(), #0()) -> c_69()
, 64: #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, 74: #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y)
, 73: #natsub^#(@x, #0()) -> c_73() }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :2
2: eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
3: filter^#(@p, @l) -> filter#1^#(@l, @p)
-->_1 filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs)) :4
4: filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :2
2: eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
3: filter^#(@p, @l) -> filter#1^#(@l, @p)
-->_1 filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs) :4
4: filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs)
-->_1 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter^#(@p, @l) -> filter#1^#(@l, @p) }
Weak DPs: { filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :2
2: eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
3: filter^#(@p, @l) -> filter#1^#(@l, @p)
-->_1 filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs) :4
4: filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs)
-->_1 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, filter^#(@p, @l) -> filter#1^#(@l, @p) }
Weak DPs:
{ eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, filter^#(@p, @l) -> filter#1^#(@l, @p) }
Weak DPs:
{ eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs) }
Remaining Rules (B):
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs: { filter^#(@p, @l) -> filter#1^#(@l, @p) }
Weak DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs))
, eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs)
, filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^1)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :2
2: eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { eratos^#(@l) -> eratos#1^#(@l) }
Weak DPs:
{ eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :2
2: eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { eratos^#(@l) -> eratos#1^#(@l) }
Weak DPs: { eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'matrix interpretation of dimension 1' to
orient following rules strictly.
DPs:
{ 2: eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs)) }
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()
, filter#3(#true(), @x, @xs') -> @xs' }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#equal) = {}, Uargs(#eq) = {}, Uargs(*) = {},
Uargs(#mult) = {}, Uargs(-) = {}, Uargs(#sub) = {},
Uargs(div) = {}, Uargs(#div) = {}, Uargs(::) = {},
Uargs(filter) = {}, Uargs(filter#1) = {}, Uargs(filter#2) = {},
Uargs(mod) = {}, Uargs(filter#3) = {}, Uargs(#add) = {},
Uargs(#s) = {}, Uargs(#neg) = {}, Uargs(#pred) = {},
Uargs(#pos) = {}, Uargs(#succ) = {}, Uargs(#and) = {},
Uargs(#natdiv) = {}, Uargs(#natmult) = {}, Uargs(#natsub) = {},
Uargs(#equal^#) = {}, Uargs(#eq^#) = {}, Uargs(*^#) = {},
Uargs(#mult^#) = {}, Uargs(-^#) = {}, Uargs(#sub^#) = {},
Uargs(div^#) = {}, Uargs(#div^#) = {}, Uargs(eratos^#) = {},
Uargs(eratos#1^#) = {}, Uargs(filter^#) = {},
Uargs(filter#1^#) = {}, Uargs(filter#2^#) = {},
Uargs(filter#3^#) = {}, Uargs(mod^#) = {}, Uargs(#and^#) = {},
Uargs(#natmult^#) = {}, Uargs(#add^#) = {}, Uargs(#natdiv^#) = {},
Uargs(#pred^#) = {}, Uargs(#succ^#) = {}, Uargs(#natsub^#) = {},
Uargs(c_1) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#equal](x1, x2) = [1] x1 + [3] x2 + [3]
[#eq](x1, x2) = [1] x1 + [0]
[*](x1, x2) = [0]
[#mult](x1, x2) = [0]
[-](x1, x2) = [1] x1 + [2] x2 + [0]
[#sub](x1, x2) = [1] x1 + [2] x2 + [0]
[div](x1, x2) = [0]
[#div](x1, x2) = [0]
[::](x1, x2) = [1] x2 + [1]
[filter](x1, x2) = [1] x2 + [0]
[nil] = [0]
[filter#1](x1, x2) = [1] x1 + [0]
[filter#2](x1, x2, x3) = [1] x1 + [1]
[mod](x1, x2) = [2] x1 + [0]
[#0] = [0]
[filter#3](x1, x2, x3) = [1] x3 + [1]
[#false] = [0]
[#true] = [0]
[#add](x1, x2) = [2] x2 + [0]
[#s](x1) = [1] x1 + [0]
[#neg](x1) = [1] x1 + [0]
[#pred](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#succ](x1) = [1] x1 + [0]
[#and](x1, x2) = [0]
[#divByZero] = [0]
[#natdiv](x1, x2) = [0]
[#natmult](x1, x2) = [0]
[#natsub](x1, x2) = [2] x1 + [0]
[#equal^#](x1, x2) = [0]
[#eq^#](x1, x2) = [0]
[*^#](x1, x2) = [0]
[#mult^#](x1, x2) = [0]
[-^#](x1, x2) = [0]
[#sub^#](x1, x2) = [0]
[div^#](x1, x2) = [0]
[#div^#](x1, x2) = [0]
[eratos^#](x1) = [2] x1 + [1]
[eratos#1^#](x1) = [2] x1 + [1]
[filter^#](x1, x2) = [0]
[filter#1^#](x1, x2) = [0]
[filter#2^#](x1, x2, x3) = [0]
[filter#3^#](x1, x2, x3) = [0]
[mod^#](x1, x2) = [0]
[#and^#](x1, x2) = [0]
[#natmult^#](x1, x2) = [0]
[#add^#](x1, x2) = [0]
[#natdiv^#](x1, x2) = [0]
[#pred^#](x1) = [0]
[#succ^#](x1) = [0]
[#natsub^#](x1, x2) = [0]
[c_1](x1, x2) = [0]
[c] = [0]
This order satisfies following ordering constraints
[#equal(@x, @y)] = [1] @x + [3] @y + [3]
> [1] @x + [0]
= [#eq(@x, @y)]
[#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [1] @x_2 + [1]
> [0]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(::(@x_1, @x_2), nil())] = [1] @x_2 + [1]
> [0]
= [#false()]
[#eq(nil(), ::(@y_1, @y_2))] = [0]
>= [0]
= [#false()]
[#eq(nil(), nil())] = [0]
>= [0]
= [#true()]
[#eq(#0(), #0())] = [0]
>= [0]
= [#true()]
[#eq(#0(), #s(@y))] = [0]
>= [0]
= [#false()]
[#eq(#0(), #neg(@y))] = [0]
>= [0]
= [#false()]
[#eq(#0(), #pos(@y))] = [0]
>= [0]
= [#false()]
[#eq(#s(@x), #0())] = [1] @x + [0]
>= [0]
= [#false()]
[#eq(#s(@x), #s(@y))] = [1] @x + [0]
>= [1] @x + [0]
= [#eq(@x, @y)]
[#eq(#neg(@x), #0())] = [1] @x + [0]
>= [0]
= [#false()]
[#eq(#neg(@x), #neg(@y))] = [1] @x + [0]
>= [1] @x + [0]
= [#eq(@x, @y)]
[#eq(#neg(@x), #pos(@y))] = [1] @x + [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #0())] = [1] @x + [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #neg(@y))] = [1] @x + [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #pos(@y))] = [1] @x + [0]
>= [1] @x + [0]
= [#eq(@x, @y)]
[*(@x, @y)] = [0]
>= [0]
= [#mult(@x, @y)]
[#mult(#0(), #0())] = [0]
>= [0]
= [#0()]
[#mult(#0(), #neg(@y))] = [0]
>= [0]
= [#0()]
[#mult(#0(), #pos(@y))] = [0]
>= [0]
= [#0()]
[#mult(#neg(@x), #0())] = [0]
>= [0]
= [#0()]
[#mult(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#pos(#natmult(@x, @y))]
[#mult(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#neg(#natmult(@x, @y))]
[#mult(#pos(@x), #0())] = [0]
>= [0]
= [#0()]
[#mult(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#neg(#natmult(@x, @y))]
[#mult(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#pos(#natmult(@x, @y))]
[-(@x, @y)] = [1] @x + [2] @y + [0]
>= [1] @x + [2] @y + [0]
= [#sub(@x, @y)]
[#sub(@x, #0())] = [1] @x + [0]
>= [1] @x + [0]
= [@x]
[#sub(@x, #neg(@y))] = [1] @x + [2] @y + [0]
>= [2] @y + [0]
= [#add(@x, #pos(@y))]
[#sub(@x, #pos(@y))] = [1] @x + [2] @y + [0]
>= [2] @y + [0]
= [#add(@x, #neg(@y))]
[div(@x, @y)] = [0]
>= [0]
= [#div(@x, @y)]
[#div(#0(), #0())] = [0]
>= [0]
= [#divByZero()]
[#div(#0(), #neg(@y))] = [0]
>= [0]
= [#0()]
[#div(#0(), #pos(@y))] = [0]
>= [0]
= [#0()]
[#div(#neg(@x), #0())] = [0]
>= [0]
= [#divByZero()]
[#div(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#pos(#natdiv(@x, @y))]
[#div(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#neg(#natdiv(@x, @y))]
[#div(#pos(@x), #0())] = [0]
>= [0]
= [#divByZero()]
[#div(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#neg(#natdiv(@x, @y))]
[#div(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#pos(#natdiv(@x, @y))]
[filter(@p, @l)] = [1] @l + [0]
>= [1] @l + [0]
= [filter#1(@l, @p)]
[filter#1(::(@x, @xs), @p)] = [1] @xs + [1]
>= [1] @xs + [1]
= [filter#2(filter(@p, @xs), @p, @x)]
[filter#1(nil(), @p)] = [0]
>= [0]
= [nil()]
[filter#2(@xs', @p, @x)] = [1] @xs' + [1]
>= [1] @xs' + [1]
= [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')]
[mod(@x, @y)] = [2] @x + [0]
>= [1] @x + [0]
= [-(@x, *(@x, div(@x, @y)))]
[filter#3(#false(), @x, @xs')] = [1] @xs' + [1]
>= [1] @xs' + [1]
= [::(@x, @xs')]
[filter#3(#true(), @x, @xs')] = [1] @xs' + [1]
> [1] @xs' + [0]
= [@xs']
[#add(#0(), @y)] = [2] @y + [0]
>= [1] @y + [0]
= [@y]
[#add(#neg(#s(#0())), @y)] = [2] @y + [0]
>= [1] @y + [0]
= [#pred(@y)]
[#add(#neg(#s(#s(@x))), @y)] = [2] @y + [0]
>= [2] @y + [0]
= [#pred(#add(#pos(#s(@x)), @y))]
[#add(#pos(#s(#0())), @y)] = [2] @y + [0]
>= [1] @y + [0]
= [#succ(@y)]
[#add(#pos(#s(#s(@x))), @y)] = [2] @y + [0]
>= [2] @y + [0]
= [#succ(#add(#pos(#s(@x)), @y))]
[#pred(#0())] = [0]
>= [0]
= [#neg(#s(#0()))]
[#pred(#neg(#s(@x)))] = [1] @x + [0]
>= [1] @x + [0]
= [#neg(#s(#s(@x)))]
[#pred(#pos(#s(#0())))] = [0]
>= [0]
= [#0()]
[#pred(#pos(#s(#s(@x))))] = [1] @x + [0]
>= [1] @x + [0]
= [#pos(#s(@x))]
[#succ(#0())] = [0]
>= [0]
= [#pos(#s(#0()))]
[#succ(#neg(#s(#0())))] = [0]
>= [0]
= [#0()]
[#succ(#neg(#s(#s(@x))))] = [1] @x + [0]
>= [1] @x + [0]
= [#neg(#s(@x))]
[#succ(#pos(#s(@x)))] = [1] @x + [0]
>= [1] @x + [0]
= [#pos(#s(#s(@x)))]
[#and(#false(), #false())] = [0]
>= [0]
= [#false()]
[#and(#false(), #true())] = [0]
>= [0]
= [#false()]
[#and(#true(), #false())] = [0]
>= [0]
= [#false()]
[#and(#true(), #true())] = [0]
>= [0]
= [#true()]
[#natdiv(#0(), #0())] = [0]
>= [0]
= [#divByZero()]
[#natdiv(#s(@x), #s(@y))] = [0]
>= [0]
= [#s(#natdiv(#natsub(@x, @y), #s(@y)))]
[#natmult(#0(), @y)] = [0]
>= [0]
= [#0()]
[#natmult(#s(@x), @y)] = [0]
>= [0]
= [#add(#pos(@y), #natmult(@x, @y))]
[#natsub(@x, #0())] = [2] @x + [0]
>= [1] @x + [0]
= [@x]
[#natsub(#s(@x), #s(@y))] = [2] @x + [0]
>= [2] @x + [0]
= [#natsub(@x, @y)]
[eratos^#(@l)] = [2] @l + [1]
>= [2] @l + [1]
= [eratos#1^#(@l)]
[eratos#1^#(::(@x, @xs))] = [2] @xs + [3]
> [2] @xs + [1]
= [eratos^#(filter(@x, @xs))]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules {2}.
Here rules are labeled according to the (estimated) dependency
graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs)) :2
2: eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs))
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
- The rules {2} have known complexity. These cover all predecessors
of {1}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules {1,2}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: eratos^#(@l) -> eratos#1^#(@l)
, 2: eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: eratos^#(@l) -> eratos#1^#(@l)
, 2: eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs)) }
We apply the transformation 'usablerules' on the sub-problem:
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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { filter^#(@p, @l) -> filter#1^#(@l, @p) }
Weak DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs))
, eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs)
, filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'matrix interpretation of dimension 1' to
orient following rules strictly.
DPs:
{ 1: filter^#(@p, @l) -> filter#1^#(@l, @p)
, 4: eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs)
, 5: filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs) }
Trs:
{ #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))
, filter#1(nil(), @p) -> nil()
, filter#3(#true(), @x, @xs') -> @xs'
, #natmult(#0(), @y) -> #0() }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#equal) = {}, Uargs(#eq) = {}, Uargs(*) = {},
Uargs(#mult) = {}, Uargs(-) = {}, Uargs(#sub) = {},
Uargs(div) = {}, Uargs(#div) = {}, Uargs(::) = {},
Uargs(filter) = {}, Uargs(filter#1) = {}, Uargs(filter#2) = {},
Uargs(mod) = {}, Uargs(filter#3) = {}, Uargs(#add) = {},
Uargs(#s) = {}, Uargs(#neg) = {}, Uargs(#pred) = {},
Uargs(#pos) = {}, Uargs(#succ) = {}, Uargs(#and) = {},
Uargs(#natdiv) = {}, Uargs(#natmult) = {}, Uargs(#natsub) = {},
Uargs(#equal^#) = {}, Uargs(#eq^#) = {}, Uargs(*^#) = {},
Uargs(#mult^#) = {}, Uargs(-^#) = {}, Uargs(#sub^#) = {},
Uargs(div^#) = {}, Uargs(#div^#) = {}, Uargs(eratos^#) = {},
Uargs(eratos#1^#) = {}, Uargs(filter^#) = {},
Uargs(filter#1^#) = {}, Uargs(filter#2^#) = {},
Uargs(filter#3^#) = {}, Uargs(mod^#) = {}, Uargs(#and^#) = {},
Uargs(#natmult^#) = {}, Uargs(#add^#) = {}, Uargs(#natdiv^#) = {},
Uargs(#pred^#) = {}, Uargs(#succ^#) = {}, Uargs(#natsub^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#equal](x1, x2) = [1] x2 + [0]
[#eq](x1, x2) = [0]
[*](x1, x2) = [2] x1 + [1] x2 + [3]
[#mult](x1, x2) = [1] x1 + [1] x2 + [3]
[-](x1, x2) = [1] x1 + [1] x2 + [0]
[#sub](x1, x2) = [1] x1 + [1] x2 + [0]
[div](x1, x2) = [1] x2 + [0]
[#div](x1, x2) = [1] x2 + [0]
[::](x1, x2) = [1] x1 + [1] x2 + [2]
[filter](x1, x2) = [1] x2 + [2]
[nil] = [1]
[filter#1](x1, x2) = [1] x1 + [2]
[filter#2](x1, x2, x3) = [1] x1 + [1] x3 + [2]
[mod](x1, x2) = [3] x1 + [3] x2 + [3]
[#0] = [0]
[filter#3](x1, x2, x3) = [2] x1 + [1] x2 + [1] x3 + [2]
[#false] = [0]
[#true] = [0]
[#add](x1, x2) = [1] x2 + [0]
[#s](x1) = [1] x1 + [0]
[#neg](x1) = [1] x1 + [0]
[#pred](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#succ](x1) = [1] x1 + [0]
[#and](x1, x2) = [0]
[#divByZero] = [0]
[#natdiv](x1, x2) = [0]
[#natmult](x1, x2) = [2]
[#natsub](x1, x2) = [2] x1 + [0]
[#equal^#](x1, x2) = [0]
[#eq^#](x1, x2) = [0]
[*^#](x1, x2) = [0]
[#mult^#](x1, x2) = [0]
[-^#](x1, x2) = [0]
[#sub^#](x1, x2) = [0]
[div^#](x1, x2) = [0]
[#div^#](x1, x2) = [0]
[eratos^#](x1) = [2] x1 + [2]
[eratos#1^#](x1) = [2] x1 + [2]
[filter^#](x1, x2) = [2] x2 + [1]
[filter#1^#](x1, x2) = [2] x1 + [0]
[filter#2^#](x1, x2, x3) = [0]
[filter#3^#](x1, x2, x3) = [0]
[mod^#](x1, x2) = [0]
[#and^#](x1, x2) = [0]
[#natmult^#](x1, x2) = [0]
[#add^#](x1, x2) = [0]
[#natdiv^#](x1, x2) = [0]
[#pred^#](x1) = [0]
[#succ^#](x1) = [0]
[#natsub^#](x1, x2) = [0]
This order satisfies following ordering constraints
[#equal(@x, @y)] = [1] @y + [0]
>= [0]
= [#eq(@x, @y)]
[#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0]
>= [0]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(::(@x_1, @x_2), nil())] = [0]
>= [0]
= [#false()]
[#eq(nil(), ::(@y_1, @y_2))] = [0]
>= [0]
= [#false()]
[#eq(nil(), nil())] = [0]
>= [0]
= [#true()]
[#eq(#0(), #0())] = [0]
>= [0]
= [#true()]
[#eq(#0(), #s(@y))] = [0]
>= [0]
= [#false()]
[#eq(#0(), #neg(@y))] = [0]
>= [0]
= [#false()]
[#eq(#0(), #pos(@y))] = [0]
>= [0]
= [#false()]
[#eq(#s(@x), #0())] = [0]
>= [0]
= [#false()]
[#eq(#s(@x), #s(@y))] = [0]
>= [0]
= [#eq(@x, @y)]
[#eq(#neg(@x), #0())] = [0]
>= [0]
= [#false()]
[#eq(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#eq(@x, @y)]
[#eq(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #0())] = [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#eq(@x, @y)]
[*(@x, @y)] = [2] @x + [1] @y + [3]
>= [1] @x + [1] @y + [3]
= [#mult(@x, @y)]
[#mult(#0(), #0())] = [3]
> [0]
= [#0()]
[#mult(#0(), #neg(@y))] = [1] @y + [3]
> [0]
= [#0()]
[#mult(#0(), #pos(@y))] = [1] @y + [3]
> [0]
= [#0()]
[#mult(#neg(@x), #0())] = [1] @x + [3]
> [0]
= [#0()]
[#mult(#neg(@x), #neg(@y))] = [1] @x + [1] @y + [3]
> [2]
= [#pos(#natmult(@x, @y))]
[#mult(#neg(@x), #pos(@y))] = [1] @x + [1] @y + [3]
> [2]
= [#neg(#natmult(@x, @y))]
[#mult(#pos(@x), #0())] = [1] @x + [3]
> [0]
= [#0()]
[#mult(#pos(@x), #neg(@y))] = [1] @x + [1] @y + [3]
> [2]
= [#neg(#natmult(@x, @y))]
[#mult(#pos(@x), #pos(@y))] = [1] @x + [1] @y + [3]
> [2]
= [#pos(#natmult(@x, @y))]
[-(@x, @y)] = [1] @x + [1] @y + [0]
>= [1] @x + [1] @y + [0]
= [#sub(@x, @y)]
[#sub(@x, #0())] = [1] @x + [0]
>= [1] @x + [0]
= [@x]
[#sub(@x, #neg(@y))] = [1] @x + [1] @y + [0]
>= [1] @y + [0]
= [#add(@x, #pos(@y))]
[#sub(@x, #pos(@y))] = [1] @x + [1] @y + [0]
>= [1] @y + [0]
= [#add(@x, #neg(@y))]
[div(@x, @y)] = [1] @y + [0]
>= [1] @y + [0]
= [#div(@x, @y)]
[#div(#0(), #0())] = [0]
>= [0]
= [#divByZero()]
[#div(#0(), #neg(@y))] = [1] @y + [0]
>= [0]
= [#0()]
[#div(#0(), #pos(@y))] = [1] @y + [0]
>= [0]
= [#0()]
[#div(#neg(@x), #0())] = [0]
>= [0]
= [#divByZero()]
[#div(#neg(@x), #neg(@y))] = [1] @y + [0]
>= [0]
= [#pos(#natdiv(@x, @y))]
[#div(#neg(@x), #pos(@y))] = [1] @y + [0]
>= [0]
= [#neg(#natdiv(@x, @y))]
[#div(#pos(@x), #0())] = [0]
>= [0]
= [#divByZero()]
[#div(#pos(@x), #neg(@y))] = [1] @y + [0]
>= [0]
= [#neg(#natdiv(@x, @y))]
[#div(#pos(@x), #pos(@y))] = [1] @y + [0]
>= [0]
= [#pos(#natdiv(@x, @y))]
[filter(@p, @l)] = [1] @l + [2]
>= [1] @l + [2]
= [filter#1(@l, @p)]
[filter#1(::(@x, @xs), @p)] = [1] @x + [1] @xs + [4]
>= [1] @x + [1] @xs + [4]
= [filter#2(filter(@p, @xs), @p, @x)]
[filter#1(nil(), @p)] = [3]
> [1]
= [nil()]
[filter#2(@xs', @p, @x)] = [1] @x + [1] @xs' + [2]
>= [1] @x + [1] @xs' + [2]
= [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')]
[mod(@x, @y)] = [3] @x + [3] @y + [3]
>= [3] @x + [1] @y + [3]
= [-(@x, *(@x, div(@x, @y)))]
[filter#3(#false(), @x, @xs')] = [1] @x + [1] @xs' + [2]
>= [1] @x + [1] @xs' + [2]
= [::(@x, @xs')]
[filter#3(#true(), @x, @xs')] = [1] @x + [1] @xs' + [2]
> [1] @xs' + [0]
= [@xs']
[#add(#0(), @y)] = [1] @y + [0]
>= [1] @y + [0]
= [@y]
[#add(#neg(#s(#0())), @y)] = [1] @y + [0]
>= [1] @y + [0]
= [#pred(@y)]
[#add(#neg(#s(#s(@x))), @y)] = [1] @y + [0]
>= [1] @y + [0]
= [#pred(#add(#pos(#s(@x)), @y))]
[#add(#pos(#s(#0())), @y)] = [1] @y + [0]
>= [1] @y + [0]
= [#succ(@y)]
[#add(#pos(#s(#s(@x))), @y)] = [1] @y + [0]
>= [1] @y + [0]
= [#succ(#add(#pos(#s(@x)), @y))]
[#pred(#0())] = [0]
>= [0]
= [#neg(#s(#0()))]
[#pred(#neg(#s(@x)))] = [1] @x + [0]
>= [1] @x + [0]
= [#neg(#s(#s(@x)))]
[#pred(#pos(#s(#0())))] = [0]
>= [0]
= [#0()]
[#pred(#pos(#s(#s(@x))))] = [1] @x + [0]
>= [1] @x + [0]
= [#pos(#s(@x))]
[#succ(#0())] = [0]
>= [0]
= [#pos(#s(#0()))]
[#succ(#neg(#s(#0())))] = [0]
>= [0]
= [#0()]
[#succ(#neg(#s(#s(@x))))] = [1] @x + [0]
>= [1] @x + [0]
= [#neg(#s(@x))]
[#succ(#pos(#s(@x)))] = [1] @x + [0]
>= [1] @x + [0]
= [#pos(#s(#s(@x)))]
[#and(#false(), #false())] = [0]
>= [0]
= [#false()]
[#and(#false(), #true())] = [0]
>= [0]
= [#false()]
[#and(#true(), #false())] = [0]
>= [0]
= [#false()]
[#and(#true(), #true())] = [0]
>= [0]
= [#true()]
[#natdiv(#0(), #0())] = [0]
>= [0]
= [#divByZero()]
[#natdiv(#s(@x), #s(@y))] = [0]
>= [0]
= [#s(#natdiv(#natsub(@x, @y), #s(@y)))]
[#natmult(#0(), @y)] = [2]
> [0]
= [#0()]
[#natmult(#s(@x), @y)] = [2]
>= [2]
= [#add(#pos(@y), #natmult(@x, @y))]
[#natsub(@x, #0())] = [2] @x + [0]
>= [1] @x + [0]
= [@x]
[#natsub(#s(@x), #s(@y))] = [2] @x + [0]
>= [2] @x + [0]
= [#natsub(@x, @y)]
[eratos^#(@l)] = [2] @l + [2]
>= [2] @l + [2]
= [eratos#1^#(@l)]
[eratos#1^#(::(@x, @xs))] = [2] @x + [2] @xs + [6]
>= [2] @xs + [6]
= [eratos^#(filter(@x, @xs))]
[eratos#1^#(::(@x, @xs))] = [2] @x + [2] @xs + [6]
> [2] @xs + [1]
= [filter^#(@x, @xs)]
[filter^#(@p, @l)] = [2] @l + [1]
> [2] @l + [0]
= [filter#1^#(@l, @p)]
[filter#1^#(::(@x, @xs), @p)] = [2] @x + [2] @xs + [4]
> [2] @xs + [1]
= [filter^#(@p, @xs)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{1,4,5}. Here rules are labeled according to the (estimated)
dependency graph
1: filter^#(@p, @l) -> filter#1^#(@l, @p)
-->_1 filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs) :5
2: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs) :4
-->_1 eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs)) :3
3: eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs))
-->_1 eratos^#(@l) -> eratos#1^#(@l) :2
4: eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs)
-->_1 filter^#(@p, @l) -> filter#1^#(@l, @p) :1
5: filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs)
-->_1 filter^#(@p, @l) -> filter#1^#(@l, @p) :1
Overall, we obtain that the number of applications of rules {1,4,5}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs))
, eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs)
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,2} Weak SCC
|
`->2:{3} Weak SCC
|
`->3:{4,5} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: eratos^#(@l) -> eratos#1^#(@l)
, 2: eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs))
, 3: eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs)
, 4: filter^#(@p, @l) -> filter#1^#(@l, @p)
, 5: filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: eratos^#(@l) -> eratos#1^#(@l)
, 2: eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs))
, 3: eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs)
, 4: filter^#(@p, @l) -> filter#1^#(@l, @p)
, 5: filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs) }
We apply the transformation 'usablerules' on the sub-problem:
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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
Hurray, we answered YES(O(1),O(n^2))
tct-popstar
YES(O(1),O(n^2))
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
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, *(@x, 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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We add following dependency tuples
Strict DPs:
{ #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)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, eratos#1^#(nil()) -> c_7()
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
, filter#1^#(nil(), @p) -> c_10()
, filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
, filter#3^#(#false(), @x, @xs') -> c_13()
, filter#3^#(#true(), @x, @xs') -> c_14()
, mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y)) }
Weak DPs:
{ #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_16()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
, #eq^#(nil(), nil()) -> c_18()
, #eq^#(#0(), #0()) -> c_19()
, #eq^#(#0(), #s(@y)) -> c_20()
, #eq^#(#0(), #neg(@y)) -> c_21()
, #eq^#(#0(), #pos(@y)) -> c_22()
, #eq^#(#s(@x), #0()) -> c_23()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #0()) -> c_25()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_27()
, #eq^#(#pos(@x), #0()) -> c_28()
, #eq^#(#pos(@x), #neg(@y)) -> c_29()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #mult^#(#0(), #0()) -> c_31()
, #mult^#(#0(), #neg(@y)) -> c_32()
, #mult^#(#0(), #pos(@y)) -> c_33()
, #mult^#(#neg(@x), #0()) -> c_34()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_37()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #sub^#(@x, #0()) -> c_40()
, #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y))
, #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y))
, #div^#(#0(), #0()) -> c_43()
, #div^#(#0(), #neg(@y)) -> c_44()
, #div^#(#0(), #pos(@y)) -> c_45()
, #div^#(#neg(@x), #0()) -> c_46()
, #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #0()) -> c_49()
, #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, #and^#(#false(), #false()) -> c_65()
, #and^#(#false(), #true()) -> c_66()
, #and^#(#true(), #false()) -> c_67()
, #and^#(#true(), #true()) -> c_68()
, #natmult^#(#0(), @y) -> c_71()
, #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #add^#(#0(), @y) -> c_52()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natdiv^#(#0(), #0()) -> c_69()
, #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#0()) -> c_57()
, #pred^#(#neg(#s(@x))) -> c_58()
, #pred^#(#pos(#s(#0()))) -> c_59()
, #pred^#(#pos(#s(#s(@x)))) -> c_60()
, #succ^#(#0()) -> c_61()
, #succ^#(#neg(#s(#0()))) -> c_62()
, #succ^#(#neg(#s(#s(@x)))) -> c_63()
, #succ^#(#pos(#s(@x))) -> c_64()
, #natsub^#(@x, #0()) -> c_73()
, #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) }
and replace the set of basic marked basic terms accordingly.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ #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)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, eratos#1^#(nil()) -> c_7()
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
, filter#1^#(nil(), @p) -> c_10()
, filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
, filter#3^#(#false(), @x, @xs') -> c_13()
, filter#3^#(#true(), @x, @xs') -> c_14()
, mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y)) }
Weak DPs:
{ #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_16()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
, #eq^#(nil(), nil()) -> c_18()
, #eq^#(#0(), #0()) -> c_19()
, #eq^#(#0(), #s(@y)) -> c_20()
, #eq^#(#0(), #neg(@y)) -> c_21()
, #eq^#(#0(), #pos(@y)) -> c_22()
, #eq^#(#s(@x), #0()) -> c_23()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #0()) -> c_25()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_27()
, #eq^#(#pos(@x), #0()) -> c_28()
, #eq^#(#pos(@x), #neg(@y)) -> c_29()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #mult^#(#0(), #0()) -> c_31()
, #mult^#(#0(), #neg(@y)) -> c_32()
, #mult^#(#0(), #pos(@y)) -> c_33()
, #mult^#(#neg(@x), #0()) -> c_34()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_37()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #sub^#(@x, #0()) -> c_40()
, #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y))
, #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y))
, #div^#(#0(), #0()) -> c_43()
, #div^#(#0(), #neg(@y)) -> c_44()
, #div^#(#0(), #pos(@y)) -> c_45()
, #div^#(#neg(@x), #0()) -> c_46()
, #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #0()) -> c_49()
, #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, #and^#(#false(), #false()) -> c_65()
, #and^#(#false(), #true()) -> c_66()
, #and^#(#true(), #false()) -> c_67()
, #and^#(#true(), #true()) -> c_68()
, #natmult^#(#0(), @y) -> c_71()
, #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #add^#(#0(), @y) -> c_52()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natdiv^#(#0(), #0()) -> c_69()
, #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#0()) -> c_57()
, #pred^#(#neg(#s(@x))) -> c_58()
, #pred^#(#pos(#s(#0()))) -> c_59()
, #pred^#(#pos(#s(#s(@x)))) -> c_60()
, #succ^#(#0()) -> c_61()
, #succ^#(#neg(#s(#0()))) -> c_62()
, #succ^#(#neg(#s(#s(@x)))) -> c_63()
, #succ^#(#pos(#s(@x))) -> c_64()
, #natsub^#(@x, #0()) -> c_73()
, #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :15
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :27
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :25
-->_1 #eq^#(#s(@x), #0()) -> c_23() :23
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :22
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :21
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :20
-->_1 #eq^#(#0(), #0()) -> c_19() :19
-->_1 #eq^#(nil(), nil()) -> c_18() :18
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :17
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :16
2: *^#(@x, @y) -> #mult^#(@x, @y)
-->_1 #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y) :39
-->_1 #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y) :38
-->_1 #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y) :36
-->_1 #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y) :35
-->_1 #mult^#(#pos(@x), #0()) -> c_37() :37
-->_1 #mult^#(#neg(@x), #0()) -> c_34() :34
-->_1 #mult^#(#0(), #pos(@y)) -> c_33() :33
-->_1 #mult^#(#0(), #neg(@y)) -> c_32() :32
-->_1 #mult^#(#0(), #0()) -> c_31() :31
3: -^#(@x, @y) -> #sub^#(@x, @y)
-->_1 #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y)) :42
-->_1 #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y)) :41
-->_1 #sub^#(@x, #0()) -> c_40() :40
4: div^#(@x, @y) -> #div^#(@x, @y)
-->_1 #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y) :51
-->_1 #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y) :50
-->_1 #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y) :48
-->_1 #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y) :47
-->_1 #div^#(#pos(@x), #0()) -> c_49() :49
-->_1 #div^#(#neg(@x), #0()) -> c_46() :46
-->_1 #div^#(#0(), #pos(@y)) -> c_45() :45
-->_1 #div^#(#0(), #neg(@y)) -> c_44() :44
-->_1 #div^#(#0(), #0()) -> c_43() :43
5: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :6
-->_1 eratos#1^#(nil()) -> c_7() :7
6: eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :8
-->_1 eratos^#(@l) -> eratos#1^#(@l) :5
7: eratos#1^#(nil()) -> c_7()
8: filter^#(@p, @l) -> filter#1^#(@l, @p)
-->_1 filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs)) :9
-->_1 filter#1^#(nil(), @p) -> c_10() :10
9: filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
-->_1 filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p)) :11
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :8
10: filter#1^#(nil(), @p) -> c_10()
11: filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
-->_3 mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y)) :14
-->_1 filter#3^#(#true(), @x, @xs') -> c_14() :13
-->_1 filter#3^#(#false(), @x, @xs') -> c_13() :12
-->_2 #equal^#(@x, @y) -> #eq^#(@x, @y) :1
12: filter#3^#(#false(), @x, @xs') -> c_13()
13: filter#3^#(#true(), @x, @xs') -> c_14()
14: mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
-->_3 div^#(@x, @y) -> #div^#(@x, @y) :4
-->_1 -^#(@x, @y) -> #sub^#(@x, @y) :3
-->_2 *^#(@x, @y) -> #mult^#(@x, @y) :2
15: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :24
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :24
-->_1 #and^#(#true(), #true()) -> c_68() :55
-->_1 #and^#(#true(), #false()) -> c_67() :54
-->_1 #and^#(#false(), #true()) -> c_66() :53
-->_1 #and^#(#false(), #false()) -> c_65() :52
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_29() :29
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_29() :29
-->_3 #eq^#(#pos(@x), #0()) -> c_28() :28
-->_2 #eq^#(#pos(@x), #0()) -> c_28() :28
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_27() :27
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_27() :27
-->_3 #eq^#(#neg(@x), #0()) -> c_25() :25
-->_2 #eq^#(#neg(@x), #0()) -> c_25() :25
-->_3 #eq^#(#s(@x), #0()) -> c_23() :23
-->_2 #eq^#(#s(@x), #0()) -> c_23() :23
-->_3 #eq^#(#0(), #pos(@y)) -> c_22() :22
-->_2 #eq^#(#0(), #pos(@y)) -> c_22() :22
-->_3 #eq^#(#0(), #neg(@y)) -> c_21() :21
-->_2 #eq^#(#0(), #neg(@y)) -> c_21() :21
-->_3 #eq^#(#0(), #s(@y)) -> c_20() :20
-->_2 #eq^#(#0(), #s(@y)) -> c_20() :20
-->_3 #eq^#(#0(), #0()) -> c_19() :19
-->_2 #eq^#(#0(), #0()) -> c_19() :19
-->_3 #eq^#(nil(), nil()) -> c_18() :18
-->_2 #eq^#(nil(), nil()) -> c_18() :18
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :17
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :17
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :16
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :16
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :15
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :15
16: #eq^#(::(@x_1, @x_2), nil()) -> c_16()
17: #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
18: #eq^#(nil(), nil()) -> c_18()
19: #eq^#(#0(), #0()) -> c_19()
20: #eq^#(#0(), #s(@y)) -> c_20()
21: #eq^#(#0(), #neg(@y)) -> c_21()
22: #eq^#(#0(), #pos(@y)) -> c_22()
23: #eq^#(#s(@x), #0()) -> c_23()
24: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :27
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :25
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(#s(@x), #0()) -> c_23() :23
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :22
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :21
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :20
-->_1 #eq^#(#0(), #0()) -> c_19() :19
-->_1 #eq^#(nil(), nil()) -> c_18() :18
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :17
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :16
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :15
25: #eq^#(#neg(@x), #0()) -> c_25()
26: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :27
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :25
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(#s(@x), #0()) -> c_23() :23
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :22
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :21
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :20
-->_1 #eq^#(#0(), #0()) -> c_19() :19
-->_1 #eq^#(nil(), nil()) -> c_18() :18
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :17
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :16
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :15
27: #eq^#(#neg(@x), #pos(@y)) -> c_27()
28: #eq^#(#pos(@x), #0()) -> c_28()
29: #eq^#(#pos(@x), #neg(@y)) -> c_29()
30: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :27
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :25
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(#s(@x), #0()) -> c_23() :23
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :22
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :21
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :20
-->_1 #eq^#(#0(), #0()) -> c_19() :19
-->_1 #eq^#(nil(), nil()) -> c_18() :18
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :17
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :16
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :15
31: #mult^#(#0(), #0()) -> c_31()
32: #mult^#(#0(), #neg(@y)) -> c_32()
33: #mult^#(#0(), #pos(@y)) -> c_33()
34: #mult^#(#neg(@x), #0()) -> c_34()
35: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
36: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
37: #mult^#(#pos(@x), #0()) -> c_37()
38: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
39: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
40: #sub^#(@x, #0()) -> c_40()
41: #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :60
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :59
-->_1 #add^#(#0(), @y) -> c_52() :58
42: #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :60
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :59
-->_1 #add^#(#0(), @y) -> c_52() :58
43: #div^#(#0(), #0()) -> c_43()
44: #div^#(#0(), #neg(@y)) -> c_44()
45: #div^#(#0(), #pos(@y)) -> c_45()
46: #div^#(#neg(@x), #0()) -> c_46()
47: #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
48: #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
49: #div^#(#pos(@x), #0()) -> c_49()
50: #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
51: #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
52: #and^#(#false(), #false()) -> c_65()
53: #and^#(#false(), #true()) -> c_66()
54: #and^#(#true(), #false()) -> c_67()
55: #and^#(#true(), #true()) -> c_68()
56: #natmult^#(#0(), @y) -> c_71()
57: #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_2 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_2 #natmult^#(#0(), @y) -> c_71() :56
58: #add^#(#0(), @y) -> c_52()
59: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_60() :68
-->_1 #pred^#(#pos(#s(#0()))) -> c_59() :67
-->_1 #pred^#(#neg(#s(@x))) -> c_58() :66
-->_1 #pred^#(#0()) -> c_57() :65
60: #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_60() :68
-->_1 #pred^#(#pos(#s(#0()))) -> c_59() :67
-->_1 #pred^#(#neg(#s(@x))) -> c_58() :66
-->_1 #pred^#(#0()) -> c_57() :65
61: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_64() :72
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_63() :71
-->_1 #succ^#(#neg(#s(#0()))) -> c_62() :70
-->_1 #succ^#(#0()) -> c_61() :69
62: #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_64() :72
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_63() :71
-->_1 #succ^#(#neg(#s(#0()))) -> c_62() :70
-->_1 #succ^#(#0()) -> c_61() :69
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
63: #natdiv^#(#0(), #0()) -> c_69()
64: #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
-->_2 #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) :74
-->_2 #natsub^#(@x, #0()) -> c_73() :73
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
65: #pred^#(#0()) -> c_57()
66: #pred^#(#neg(#s(@x))) -> c_58()
67: #pred^#(#pos(#s(#0()))) -> c_59()
68: #pred^#(#pos(#s(#s(@x)))) -> c_60()
69: #succ^#(#0()) -> c_61()
70: #succ^#(#neg(#s(#0()))) -> c_62()
71: #succ^#(#neg(#s(#s(@x)))) -> c_63()
72: #succ^#(#pos(#s(@x))) -> c_64()
73: #natsub^#(@x, #0()) -> c_73()
74: #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y)
-->_1 #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) :74
-->_1 #natsub^#(@x, #0()) -> c_73() :73
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {7} and add Pre({7}) = {5} to the strict component.
- We remove {10} and add Pre({10}) = {8} to the strict component.
- We remove {12} and add Pre({12}) = {11} to the strict component.
- We remove {13} and add Pre({13}) = {11} to the strict component.
- We remove {4} and add Pre({4}) = {14} to the strict component.
- We remove {3} and add Pre({3}) = {14} to the strict component.
- We remove {2} and add Pre({2}) = {14} to the strict component.
- We remove {1} and add Pre({1}) = {11} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
, filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
, mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y)) }
Weak DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_16()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
, #eq^#(nil(), nil()) -> c_18()
, #eq^#(#0(), #0()) -> c_19()
, #eq^#(#0(), #s(@y)) -> c_20()
, #eq^#(#0(), #neg(@y)) -> c_21()
, #eq^#(#0(), #pos(@y)) -> c_22()
, #eq^#(#s(@x), #0()) -> c_23()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #0()) -> c_25()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_27()
, #eq^#(#pos(@x), #0()) -> c_28()
, #eq^#(#pos(@x), #neg(@y)) -> c_29()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, *^#(@x, @y) -> #mult^#(@x, @y)
, #mult^#(#0(), #0()) -> c_31()
, #mult^#(#0(), #neg(@y)) -> c_32()
, #mult^#(#0(), #pos(@y)) -> c_33()
, #mult^#(#neg(@x), #0()) -> c_34()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_37()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, -^#(@x, @y) -> #sub^#(@x, @y)
, #sub^#(@x, #0()) -> c_40()
, #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()) -> c_43()
, #div^#(#0(), #neg(@y)) -> c_44()
, #div^#(#0(), #pos(@y)) -> c_45()
, #div^#(#neg(@x), #0()) -> c_46()
, #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #0()) -> c_49()
, #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, eratos#1^#(nil()) -> c_7()
, filter#1^#(nil(), @p) -> c_10()
, filter#3^#(#false(), @x, @xs') -> c_13()
, filter#3^#(#true(), @x, @xs') -> c_14()
, #and^#(#false(), #false()) -> c_65()
, #and^#(#false(), #true()) -> c_66()
, #and^#(#true(), #false()) -> c_67()
, #and^#(#true(), #true()) -> c_68()
, #natmult^#(#0(), @y) -> c_71()
, #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #add^#(#0(), @y) -> c_52()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natdiv^#(#0(), #0()) -> c_69()
, #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#0()) -> c_57()
, #pred^#(#neg(#s(@x))) -> c_58()
, #pred^#(#pos(#s(#0()))) -> c_59()
, #pred^#(#pos(#s(#s(@x)))) -> c_60()
, #succ^#(#0()) -> c_61()
, #succ^#(#neg(#s(#0()))) -> c_62()
, #succ^#(#neg(#s(#s(@x)))) -> c_63()
, #succ^#(#pos(#s(@x))) -> c_64()
, #natsub^#(@x, #0()) -> c_73()
, #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :2
-->_1 eratos#1^#(nil()) -> c_7() :48
2: eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
3: filter^#(@p, @l) -> filter#1^#(@l, @p)
-->_1 filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs)) :4
-->_1 filter#1^#(nil(), @p) -> c_10() :49
4: filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
-->_1 filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p)) :5
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
5: filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
-->_2 #equal^#(@x, @y) -> #eq^#(@x, @y) :7
-->_3 mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y)) :6
-->_1 filter#3^#(#true(), @x, @xs') -> c_14() :51
-->_1 filter#3^#(#false(), @x, @xs') -> c_13() :50
6: mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
-->_3 div^#(@x, @y) -> #div^#(@x, @y) :38
-->_1 -^#(@x, @y) -> #sub^#(@x, @y) :34
-->_2 *^#(@x, @y) -> #mult^#(@x, @y) :24
7: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :19
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :17
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :8
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :22
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :21
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :20
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :18
-->_1 #eq^#(#s(@x), #0()) -> c_23() :16
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :15
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :14
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :13
-->_1 #eq^#(#0(), #0()) -> c_19() :12
-->_1 #eq^#(nil(), nil()) -> c_18() :11
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :10
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :9
8: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :23
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :23
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :19
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :19
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :17
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :17
-->_1 #and^#(#true(), #true()) -> c_68() :55
-->_1 #and^#(#true(), #false()) -> c_67() :54
-->_1 #and^#(#false(), #true()) -> c_66() :53
-->_1 #and^#(#false(), #false()) -> c_65() :52
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_29() :22
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_29() :22
-->_3 #eq^#(#pos(@x), #0()) -> c_28() :21
-->_2 #eq^#(#pos(@x), #0()) -> c_28() :21
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_27() :20
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_27() :20
-->_3 #eq^#(#neg(@x), #0()) -> c_25() :18
-->_2 #eq^#(#neg(@x), #0()) -> c_25() :18
-->_3 #eq^#(#s(@x), #0()) -> c_23() :16
-->_2 #eq^#(#s(@x), #0()) -> c_23() :16
-->_3 #eq^#(#0(), #pos(@y)) -> c_22() :15
-->_2 #eq^#(#0(), #pos(@y)) -> c_22() :15
-->_3 #eq^#(#0(), #neg(@y)) -> c_21() :14
-->_2 #eq^#(#0(), #neg(@y)) -> c_21() :14
-->_3 #eq^#(#0(), #s(@y)) -> c_20() :13
-->_2 #eq^#(#0(), #s(@y)) -> c_20() :13
-->_3 #eq^#(#0(), #0()) -> c_19() :12
-->_2 #eq^#(#0(), #0()) -> c_19() :12
-->_3 #eq^#(nil(), nil()) -> c_18() :11
-->_2 #eq^#(nil(), nil()) -> c_18() :11
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :10
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :10
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :9
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :9
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :8
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :8
9: #eq^#(::(@x_1, @x_2), nil()) -> c_16()
10: #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
11: #eq^#(nil(), nil()) -> c_18()
12: #eq^#(#0(), #0()) -> c_19()
13: #eq^#(#0(), #s(@y)) -> c_20()
14: #eq^#(#0(), #neg(@y)) -> c_21()
15: #eq^#(#0(), #pos(@y)) -> c_22()
16: #eq^#(#s(@x), #0()) -> c_23()
17: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :19
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :22
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :21
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :20
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :18
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :17
-->_1 #eq^#(#s(@x), #0()) -> c_23() :16
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :15
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :14
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :13
-->_1 #eq^#(#0(), #0()) -> c_19() :12
-->_1 #eq^#(nil(), nil()) -> c_18() :11
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :10
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :9
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :8
18: #eq^#(#neg(@x), #0()) -> c_25()
19: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :22
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :21
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :20
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :19
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :18
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :17
-->_1 #eq^#(#s(@x), #0()) -> c_23() :16
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :15
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :14
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :13
-->_1 #eq^#(#0(), #0()) -> c_19() :12
-->_1 #eq^#(nil(), nil()) -> c_18() :11
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :10
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :9
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :8
20: #eq^#(#neg(@x), #pos(@y)) -> c_27()
21: #eq^#(#pos(@x), #0()) -> c_28()
22: #eq^#(#pos(@x), #neg(@y)) -> c_29()
23: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :22
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :21
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :20
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :19
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :18
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :17
-->_1 #eq^#(#s(@x), #0()) -> c_23() :16
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :15
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :14
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :13
-->_1 #eq^#(#0(), #0()) -> c_19() :12
-->_1 #eq^#(nil(), nil()) -> c_18() :11
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :10
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :9
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :8
24: *^#(@x, @y) -> #mult^#(@x, @y)
-->_1 #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y) :33
-->_1 #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y) :32
-->_1 #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y) :30
-->_1 #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y) :29
-->_1 #mult^#(#pos(@x), #0()) -> c_37() :31
-->_1 #mult^#(#neg(@x), #0()) -> c_34() :28
-->_1 #mult^#(#0(), #pos(@y)) -> c_33() :27
-->_1 #mult^#(#0(), #neg(@y)) -> c_32() :26
-->_1 #mult^#(#0(), #0()) -> c_31() :25
25: #mult^#(#0(), #0()) -> c_31()
26: #mult^#(#0(), #neg(@y)) -> c_32()
27: #mult^#(#0(), #pos(@y)) -> c_33()
28: #mult^#(#neg(@x), #0()) -> c_34()
29: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
30: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
31: #mult^#(#pos(@x), #0()) -> c_37()
32: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
33: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
34: -^#(@x, @y) -> #sub^#(@x, @y)
-->_1 #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y)) :37
-->_1 #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y)) :36
-->_1 #sub^#(@x, #0()) -> c_40() :35
35: #sub^#(@x, #0()) -> c_40()
36: #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :60
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :59
-->_1 #add^#(#0(), @y) -> c_52() :58
37: #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :60
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :59
-->_1 #add^#(#0(), @y) -> c_52() :58
38: div^#(@x, @y) -> #div^#(@x, @y)
-->_1 #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y) :47
-->_1 #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y) :46
-->_1 #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y) :44
-->_1 #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y) :43
-->_1 #div^#(#pos(@x), #0()) -> c_49() :45
-->_1 #div^#(#neg(@x), #0()) -> c_46() :42
-->_1 #div^#(#0(), #pos(@y)) -> c_45() :41
-->_1 #div^#(#0(), #neg(@y)) -> c_44() :40
-->_1 #div^#(#0(), #0()) -> c_43() :39
39: #div^#(#0(), #0()) -> c_43()
40: #div^#(#0(), #neg(@y)) -> c_44()
41: #div^#(#0(), #pos(@y)) -> c_45()
42: #div^#(#neg(@x), #0()) -> c_46()
43: #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
44: #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
45: #div^#(#pos(@x), #0()) -> c_49()
46: #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
47: #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
48: eratos#1^#(nil()) -> c_7()
49: filter#1^#(nil(), @p) -> c_10()
50: filter#3^#(#false(), @x, @xs') -> c_13()
51: filter#3^#(#true(), @x, @xs') -> c_14()
52: #and^#(#false(), #false()) -> c_65()
53: #and^#(#false(), #true()) -> c_66()
54: #and^#(#true(), #false()) -> c_67()
55: #and^#(#true(), #true()) -> c_68()
56: #natmult^#(#0(), @y) -> c_71()
57: #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_2 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_2 #natmult^#(#0(), @y) -> c_71() :56
58: #add^#(#0(), @y) -> c_52()
59: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_60() :68
-->_1 #pred^#(#pos(#s(#0()))) -> c_59() :67
-->_1 #pred^#(#neg(#s(@x))) -> c_58() :66
-->_1 #pred^#(#0()) -> c_57() :65
60: #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_60() :68
-->_1 #pred^#(#pos(#s(#0()))) -> c_59() :67
-->_1 #pred^#(#neg(#s(@x))) -> c_58() :66
-->_1 #pred^#(#0()) -> c_57() :65
61: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_64() :72
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_63() :71
-->_1 #succ^#(#neg(#s(#0()))) -> c_62() :70
-->_1 #succ^#(#0()) -> c_61() :69
62: #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_64() :72
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_63() :71
-->_1 #succ^#(#neg(#s(#0()))) -> c_62() :70
-->_1 #succ^#(#0()) -> c_61() :69
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
63: #natdiv^#(#0(), #0()) -> c_69()
64: #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
-->_2 #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) :74
-->_2 #natsub^#(@x, #0()) -> c_73() :73
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
65: #pred^#(#0()) -> c_57()
66: #pred^#(#neg(#s(@x))) -> c_58()
67: #pred^#(#pos(#s(#0()))) -> c_59()
68: #pred^#(#pos(#s(#s(@x)))) -> c_60()
69: #succ^#(#0()) -> c_61()
70: #succ^#(#neg(#s(#0()))) -> c_62()
71: #succ^#(#neg(#s(#s(@x)))) -> c_63()
72: #succ^#(#pos(#s(@x))) -> c_64()
73: #natsub^#(@x, #0()) -> c_73()
74: #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y)
-->_1 #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) :74
-->_1 #natsub^#(@x, #0()) -> c_73() :73
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {6} and add Pre({6}) = {5} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
, filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p)) }
Weak DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_16()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
, #eq^#(nil(), nil()) -> c_18()
, #eq^#(#0(), #0()) -> c_19()
, #eq^#(#0(), #s(@y)) -> c_20()
, #eq^#(#0(), #neg(@y)) -> c_21()
, #eq^#(#0(), #pos(@y)) -> c_22()
, #eq^#(#s(@x), #0()) -> c_23()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #0()) -> c_25()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_27()
, #eq^#(#pos(@x), #0()) -> c_28()
, #eq^#(#pos(@x), #neg(@y)) -> c_29()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, *^#(@x, @y) -> #mult^#(@x, @y)
, #mult^#(#0(), #0()) -> c_31()
, #mult^#(#0(), #neg(@y)) -> c_32()
, #mult^#(#0(), #pos(@y)) -> c_33()
, #mult^#(#neg(@x), #0()) -> c_34()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_37()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, -^#(@x, @y) -> #sub^#(@x, @y)
, #sub^#(@x, #0()) -> c_40()
, #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()) -> c_43()
, #div^#(#0(), #neg(@y)) -> c_44()
, #div^#(#0(), #pos(@y)) -> c_45()
, #div^#(#neg(@x), #0()) -> c_46()
, #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #0()) -> c_49()
, #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, eratos#1^#(nil()) -> c_7()
, filter#1^#(nil(), @p) -> c_10()
, filter#3^#(#false(), @x, @xs') -> c_13()
, filter#3^#(#true(), @x, @xs') -> c_14()
, mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, #and^#(#false(), #false()) -> c_65()
, #and^#(#false(), #true()) -> c_66()
, #and^#(#true(), #false()) -> c_67()
, #and^#(#true(), #true()) -> c_68()
, #natmult^#(#0(), @y) -> c_71()
, #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #add^#(#0(), @y) -> c_52()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natdiv^#(#0(), #0()) -> c_69()
, #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#0()) -> c_57()
, #pred^#(#neg(#s(@x))) -> c_58()
, #pred^#(#pos(#s(#0()))) -> c_59()
, #pred^#(#pos(#s(#s(@x)))) -> c_60()
, #succ^#(#0()) -> c_61()
, #succ^#(#neg(#s(#0()))) -> c_62()
, #succ^#(#neg(#s(#s(@x)))) -> c_63()
, #succ^#(#pos(#s(@x))) -> c_64()
, #natsub^#(@x, #0()) -> c_73()
, #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :2
-->_1 eratos#1^#(nil()) -> c_7() :47
2: eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
3: filter^#(@p, @l) -> filter#1^#(@l, @p)
-->_1 filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs)) :4
-->_1 filter#1^#(nil(), @p) -> c_10() :48
4: filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
-->_1 filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p)) :5
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
5: filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
-->_3 mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y)) :51
-->_2 #equal^#(@x, @y) -> #eq^#(@x, @y) :6
-->_1 filter#3^#(#true(), @x, @xs') -> c_14() :50
-->_1 filter#3^#(#false(), @x, @xs') -> c_13() :49
6: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :22
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :18
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :16
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :7
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :21
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :20
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :19
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :17
-->_1 #eq^#(#s(@x), #0()) -> c_23() :15
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :14
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :13
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :12
-->_1 #eq^#(#0(), #0()) -> c_19() :11
-->_1 #eq^#(nil(), nil()) -> c_18() :10
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :9
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :8
7: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :22
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :22
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :18
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :18
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :16
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :16
-->_1 #and^#(#true(), #true()) -> c_68() :55
-->_1 #and^#(#true(), #false()) -> c_67() :54
-->_1 #and^#(#false(), #true()) -> c_66() :53
-->_1 #and^#(#false(), #false()) -> c_65() :52
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_29() :21
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_29() :21
-->_3 #eq^#(#pos(@x), #0()) -> c_28() :20
-->_2 #eq^#(#pos(@x), #0()) -> c_28() :20
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_27() :19
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_27() :19
-->_3 #eq^#(#neg(@x), #0()) -> c_25() :17
-->_2 #eq^#(#neg(@x), #0()) -> c_25() :17
-->_3 #eq^#(#s(@x), #0()) -> c_23() :15
-->_2 #eq^#(#s(@x), #0()) -> c_23() :15
-->_3 #eq^#(#0(), #pos(@y)) -> c_22() :14
-->_2 #eq^#(#0(), #pos(@y)) -> c_22() :14
-->_3 #eq^#(#0(), #neg(@y)) -> c_21() :13
-->_2 #eq^#(#0(), #neg(@y)) -> c_21() :13
-->_3 #eq^#(#0(), #s(@y)) -> c_20() :12
-->_2 #eq^#(#0(), #s(@y)) -> c_20() :12
-->_3 #eq^#(#0(), #0()) -> c_19() :11
-->_2 #eq^#(#0(), #0()) -> c_19() :11
-->_3 #eq^#(nil(), nil()) -> c_18() :10
-->_2 #eq^#(nil(), nil()) -> c_18() :10
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :9
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :9
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :8
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :8
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :7
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :7
8: #eq^#(::(@x_1, @x_2), nil()) -> c_16()
9: #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
10: #eq^#(nil(), nil()) -> c_18()
11: #eq^#(#0(), #0()) -> c_19()
12: #eq^#(#0(), #s(@y)) -> c_20()
13: #eq^#(#0(), #neg(@y)) -> c_21()
14: #eq^#(#0(), #pos(@y)) -> c_22()
15: #eq^#(#s(@x), #0()) -> c_23()
16: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :22
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :18
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :21
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :20
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :19
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :17
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :16
-->_1 #eq^#(#s(@x), #0()) -> c_23() :15
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :14
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :13
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :12
-->_1 #eq^#(#0(), #0()) -> c_19() :11
-->_1 #eq^#(nil(), nil()) -> c_18() :10
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :9
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :8
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :7
17: #eq^#(#neg(@x), #0()) -> c_25()
18: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :22
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :21
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :20
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :19
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :18
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :17
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :16
-->_1 #eq^#(#s(@x), #0()) -> c_23() :15
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :14
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :13
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :12
-->_1 #eq^#(#0(), #0()) -> c_19() :11
-->_1 #eq^#(nil(), nil()) -> c_18() :10
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :9
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :8
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :7
19: #eq^#(#neg(@x), #pos(@y)) -> c_27()
20: #eq^#(#pos(@x), #0()) -> c_28()
21: #eq^#(#pos(@x), #neg(@y)) -> c_29()
22: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :22
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_29() :21
-->_1 #eq^#(#pos(@x), #0()) -> c_28() :20
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_27() :19
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :18
-->_1 #eq^#(#neg(@x), #0()) -> c_25() :17
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :16
-->_1 #eq^#(#s(@x), #0()) -> c_23() :15
-->_1 #eq^#(#0(), #pos(@y)) -> c_22() :14
-->_1 #eq^#(#0(), #neg(@y)) -> c_21() :13
-->_1 #eq^#(#0(), #s(@y)) -> c_20() :12
-->_1 #eq^#(#0(), #0()) -> c_19() :11
-->_1 #eq^#(nil(), nil()) -> c_18() :10
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_17() :9
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_16() :8
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :7
23: *^#(@x, @y) -> #mult^#(@x, @y)
-->_1 #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y) :32
-->_1 #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y) :31
-->_1 #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y) :29
-->_1 #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y) :28
-->_1 #mult^#(#pos(@x), #0()) -> c_37() :30
-->_1 #mult^#(#neg(@x), #0()) -> c_34() :27
-->_1 #mult^#(#0(), #pos(@y)) -> c_33() :26
-->_1 #mult^#(#0(), #neg(@y)) -> c_32() :25
-->_1 #mult^#(#0(), #0()) -> c_31() :24
24: #mult^#(#0(), #0()) -> c_31()
25: #mult^#(#0(), #neg(@y)) -> c_32()
26: #mult^#(#0(), #pos(@y)) -> c_33()
27: #mult^#(#neg(@x), #0()) -> c_34()
28: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
29: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
30: #mult^#(#pos(@x), #0()) -> c_37()
31: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
32: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_1 #natmult^#(#0(), @y) -> c_71() :56
33: -^#(@x, @y) -> #sub^#(@x, @y)
-->_1 #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y)) :36
-->_1 #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y)) :35
-->_1 #sub^#(@x, #0()) -> c_40() :34
34: #sub^#(@x, #0()) -> c_40()
35: #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :60
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :59
-->_1 #add^#(#0(), @y) -> c_52() :58
36: #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :60
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :59
-->_1 #add^#(#0(), @y) -> c_52() :58
37: div^#(@x, @y) -> #div^#(@x, @y)
-->_1 #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y) :46
-->_1 #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y) :45
-->_1 #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y) :43
-->_1 #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y) :42
-->_1 #div^#(#pos(@x), #0()) -> c_49() :44
-->_1 #div^#(#neg(@x), #0()) -> c_46() :41
-->_1 #div^#(#0(), #pos(@y)) -> c_45() :40
-->_1 #div^#(#0(), #neg(@y)) -> c_44() :39
-->_1 #div^#(#0(), #0()) -> c_43() :38
38: #div^#(#0(), #0()) -> c_43()
39: #div^#(#0(), #neg(@y)) -> c_44()
40: #div^#(#0(), #pos(@y)) -> c_45()
41: #div^#(#neg(@x), #0()) -> c_46()
42: #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
43: #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
44: #div^#(#pos(@x), #0()) -> c_49()
45: #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
46: #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
-->_1 #natdiv^#(#0(), #0()) -> c_69() :63
47: eratos#1^#(nil()) -> c_7()
48: filter#1^#(nil(), @p) -> c_10()
49: filter#3^#(#false(), @x, @xs') -> c_13()
50: filter#3^#(#true(), @x, @xs') -> c_14()
51: mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
-->_3 div^#(@x, @y) -> #div^#(@x, @y) :37
-->_1 -^#(@x, @y) -> #sub^#(@x, @y) :33
-->_2 *^#(@x, @y) -> #mult^#(@x, @y) :23
52: #and^#(#false(), #false()) -> c_65()
53: #and^#(#false(), #true()) -> c_66()
54: #and^#(#true(), #false()) -> c_67()
55: #and^#(#true(), #true()) -> c_68()
56: #natmult^#(#0(), @y) -> c_71()
57: #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_2 #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :57
-->_2 #natmult^#(#0(), @y) -> c_71() :56
58: #add^#(#0(), @y) -> c_52()
59: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_60() :68
-->_1 #pred^#(#pos(#s(#0()))) -> c_59() :67
-->_1 #pred^#(#neg(#s(@x))) -> c_58() :66
-->_1 #pred^#(#0()) -> c_57() :65
60: #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_60() :68
-->_1 #pred^#(#pos(#s(#0()))) -> c_59() :67
-->_1 #pred^#(#neg(#s(@x))) -> c_58() :66
-->_1 #pred^#(#0()) -> c_57() :65
61: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_64() :72
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_63() :71
-->_1 #succ^#(#neg(#s(#0()))) -> c_62() :70
-->_1 #succ^#(#0()) -> c_61() :69
62: #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_64() :72
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_63() :71
-->_1 #succ^#(#neg(#s(#0()))) -> c_62() :70
-->_1 #succ^#(#0()) -> c_61() :69
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :62
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :61
63: #natdiv^#(#0(), #0()) -> c_69()
64: #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
-->_2 #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) :74
-->_2 #natsub^#(@x, #0()) -> c_73() :73
-->_1 #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y)) :64
65: #pred^#(#0()) -> c_57()
66: #pred^#(#neg(#s(@x))) -> c_58()
67: #pred^#(#pos(#s(#0()))) -> c_59()
68: #pred^#(#pos(#s(#s(@x)))) -> c_60()
69: #succ^#(#0()) -> c_61()
70: #succ^#(#neg(#s(#0()))) -> c_62()
71: #succ^#(#neg(#s(#s(@x)))) -> c_63()
72: #succ^#(#pos(#s(@x))) -> c_64()
73: #natsub^#(@x, #0()) -> c_73()
74: #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y)
-->_1 #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) :74
-->_1 #natsub^#(@x, #0()) -> c_73() :73
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {4} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs)) }
Weak DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_16()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
, #eq^#(nil(), nil()) -> c_18()
, #eq^#(#0(), #0()) -> c_19()
, #eq^#(#0(), #s(@y)) -> c_20()
, #eq^#(#0(), #neg(@y)) -> c_21()
, #eq^#(#0(), #pos(@y)) -> c_22()
, #eq^#(#s(@x), #0()) -> c_23()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #0()) -> c_25()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_27()
, #eq^#(#pos(@x), #0()) -> c_28()
, #eq^#(#pos(@x), #neg(@y)) -> c_29()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, *^#(@x, @y) -> #mult^#(@x, @y)
, #mult^#(#0(), #0()) -> c_31()
, #mult^#(#0(), #neg(@y)) -> c_32()
, #mult^#(#0(), #pos(@y)) -> c_33()
, #mult^#(#neg(@x), #0()) -> c_34()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_37()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, -^#(@x, @y) -> #sub^#(@x, @y)
, #sub^#(@x, #0()) -> c_40()
, #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()) -> c_43()
, #div^#(#0(), #neg(@y)) -> c_44()
, #div^#(#0(), #pos(@y)) -> c_45()
, #div^#(#neg(@x), #0()) -> c_46()
, #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #0()) -> c_49()
, #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, eratos#1^#(nil()) -> c_7()
, filter#1^#(nil(), @p) -> c_10()
, filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
, filter#3^#(#false(), @x, @xs') -> c_13()
, filter#3^#(#true(), @x, @xs') -> c_14()
, mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, #and^#(#false(), #false()) -> c_65()
, #and^#(#false(), #true()) -> c_66()
, #and^#(#true(), #false()) -> c_67()
, #and^#(#true(), #true()) -> c_68()
, #natmult^#(#0(), @y) -> c_71()
, #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #add^#(#0(), @y) -> c_52()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natdiv^#(#0(), #0()) -> c_69()
, #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#0()) -> c_57()
, #pred^#(#neg(#s(@x))) -> c_58()
, #pred^#(#pos(#s(#0()))) -> c_59()
, #pred^#(#pos(#s(#s(@x)))) -> c_60()
, #succ^#(#0()) -> c_61()
, #succ^#(#neg(#s(#0()))) -> c_62()
, #succ^#(#neg(#s(#s(@x)))) -> c_63()
, #succ^#(#pos(#s(@x))) -> c_64()
, #natsub^#(@x, #0()) -> c_73()
, #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the the dependency graph
->1:{1,2}
|
|->3:{3,4}
| |
| |->4:{47} Weak SCC
| |
| `->5:{48} Weak SCC
| |
| |->6:{5} Weak SCC
| | |
| | |->12:{7} Weak SCC
| | |
| | |->13:{8} Weak SCC
| | |
| | |->14:{9} Weak SCC
| | |
| | |->15:{10} Weak SCC
| | |
| | |->16:{11} Weak SCC
| | |
| | |->17:{12} Weak SCC
| | |
| | |->18:{13} Weak SCC
| | |
| | |->19:{14} Weak SCC
| | |
| | |->20:{16} Weak SCC
| | |
| | |->21:{18} Weak SCC
| | |
| | |->22:{19} Weak SCC
| | |
| | |->23:{20} Weak SCC
| | |
| | `->7:{21,17,15,6} Weak SCC
| | |
| | |->12:{7} Weak SCC
| | |
| | |->13:{8} Weak SCC
| | |
| | |->14:{9} Weak SCC
| | |
| | |->15:{10} Weak SCC
| | |
| | |->16:{11} Weak SCC
| | |
| | |->17:{12} Weak SCC
| | |
| | |->18:{13} Weak SCC
| | |
| | |->19:{14} Weak SCC
| | |
| | |->20:{16} Weak SCC
| | |
| | |->21:{18} Weak SCC
| | |
| | |->22:{19} Weak SCC
| | |
| | |->23:{20} Weak SCC
| | |
| | |->8:{52} Weak SCC
| | |
| | |->9:{53} Weak SCC
| | |
| | |->10:{54} Weak SCC
| | |
| | `->11:{55} Weak SCC
| |
| |->24:{49} Weak SCC
| |
| |->25:{50} Weak SCC
| |
| `->26:{51} Weak SCC
| |
| |->27:{22} Weak SCC
| | |
| | |->28:{23} Weak SCC
| | |
| | |->29:{24} Weak SCC
| | |
| | |->30:{25} Weak SCC
| | |
| | |->31:{26} Weak SCC
| | |
| | |->33:{27} Weak SCC
| | | |
| | | |->38:{56} Weak SCC
| | | |
| | | `->37:{57} Weak SCC
| | | |
| | | |->38:{56} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69} Weak SCC
| | | | |
| | | | |->53:{70} Weak SCC
| | | | |
| | | | |->54:{71} Weak SCC
| | | | |
| | | | `->55:{72} Weak SCC
| | | |
| | | `->50:{62} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69}
Weak SCC
| | | | |
| | | | |->53:{70}
Weak SCC
| | | | |
| | | | |->54:{71}
Weak SCC
| | | | |
| | | | `->55:{72}
Weak SCC
| | | |
| | | |->52:{69} Weak SCC
| | | |
| | | |->53:{70} Weak SCC
| | | |
| | | |->54:{71} Weak SCC
| | | |
| | | `->55:{72} Weak SCC
| | |
| | |->34:{28} Weak SCC
| | | |
| | | |->38:{56} Weak SCC
| | | |
| | | `->37:{57} Weak SCC
| | | |
| | | |->38:{56} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69} Weak SCC
| | | | |
| | | | |->53:{70} Weak SCC
| | | | |
| | | | |->54:{71} Weak SCC
| | | | |
| | | | `->55:{72} Weak SCC
| | | |
| | | `->50:{62} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69}
Weak SCC
| | | | |
| | | | |->53:{70}
Weak SCC
| | | | |
| | | | |->54:{71}
Weak SCC
| | | | |
| | | | `->55:{72}
Weak SCC
| | | |
| | | |->52:{69} Weak SCC
| | | |
| | | |->53:{70} Weak SCC
| | | |
| | | |->54:{71} Weak SCC
| | | |
| | | `->55:{72} Weak SCC
| | |
| | |->32:{29} Weak SCC
| | |
| | |->35:{30} Weak SCC
| | | |
| | | |->38:{56} Weak SCC
| | | |
| | | `->37:{57} Weak SCC
| | | |
| | | |->38:{56} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69} Weak SCC
| | | | |
| | | | |->53:{70} Weak SCC
| | | | |
| | | | |->54:{71} Weak SCC
| | | | |
| | | | `->55:{72} Weak SCC
| | | |
| | | `->50:{62} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69}
Weak SCC
| | | | |
| | | | |->53:{70}
Weak SCC
| | | | |
| | | | |->54:{71}
Weak SCC
| | | | |
| | | | `->55:{72}
Weak SCC
| | | |
| | | |->52:{69} Weak SCC
| | | |
| | | |->53:{70} Weak SCC
| | | |
| | | |->54:{71} Weak SCC
| | | |
| | | `->55:{72} Weak SCC
| | |
| | `->36:{31} Weak SCC
| | |
| | |->38:{56} Weak SCC
| | |
| | `->37:{57} Weak SCC
| | |
| | |->38:{56} Weak SCC
| | |
| | |->51:{61} Weak SCC
| | | |
| | | |->52:{69} Weak SCC
| | | |
| | | |->53:{70} Weak SCC
| | | |
| | | |->54:{71} Weak SCC
| | | |
| | | `->55:{72} Weak SCC
| | |
| | `->50:{62} Weak SCC
| | |
| | |->51:{61} Weak SCC
| | | |
| | | |->52:{69}
Weak SCC
| | | |
| | | |->53:{70}
Weak SCC
| | | |
| | | |->54:{71}
Weak SCC
| | | |
| | | `->55:{72}
Weak SCC
| | |
| | |->52:{69} Weak SCC
| | |
| | |->53:{70} Weak SCC
| | |
| | |->54:{71} Weak SCC
| | |
| | `->55:{72} Weak SCC
| |
| |->39:{32} Weak SCC
| | |
| | |->40:{33} Weak SCC
| | |
| | |->41:{34} Weak SCC
| | | |
| | | |->43:{58} Weak SCC
| | | |
| | | |->44:{59} Weak SCC
| | | | |
| | | | |->46:{65} Weak SCC
| | | | |
| | | | |->47:{66} Weak SCC
| | | | |
| | | | |->48:{67} Weak SCC
| | | | |
| | | | `->49:{68} Weak SCC
| | | |
| | | |->45:{60} Weak SCC
| | | | |
| | | | |->51:{61} Weak SCC
| | | | | |
| | | | | |->52:{69} Weak SCC
| | | | | |
| | | | | |->53:{70} Weak SCC
| | | | | |
| | | | | |->54:{71} Weak SCC
| | | | | |
| | | | | `->55:{72} Weak SCC
| | | | |
| | | | |->50:{62} Weak SCC
| | | | | |
| | | | | |->51:{61} Weak SCC
| | | | | | |
| | | | | | |->52:{69}
Weak SCC
| | | | | | |
| | | | | | |->53:{70}
Weak SCC
| | | | | | |
| | | | | | |->54:{71}
Weak SCC
| | | | | | |
| | | | | | `->55:{72}
Weak SCC
| | | | | |
| | | | | |->52:{69} Weak SCC
| | | | | |
| | | | | |->53:{70} Weak SCC
| | | | | |
| | | | | |->54:{71} Weak SCC
| | | | | |
| | | | | `->55:{72} Weak SCC
| | | | |
| | | | |->46:{65} Weak SCC
| | | | |
| | | | |->47:{66} Weak SCC
| | | | |
| | | | |->48:{67} Weak SCC
| | | | |
| | | | `->49:{68} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69} Weak SCC
| | | | |
| | | | |->53:{70} Weak SCC
| | | | |
| | | | |->54:{71} Weak SCC
| | | | |
| | | | `->55:{72} Weak SCC
| | | |
| | | `->50:{62} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69} Weak SCC
| | | | |
| | | | |->53:{70} Weak SCC
| | | | |
| | | | |->54:{71} Weak SCC
| | | | |
| | | | `->55:{72} Weak SCC
| | | |
| | | |->52:{69} Weak SCC
| | | |
| | | |->53:{70} Weak SCC
| | | |
| | | |->54:{71} Weak SCC
| | | |
| | | `->55:{72} Weak SCC
| | |
| | `->42:{35} Weak SCC
| | |
| | |->43:{58} Weak SCC
| | |
| | |->44:{59} Weak SCC
| | | |
| | | |->46:{65} Weak SCC
| | | |
| | | |->47:{66} Weak SCC
| | | |
| | | |->48:{67} Weak SCC
| | | |
| | | `->49:{68} Weak SCC
| | |
| | |->45:{60} Weak SCC
| | | |
| | | |->51:{61} Weak SCC
| | | | |
| | | | |->52:{69} Weak SCC
| | | | |
| | | | |->53:{70} Weak SCC
| | | | |
| | | | |->54:{71} Weak SCC
| | | | |
| | | | `->55:{72} Weak SCC
| | | |
| | | |->50:{62} Weak SCC
| | | | |
| | | | |->51:{61} Weak SCC
| | | | | |
| | | | | |->52:{69}
Weak SCC
| | | | | |
| | | | | |->53:{70}
Weak SCC
| | | | | |
| | | | | |->54:{71}
Weak SCC
| | | | | |
| | | | | `->55:{72}
Weak SCC
| | | | |
| | | | |->52:{69} Weak SCC
| | | | |
| | | | |->53:{70} Weak SCC
| | | | |
| | | | |->54:{71} Weak SCC
| | | | |
| | | | `->55:{72} Weak SCC
| | | |
| | | |->46:{65} Weak SCC
| | | |
| | | |->47:{66} Weak SCC
| | | |
| | | |->48:{67} Weak SCC
| | | |
| | | `->49:{68} Weak SCC
| | |
| | |->51:{61} Weak SCC
| | | |
| | | |->52:{69} Weak SCC
| | | |
| | | |->53:{70} Weak SCC
| | | |
| | | |->54:{71} Weak SCC
| | | |
| | | `->55:{72} Weak SCC
| | |
| | `->50:{62} Weak SCC
| | |
| | |->51:{61} Weak SCC
| | | |
| | | |->52:{69} Weak SCC
| | | |
| | | |->53:{70} Weak SCC
| | | |
| | | |->54:{71} Weak SCC
| | | |
| | | `->55:{72} Weak SCC
| | |
| | |->52:{69} Weak SCC
| | |
| | |->53:{70} Weak SCC
| | |
| | |->54:{71} Weak SCC
| | |
| | `->55:{72} Weak SCC
| |
| `->56:{36} Weak SCC
| |
| |->57:{37} Weak SCC
| |
| |->58:{38} Weak SCC
| |
| |->59:{39} Weak SCC
| |
| |->60:{40} Weak SCC
| |
| |->62:{41} Weak SCC
| | |
| | |->66:{63} Weak SCC
| | |
| | `->67:{64} Weak SCC
| | |
| | |->69:{73} Weak SCC
| | |
| | `->68:{74} Weak SCC
| | |
| | `->69:{73} Weak SCC
| |
| |->63:{42} Weak SCC
| | |
| | |->66:{63} Weak SCC
| | |
| | `->67:{64} Weak SCC
| | |
| | |->69:{73} Weak SCC
| | |
| | `->68:{74} Weak SCC
| | |
| | `->69:{73} Weak SCC
| |
| |->61:{43} Weak SCC
| |
| |->64:{44} Weak SCC
| | |
| | |->66:{63} Weak SCC
| | |
| | `->67:{64} Weak SCC
| | |
| | |->69:{73} Weak SCC
| | |
| | `->68:{74} Weak SCC
| | |
| | `->69:{73} Weak SCC
| |
| `->65:{45} Weak SCC
| |
| |->66:{63} Weak SCC
| |
| `->67:{64} Weak SCC
| |
| |->69:{73} Weak SCC
| |
| `->68:{74} Weak SCC
| |
| `->69:{73} Weak SCC
|
`->2:{46} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: eratos^#(@l) -> eratos#1^#(@l)
, 2: eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, 3: filter^#(@p, @l) -> filter#1^#(@l, @p)
, 4: filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs)) }
Weak DPs:
{ 5: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 6: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 7: #eq^#(::(@x_1, @x_2), nil()) -> c_16()
, 8: #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
, 9: #eq^#(nil(), nil()) -> c_18()
, 10: #eq^#(#0(), #0()) -> c_19()
, 11: #eq^#(#0(), #s(@y)) -> c_20()
, 12: #eq^#(#0(), #neg(@y)) -> c_21()
, 13: #eq^#(#0(), #pos(@y)) -> c_22()
, 14: #eq^#(#s(@x), #0()) -> c_23()
, 15: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 16: #eq^#(#neg(@x), #0()) -> c_25()
, 17: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 18: #eq^#(#neg(@x), #pos(@y)) -> c_27()
, 19: #eq^#(#pos(@x), #0()) -> c_28()
, 20: #eq^#(#pos(@x), #neg(@y)) -> c_29()
, 21: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 22: *^#(@x, @y) -> #mult^#(@x, @y)
, 23: #mult^#(#0(), #0()) -> c_31()
, 24: #mult^#(#0(), #neg(@y)) -> c_32()
, 25: #mult^#(#0(), #pos(@y)) -> c_33()
, 26: #mult^#(#neg(@x), #0()) -> c_34()
, 27: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 28: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 29: #mult^#(#pos(@x), #0()) -> c_37()
, 30: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 31: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 32: -^#(@x, @y) -> #sub^#(@x, @y)
, 33: #sub^#(@x, #0()) -> c_40()
, 34: #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y))
, 35: #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y))
, 36: div^#(@x, @y) -> #div^#(@x, @y)
, 37: #div^#(#0(), #0()) -> c_43()
, 38: #div^#(#0(), #neg(@y)) -> c_44()
, 39: #div^#(#0(), #pos(@y)) -> c_45()
, 40: #div^#(#neg(@x), #0()) -> c_46()
, 41: #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, 42: #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, 43: #div^#(#pos(@x), #0()) -> c_49()
, 44: #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, 45: #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, 46: eratos#1^#(nil()) -> c_7()
, 47: filter#1^#(nil(), @p) -> c_10()
, 48: filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
, 49: filter#3^#(#false(), @x, @xs') -> c_13()
, 50: filter#3^#(#true(), @x, @xs') -> c_14()
, 51: mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, 52: #and^#(#false(), #false()) -> c_65()
, 53: #and^#(#false(), #true()) -> c_66()
, 54: #and^#(#true(), #false()) -> c_67()
, 55: #and^#(#true(), #true()) -> c_68()
, 56: #natmult^#(#0(), @y) -> c_71()
, 57: #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, 58: #add^#(#0(), @y) -> c_52()
, 59: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 60: #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 61: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 62: #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 63: #natdiv^#(#0(), #0()) -> c_69()
, 64: #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, 65: #pred^#(#0()) -> c_57()
, 66: #pred^#(#neg(#s(@x))) -> c_58()
, 67: #pred^#(#pos(#s(#0()))) -> c_59()
, 68: #pred^#(#pos(#s(#s(@x)))) -> c_60()
, 69: #succ^#(#0()) -> c_61()
, 70: #succ^#(#neg(#s(#0()))) -> c_62()
, 71: #succ^#(#neg(#s(#s(@x)))) -> c_63()
, 72: #succ^#(#pos(#s(@x))) -> c_64()
, 73: #natsub^#(@x, #0()) -> c_73()
, 74: #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 46: eratos#1^#(nil()) -> c_7()
, 47: filter#1^#(nil(), @p) -> c_10()
, 48: filter#2^#(@xs', @p, @x) ->
c_11(filter#3^#(#equal(mod(@x, @p), #0()), @x, @xs'),
#equal^#(mod(@x, @p), #0()),
mod^#(@x, @p))
, 5: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 21: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 17: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 15: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 6: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_15(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 52: #and^#(#false(), #false()) -> c_65()
, 53: #and^#(#false(), #true()) -> c_66()
, 54: #and^#(#true(), #false()) -> c_67()
, 55: #and^#(#true(), #true()) -> c_68()
, 7: #eq^#(::(@x_1, @x_2), nil()) -> c_16()
, 8: #eq^#(nil(), ::(@y_1, @y_2)) -> c_17()
, 9: #eq^#(nil(), nil()) -> c_18()
, 10: #eq^#(#0(), #0()) -> c_19()
, 11: #eq^#(#0(), #s(@y)) -> c_20()
, 12: #eq^#(#0(), #neg(@y)) -> c_21()
, 13: #eq^#(#0(), #pos(@y)) -> c_22()
, 14: #eq^#(#s(@x), #0()) -> c_23()
, 16: #eq^#(#neg(@x), #0()) -> c_25()
, 18: #eq^#(#neg(@x), #pos(@y)) -> c_27()
, 19: #eq^#(#pos(@x), #0()) -> c_28()
, 20: #eq^#(#pos(@x), #neg(@y)) -> c_29()
, 49: filter#3^#(#false(), @x, @xs') -> c_13()
, 50: filter#3^#(#true(), @x, @xs') -> c_14()
, 51: mod^#(@x, @y) ->
c_12(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, 22: *^#(@x, @y) -> #mult^#(@x, @y)
, 23: #mult^#(#0(), #0()) -> c_31()
, 24: #mult^#(#0(), #neg(@y)) -> c_32()
, 25: #mult^#(#0(), #pos(@y)) -> c_33()
, 26: #mult^#(#neg(@x), #0()) -> c_34()
, 29: #mult^#(#pos(@x), #0()) -> c_37()
, 27: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 28: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 30: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 31: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 57: #natmult^#(#s(@x), @y) ->
c_72(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, 56: #natmult^#(#0(), @y) -> c_71()
, 32: -^#(@x, @y) -> #sub^#(@x, @y)
, 33: #sub^#(@x, #0()) -> c_40()
, 34: #sub^#(@x, #neg(@y)) -> #add^#(@x, #pos(@y))
, 35: #sub^#(@x, #pos(@y)) -> #add^#(@x, #neg(@y))
, 58: #add^#(#0(), @y) -> c_52()
, 59: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 60: #add^#(#neg(#s(#s(@x))), @y) ->
c_54(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 65: #pred^#(#0()) -> c_57()
, 66: #pred^#(#neg(#s(@x))) -> c_58()
, 67: #pred^#(#pos(#s(#0()))) -> c_59()
, 68: #pred^#(#pos(#s(#s(@x)))) -> c_60()
, 62: #add^#(#pos(#s(#s(@x))), @y) ->
c_56(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 61: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 69: #succ^#(#0()) -> c_61()
, 70: #succ^#(#neg(#s(#0()))) -> c_62()
, 71: #succ^#(#neg(#s(#s(@x)))) -> c_63()
, 72: #succ^#(#pos(#s(@x))) -> c_64()
, 36: div^#(@x, @y) -> #div^#(@x, @y)
, 37: #div^#(#0(), #0()) -> c_43()
, 38: #div^#(#0(), #neg(@y)) -> c_44()
, 39: #div^#(#0(), #pos(@y)) -> c_45()
, 40: #div^#(#neg(@x), #0()) -> c_46()
, 43: #div^#(#pos(@x), #0()) -> c_49()
, 41: #div^#(#neg(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, 42: #div^#(#neg(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, 44: #div^#(#pos(@x), #neg(@y)) -> #natdiv^#(@x, @y)
, 45: #div^#(#pos(@x), #pos(@y)) -> #natdiv^#(@x, @y)
, 63: #natdiv^#(#0(), #0()) -> c_69()
, 64: #natdiv^#(#s(@x), #s(@y)) ->
c_70(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, 74: #natsub^#(#s(@x), #s(@y)) -> #natsub^#(@x, @y)
, 73: #natsub^#(@x, #0()) -> c_73() }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :2
2: eratos#1^#(::(@x, @xs)) ->
c_6(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
3: filter^#(@p, @l) -> filter#1^#(@l, @p)
-->_1 filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs)) :4
4: filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs))
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ filter#1^#(::(@x, @xs), @p) ->
c_9(filter#2^#(filter(@p, @xs), @p, @x), filter^#(@p, @xs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :2
2: eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
3: filter^#(@p, @l) -> filter#1^#(@l, @p)
-->_1 filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs) :4
4: filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs)
-->_1 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter^#(@p, @l) -> filter#1^#(@l, @p) }
Weak DPs: { filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :2
2: eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_2 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
3: filter^#(@p, @l) -> filter#1^#(@l, @p)
-->_1 filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs) :4
4: filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs)
-->_1 filter^#(@p, @l) -> filter#1^#(@l, @p) :3
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, filter^#(@p, @l) -> filter#1^#(@l, @p) }
Weak DPs:
{ eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, filter^#(@p, @l) -> filter#1^#(@l, @p) }
Weak DPs:
{ eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
, filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs) }
Remaining Rules (B):
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs: { filter^#(@p, @l) -> filter#1^#(@l, @p) }
Weak DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs))
, eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs)
, filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^1)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :2
2: eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { eratos^#(@l) -> eratos#1^#(@l) }
Weak DPs:
{ eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) :2
2: eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs))
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ eratos#1^#(::(@x, @xs)) ->
c_1(eratos^#(filter(@x, @xs)), filter^#(@x, @xs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { eratos^#(@l) -> eratos#1^#(@l) }
Weak DPs: { eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'matrix interpretation of dimension 1' to
orient following rules strictly.
DPs:
{ 2: eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs)) }
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()
, filter#3(#true(), @x, @xs') -> @xs' }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#equal) = {}, Uargs(#eq) = {}, Uargs(*) = {},
Uargs(#mult) = {}, Uargs(-) = {}, Uargs(#sub) = {},
Uargs(div) = {}, Uargs(#div) = {}, Uargs(::) = {},
Uargs(filter) = {}, Uargs(filter#1) = {}, Uargs(filter#2) = {},
Uargs(mod) = {}, Uargs(filter#3) = {}, Uargs(#add) = {},
Uargs(#s) = {}, Uargs(#neg) = {}, Uargs(#pred) = {},
Uargs(#pos) = {}, Uargs(#succ) = {}, Uargs(#and) = {},
Uargs(#natdiv) = {}, Uargs(#natmult) = {}, Uargs(#natsub) = {},
Uargs(#equal^#) = {}, Uargs(#eq^#) = {}, Uargs(*^#) = {},
Uargs(#mult^#) = {}, Uargs(-^#) = {}, Uargs(#sub^#) = {},
Uargs(div^#) = {}, Uargs(#div^#) = {}, Uargs(eratos^#) = {},
Uargs(eratos#1^#) = {}, Uargs(filter^#) = {},
Uargs(filter#1^#) = {}, Uargs(filter#2^#) = {},
Uargs(filter#3^#) = {}, Uargs(mod^#) = {}, Uargs(#and^#) = {},
Uargs(#natmult^#) = {}, Uargs(#add^#) = {}, Uargs(#natdiv^#) = {},
Uargs(#pred^#) = {}, Uargs(#succ^#) = {}, Uargs(#natsub^#) = {},
Uargs(c_1) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#equal](x1, x2) = [1] x1 + [3] x2 + [3]
[#eq](x1, x2) = [1] x1 + [0]
[*](x1, x2) = [0]
[#mult](x1, x2) = [0]
[-](x1, x2) = [1] x1 + [2] x2 + [0]
[#sub](x1, x2) = [1] x1 + [2] x2 + [0]
[div](x1, x2) = [0]
[#div](x1, x2) = [0]
[::](x1, x2) = [1] x2 + [1]
[filter](x1, x2) = [1] x2 + [0]
[nil] = [0]
[filter#1](x1, x2) = [1] x1 + [0]
[filter#2](x1, x2, x3) = [1] x1 + [1]
[mod](x1, x2) = [2] x1 + [0]
[#0] = [0]
[filter#3](x1, x2, x3) = [1] x3 + [1]
[#false] = [0]
[#true] = [0]
[#add](x1, x2) = [2] x2 + [0]
[#s](x1) = [1] x1 + [0]
[#neg](x1) = [1] x1 + [0]
[#pred](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#succ](x1) = [1] x1 + [0]
[#and](x1, x2) = [0]
[#divByZero] = [0]
[#natdiv](x1, x2) = [0]
[#natmult](x1, x2) = [0]
[#natsub](x1, x2) = [2] x1 + [0]
[#equal^#](x1, x2) = [0]
[#eq^#](x1, x2) = [0]
[*^#](x1, x2) = [0]
[#mult^#](x1, x2) = [0]
[-^#](x1, x2) = [0]
[#sub^#](x1, x2) = [0]
[div^#](x1, x2) = [0]
[#div^#](x1, x2) = [0]
[eratos^#](x1) = [2] x1 + [1]
[eratos#1^#](x1) = [2] x1 + [1]
[filter^#](x1, x2) = [0]
[filter#1^#](x1, x2) = [0]
[filter#2^#](x1, x2, x3) = [0]
[filter#3^#](x1, x2, x3) = [0]
[mod^#](x1, x2) = [0]
[#and^#](x1, x2) = [0]
[#natmult^#](x1, x2) = [0]
[#add^#](x1, x2) = [0]
[#natdiv^#](x1, x2) = [0]
[#pred^#](x1) = [0]
[#succ^#](x1) = [0]
[#natsub^#](x1, x2) = [0]
[c_1](x1, x2) = [0]
[c] = [0]
This order satisfies following ordering constraints
[#equal(@x, @y)] = [1] @x + [3] @y + [3]
> [1] @x + [0]
= [#eq(@x, @y)]
[#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [1] @x_2 + [1]
> [0]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(::(@x_1, @x_2), nil())] = [1] @x_2 + [1]
> [0]
= [#false()]
[#eq(nil(), ::(@y_1, @y_2))] = [0]
>= [0]
= [#false()]
[#eq(nil(), nil())] = [0]
>= [0]
= [#true()]
[#eq(#0(), #0())] = [0]
>= [0]
= [#true()]
[#eq(#0(), #s(@y))] = [0]
>= [0]
= [#false()]
[#eq(#0(), #neg(@y))] = [0]
>= [0]
= [#false()]
[#eq(#0(), #pos(@y))] = [0]
>= [0]
= [#false()]
[#eq(#s(@x), #0())] = [1] @x + [0]
>= [0]
= [#false()]
[#eq(#s(@x), #s(@y))] = [1] @x + [0]
>= [1] @x + [0]
= [#eq(@x, @y)]
[#eq(#neg(@x), #0())] = [1] @x + [0]
>= [0]
= [#false()]
[#eq(#neg(@x), #neg(@y))] = [1] @x + [0]
>= [1] @x + [0]
= [#eq(@x, @y)]
[#eq(#neg(@x), #pos(@y))] = [1] @x + [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #0())] = [1] @x + [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #neg(@y))] = [1] @x + [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #pos(@y))] = [1] @x + [0]
>= [1] @x + [0]
= [#eq(@x, @y)]
[*(@x, @y)] = [0]
>= [0]
= [#mult(@x, @y)]
[#mult(#0(), #0())] = [0]
>= [0]
= [#0()]
[#mult(#0(), #neg(@y))] = [0]
>= [0]
= [#0()]
[#mult(#0(), #pos(@y))] = [0]
>= [0]
= [#0()]
[#mult(#neg(@x), #0())] = [0]
>= [0]
= [#0()]
[#mult(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#pos(#natmult(@x, @y))]
[#mult(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#neg(#natmult(@x, @y))]
[#mult(#pos(@x), #0())] = [0]
>= [0]
= [#0()]
[#mult(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#neg(#natmult(@x, @y))]
[#mult(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#pos(#natmult(@x, @y))]
[-(@x, @y)] = [1] @x + [2] @y + [0]
>= [1] @x + [2] @y + [0]
= [#sub(@x, @y)]
[#sub(@x, #0())] = [1] @x + [0]
>= [1] @x + [0]
= [@x]
[#sub(@x, #neg(@y))] = [1] @x + [2] @y + [0]
>= [2] @y + [0]
= [#add(@x, #pos(@y))]
[#sub(@x, #pos(@y))] = [1] @x + [2] @y + [0]
>= [2] @y + [0]
= [#add(@x, #neg(@y))]
[div(@x, @y)] = [0]
>= [0]
= [#div(@x, @y)]
[#div(#0(), #0())] = [0]
>= [0]
= [#divByZero()]
[#div(#0(), #neg(@y))] = [0]
>= [0]
= [#0()]
[#div(#0(), #pos(@y))] = [0]
>= [0]
= [#0()]
[#div(#neg(@x), #0())] = [0]
>= [0]
= [#divByZero()]
[#div(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#pos(#natdiv(@x, @y))]
[#div(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#neg(#natdiv(@x, @y))]
[#div(#pos(@x), #0())] = [0]
>= [0]
= [#divByZero()]
[#div(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#neg(#natdiv(@x, @y))]
[#div(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#pos(#natdiv(@x, @y))]
[filter(@p, @l)] = [1] @l + [0]
>= [1] @l + [0]
= [filter#1(@l, @p)]
[filter#1(::(@x, @xs), @p)] = [1] @xs + [1]
>= [1] @xs + [1]
= [filter#2(filter(@p, @xs), @p, @x)]
[filter#1(nil(), @p)] = [0]
>= [0]
= [nil()]
[filter#2(@xs', @p, @x)] = [1] @xs' + [1]
>= [1] @xs' + [1]
= [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')]
[mod(@x, @y)] = [2] @x + [0]
>= [1] @x + [0]
= [-(@x, *(@x, div(@x, @y)))]
[filter#3(#false(), @x, @xs')] = [1] @xs' + [1]
>= [1] @xs' + [1]
= [::(@x, @xs')]
[filter#3(#true(), @x, @xs')] = [1] @xs' + [1]
> [1] @xs' + [0]
= [@xs']
[#add(#0(), @y)] = [2] @y + [0]
>= [1] @y + [0]
= [@y]
[#add(#neg(#s(#0())), @y)] = [2] @y + [0]
>= [1] @y + [0]
= [#pred(@y)]
[#add(#neg(#s(#s(@x))), @y)] = [2] @y + [0]
>= [2] @y + [0]
= [#pred(#add(#pos(#s(@x)), @y))]
[#add(#pos(#s(#0())), @y)] = [2] @y + [0]
>= [1] @y + [0]
= [#succ(@y)]
[#add(#pos(#s(#s(@x))), @y)] = [2] @y + [0]
>= [2] @y + [0]
= [#succ(#add(#pos(#s(@x)), @y))]
[#pred(#0())] = [0]
>= [0]
= [#neg(#s(#0()))]
[#pred(#neg(#s(@x)))] = [1] @x + [0]
>= [1] @x + [0]
= [#neg(#s(#s(@x)))]
[#pred(#pos(#s(#0())))] = [0]
>= [0]
= [#0()]
[#pred(#pos(#s(#s(@x))))] = [1] @x + [0]
>= [1] @x + [0]
= [#pos(#s(@x))]
[#succ(#0())] = [0]
>= [0]
= [#pos(#s(#0()))]
[#succ(#neg(#s(#0())))] = [0]
>= [0]
= [#0()]
[#succ(#neg(#s(#s(@x))))] = [1] @x + [0]
>= [1] @x + [0]
= [#neg(#s(@x))]
[#succ(#pos(#s(@x)))] = [1] @x + [0]
>= [1] @x + [0]
= [#pos(#s(#s(@x)))]
[#and(#false(), #false())] = [0]
>= [0]
= [#false()]
[#and(#false(), #true())] = [0]
>= [0]
= [#false()]
[#and(#true(), #false())] = [0]
>= [0]
= [#false()]
[#and(#true(), #true())] = [0]
>= [0]
= [#true()]
[#natdiv(#0(), #0())] = [0]
>= [0]
= [#divByZero()]
[#natdiv(#s(@x), #s(@y))] = [0]
>= [0]
= [#s(#natdiv(#natsub(@x, @y), #s(@y)))]
[#natmult(#0(), @y)] = [0]
>= [0]
= [#0()]
[#natmult(#s(@x), @y)] = [0]
>= [0]
= [#add(#pos(@y), #natmult(@x, @y))]
[#natsub(@x, #0())] = [2] @x + [0]
>= [1] @x + [0]
= [@x]
[#natsub(#s(@x), #s(@y))] = [2] @x + [0]
>= [2] @x + [0]
= [#natsub(@x, @y)]
[eratos^#(@l)] = [2] @l + [1]
>= [2] @l + [1]
= [eratos#1^#(@l)]
[eratos#1^#(::(@x, @xs))] = [2] @xs + [3]
> [2] @xs + [1]
= [eratos^#(filter(@x, @xs))]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules {2}.
Here rules are labeled according to the (estimated) dependency
graph
1: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs)) :2
2: eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs))
-->_1 eratos^#(@l) -> eratos#1^#(@l) :1
- The rules {2} have known complexity. These cover all predecessors
of {1}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules {1,2}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: eratos^#(@l) -> eratos#1^#(@l)
, 2: eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: eratos^#(@l) -> eratos#1^#(@l)
, 2: eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs)) }
We apply the transformation 'usablerules' on the sub-problem:
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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { filter^#(@p, @l) -> filter#1^#(@l, @p) }
Weak DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs))
, eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs)
, filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'matrix interpretation of dimension 1' to
orient following rules strictly.
DPs:
{ 1: filter^#(@p, @l) -> filter#1^#(@l, @p)
, 4: eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs)
, 5: filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs) }
Trs:
{ #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))
, filter#1(nil(), @p) -> nil()
, filter#3(#true(), @x, @xs') -> @xs'
, #natmult(#0(), @y) -> #0() }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#equal) = {}, Uargs(#eq) = {}, Uargs(*) = {},
Uargs(#mult) = {}, Uargs(-) = {}, Uargs(#sub) = {},
Uargs(div) = {}, Uargs(#div) = {}, Uargs(::) = {},
Uargs(filter) = {}, Uargs(filter#1) = {}, Uargs(filter#2) = {},
Uargs(mod) = {}, Uargs(filter#3) = {}, Uargs(#add) = {},
Uargs(#s) = {}, Uargs(#neg) = {}, Uargs(#pred) = {},
Uargs(#pos) = {}, Uargs(#succ) = {}, Uargs(#and) = {},
Uargs(#natdiv) = {}, Uargs(#natmult) = {}, Uargs(#natsub) = {},
Uargs(#equal^#) = {}, Uargs(#eq^#) = {}, Uargs(*^#) = {},
Uargs(#mult^#) = {}, Uargs(-^#) = {}, Uargs(#sub^#) = {},
Uargs(div^#) = {}, Uargs(#div^#) = {}, Uargs(eratos^#) = {},
Uargs(eratos#1^#) = {}, Uargs(filter^#) = {},
Uargs(filter#1^#) = {}, Uargs(filter#2^#) = {},
Uargs(filter#3^#) = {}, Uargs(mod^#) = {}, Uargs(#and^#) = {},
Uargs(#natmult^#) = {}, Uargs(#add^#) = {}, Uargs(#natdiv^#) = {},
Uargs(#pred^#) = {}, Uargs(#succ^#) = {}, Uargs(#natsub^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#equal](x1, x2) = [1] x2 + [0]
[#eq](x1, x2) = [0]
[*](x1, x2) = [2] x1 + [1] x2 + [3]
[#mult](x1, x2) = [1] x1 + [1] x2 + [3]
[-](x1, x2) = [1] x1 + [1] x2 + [0]
[#sub](x1, x2) = [1] x1 + [1] x2 + [0]
[div](x1, x2) = [1] x2 + [0]
[#div](x1, x2) = [1] x2 + [0]
[::](x1, x2) = [1] x1 + [1] x2 + [2]
[filter](x1, x2) = [1] x2 + [2]
[nil] = [1]
[filter#1](x1, x2) = [1] x1 + [2]
[filter#2](x1, x2, x3) = [1] x1 + [1] x3 + [2]
[mod](x1, x2) = [3] x1 + [3] x2 + [3]
[#0] = [0]
[filter#3](x1, x2, x3) = [2] x1 + [1] x2 + [1] x3 + [2]
[#false] = [0]
[#true] = [0]
[#add](x1, x2) = [1] x2 + [0]
[#s](x1) = [1] x1 + [0]
[#neg](x1) = [1] x1 + [0]
[#pred](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#succ](x1) = [1] x1 + [0]
[#and](x1, x2) = [0]
[#divByZero] = [0]
[#natdiv](x1, x2) = [0]
[#natmult](x1, x2) = [2]
[#natsub](x1, x2) = [2] x1 + [0]
[#equal^#](x1, x2) = [0]
[#eq^#](x1, x2) = [0]
[*^#](x1, x2) = [0]
[#mult^#](x1, x2) = [0]
[-^#](x1, x2) = [0]
[#sub^#](x1, x2) = [0]
[div^#](x1, x2) = [0]
[#div^#](x1, x2) = [0]
[eratos^#](x1) = [2] x1 + [2]
[eratos#1^#](x1) = [2] x1 + [2]
[filter^#](x1, x2) = [2] x2 + [1]
[filter#1^#](x1, x2) = [2] x1 + [0]
[filter#2^#](x1, x2, x3) = [0]
[filter#3^#](x1, x2, x3) = [0]
[mod^#](x1, x2) = [0]
[#and^#](x1, x2) = [0]
[#natmult^#](x1, x2) = [0]
[#add^#](x1, x2) = [0]
[#natdiv^#](x1, x2) = [0]
[#pred^#](x1) = [0]
[#succ^#](x1) = [0]
[#natsub^#](x1, x2) = [0]
This order satisfies following ordering constraints
[#equal(@x, @y)] = [1] @y + [0]
>= [0]
= [#eq(@x, @y)]
[#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0]
>= [0]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(::(@x_1, @x_2), nil())] = [0]
>= [0]
= [#false()]
[#eq(nil(), ::(@y_1, @y_2))] = [0]
>= [0]
= [#false()]
[#eq(nil(), nil())] = [0]
>= [0]
= [#true()]
[#eq(#0(), #0())] = [0]
>= [0]
= [#true()]
[#eq(#0(), #s(@y))] = [0]
>= [0]
= [#false()]
[#eq(#0(), #neg(@y))] = [0]
>= [0]
= [#false()]
[#eq(#0(), #pos(@y))] = [0]
>= [0]
= [#false()]
[#eq(#s(@x), #0())] = [0]
>= [0]
= [#false()]
[#eq(#s(@x), #s(@y))] = [0]
>= [0]
= [#eq(@x, @y)]
[#eq(#neg(@x), #0())] = [0]
>= [0]
= [#false()]
[#eq(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#eq(@x, @y)]
[#eq(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #0())] = [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#eq(@x, @y)]
[*(@x, @y)] = [2] @x + [1] @y + [3]
>= [1] @x + [1] @y + [3]
= [#mult(@x, @y)]
[#mult(#0(), #0())] = [3]
> [0]
= [#0()]
[#mult(#0(), #neg(@y))] = [1] @y + [3]
> [0]
= [#0()]
[#mult(#0(), #pos(@y))] = [1] @y + [3]
> [0]
= [#0()]
[#mult(#neg(@x), #0())] = [1] @x + [3]
> [0]
= [#0()]
[#mult(#neg(@x), #neg(@y))] = [1] @x + [1] @y + [3]
> [2]
= [#pos(#natmult(@x, @y))]
[#mult(#neg(@x), #pos(@y))] = [1] @x + [1] @y + [3]
> [2]
= [#neg(#natmult(@x, @y))]
[#mult(#pos(@x), #0())] = [1] @x + [3]
> [0]
= [#0()]
[#mult(#pos(@x), #neg(@y))] = [1] @x + [1] @y + [3]
> [2]
= [#neg(#natmult(@x, @y))]
[#mult(#pos(@x), #pos(@y))] = [1] @x + [1] @y + [3]
> [2]
= [#pos(#natmult(@x, @y))]
[-(@x, @y)] = [1] @x + [1] @y + [0]
>= [1] @x + [1] @y + [0]
= [#sub(@x, @y)]
[#sub(@x, #0())] = [1] @x + [0]
>= [1] @x + [0]
= [@x]
[#sub(@x, #neg(@y))] = [1] @x + [1] @y + [0]
>= [1] @y + [0]
= [#add(@x, #pos(@y))]
[#sub(@x, #pos(@y))] = [1] @x + [1] @y + [0]
>= [1] @y + [0]
= [#add(@x, #neg(@y))]
[div(@x, @y)] = [1] @y + [0]
>= [1] @y + [0]
= [#div(@x, @y)]
[#div(#0(), #0())] = [0]
>= [0]
= [#divByZero()]
[#div(#0(), #neg(@y))] = [1] @y + [0]
>= [0]
= [#0()]
[#div(#0(), #pos(@y))] = [1] @y + [0]
>= [0]
= [#0()]
[#div(#neg(@x), #0())] = [0]
>= [0]
= [#divByZero()]
[#div(#neg(@x), #neg(@y))] = [1] @y + [0]
>= [0]
= [#pos(#natdiv(@x, @y))]
[#div(#neg(@x), #pos(@y))] = [1] @y + [0]
>= [0]
= [#neg(#natdiv(@x, @y))]
[#div(#pos(@x), #0())] = [0]
>= [0]
= [#divByZero()]
[#div(#pos(@x), #neg(@y))] = [1] @y + [0]
>= [0]
= [#neg(#natdiv(@x, @y))]
[#div(#pos(@x), #pos(@y))] = [1] @y + [0]
>= [0]
= [#pos(#natdiv(@x, @y))]
[filter(@p, @l)] = [1] @l + [2]
>= [1] @l + [2]
= [filter#1(@l, @p)]
[filter#1(::(@x, @xs), @p)] = [1] @x + [1] @xs + [4]
>= [1] @x + [1] @xs + [4]
= [filter#2(filter(@p, @xs), @p, @x)]
[filter#1(nil(), @p)] = [3]
> [1]
= [nil()]
[filter#2(@xs', @p, @x)] = [1] @x + [1] @xs' + [2]
>= [1] @x + [1] @xs' + [2]
= [filter#3(#equal(mod(@x, @p), #0()), @x, @xs')]
[mod(@x, @y)] = [3] @x + [3] @y + [3]
>= [3] @x + [1] @y + [3]
= [-(@x, *(@x, div(@x, @y)))]
[filter#3(#false(), @x, @xs')] = [1] @x + [1] @xs' + [2]
>= [1] @x + [1] @xs' + [2]
= [::(@x, @xs')]
[filter#3(#true(), @x, @xs')] = [1] @x + [1] @xs' + [2]
> [1] @xs' + [0]
= [@xs']
[#add(#0(), @y)] = [1] @y + [0]
>= [1] @y + [0]
= [@y]
[#add(#neg(#s(#0())), @y)] = [1] @y + [0]
>= [1] @y + [0]
= [#pred(@y)]
[#add(#neg(#s(#s(@x))), @y)] = [1] @y + [0]
>= [1] @y + [0]
= [#pred(#add(#pos(#s(@x)), @y))]
[#add(#pos(#s(#0())), @y)] = [1] @y + [0]
>= [1] @y + [0]
= [#succ(@y)]
[#add(#pos(#s(#s(@x))), @y)] = [1] @y + [0]
>= [1] @y + [0]
= [#succ(#add(#pos(#s(@x)), @y))]
[#pred(#0())] = [0]
>= [0]
= [#neg(#s(#0()))]
[#pred(#neg(#s(@x)))] = [1] @x + [0]
>= [1] @x + [0]
= [#neg(#s(#s(@x)))]
[#pred(#pos(#s(#0())))] = [0]
>= [0]
= [#0()]
[#pred(#pos(#s(#s(@x))))] = [1] @x + [0]
>= [1] @x + [0]
= [#pos(#s(@x))]
[#succ(#0())] = [0]
>= [0]
= [#pos(#s(#0()))]
[#succ(#neg(#s(#0())))] = [0]
>= [0]
= [#0()]
[#succ(#neg(#s(#s(@x))))] = [1] @x + [0]
>= [1] @x + [0]
= [#neg(#s(@x))]
[#succ(#pos(#s(@x)))] = [1] @x + [0]
>= [1] @x + [0]
= [#pos(#s(#s(@x)))]
[#and(#false(), #false())] = [0]
>= [0]
= [#false()]
[#and(#false(), #true())] = [0]
>= [0]
= [#false()]
[#and(#true(), #false())] = [0]
>= [0]
= [#false()]
[#and(#true(), #true())] = [0]
>= [0]
= [#true()]
[#natdiv(#0(), #0())] = [0]
>= [0]
= [#divByZero()]
[#natdiv(#s(@x), #s(@y))] = [0]
>= [0]
= [#s(#natdiv(#natsub(@x, @y), #s(@y)))]
[#natmult(#0(), @y)] = [2]
> [0]
= [#0()]
[#natmult(#s(@x), @y)] = [2]
>= [2]
= [#add(#pos(@y), #natmult(@x, @y))]
[#natsub(@x, #0())] = [2] @x + [0]
>= [1] @x + [0]
= [@x]
[#natsub(#s(@x), #s(@y))] = [2] @x + [0]
>= [2] @x + [0]
= [#natsub(@x, @y)]
[eratos^#(@l)] = [2] @l + [2]
>= [2] @l + [2]
= [eratos#1^#(@l)]
[eratos#1^#(::(@x, @xs))] = [2] @x + [2] @xs + [6]
>= [2] @xs + [6]
= [eratos^#(filter(@x, @xs))]
[eratos#1^#(::(@x, @xs))] = [2] @x + [2] @xs + [6]
> [2] @xs + [1]
= [filter^#(@x, @xs)]
[filter^#(@p, @l)] = [2] @l + [1]
> [2] @l + [0]
= [filter#1^#(@l, @p)]
[filter#1^#(::(@x, @xs), @p)] = [2] @x + [2] @xs + [4]
> [2] @xs + [1]
= [filter^#(@p, @xs)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{1,4,5}. Here rules are labeled according to the (estimated)
dependency graph
1: filter^#(@p, @l) -> filter#1^#(@l, @p)
-->_1 filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs) :5
2: eratos^#(@l) -> eratos#1^#(@l)
-->_1 eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs) :4
-->_1 eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs)) :3
3: eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs))
-->_1 eratos^#(@l) -> eratos#1^#(@l) :2
4: eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs)
-->_1 filter^#(@p, @l) -> filter#1^#(@l, @p) :1
5: filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs)
-->_1 filter^#(@p, @l) -> filter#1^#(@l, @p) :1
Overall, we obtain that the number of applications of rules {1,4,5}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ eratos^#(@l) -> eratos#1^#(@l)
, eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs))
, eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs)
, filter^#(@p, @l) -> filter#1^#(@l, @p)
, filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @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))
, -(@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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,2} Weak SCC
|
`->2:{3} Weak SCC
|
`->3:{4,5} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: eratos^#(@l) -> eratos#1^#(@l)
, 2: eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs))
, 3: eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs)
, 4: filter^#(@p, @l) -> filter#1^#(@l, @p)
, 5: filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: eratos^#(@l) -> eratos#1^#(@l)
, 2: eratos#1^#(::(@x, @xs)) -> eratos^#(filter(@x, @xs))
, 3: eratos#1^#(::(@x, @xs)) -> filter^#(@x, @xs)
, 4: filter^#(@p, @l) -> filter#1^#(@l, @p)
, 5: filter#1^#(::(@x, @xs), @p) -> filter^#(@p, @xs) }
We apply the transformation 'usablerules' on the sub-problem:
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)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, 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, *(@x, 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(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y) }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
Hurray, we answered YES(O(1),O(n^2))