We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict Trs:
{ -(@x, @y) -> #sub(@x, @y)
, sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0())))
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, bitToInt'#1(nil(), @n) -> #abs(#0())
, bitToInt'#1(::(@x, @xs), @n) ->
+(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0()))))))
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2)
, sub#1(tuple#2(@b, @_@1)) -> @b
, leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0())))
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, bitToInt'(@b, @n) -> bitToInt'#1(@b, @n)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0()))))
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs)
, sub'#5(#false(), @z, @zs) -> ::(@z, @zs)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, sub'#3(tuple#2(@z, @r'), @xs, @ys) ->
sub'#4(sub'(@xs, @ys, @r'), @z)
, #equal(@x, @y) -> #eq(@x, @y)
, sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r)
, sub'#2(::(@y, @ys), @r, @x, @xs) ->
sub'#3(diff(@x, @y, @r), @xs, @ys)
, compare#2(nil(), @x, @xs) -> #abs(#0())
, compare#2(::(@y, @ys), @x, @xs) ->
compare#3(compare(@xs, @ys), @x, @y)
, sub'#4(tuple#2(@zs, @s), @z) ->
tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s)
, compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0())))
, compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y))
, compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y)
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r)
, sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs)
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r)
, compare(@b1, @b2) -> compare#1(@b1, @b2)
, compare#6(#true()) -> #abs(#pos(#s(#0())))
, compare#6(#false()) -> #abs(#0())
, compare#4(#true(), @r, @x, @y) ->
compare#5(#less(@x, @y), @x, @y)
, compare#4(#false(), @r, @x, @y) -> @r
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, compare#1(nil(), @b2) -> #abs(#0())
, compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #ckgt(#EQ()) -> #false()
, #ckgt(#LT()) -> #false()
, #ckgt(#GT()) -> #true()
, #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))
, #add(#0(), @y) -> @y
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We add the following dependency tuples:
Strict DPs:
{ -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, #abs^#(#neg(@x)) -> c_62()
, #abs^#(#pos(@x)) -> c_63()
, #abs^#(#0()) -> c_64()
, #abs^#(#s(@x)) -> c_65()
, diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, diff#1^#(#false()) -> c_4(#abs^#(#0()))
, mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, mult#3^#(#false(), @b2, @zs) -> c_43()
, #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, div^#(@x, @y) -> c_6(#div^#(@x, @y))
, bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, +^#(@x, @y) -> c_21(#add^#(@x, @y))
, *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, mult#1^#(nil(), @b2) -> c_49()
, mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, sum#4^#(#true()) -> c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, sub'#5^#(#false(), @z, @zs) -> c_26()
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, compare#5^#(#true(), @x, @y) -> c_35(-^#(#0(), #pos(#s(#0()))))
, compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, compare#6^#(#false()) -> c_54(#abs^#(#0()))
, compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, compare#4^#(#false(), @r, @x, @y) -> c_56()
, add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, sub'#1^#(nil(), @b2, @r) -> c_40()
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, add'#1^#(nil(), @b2, @r) -> c_44()
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(nil(), @r, @x, @xs) -> c_46()
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, #sub^#(@x, #0()) -> c_122()
, #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #0()) -> c_138()
, #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #0()) -> c_141()
, #div^#(#0(), #neg(@y)) -> c_142()
, #div^#(#0(), #pos(@y)) -> c_143()
, #div^#(#0(), #0()) -> c_144()
, #ckgt^#(#EQ()) -> c_70()
, #ckgt^#(#LT()) -> c_71()
, #ckgt^#(#GT()) -> c_72()
, #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, #compare^#(#neg(@x), #pos(@y)) -> c_83()
, #compare^#(#neg(@x), #0()) -> c_84()
, #compare^#(#pos(@x), #neg(@y)) -> c_85()
, #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, #compare^#(#pos(@x), #0()) -> c_87()
, #compare^#(#0(), #neg(@y)) -> c_88()
, #compare^#(#0(), #pos(@y)) -> c_89()
, #compare^#(#0(), #0()) -> c_90()
, #compare^#(#0(), #s(@y)) -> c_91()
, #compare^#(#s(@x), #0()) -> c_92()
, #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#0(), @y) -> c_77()
, #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #0()) -> c_125()
, #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #0()) -> c_128()
, #mult^#(#0(), #neg(@y)) -> c_129()
, #mult^#(#0(), #pos(@y)) -> c_130()
, #mult^#(#0(), #0()) -> c_131()
, #cklt^#(#EQ()) -> c_117()
, #cklt^#(#LT()) -> c_118()
, #cklt^#(#GT()) -> c_119()
, #eq^#(nil(), nil()) -> c_94()
, #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, #eq^#(#neg(@x), #pos(@y)) -> c_98()
, #eq^#(#neg(@x), #0()) -> c_99()
, #eq^#(#pos(@x), #neg(@y)) -> c_100()
, #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, #eq^#(#pos(@x), #0()) -> c_102()
, #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(#0(), #neg(@y)) -> c_109()
, #eq^#(#0(), #pos(@y)) -> c_110()
, #eq^#(#0(), #0()) -> c_111()
, #eq^#(#0(), #s(@y)) -> c_112()
, #eq^#(#s(@x), #0()) -> c_113()
, #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, #natsub^#(@x, #0()) -> c_66()
, #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, #natdiv^#(#0(), #0()) -> c_68()
, #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#neg(#s(@x))) -> c_145()
, #pred^#(#pos(#s(#0()))) -> c_146()
, #pred^#(#pos(#s(#s(@x)))) -> c_147()
, #pred^#(#0()) -> c_148()
, #succ^#(#neg(#s(#0()))) -> c_132()
, #succ^#(#neg(#s(#s(@x)))) -> c_133()
, #succ^#(#pos(#s(@x))) -> c_134()
, #succ^#(#0()) -> c_135()
, #and^#(#true(), #true()) -> c_78()
, #and^#(#true(), #false()) -> c_79()
, #and^#(#false(), #true()) -> c_80()
, #and^#(#false(), #false()) -> c_81()
, #natmult^#(#0(), @y) -> c_115()
, #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
and mark the set of starting terms.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, #abs^#(#neg(@x)) -> c_62()
, #abs^#(#pos(@x)) -> c_63()
, #abs^#(#0()) -> c_64()
, #abs^#(#s(@x)) -> c_65()
, diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, diff#1^#(#false()) -> c_4(#abs^#(#0()))
, mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, mult#3^#(#false(), @b2, @zs) -> c_43()
, #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, div^#(@x, @y) -> c_6(#div^#(@x, @y))
, bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, +^#(@x, @y) -> c_21(#add^#(@x, @y))
, *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, mult#1^#(nil(), @b2) -> c_49()
, mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, sum#4^#(#true()) -> c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, sub'#5^#(#false(), @z, @zs) -> c_26()
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, compare#5^#(#true(), @x, @y) -> c_35(-^#(#0(), #pos(#s(#0()))))
, compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, compare#6^#(#false()) -> c_54(#abs^#(#0()))
, compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, compare#4^#(#false(), @r, @x, @y) -> c_56()
, add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, sub'#1^#(nil(), @b2, @r) -> c_40()
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, add'#1^#(nil(), @b2, @r) -> c_44()
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(nil(), @r, @x, @xs) -> c_46()
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, #sub^#(@x, #0()) -> c_122()
, #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #0()) -> c_138()
, #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #0()) -> c_141()
, #div^#(#0(), #neg(@y)) -> c_142()
, #div^#(#0(), #pos(@y)) -> c_143()
, #div^#(#0(), #0()) -> c_144()
, #ckgt^#(#EQ()) -> c_70()
, #ckgt^#(#LT()) -> c_71()
, #ckgt^#(#GT()) -> c_72()
, #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, #compare^#(#neg(@x), #pos(@y)) -> c_83()
, #compare^#(#neg(@x), #0()) -> c_84()
, #compare^#(#pos(@x), #neg(@y)) -> c_85()
, #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, #compare^#(#pos(@x), #0()) -> c_87()
, #compare^#(#0(), #neg(@y)) -> c_88()
, #compare^#(#0(), #pos(@y)) -> c_89()
, #compare^#(#0(), #0()) -> c_90()
, #compare^#(#0(), #s(@y)) -> c_91()
, #compare^#(#s(@x), #0()) -> c_92()
, #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#0(), @y) -> c_77()
, #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #0()) -> c_125()
, #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #0()) -> c_128()
, #mult^#(#0(), #neg(@y)) -> c_129()
, #mult^#(#0(), #pos(@y)) -> c_130()
, #mult^#(#0(), #0()) -> c_131()
, #cklt^#(#EQ()) -> c_117()
, #cklt^#(#LT()) -> c_118()
, #cklt^#(#GT()) -> c_119()
, #eq^#(nil(), nil()) -> c_94()
, #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, #eq^#(#neg(@x), #pos(@y)) -> c_98()
, #eq^#(#neg(@x), #0()) -> c_99()
, #eq^#(#pos(@x), #neg(@y)) -> c_100()
, #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, #eq^#(#pos(@x), #0()) -> c_102()
, #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(#0(), #neg(@y)) -> c_109()
, #eq^#(#0(), #pos(@y)) -> c_110()
, #eq^#(#0(), #0()) -> c_111()
, #eq^#(#0(), #s(@y)) -> c_112()
, #eq^#(#s(@x), #0()) -> c_113()
, #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, #natsub^#(@x, #0()) -> c_66()
, #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, #natdiv^#(#0(), #0()) -> c_68()
, #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#neg(#s(@x))) -> c_145()
, #pred^#(#pos(#s(#0()))) -> c_146()
, #pred^#(#pos(#s(#s(@x)))) -> c_147()
, #pred^#(#0()) -> c_148()
, #succ^#(#neg(#s(#0()))) -> c_132()
, #succ^#(#neg(#s(#s(@x)))) -> c_133()
, #succ^#(#pos(#s(@x))) -> c_134()
, #succ^#(#0()) -> c_135()
, #and^#(#true(), #true()) -> c_78()
, #and^#(#true(), #false()) -> c_79()
, #and^#(#false(), #true()) -> c_80()
, #and^#(#false(), #false()) -> c_81()
, #natmult^#(#0(), @y) -> c_115()
, #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0())))
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #ckgt(#EQ()) -> #false()
, #ckgt(#LT()) -> #false()
, #ckgt(#GT()) -> #true()
, #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, bitToInt'#1(nil(), @n) -> #abs(#0())
, bitToInt'#1(::(@x, @xs), @n) ->
+(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0()))))))
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2)
, sub#1(tuple#2(@b, @_@1)) -> @b
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0())))
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, bitToInt'(@b, @n) -> bitToInt'#1(@b, @n)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0()))))
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs)
, sub'#5(#false(), @z, @zs) -> ::(@z, @zs)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, sub'#3(tuple#2(@z, @r'), @xs, @ys) ->
sub'#4(sub'(@xs, @ys, @r'), @z)
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r)
, sub'#2(::(@y, @ys), @r, @x, @xs) ->
sub'#3(diff(@x, @y, @r), @xs, @ys)
, compare#2(nil(), @x, @xs) -> #abs(#0())
, compare#2(::(@y, @ys), @x, @xs) ->
compare#3(compare(@xs, @ys), @x, @y)
, sub'#4(tuple#2(@zs, @s), @z) ->
tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s)
, compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0())))
, compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y))
, compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r)
, sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs)
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r)
, compare(@b1, @b2) -> compare#1(@b1, @b2)
, compare#6(#true()) -> #abs(#pos(#s(#0())))
, compare#6(#false()) -> #abs(#0())
, compare#4(#true(), @r, @x, @y) ->
compare#5(#less(@x, @y), @x, @y)
, compare#4(#false(), @r, @x, @y) -> @r
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, compare#1(nil(), @b2) -> #abs(#0())
, compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We estimate the number of application of
{1,3,5,6,7,8,13,14,15,18,19,27,29,30,40,43,54,58,60,62} by
applications of
Pre({1,3,5,6,7,8,13,14,15,18,19,27,29,30,40,43,54,58,60,62}) =
{2,4,9,10,11,16,17,21,22,23,25,26,31,32,33,34,35,36,37,38,39,42,45,46,48,49,50,51,52,53,55,56,59,61,64}.
Here rules are labeled as follows:
DPs:
{ 1: -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, 2: sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, 3: sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, 4: sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, 5: #abs^#(#neg(@x)) -> c_62()
, 6: #abs^#(#pos(@x)) -> c_63()
, 7: #abs^#(#0()) -> c_64()
, 8: #abs^#(#s(@x)) -> c_65()
, 9: diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, 10: diff#1^#(#false()) -> c_4(#abs^#(#0()))
, 11: mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, 12: mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, 13: mult#3^#(#false(), @b2, @zs) -> c_43()
, 14: #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, 15: div^#(@x, @y) -> c_6(#div^#(@x, @y))
, 16: bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, 17: bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, 18: +^#(@x, @y) -> c_21(#add^#(@x, @y))
, 19: *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, 20: bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, 21: sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, 22: sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, 23: mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, 24: mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, 25: mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, 26: leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, 27: #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 28: compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, 29: #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 30: mult#1^#(nil(), @b2) -> c_49()
, 31: mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, 32: bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, 33: sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, 34: sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, 35: sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, 36: sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, 37: sum#4^#(#true()) ->
c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, 38: sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, 39: sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, 40: sub'#5^#(#false(), @z, @zs) -> c_26()
, 41: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, 42: sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, 43: sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, 44: sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, 45: diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, 46: compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, 47: compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, 48: compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, 49: compare#5^#(#true(), @x, @y) ->
c_35(-^#(#0(), #pos(#s(#0()))))
, 50: compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, 51: compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, 52: compare#6^#(#false()) -> c_54(#abs^#(#0()))
, 53: compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, 54: compare#4^#(#false(), @r, @x, @y) -> c_56()
, 55: add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, 56: add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, 57: add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, 58: sub'#1^#(nil(), @b2, @r) -> c_40()
, 59: sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, 60: add'#1^#(nil(), @b2, @r) -> c_44()
, 61: add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, 62: add'#2^#(nil(), @r, @x, @xs) -> c_46()
, 63: add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, 64: compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, 65: compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs))
, 66: #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, 67: #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, 68: #sub^#(@x, #0()) -> c_122()
, 69: #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, 70: #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, 71: #div^#(#neg(@x), #0()) -> c_138()
, 72: #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, 73: #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, 74: #div^#(#pos(@x), #0()) -> c_141()
, 75: #div^#(#0(), #neg(@y)) -> c_142()
, 76: #div^#(#0(), #pos(@y)) -> c_143()
, 77: #div^#(#0(), #0()) -> c_144()
, 78: #ckgt^#(#EQ()) -> c_70()
, 79: #ckgt^#(#LT()) -> c_71()
, 80: #ckgt^#(#GT()) -> c_72()
, 81: #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, 82: #compare^#(#neg(@x), #pos(@y)) -> c_83()
, 83: #compare^#(#neg(@x), #0()) -> c_84()
, 84: #compare^#(#pos(@x), #neg(@y)) -> c_85()
, 85: #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, 86: #compare^#(#pos(@x), #0()) -> c_87()
, 87: #compare^#(#0(), #neg(@y)) -> c_88()
, 88: #compare^#(#0(), #pos(@y)) -> c_89()
, 89: #compare^#(#0(), #0()) -> c_90()
, 90: #compare^#(#0(), #s(@y)) -> c_91()
, 91: #compare^#(#s(@x), #0()) -> c_92()
, 92: #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, 93: #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, 94: #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 95: #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, 96: #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 97: #add^#(#0(), @y) -> c_77()
, 98: #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, 99: #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, 100: #mult^#(#neg(@x), #0()) -> c_125()
, 101: #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, 102: #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, 103: #mult^#(#pos(@x), #0()) -> c_128()
, 104: #mult^#(#0(), #neg(@y)) -> c_129()
, 105: #mult^#(#0(), #pos(@y)) -> c_130()
, 106: #mult^#(#0(), #0()) -> c_131()
, 107: #cklt^#(#EQ()) -> c_117()
, 108: #cklt^#(#LT()) -> c_118()
, 109: #cklt^#(#GT()) -> c_119()
, 110: #eq^#(nil(), nil()) -> c_94()
, 111: #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, 112: #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, 113: #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, 114: #eq^#(#neg(@x), #pos(@y)) -> c_98()
, 115: #eq^#(#neg(@x), #0()) -> c_99()
, 116: #eq^#(#pos(@x), #neg(@y)) -> c_100()
, 117: #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, 118: #eq^#(#pos(@x), #0()) -> c_102()
, 119: #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, 120: #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 121: #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, 122: #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, 123: #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, 124: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 125: #eq^#(#0(), #neg(@y)) -> c_109()
, 126: #eq^#(#0(), #pos(@y)) -> c_110()
, 127: #eq^#(#0(), #0()) -> c_111()
, 128: #eq^#(#0(), #s(@y)) -> c_112()
, 129: #eq^#(#s(@x), #0()) -> c_113()
, 130: #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, 131: #natsub^#(@x, #0()) -> c_66()
, 132: #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, 133: #natdiv^#(#0(), #0()) -> c_68()
, 134: #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, 135: #pred^#(#neg(#s(@x))) -> c_145()
, 136: #pred^#(#pos(#s(#0()))) -> c_146()
, 137: #pred^#(#pos(#s(#s(@x)))) -> c_147()
, 138: #pred^#(#0()) -> c_148()
, 139: #succ^#(#neg(#s(#0()))) -> c_132()
, 140: #succ^#(#neg(#s(#s(@x)))) -> c_133()
, 141: #succ^#(#pos(#s(@x))) -> c_134()
, 142: #succ^#(#0()) -> c_135()
, 143: #and^#(#true(), #true()) -> c_78()
, 144: #and^#(#true(), #false()) -> c_79()
, 145: #and^#(#false(), #true()) -> c_80()
, 146: #and^#(#false(), #false()) -> c_81()
, 147: #natmult^#(#0(), @y) -> c_115()
, 148: #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, diff#1^#(#false()) -> c_4(#abs^#(#0()))
, mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, sum#4^#(#true()) -> c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, compare#5^#(#true(), @x, @y) -> c_35(-^#(#0(), #pos(#s(#0()))))
, compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, compare#6^#(#false()) -> c_54(#abs^#(#0()))
, compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, #sub^#(@x, #0()) -> c_122()
, sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, #abs^#(#neg(@x)) -> c_62()
, #abs^#(#pos(@x)) -> c_63()
, #abs^#(#0()) -> c_64()
, #abs^#(#s(@x)) -> c_65()
, mult#3^#(#false(), @b2, @zs) -> c_43()
, #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, div^#(@x, @y) -> c_6(#div^#(@x, @y))
, #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #0()) -> c_138()
, #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #0()) -> c_141()
, #div^#(#0(), #neg(@y)) -> c_142()
, #div^#(#0(), #pos(@y)) -> c_143()
, #div^#(#0(), #0()) -> c_144()
, +^#(@x, @y) -> c_21(#add^#(@x, @y))
, *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_70()
, #ckgt^#(#LT()) -> c_71()
, #ckgt^#(#GT()) -> c_72()
, #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, #compare^#(#neg(@x), #pos(@y)) -> c_83()
, #compare^#(#neg(@x), #0()) -> c_84()
, #compare^#(#pos(@x), #neg(@y)) -> c_85()
, #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, #compare^#(#pos(@x), #0()) -> c_87()
, #compare^#(#0(), #neg(@y)) -> c_88()
, #compare^#(#0(), #pos(@y)) -> c_89()
, #compare^#(#0(), #0()) -> c_90()
, #compare^#(#0(), #s(@y)) -> c_91()
, #compare^#(#s(@x), #0()) -> c_92()
, #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, mult#1^#(nil(), @b2) -> c_49()
, #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#0(), @y) -> c_77()
, #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #0()) -> c_125()
, #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #0()) -> c_128()
, #mult^#(#0(), #neg(@y)) -> c_129()
, #mult^#(#0(), #pos(@y)) -> c_130()
, #mult^#(#0(), #0()) -> c_131()
, sub'#5^#(#false(), @z, @zs) -> c_26()
, #cklt^#(#EQ()) -> c_117()
, #cklt^#(#LT()) -> c_118()
, #cklt^#(#GT()) -> c_119()
, #eq^#(nil(), nil()) -> c_94()
, #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, #eq^#(#neg(@x), #pos(@y)) -> c_98()
, #eq^#(#neg(@x), #0()) -> c_99()
, #eq^#(#pos(@x), #neg(@y)) -> c_100()
, #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, #eq^#(#pos(@x), #0()) -> c_102()
, #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(#0(), #neg(@y)) -> c_109()
, #eq^#(#0(), #pos(@y)) -> c_110()
, #eq^#(#0(), #0()) -> c_111()
, #eq^#(#0(), #s(@y)) -> c_112()
, #eq^#(#s(@x), #0()) -> c_113()
, #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, compare#4^#(#false(), @r, @x, @y) -> c_56()
, sub'#1^#(nil(), @b2, @r) -> c_40()
, add'#1^#(nil(), @b2, @r) -> c_44()
, add'#2^#(nil(), @r, @x, @xs) -> c_46()
, #natsub^#(@x, #0()) -> c_66()
, #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, #natdiv^#(#0(), #0()) -> c_68()
, #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#neg(#s(@x))) -> c_145()
, #pred^#(#pos(#s(#0()))) -> c_146()
, #pred^#(#pos(#s(#s(@x)))) -> c_147()
, #pred^#(#0()) -> c_148()
, #succ^#(#neg(#s(#0()))) -> c_132()
, #succ^#(#neg(#s(#s(@x)))) -> c_133()
, #succ^#(#pos(#s(@x))) -> c_134()
, #succ^#(#0()) -> c_135()
, #and^#(#true(), #true()) -> c_78()
, #and^#(#true(), #false()) -> c_79()
, #and^#(#false(), #true()) -> c_80()
, #and^#(#false(), #false()) -> c_81()
, #natmult^#(#0(), @y) -> c_115()
, #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0())))
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #ckgt(#EQ()) -> #false()
, #ckgt(#LT()) -> #false()
, #ckgt(#GT()) -> #true()
, #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, bitToInt'#1(nil(), @n) -> #abs(#0())
, bitToInt'#1(::(@x, @xs), @n) ->
+(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0()))))))
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2)
, sub#1(tuple#2(@b, @_@1)) -> @b
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0())))
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, bitToInt'(@b, @n) -> bitToInt'#1(@b, @n)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0()))))
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs)
, sub'#5(#false(), @z, @zs) -> ::(@z, @zs)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, sub'#3(tuple#2(@z, @r'), @xs, @ys) ->
sub'#4(sub'(@xs, @ys, @r'), @z)
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r)
, sub'#2(::(@y, @ys), @r, @x, @xs) ->
sub'#3(diff(@x, @y, @r), @xs, @ys)
, compare#2(nil(), @x, @xs) -> #abs(#0())
, compare#2(::(@y, @ys), @x, @xs) ->
compare#3(compare(@xs, @ys), @x, @y)
, sub'#4(tuple#2(@zs, @s), @z) ->
tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s)
, compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0())))
, compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y))
, compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r)
, sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs)
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r)
, compare(@b1, @b2) -> compare#1(@b1, @b2)
, compare#6(#true()) -> #abs(#pos(#s(#0())))
, compare#6(#false()) -> #abs(#0())
, compare#4(#true(), @r, @x, @y) ->
compare#5(#less(@x, @y), @x, @y)
, compare#4(#false(), @r, @x, @y) -> @r
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, compare#1(nil(), @b2) -> #abs(#0())
, compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We estimate the number of application of
{3,4,7,12,19,21,23,24,25,30,33,35,36,44} by applications of
Pre({3,4,7,12,19,21,23,24,25,30,33,35,36,44}) =
{9,11,16,20,22,27,29,34,37,45}. Here rules are labeled as follows:
DPs:
{ 1: sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, 2: sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, 3: diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, 4: diff#1^#(#false()) -> c_4(#abs^#(#0()))
, 5: mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, 6: mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, 7: bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, 8: bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, 9: bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, 10: sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, 11: sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, 12: mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, 13: mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, 14: mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, 15: leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, 16: compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, 17: mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, 18: bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, 19: sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, 20: sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, 21: sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, 22: sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, 23: sum#4^#(#true()) ->
c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, 24: sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, 25: sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, 26: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, 27: sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, 28: sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, 29: diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, 30: compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, 31: compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, 32: compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, 33: compare#5^#(#true(), @x, @y) ->
c_35(-^#(#0(), #pos(#s(#0()))))
, 34: compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, 35: compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, 36: compare#6^#(#false()) -> c_54(#abs^#(#0()))
, 37: compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, 38: add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, 39: add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, 40: add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, 41: sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, 42: add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, 43: add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, 44: compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, 45: compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs))
, 46: -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, 47: #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, 48: #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, 49: #sub^#(@x, #0()) -> c_122()
, 50: sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, 51: #abs^#(#neg(@x)) -> c_62()
, 52: #abs^#(#pos(@x)) -> c_63()
, 53: #abs^#(#0()) -> c_64()
, 54: #abs^#(#s(@x)) -> c_65()
, 55: mult#3^#(#false(), @b2, @zs) -> c_43()
, 56: #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, 57: div^#(@x, @y) -> c_6(#div^#(@x, @y))
, 58: #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, 59: #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, 60: #div^#(#neg(@x), #0()) -> c_138()
, 61: #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, 62: #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, 63: #div^#(#pos(@x), #0()) -> c_141()
, 64: #div^#(#0(), #neg(@y)) -> c_142()
, 65: #div^#(#0(), #pos(@y)) -> c_143()
, 66: #div^#(#0(), #0()) -> c_144()
, 67: +^#(@x, @y) -> c_21(#add^#(@x, @y))
, 68: *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, 69: #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 70: #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 71: #ckgt^#(#EQ()) -> c_70()
, 72: #ckgt^#(#LT()) -> c_71()
, 73: #ckgt^#(#GT()) -> c_72()
, 74: #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, 75: #compare^#(#neg(@x), #pos(@y)) -> c_83()
, 76: #compare^#(#neg(@x), #0()) -> c_84()
, 77: #compare^#(#pos(@x), #neg(@y)) -> c_85()
, 78: #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, 79: #compare^#(#pos(@x), #0()) -> c_87()
, 80: #compare^#(#0(), #neg(@y)) -> c_88()
, 81: #compare^#(#0(), #pos(@y)) -> c_89()
, 82: #compare^#(#0(), #0()) -> c_90()
, 83: #compare^#(#0(), #s(@y)) -> c_91()
, 84: #compare^#(#s(@x), #0()) -> c_92()
, 85: #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, 86: mult#1^#(nil(), @b2) -> c_49()
, 87: #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, 88: #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 89: #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, 90: #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 91: #add^#(#0(), @y) -> c_77()
, 92: #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, 93: #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, 94: #mult^#(#neg(@x), #0()) -> c_125()
, 95: #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, 96: #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, 97: #mult^#(#pos(@x), #0()) -> c_128()
, 98: #mult^#(#0(), #neg(@y)) -> c_129()
, 99: #mult^#(#0(), #pos(@y)) -> c_130()
, 100: #mult^#(#0(), #0()) -> c_131()
, 101: sub'#5^#(#false(), @z, @zs) -> c_26()
, 102: #cklt^#(#EQ()) -> c_117()
, 103: #cklt^#(#LT()) -> c_118()
, 104: #cklt^#(#GT()) -> c_119()
, 105: #eq^#(nil(), nil()) -> c_94()
, 106: #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, 107: #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, 108: #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, 109: #eq^#(#neg(@x), #pos(@y)) -> c_98()
, 110: #eq^#(#neg(@x), #0()) -> c_99()
, 111: #eq^#(#pos(@x), #neg(@y)) -> c_100()
, 112: #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, 113: #eq^#(#pos(@x), #0()) -> c_102()
, 114: #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, 115: #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 116: #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, 117: #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, 118: #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, 119: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 120: #eq^#(#0(), #neg(@y)) -> c_109()
, 121: #eq^#(#0(), #pos(@y)) -> c_110()
, 122: #eq^#(#0(), #0()) -> c_111()
, 123: #eq^#(#0(), #s(@y)) -> c_112()
, 124: #eq^#(#s(@x), #0()) -> c_113()
, 125: #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, 126: sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, 127: compare#4^#(#false(), @r, @x, @y) -> c_56()
, 128: sub'#1^#(nil(), @b2, @r) -> c_40()
, 129: add'#1^#(nil(), @b2, @r) -> c_44()
, 130: add'#2^#(nil(), @r, @x, @xs) -> c_46()
, 131: #natsub^#(@x, #0()) -> c_66()
, 132: #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, 133: #natdiv^#(#0(), #0()) -> c_68()
, 134: #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, 135: #pred^#(#neg(#s(@x))) -> c_145()
, 136: #pred^#(#pos(#s(#0()))) -> c_146()
, 137: #pred^#(#pos(#s(#s(@x)))) -> c_147()
, 138: #pred^#(#0()) -> c_148()
, 139: #succ^#(#neg(#s(#0()))) -> c_132()
, 140: #succ^#(#neg(#s(#s(@x)))) -> c_133()
, 141: #succ^#(#pos(#s(@x))) -> c_134()
, 142: #succ^#(#0()) -> c_135()
, 143: #and^#(#true(), #true()) -> c_78()
, 144: #and^#(#true(), #false()) -> c_79()
, 145: #and^#(#false(), #true()) -> c_80()
, 146: #and^#(#false(), #false()) -> c_81()
, 147: #natmult^#(#0(), @y) -> c_115()
, 148: #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, #sub^#(@x, #0()) -> c_122()
, sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, #abs^#(#neg(@x)) -> c_62()
, #abs^#(#pos(@x)) -> c_63()
, #abs^#(#0()) -> c_64()
, #abs^#(#s(@x)) -> c_65()
, diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, diff#1^#(#false()) -> c_4(#abs^#(#0()))
, mult#3^#(#false(), @b2, @zs) -> c_43()
, #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, div^#(@x, @y) -> c_6(#div^#(@x, @y))
, #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #0()) -> c_138()
, #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #0()) -> c_141()
, #div^#(#0(), #neg(@y)) -> c_142()
, #div^#(#0(), #pos(@y)) -> c_143()
, #div^#(#0(), #0()) -> c_144()
, bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, +^#(@x, @y) -> c_21(#add^#(@x, @y))
, *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_70()
, #ckgt^#(#LT()) -> c_71()
, #ckgt^#(#GT()) -> c_72()
, #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, #compare^#(#neg(@x), #pos(@y)) -> c_83()
, #compare^#(#neg(@x), #0()) -> c_84()
, #compare^#(#pos(@x), #neg(@y)) -> c_85()
, #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, #compare^#(#pos(@x), #0()) -> c_87()
, #compare^#(#0(), #neg(@y)) -> c_88()
, #compare^#(#0(), #pos(@y)) -> c_89()
, #compare^#(#0(), #0()) -> c_90()
, #compare^#(#0(), #s(@y)) -> c_91()
, #compare^#(#s(@x), #0()) -> c_92()
, #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, mult#1^#(nil(), @b2) -> c_49()
, sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#0(), @y) -> c_77()
, sum#4^#(#true()) -> c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #0()) -> c_125()
, #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #0()) -> c_128()
, #mult^#(#0(), #neg(@y)) -> c_129()
, #mult^#(#0(), #pos(@y)) -> c_130()
, #mult^#(#0(), #0()) -> c_131()
, sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, sub'#5^#(#false(), @z, @zs) -> c_26()
, #cklt^#(#EQ()) -> c_117()
, #cklt^#(#LT()) -> c_118()
, #cklt^#(#GT()) -> c_119()
, #eq^#(nil(), nil()) -> c_94()
, #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, #eq^#(#neg(@x), #pos(@y)) -> c_98()
, #eq^#(#neg(@x), #0()) -> c_99()
, #eq^#(#pos(@x), #neg(@y)) -> c_100()
, #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, #eq^#(#pos(@x), #0()) -> c_102()
, #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(#0(), #neg(@y)) -> c_109()
, #eq^#(#0(), #pos(@y)) -> c_110()
, #eq^#(#0(), #0()) -> c_111()
, #eq^#(#0(), #s(@y)) -> c_112()
, #eq^#(#s(@x), #0()) -> c_113()
, #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, compare#5^#(#true(), @x, @y) -> c_35(-^#(#0(), #pos(#s(#0()))))
, compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, compare#6^#(#false()) -> c_54(#abs^#(#0()))
, compare#4^#(#false(), @r, @x, @y) -> c_56()
, sub'#1^#(nil(), @b2, @r) -> c_40()
, add'#1^#(nil(), @b2, @r) -> c_44()
, add'#2^#(nil(), @r, @x, @xs) -> c_46()
, compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, #natsub^#(@x, #0()) -> c_66()
, #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, #natdiv^#(#0(), #0()) -> c_68()
, #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#neg(#s(@x))) -> c_145()
, #pred^#(#pos(#s(#0()))) -> c_146()
, #pred^#(#pos(#s(#s(@x)))) -> c_147()
, #pred^#(#0()) -> c_148()
, #succ^#(#neg(#s(#0()))) -> c_132()
, #succ^#(#neg(#s(#s(@x)))) -> c_133()
, #succ^#(#pos(#s(@x))) -> c_134()
, #succ^#(#0()) -> c_135()
, #and^#(#true(), #true()) -> c_78()
, #and^#(#true(), #false()) -> c_79()
, #and^#(#false(), #true()) -> c_80()
, #and^#(#false(), #false()) -> c_81()
, #natmult^#(#0(), @y) -> c_115()
, #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0())))
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #ckgt(#EQ()) -> #false()
, #ckgt(#LT()) -> #false()
, #ckgt(#GT()) -> #true()
, #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, bitToInt'#1(nil(), @n) -> #abs(#0())
, bitToInt'#1(::(@x, @xs), @n) ->
+(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0()))))))
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2)
, sub#1(tuple#2(@b, @_@1)) -> @b
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0())))
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, bitToInt'(@b, @n) -> bitToInt'#1(@b, @n)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0()))))
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs)
, sub'#5(#false(), @z, @zs) -> ::(@z, @zs)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, sub'#3(tuple#2(@z, @r'), @xs, @ys) ->
sub'#4(sub'(@xs, @ys, @r'), @z)
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r)
, sub'#2(::(@y, @ys), @r, @x, @xs) ->
sub'#3(diff(@x, @y, @r), @xs, @ys)
, compare#2(nil(), @x, @xs) -> #abs(#0())
, compare#2(::(@y, @ys), @x, @xs) ->
compare#3(compare(@xs, @ys), @x, @y)
, sub'#4(tuple#2(@zs, @s), @z) ->
tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s)
, compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0())))
, compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y))
, compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r)
, sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs)
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r)
, compare(@b1, @b2) -> compare#1(@b1, @b2)
, compare#6(#true()) -> #abs(#pos(#s(#0())))
, compare#6(#false()) -> #abs(#0())
, compare#4(#true(), @r, @x, @y) ->
compare#5(#less(@x, @y), @x, @y)
, compare#4(#false(), @r, @x, @y) -> @r
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, compare#1(nil(), @b2) -> #abs(#0())
, compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We estimate the number of application of {16,18,20,23} by
applications of Pre({16,18,20,23}) = {15,17,19,24}. Here rules are
labeled as follows:
DPs:
{ 1: sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, 2: sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, 3: mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, 4: mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, 5: bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, 6: bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, 7: sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, 8: sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, 9: mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, 10: mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, 11: leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, 12: compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, 13: mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, 14: bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, 15: sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, 16: sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, 17: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, 18: sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, 19: sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, 20: diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, 21: compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, 22: compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, 23: compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, 24: compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, 25: add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, 26: add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, 27: add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, 28: sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, 29: add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, 30: add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, 31: compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs))
, 32: -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, 33: #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, 34: #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, 35: #sub^#(@x, #0()) -> c_122()
, 36: sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, 37: #abs^#(#neg(@x)) -> c_62()
, 38: #abs^#(#pos(@x)) -> c_63()
, 39: #abs^#(#0()) -> c_64()
, 40: #abs^#(#s(@x)) -> c_65()
, 41: diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, 42: diff#1^#(#false()) -> c_4(#abs^#(#0()))
, 43: mult#3^#(#false(), @b2, @zs) -> c_43()
, 44: #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, 45: div^#(@x, @y) -> c_6(#div^#(@x, @y))
, 46: #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, 47: #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, 48: #div^#(#neg(@x), #0()) -> c_138()
, 49: #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, 50: #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, 51: #div^#(#pos(@x), #0()) -> c_141()
, 52: #div^#(#0(), #neg(@y)) -> c_142()
, 53: #div^#(#0(), #pos(@y)) -> c_143()
, 54: #div^#(#0(), #0()) -> c_144()
, 55: bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, 56: +^#(@x, @y) -> c_21(#add^#(@x, @y))
, 57: *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, 58: mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, 59: #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 60: #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 61: #ckgt^#(#EQ()) -> c_70()
, 62: #ckgt^#(#LT()) -> c_71()
, 63: #ckgt^#(#GT()) -> c_72()
, 64: #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, 65: #compare^#(#neg(@x), #pos(@y)) -> c_83()
, 66: #compare^#(#neg(@x), #0()) -> c_84()
, 67: #compare^#(#pos(@x), #neg(@y)) -> c_85()
, 68: #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, 69: #compare^#(#pos(@x), #0()) -> c_87()
, 70: #compare^#(#0(), #neg(@y)) -> c_88()
, 71: #compare^#(#0(), #pos(@y)) -> c_89()
, 72: #compare^#(#0(), #0()) -> c_90()
, 73: #compare^#(#0(), #s(@y)) -> c_91()
, 74: #compare^#(#s(@x), #0()) -> c_92()
, 75: #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, 76: mult#1^#(nil(), @b2) -> c_49()
, 77: sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, 78: sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, 79: #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, 80: #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 81: #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, 82: #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 83: #add^#(#0(), @y) -> c_77()
, 84: sum#4^#(#true()) ->
c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, 85: sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, 86: #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, 87: #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, 88: #mult^#(#neg(@x), #0()) -> c_125()
, 89: #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, 90: #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, 91: #mult^#(#pos(@x), #0()) -> c_128()
, 92: #mult^#(#0(), #neg(@y)) -> c_129()
, 93: #mult^#(#0(), #pos(@y)) -> c_130()
, 94: #mult^#(#0(), #0()) -> c_131()
, 95: sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, 96: sub'#5^#(#false(), @z, @zs) -> c_26()
, 97: #cklt^#(#EQ()) -> c_117()
, 98: #cklt^#(#LT()) -> c_118()
, 99: #cklt^#(#GT()) -> c_119()
, 100: #eq^#(nil(), nil()) -> c_94()
, 101: #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, 102: #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, 103: #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, 104: #eq^#(#neg(@x), #pos(@y)) -> c_98()
, 105: #eq^#(#neg(@x), #0()) -> c_99()
, 106: #eq^#(#pos(@x), #neg(@y)) -> c_100()
, 107: #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, 108: #eq^#(#pos(@x), #0()) -> c_102()
, 109: #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, 110: #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 111: #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, 112: #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, 113: #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, 114: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 115: #eq^#(#0(), #neg(@y)) -> c_109()
, 116: #eq^#(#0(), #pos(@y)) -> c_110()
, 117: #eq^#(#0(), #0()) -> c_111()
, 118: #eq^#(#0(), #s(@y)) -> c_112()
, 119: #eq^#(#s(@x), #0()) -> c_113()
, 120: #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, 121: sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, 122: compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, 123: compare#5^#(#true(), @x, @y) ->
c_35(-^#(#0(), #pos(#s(#0()))))
, 124: compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, 125: compare#6^#(#false()) -> c_54(#abs^#(#0()))
, 126: compare#4^#(#false(), @r, @x, @y) -> c_56()
, 127: sub'#1^#(nil(), @b2, @r) -> c_40()
, 128: add'#1^#(nil(), @b2, @r) -> c_44()
, 129: add'#2^#(nil(), @r, @x, @xs) -> c_46()
, 130: compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, 131: #natsub^#(@x, #0()) -> c_66()
, 132: #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, 133: #natdiv^#(#0(), #0()) -> c_68()
, 134: #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, 135: #pred^#(#neg(#s(@x))) -> c_145()
, 136: #pred^#(#pos(#s(#0()))) -> c_146()
, 137: #pred^#(#pos(#s(#s(@x)))) -> c_147()
, 138: #pred^#(#0()) -> c_148()
, 139: #succ^#(#neg(#s(#0()))) -> c_132()
, 140: #succ^#(#neg(#s(#s(@x)))) -> c_133()
, 141: #succ^#(#pos(#s(@x))) -> c_134()
, 142: #succ^#(#0()) -> c_135()
, 143: #and^#(#true(), #true()) -> c_78()
, 144: #and^#(#true(), #false()) -> c_79()
, 145: #and^#(#false(), #true()) -> c_80()
, 146: #and^#(#false(), #false()) -> c_81()
, 147: #natmult^#(#0(), @y) -> c_115()
, 148: #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, #sub^#(@x, #0()) -> c_122()
, sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, #abs^#(#neg(@x)) -> c_62()
, #abs^#(#pos(@x)) -> c_63()
, #abs^#(#0()) -> c_64()
, #abs^#(#s(@x)) -> c_65()
, diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, diff#1^#(#false()) -> c_4(#abs^#(#0()))
, mult#3^#(#false(), @b2, @zs) -> c_43()
, #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, div^#(@x, @y) -> c_6(#div^#(@x, @y))
, #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #0()) -> c_138()
, #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #0()) -> c_141()
, #div^#(#0(), #neg(@y)) -> c_142()
, #div^#(#0(), #pos(@y)) -> c_143()
, #div^#(#0(), #0()) -> c_144()
, bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, +^#(@x, @y) -> c_21(#add^#(@x, @y))
, *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_70()
, #ckgt^#(#LT()) -> c_71()
, #ckgt^#(#GT()) -> c_72()
, #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, #compare^#(#neg(@x), #pos(@y)) -> c_83()
, #compare^#(#neg(@x), #0()) -> c_84()
, #compare^#(#pos(@x), #neg(@y)) -> c_85()
, #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, #compare^#(#pos(@x), #0()) -> c_87()
, #compare^#(#0(), #neg(@y)) -> c_88()
, #compare^#(#0(), #pos(@y)) -> c_89()
, #compare^#(#0(), #0()) -> c_90()
, #compare^#(#0(), #s(@y)) -> c_91()
, #compare^#(#s(@x), #0()) -> c_92()
, #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, mult#1^#(nil(), @b2) -> c_49()
, sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#0(), @y) -> c_77()
, sum#4^#(#true()) -> c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #0()) -> c_125()
, #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #0()) -> c_128()
, #mult^#(#0(), #neg(@y)) -> c_129()
, #mult^#(#0(), #pos(@y)) -> c_130()
, #mult^#(#0(), #0()) -> c_131()
, sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, sub'#5^#(#false(), @z, @zs) -> c_26()
, #cklt^#(#EQ()) -> c_117()
, #cklt^#(#LT()) -> c_118()
, #cklt^#(#GT()) -> c_119()
, sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, #eq^#(nil(), nil()) -> c_94()
, #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, #eq^#(#neg(@x), #pos(@y)) -> c_98()
, #eq^#(#neg(@x), #0()) -> c_99()
, #eq^#(#pos(@x), #neg(@y)) -> c_100()
, #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, #eq^#(#pos(@x), #0()) -> c_102()
, #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(#0(), #neg(@y)) -> c_109()
, #eq^#(#0(), #pos(@y)) -> c_110()
, #eq^#(#0(), #0()) -> c_111()
, #eq^#(#0(), #s(@y)) -> c_112()
, #eq^#(#s(@x), #0()) -> c_113()
, #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, compare#5^#(#true(), @x, @y) -> c_35(-^#(#0(), #pos(#s(#0()))))
, compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, compare#6^#(#false()) -> c_54(#abs^#(#0()))
, compare#4^#(#false(), @r, @x, @y) -> c_56()
, sub'#1^#(nil(), @b2, @r) -> c_40()
, add'#1^#(nil(), @b2, @r) -> c_44()
, add'#2^#(nil(), @r, @x, @xs) -> c_46()
, compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, #natsub^#(@x, #0()) -> c_66()
, #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, #natdiv^#(#0(), #0()) -> c_68()
, #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#neg(#s(@x))) -> c_145()
, #pred^#(#pos(#s(#0()))) -> c_146()
, #pred^#(#pos(#s(#s(@x)))) -> c_147()
, #pred^#(#0()) -> c_148()
, #succ^#(#neg(#s(#0()))) -> c_132()
, #succ^#(#neg(#s(#s(@x)))) -> c_133()
, #succ^#(#pos(#s(@x))) -> c_134()
, #succ^#(#0()) -> c_135()
, #and^#(#true(), #true()) -> c_78()
, #and^#(#true(), #false()) -> c_79()
, #and^#(#false(), #true()) -> c_80()
, #and^#(#false(), #false()) -> c_81()
, #natmult^#(#0(), @y) -> c_115()
, #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0())))
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #ckgt(#EQ()) -> #false()
, #ckgt(#LT()) -> #false()
, #ckgt(#GT()) -> #true()
, #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, bitToInt'#1(nil(), @n) -> #abs(#0())
, bitToInt'#1(::(@x, @xs), @n) ->
+(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0()))))))
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2)
, sub#1(tuple#2(@b, @_@1)) -> @b
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0())))
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, bitToInt'(@b, @n) -> bitToInt'#1(@b, @n)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0()))))
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs)
, sub'#5(#false(), @z, @zs) -> ::(@z, @zs)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, sub'#3(tuple#2(@z, @r'), @xs, @ys) ->
sub'#4(sub'(@xs, @ys, @r'), @z)
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r)
, sub'#2(::(@y, @ys), @r, @x, @xs) ->
sub'#3(diff(@x, @y, @r), @xs, @ys)
, compare#2(nil(), @x, @xs) -> #abs(#0())
, compare#2(::(@y, @ys), @x, @xs) ->
compare#3(compare(@xs, @ys), @x, @y)
, sub'#4(tuple#2(@zs, @s), @z) ->
tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s)
, compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0())))
, compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y))
, compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r)
, sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs)
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r)
, compare(@b1, @b2) -> compare#1(@b1, @b2)
, compare#6(#true()) -> #abs(#pos(#s(#0())))
, compare#6(#false()) -> #abs(#0())
, compare#4(#true(), @r, @x, @y) ->
compare#5(#less(@x, @y), @x, @y)
, compare#4(#false(), @r, @x, @y) -> @r
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, compare#1(nil(), @b2) -> #abs(#0())
, compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We estimate the number of application of {15,20} by applications of
Pre({15,20}) = {8,19}. Here rules are labeled as follows:
DPs:
{ 1: sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, 2: sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, 3: mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, 4: mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, 5: bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, 6: bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, 7: sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, 8: sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, 9: mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, 10: mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, 11: leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, 12: compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, 13: mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, 14: bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, 15: sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, 16: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, 17: sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, 18: compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, 19: compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, 20: compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, 21: add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, 22: add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, 23: add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, 24: sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, 25: add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, 26: add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, 27: compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs))
, 28: -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, 29: #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, 30: #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, 31: #sub^#(@x, #0()) -> c_122()
, 32: sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, 33: #abs^#(#neg(@x)) -> c_62()
, 34: #abs^#(#pos(@x)) -> c_63()
, 35: #abs^#(#0()) -> c_64()
, 36: #abs^#(#s(@x)) -> c_65()
, 37: diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, 38: diff#1^#(#false()) -> c_4(#abs^#(#0()))
, 39: mult#3^#(#false(), @b2, @zs) -> c_43()
, 40: #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, 41: div^#(@x, @y) -> c_6(#div^#(@x, @y))
, 42: #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, 43: #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, 44: #div^#(#neg(@x), #0()) -> c_138()
, 45: #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, 46: #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, 47: #div^#(#pos(@x), #0()) -> c_141()
, 48: #div^#(#0(), #neg(@y)) -> c_142()
, 49: #div^#(#0(), #pos(@y)) -> c_143()
, 50: #div^#(#0(), #0()) -> c_144()
, 51: bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, 52: +^#(@x, @y) -> c_21(#add^#(@x, @y))
, 53: *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, 54: mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, 55: #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 56: #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 57: #ckgt^#(#EQ()) -> c_70()
, 58: #ckgt^#(#LT()) -> c_71()
, 59: #ckgt^#(#GT()) -> c_72()
, 60: #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, 61: #compare^#(#neg(@x), #pos(@y)) -> c_83()
, 62: #compare^#(#neg(@x), #0()) -> c_84()
, 63: #compare^#(#pos(@x), #neg(@y)) -> c_85()
, 64: #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, 65: #compare^#(#pos(@x), #0()) -> c_87()
, 66: #compare^#(#0(), #neg(@y)) -> c_88()
, 67: #compare^#(#0(), #pos(@y)) -> c_89()
, 68: #compare^#(#0(), #0()) -> c_90()
, 69: #compare^#(#0(), #s(@y)) -> c_91()
, 70: #compare^#(#s(@x), #0()) -> c_92()
, 71: #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, 72: mult#1^#(nil(), @b2) -> c_49()
, 73: sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, 74: sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, 75: sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, 76: #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, 77: #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 78: #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, 79: #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 80: #add^#(#0(), @y) -> c_77()
, 81: sum#4^#(#true()) ->
c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, 82: sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, 83: #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, 84: #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, 85: #mult^#(#neg(@x), #0()) -> c_125()
, 86: #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, 87: #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, 88: #mult^#(#pos(@x), #0()) -> c_128()
, 89: #mult^#(#0(), #neg(@y)) -> c_129()
, 90: #mult^#(#0(), #pos(@y)) -> c_130()
, 91: #mult^#(#0(), #0()) -> c_131()
, 92: sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, 93: sub'#5^#(#false(), @z, @zs) -> c_26()
, 94: #cklt^#(#EQ()) -> c_117()
, 95: #cklt^#(#LT()) -> c_118()
, 96: #cklt^#(#GT()) -> c_119()
, 97: sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, 98: #eq^#(nil(), nil()) -> c_94()
, 99: #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, 100: #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, 101: #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, 102: #eq^#(#neg(@x), #pos(@y)) -> c_98()
, 103: #eq^#(#neg(@x), #0()) -> c_99()
, 104: #eq^#(#pos(@x), #neg(@y)) -> c_100()
, 105: #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, 106: #eq^#(#pos(@x), #0()) -> c_102()
, 107: #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, 108: #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 109: #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, 110: #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, 111: #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, 112: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 113: #eq^#(#0(), #neg(@y)) -> c_109()
, 114: #eq^#(#0(), #pos(@y)) -> c_110()
, 115: #eq^#(#0(), #0()) -> c_111()
, 116: #eq^#(#0(), #s(@y)) -> c_112()
, 117: #eq^#(#s(@x), #0()) -> c_113()
, 118: #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, 119: sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, 120: diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, 121: compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, 122: compare#5^#(#true(), @x, @y) ->
c_35(-^#(#0(), #pos(#s(#0()))))
, 123: compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, 124: compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, 125: compare#6^#(#false()) -> c_54(#abs^#(#0()))
, 126: compare#4^#(#false(), @r, @x, @y) -> c_56()
, 127: sub'#1^#(nil(), @b2, @r) -> c_40()
, 128: add'#1^#(nil(), @b2, @r) -> c_44()
, 129: add'#2^#(nil(), @r, @x, @xs) -> c_46()
, 130: compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, 131: #natsub^#(@x, #0()) -> c_66()
, 132: #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, 133: #natdiv^#(#0(), #0()) -> c_68()
, 134: #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, 135: #pred^#(#neg(#s(@x))) -> c_145()
, 136: #pred^#(#pos(#s(#0()))) -> c_146()
, 137: #pred^#(#pos(#s(#s(@x)))) -> c_147()
, 138: #pred^#(#0()) -> c_148()
, 139: #succ^#(#neg(#s(#0()))) -> c_132()
, 140: #succ^#(#neg(#s(#s(@x)))) -> c_133()
, 141: #succ^#(#pos(#s(@x))) -> c_134()
, 142: #succ^#(#0()) -> c_135()
, 143: #and^#(#true(), #true()) -> c_78()
, 144: #and^#(#true(), #false()) -> c_79()
, 145: #and^#(#false(), #true()) -> c_80()
, 146: #and^#(#false(), #false()) -> c_81()
, 147: #natmult^#(#0(), @y) -> c_115()
, 148: #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, #sub^#(@x, #0()) -> c_122()
, sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, #abs^#(#neg(@x)) -> c_62()
, #abs^#(#pos(@x)) -> c_63()
, #abs^#(#0()) -> c_64()
, #abs^#(#s(@x)) -> c_65()
, diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, diff#1^#(#false()) -> c_4(#abs^#(#0()))
, mult#3^#(#false(), @b2, @zs) -> c_43()
, #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, div^#(@x, @y) -> c_6(#div^#(@x, @y))
, #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #0()) -> c_138()
, #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #0()) -> c_141()
, #div^#(#0(), #neg(@y)) -> c_142()
, #div^#(#0(), #pos(@y)) -> c_143()
, #div^#(#0(), #0()) -> c_144()
, bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, +^#(@x, @y) -> c_21(#add^#(@x, @y))
, *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_70()
, #ckgt^#(#LT()) -> c_71()
, #ckgt^#(#GT()) -> c_72()
, #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, #compare^#(#neg(@x), #pos(@y)) -> c_83()
, #compare^#(#neg(@x), #0()) -> c_84()
, #compare^#(#pos(@x), #neg(@y)) -> c_85()
, #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, #compare^#(#pos(@x), #0()) -> c_87()
, #compare^#(#0(), #neg(@y)) -> c_88()
, #compare^#(#0(), #pos(@y)) -> c_89()
, #compare^#(#0(), #0()) -> c_90()
, #compare^#(#0(), #s(@y)) -> c_91()
, #compare^#(#s(@x), #0()) -> c_92()
, #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, mult#1^#(nil(), @b2) -> c_49()
, sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#0(), @y) -> c_77()
, sum#4^#(#true()) -> c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #0()) -> c_125()
, #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #0()) -> c_128()
, #mult^#(#0(), #neg(@y)) -> c_129()
, #mult^#(#0(), #pos(@y)) -> c_130()
, #mult^#(#0(), #0()) -> c_131()
, sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, sub'#5^#(#false(), @z, @zs) -> c_26()
, #cklt^#(#EQ()) -> c_117()
, #cklt^#(#LT()) -> c_118()
, #cklt^#(#GT()) -> c_119()
, sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, #eq^#(nil(), nil()) -> c_94()
, #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, #eq^#(#neg(@x), #pos(@y)) -> c_98()
, #eq^#(#neg(@x), #0()) -> c_99()
, #eq^#(#pos(@x), #neg(@y)) -> c_100()
, #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, #eq^#(#pos(@x), #0()) -> c_102()
, #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(#0(), #neg(@y)) -> c_109()
, #eq^#(#0(), #pos(@y)) -> c_110()
, #eq^#(#0(), #0()) -> c_111()
, #eq^#(#0(), #s(@y)) -> c_112()
, #eq^#(#s(@x), #0()) -> c_113()
, #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, compare#5^#(#true(), @x, @y) -> c_35(-^#(#0(), #pos(#s(#0()))))
, compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, compare#6^#(#false()) -> c_54(#abs^#(#0()))
, compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, compare#4^#(#false(), @r, @x, @y) -> c_56()
, sub'#1^#(nil(), @b2, @r) -> c_40()
, add'#1^#(nil(), @b2, @r) -> c_44()
, add'#2^#(nil(), @r, @x, @xs) -> c_46()
, compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, #natsub^#(@x, #0()) -> c_66()
, #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, #natdiv^#(#0(), #0()) -> c_68()
, #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#neg(#s(@x))) -> c_145()
, #pred^#(#pos(#s(#0()))) -> c_146()
, #pred^#(#pos(#s(#s(@x)))) -> c_147()
, #pred^#(#0()) -> c_148()
, #succ^#(#neg(#s(#0()))) -> c_132()
, #succ^#(#neg(#s(#s(@x)))) -> c_133()
, #succ^#(#pos(#s(@x))) -> c_134()
, #succ^#(#0()) -> c_135()
, #and^#(#true(), #true()) -> c_78()
, #and^#(#true(), #false()) -> c_79()
, #and^#(#false(), #true()) -> c_80()
, #and^#(#false(), #false()) -> c_81()
, #natmult^#(#0(), @y) -> c_115()
, #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0())))
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #ckgt(#EQ()) -> #false()
, #ckgt(#LT()) -> #false()
, #ckgt(#GT()) -> #true()
, #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, bitToInt'#1(nil(), @n) -> #abs(#0())
, bitToInt'#1(::(@x, @xs), @n) ->
+(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0()))))))
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2)
, sub#1(tuple#2(@b, @_@1)) -> @b
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0())))
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, bitToInt'(@b, @n) -> bitToInt'#1(@b, @n)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0()))))
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs)
, sub'#5(#false(), @z, @zs) -> ::(@z, @zs)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, sub'#3(tuple#2(@z, @r'), @xs, @ys) ->
sub'#4(sub'(@xs, @ys, @r'), @z)
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r)
, sub'#2(::(@y, @ys), @r, @x, @xs) ->
sub'#3(diff(@x, @y, @r), @xs, @ys)
, compare#2(nil(), @x, @xs) -> #abs(#0())
, compare#2(::(@y, @ys), @x, @xs) ->
compare#3(compare(@xs, @ys), @x, @y)
, sub'#4(tuple#2(@zs, @s), @z) ->
tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s)
, compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0())))
, compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y))
, compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r)
, sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs)
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r)
, compare(@b1, @b2) -> compare#1(@b1, @b2)
, compare#6(#true()) -> #abs(#pos(#s(#0())))
, compare#6(#false()) -> #abs(#0())
, compare#4(#true(), @r, @x, @y) ->
compare#5(#less(@x, @y), @x, @y)
, compare#4(#false(), @r, @x, @y) -> @r
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, compare#1(nil(), @b2) -> #abs(#0())
, compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We estimate the number of application of {8,18} by applications of
Pre({8,18}) = {7,17}. Here rules are labeled as follows:
DPs:
{ 1: sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, 2: sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, 3: mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, 4: mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, 5: bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, 6: bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, 7: sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, 8: sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, 9: mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, 10: mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, 11: leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, 12: compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, 13: mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, 14: bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, 15: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, 16: sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, 17: compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, 18: compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, 19: add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, 20: add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, 21: add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, 22: sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, 23: add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, 24: add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, 25: compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs))
, 26: -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, 27: #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, 28: #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, 29: #sub^#(@x, #0()) -> c_122()
, 30: sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, 31: #abs^#(#neg(@x)) -> c_62()
, 32: #abs^#(#pos(@x)) -> c_63()
, 33: #abs^#(#0()) -> c_64()
, 34: #abs^#(#s(@x)) -> c_65()
, 35: diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, 36: diff#1^#(#false()) -> c_4(#abs^#(#0()))
, 37: mult#3^#(#false(), @b2, @zs) -> c_43()
, 38: #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, 39: div^#(@x, @y) -> c_6(#div^#(@x, @y))
, 40: #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, 41: #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, 42: #div^#(#neg(@x), #0()) -> c_138()
, 43: #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, 44: #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, 45: #div^#(#pos(@x), #0()) -> c_141()
, 46: #div^#(#0(), #neg(@y)) -> c_142()
, 47: #div^#(#0(), #pos(@y)) -> c_143()
, 48: #div^#(#0(), #0()) -> c_144()
, 49: bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, 50: +^#(@x, @y) -> c_21(#add^#(@x, @y))
, 51: *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, 52: mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, 53: #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 54: #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 55: #ckgt^#(#EQ()) -> c_70()
, 56: #ckgt^#(#LT()) -> c_71()
, 57: #ckgt^#(#GT()) -> c_72()
, 58: #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, 59: #compare^#(#neg(@x), #pos(@y)) -> c_83()
, 60: #compare^#(#neg(@x), #0()) -> c_84()
, 61: #compare^#(#pos(@x), #neg(@y)) -> c_85()
, 62: #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, 63: #compare^#(#pos(@x), #0()) -> c_87()
, 64: #compare^#(#0(), #neg(@y)) -> c_88()
, 65: #compare^#(#0(), #pos(@y)) -> c_89()
, 66: #compare^#(#0(), #0()) -> c_90()
, 67: #compare^#(#0(), #s(@y)) -> c_91()
, 68: #compare^#(#s(@x), #0()) -> c_92()
, 69: #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, 70: mult#1^#(nil(), @b2) -> c_49()
, 71: sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, 72: sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, 73: sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, 74: sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, 75: #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, 76: #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 77: #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, 78: #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 79: #add^#(#0(), @y) -> c_77()
, 80: sum#4^#(#true()) ->
c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, 81: sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, 82: #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, 83: #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, 84: #mult^#(#neg(@x), #0()) -> c_125()
, 85: #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, 86: #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, 87: #mult^#(#pos(@x), #0()) -> c_128()
, 88: #mult^#(#0(), #neg(@y)) -> c_129()
, 89: #mult^#(#0(), #pos(@y)) -> c_130()
, 90: #mult^#(#0(), #0()) -> c_131()
, 91: sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, 92: sub'#5^#(#false(), @z, @zs) -> c_26()
, 93: #cklt^#(#EQ()) -> c_117()
, 94: #cklt^#(#LT()) -> c_118()
, 95: #cklt^#(#GT()) -> c_119()
, 96: sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, 97: #eq^#(nil(), nil()) -> c_94()
, 98: #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, 99: #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, 100: #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, 101: #eq^#(#neg(@x), #pos(@y)) -> c_98()
, 102: #eq^#(#neg(@x), #0()) -> c_99()
, 103: #eq^#(#pos(@x), #neg(@y)) -> c_100()
, 104: #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, 105: #eq^#(#pos(@x), #0()) -> c_102()
, 106: #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, 107: #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 108: #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, 109: #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, 110: #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, 111: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 112: #eq^#(#0(), #neg(@y)) -> c_109()
, 113: #eq^#(#0(), #pos(@y)) -> c_110()
, 114: #eq^#(#0(), #0()) -> c_111()
, 115: #eq^#(#0(), #s(@y)) -> c_112()
, 116: #eq^#(#s(@x), #0()) -> c_113()
, 117: #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, 118: sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, 119: diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, 120: compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, 121: compare#5^#(#true(), @x, @y) ->
c_35(-^#(#0(), #pos(#s(#0()))))
, 122: compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, 123: compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, 124: compare#6^#(#false()) -> c_54(#abs^#(#0()))
, 125: compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, 126: compare#4^#(#false(), @r, @x, @y) -> c_56()
, 127: sub'#1^#(nil(), @b2, @r) -> c_40()
, 128: add'#1^#(nil(), @b2, @r) -> c_44()
, 129: add'#2^#(nil(), @r, @x, @xs) -> c_46()
, 130: compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, 131: #natsub^#(@x, #0()) -> c_66()
, 132: #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, 133: #natdiv^#(#0(), #0()) -> c_68()
, 134: #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, 135: #pred^#(#neg(#s(@x))) -> c_145()
, 136: #pred^#(#pos(#s(#0()))) -> c_146()
, 137: #pred^#(#pos(#s(#s(@x)))) -> c_147()
, 138: #pred^#(#0()) -> c_148()
, 139: #succ^#(#neg(#s(#0()))) -> c_132()
, 140: #succ^#(#neg(#s(#s(@x)))) -> c_133()
, 141: #succ^#(#pos(#s(@x))) -> c_134()
, 142: #succ^#(#0()) -> c_135()
, 143: #and^#(#true(), #true()) -> c_78()
, 144: #and^#(#true(), #false()) -> c_79()
, 145: #and^#(#false(), #true()) -> c_80()
, 146: #and^#(#false(), #false()) -> c_81()
, 147: #natmult^#(#0(), @y) -> c_115()
, 148: #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, #sub^#(@x, #0()) -> c_122()
, sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, #abs^#(#neg(@x)) -> c_62()
, #abs^#(#pos(@x)) -> c_63()
, #abs^#(#0()) -> c_64()
, #abs^#(#s(@x)) -> c_65()
, diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, diff#1^#(#false()) -> c_4(#abs^#(#0()))
, mult#3^#(#false(), @b2, @zs) -> c_43()
, #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, div^#(@x, @y) -> c_6(#div^#(@x, @y))
, #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #0()) -> c_138()
, #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #0()) -> c_141()
, #div^#(#0(), #neg(@y)) -> c_142()
, #div^#(#0(), #pos(@y)) -> c_143()
, #div^#(#0(), #0()) -> c_144()
, bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, +^#(@x, @y) -> c_21(#add^#(@x, @y))
, *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_70()
, #ckgt^#(#LT()) -> c_71()
, #ckgt^#(#GT()) -> c_72()
, #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, #compare^#(#neg(@x), #pos(@y)) -> c_83()
, #compare^#(#neg(@x), #0()) -> c_84()
, #compare^#(#pos(@x), #neg(@y)) -> c_85()
, #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, #compare^#(#pos(@x), #0()) -> c_87()
, #compare^#(#0(), #neg(@y)) -> c_88()
, #compare^#(#0(), #pos(@y)) -> c_89()
, #compare^#(#0(), #0()) -> c_90()
, #compare^#(#0(), #s(@y)) -> c_91()
, #compare^#(#s(@x), #0()) -> c_92()
, #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, mult#1^#(nil(), @b2) -> c_49()
, sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#0(), @y) -> c_77()
, sum#4^#(#true()) -> c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #0()) -> c_125()
, #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #0()) -> c_128()
, #mult^#(#0(), #neg(@y)) -> c_129()
, #mult^#(#0(), #pos(@y)) -> c_130()
, #mult^#(#0(), #0()) -> c_131()
, sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, sub'#5^#(#false(), @z, @zs) -> c_26()
, #cklt^#(#EQ()) -> c_117()
, #cklt^#(#LT()) -> c_118()
, #cklt^#(#GT()) -> c_119()
, sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, #eq^#(nil(), nil()) -> c_94()
, #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, #eq^#(#neg(@x), #pos(@y)) -> c_98()
, #eq^#(#neg(@x), #0()) -> c_99()
, #eq^#(#pos(@x), #neg(@y)) -> c_100()
, #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, #eq^#(#pos(@x), #0()) -> c_102()
, #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(#0(), #neg(@y)) -> c_109()
, #eq^#(#0(), #pos(@y)) -> c_110()
, #eq^#(#0(), #0()) -> c_111()
, #eq^#(#0(), #s(@y)) -> c_112()
, #eq^#(#s(@x), #0()) -> c_113()
, #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, compare#5^#(#true(), @x, @y) -> c_35(-^#(#0(), #pos(#s(#0()))))
, compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, compare#6^#(#false()) -> c_54(#abs^#(#0()))
, compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, compare#4^#(#false(), @r, @x, @y) -> c_56()
, sub'#1^#(nil(), @b2, @r) -> c_40()
, add'#1^#(nil(), @b2, @r) -> c_44()
, add'#2^#(nil(), @r, @x, @xs) -> c_46()
, compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, #natsub^#(@x, #0()) -> c_66()
, #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, #natdiv^#(#0(), #0()) -> c_68()
, #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#neg(#s(@x))) -> c_145()
, #pred^#(#pos(#s(#0()))) -> c_146()
, #pred^#(#pos(#s(#s(@x)))) -> c_147()
, #pred^#(#0()) -> c_148()
, #succ^#(#neg(#s(#0()))) -> c_132()
, #succ^#(#neg(#s(#s(@x)))) -> c_133()
, #succ^#(#pos(#s(@x))) -> c_134()
, #succ^#(#0()) -> c_135()
, #and^#(#true(), #true()) -> c_78()
, #and^#(#true(), #false()) -> c_79()
, #and^#(#false(), #true()) -> c_80()
, #and^#(#false(), #false()) -> c_81()
, #natmult^#(#0(), @y) -> c_115()
, #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0())))
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #ckgt(#EQ()) -> #false()
, #ckgt(#LT()) -> #false()
, #ckgt(#GT()) -> #true()
, #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, bitToInt'#1(nil(), @n) -> #abs(#0())
, bitToInt'#1(::(@x, @xs), @n) ->
+(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0()))))))
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2)
, sub#1(tuple#2(@b, @_@1)) -> @b
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0())))
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, bitToInt'(@b, @n) -> bitToInt'#1(@b, @n)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0()))))
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs)
, sub'#5(#false(), @z, @zs) -> ::(@z, @zs)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, sub'#3(tuple#2(@z, @r'), @xs, @ys) ->
sub'#4(sub'(@xs, @ys, @r'), @z)
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r)
, sub'#2(::(@y, @ys), @r, @x, @xs) ->
sub'#3(diff(@x, @y, @r), @xs, @ys)
, compare#2(nil(), @x, @xs) -> #abs(#0())
, compare#2(::(@y, @ys), @x, @xs) ->
compare#3(compare(@xs, @ys), @x, @y)
, sub'#4(tuple#2(@zs, @s), @z) ->
tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s)
, compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0())))
, compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y))
, compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r)
, sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs)
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r)
, compare(@b1, @b2) -> compare#1(@b1, @b2)
, compare#6(#true()) -> #abs(#pos(#s(#0())))
, compare#6(#false()) -> #abs(#0())
, compare#4(#true(), @r, @x, @y) ->
compare#5(#less(@x, @y), @x, @y)
, compare#4(#false(), @r, @x, @y) -> @r
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, compare#1(nil(), @b2) -> #abs(#0())
, compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We estimate the number of application of {7} by applications of
Pre({7}) = {22}. Here rules are labeled as follows:
DPs:
{ 1: sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, 2: sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, 3: mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, 4: mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, 5: bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, 6: bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, 7: sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, 8: mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, 9: mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, 10: leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, 11: compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, 12: mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, 13: bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, 14: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, 15: sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, 16: compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, 17: add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, 18: add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, 19: add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, 20: sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, 21: add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, 22: add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, 23: compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs))
, 24: -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, 25: #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, 26: #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, 27: #sub^#(@x, #0()) -> c_122()
, 28: sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, 29: #abs^#(#neg(@x)) -> c_62()
, 30: #abs^#(#pos(@x)) -> c_63()
, 31: #abs^#(#0()) -> c_64()
, 32: #abs^#(#s(@x)) -> c_65()
, 33: diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, 34: diff#1^#(#false()) -> c_4(#abs^#(#0()))
, 35: mult#3^#(#false(), @b2, @zs) -> c_43()
, 36: #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, 37: div^#(@x, @y) -> c_6(#div^#(@x, @y))
, 38: #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, 39: #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, 40: #div^#(#neg(@x), #0()) -> c_138()
, 41: #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, 42: #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, 43: #div^#(#pos(@x), #0()) -> c_141()
, 44: #div^#(#0(), #neg(@y)) -> c_142()
, 45: #div^#(#0(), #pos(@y)) -> c_143()
, 46: #div^#(#0(), #0()) -> c_144()
, 47: bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, 48: +^#(@x, @y) -> c_21(#add^#(@x, @y))
, 49: *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, 50: sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, 51: mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, 52: #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 53: #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 54: #ckgt^#(#EQ()) -> c_70()
, 55: #ckgt^#(#LT()) -> c_71()
, 56: #ckgt^#(#GT()) -> c_72()
, 57: #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, 58: #compare^#(#neg(@x), #pos(@y)) -> c_83()
, 59: #compare^#(#neg(@x), #0()) -> c_84()
, 60: #compare^#(#pos(@x), #neg(@y)) -> c_85()
, 61: #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, 62: #compare^#(#pos(@x), #0()) -> c_87()
, 63: #compare^#(#0(), #neg(@y)) -> c_88()
, 64: #compare^#(#0(), #pos(@y)) -> c_89()
, 65: #compare^#(#0(), #0()) -> c_90()
, 66: #compare^#(#0(), #s(@y)) -> c_91()
, 67: #compare^#(#s(@x), #0()) -> c_92()
, 68: #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, 69: mult#1^#(nil(), @b2) -> c_49()
, 70: sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, 71: sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, 72: sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, 73: sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, 74: #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, 75: #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 76: #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, 77: #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 78: #add^#(#0(), @y) -> c_77()
, 79: sum#4^#(#true()) ->
c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, 80: sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, 81: #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, 82: #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, 83: #mult^#(#neg(@x), #0()) -> c_125()
, 84: #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, 85: #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, 86: #mult^#(#pos(@x), #0()) -> c_128()
, 87: #mult^#(#0(), #neg(@y)) -> c_129()
, 88: #mult^#(#0(), #pos(@y)) -> c_130()
, 89: #mult^#(#0(), #0()) -> c_131()
, 90: sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, 91: sub'#5^#(#false(), @z, @zs) -> c_26()
, 92: #cklt^#(#EQ()) -> c_117()
, 93: #cklt^#(#LT()) -> c_118()
, 94: #cklt^#(#GT()) -> c_119()
, 95: sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, 96: #eq^#(nil(), nil()) -> c_94()
, 97: #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, 98: #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, 99: #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, 100: #eq^#(#neg(@x), #pos(@y)) -> c_98()
, 101: #eq^#(#neg(@x), #0()) -> c_99()
, 102: #eq^#(#pos(@x), #neg(@y)) -> c_100()
, 103: #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, 104: #eq^#(#pos(@x), #0()) -> c_102()
, 105: #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, 106: #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 107: #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, 108: #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, 109: #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, 110: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 111: #eq^#(#0(), #neg(@y)) -> c_109()
, 112: #eq^#(#0(), #pos(@y)) -> c_110()
, 113: #eq^#(#0(), #0()) -> c_111()
, 114: #eq^#(#0(), #s(@y)) -> c_112()
, 115: #eq^#(#s(@x), #0()) -> c_113()
, 116: #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, 117: sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, 118: diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, 119: compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, 120: compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, 121: compare#5^#(#true(), @x, @y) ->
c_35(-^#(#0(), #pos(#s(#0()))))
, 122: compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, 123: compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, 124: compare#6^#(#false()) -> c_54(#abs^#(#0()))
, 125: compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, 126: compare#4^#(#false(), @r, @x, @y) -> c_56()
, 127: sub'#1^#(nil(), @b2, @r) -> c_40()
, 128: add'#1^#(nil(), @b2, @r) -> c_44()
, 129: add'#2^#(nil(), @r, @x, @xs) -> c_46()
, 130: compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, 131: #natsub^#(@x, #0()) -> c_66()
, 132: #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, 133: #natdiv^#(#0(), #0()) -> c_68()
, 134: #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, 135: #pred^#(#neg(#s(@x))) -> c_145()
, 136: #pred^#(#pos(#s(#0()))) -> c_146()
, 137: #pred^#(#pos(#s(#s(@x)))) -> c_147()
, 138: #pred^#(#0()) -> c_148()
, 139: #succ^#(#neg(#s(#0()))) -> c_132()
, 140: #succ^#(#neg(#s(#s(@x)))) -> c_133()
, 141: #succ^#(#pos(#s(@x))) -> c_134()
, 142: #succ^#(#0()) -> c_135()
, 143: #and^#(#true(), #true()) -> c_78()
, 144: #and^#(#true(), #false()) -> c_79()
, 145: #and^#(#false(), #true()) -> c_80()
, 146: #and^#(#false(), #false()) -> c_81()
, 147: #natmult^#(#0(), @y) -> c_115()
, 148: #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, #sub^#(@x, #0()) -> c_122()
, sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, #abs^#(#neg(@x)) -> c_62()
, #abs^#(#pos(@x)) -> c_63()
, #abs^#(#0()) -> c_64()
, #abs^#(#s(@x)) -> c_65()
, diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, diff#1^#(#false()) -> c_4(#abs^#(#0()))
, mult#3^#(#false(), @b2, @zs) -> c_43()
, #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, div^#(@x, @y) -> c_6(#div^#(@x, @y))
, #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #0()) -> c_138()
, #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #0()) -> c_141()
, #div^#(#0(), #neg(@y)) -> c_142()
, #div^#(#0(), #pos(@y)) -> c_143()
, #div^#(#0(), #0()) -> c_144()
, bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, +^#(@x, @y) -> c_21(#add^#(@x, @y))
, *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_70()
, #ckgt^#(#LT()) -> c_71()
, #ckgt^#(#GT()) -> c_72()
, #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, #compare^#(#neg(@x), #pos(@y)) -> c_83()
, #compare^#(#neg(@x), #0()) -> c_84()
, #compare^#(#pos(@x), #neg(@y)) -> c_85()
, #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, #compare^#(#pos(@x), #0()) -> c_87()
, #compare^#(#0(), #neg(@y)) -> c_88()
, #compare^#(#0(), #pos(@y)) -> c_89()
, #compare^#(#0(), #0()) -> c_90()
, #compare^#(#0(), #s(@y)) -> c_91()
, #compare^#(#s(@x), #0()) -> c_92()
, #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, mult#1^#(nil(), @b2) -> c_49()
, sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#0(), @y) -> c_77()
, sum#4^#(#true()) -> c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #0()) -> c_125()
, #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #0()) -> c_128()
, #mult^#(#0(), #neg(@y)) -> c_129()
, #mult^#(#0(), #pos(@y)) -> c_130()
, #mult^#(#0(), #0()) -> c_131()
, sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, sub'#5^#(#false(), @z, @zs) -> c_26()
, #cklt^#(#EQ()) -> c_117()
, #cklt^#(#LT()) -> c_118()
, #cklt^#(#GT()) -> c_119()
, sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, #eq^#(nil(), nil()) -> c_94()
, #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, #eq^#(#neg(@x), #pos(@y)) -> c_98()
, #eq^#(#neg(@x), #0()) -> c_99()
, #eq^#(#pos(@x), #neg(@y)) -> c_100()
, #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, #eq^#(#pos(@x), #0()) -> c_102()
, #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(#0(), #neg(@y)) -> c_109()
, #eq^#(#0(), #pos(@y)) -> c_110()
, #eq^#(#0(), #0()) -> c_111()
, #eq^#(#0(), #s(@y)) -> c_112()
, #eq^#(#s(@x), #0()) -> c_113()
, #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, compare#5^#(#true(), @x, @y) -> c_35(-^#(#0(), #pos(#s(#0()))))
, compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, compare#6^#(#false()) -> c_54(#abs^#(#0()))
, compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, compare#4^#(#false(), @r, @x, @y) -> c_56()
, sub'#1^#(nil(), @b2, @r) -> c_40()
, add'#1^#(nil(), @b2, @r) -> c_44()
, add'#2^#(nil(), @r, @x, @xs) -> c_46()
, compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, #natsub^#(@x, #0()) -> c_66()
, #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, #natdiv^#(#0(), #0()) -> c_68()
, #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#neg(#s(@x))) -> c_145()
, #pred^#(#pos(#s(#0()))) -> c_146()
, #pred^#(#pos(#s(#s(@x)))) -> c_147()
, #pred^#(#0()) -> c_148()
, #succ^#(#neg(#s(#0()))) -> c_132()
, #succ^#(#neg(#s(#s(@x)))) -> c_133()
, #succ^#(#pos(#s(@x))) -> c_134()
, #succ^#(#0()) -> c_135()
, #and^#(#true(), #true()) -> c_78()
, #and^#(#true(), #false()) -> c_79()
, #and^#(#false(), #true()) -> c_80()
, #and^#(#false(), #false()) -> c_81()
, #natmult^#(#0(), @y) -> c_115()
, #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0())))
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #ckgt(#EQ()) -> #false()
, #ckgt(#LT()) -> #false()
, #ckgt(#GT()) -> #true()
, #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, bitToInt'#1(nil(), @n) -> #abs(#0())
, bitToInt'#1(::(@x, @xs), @n) ->
+(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0()))))))
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2)
, sub#1(tuple#2(@b, @_@1)) -> @b
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0())))
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, bitToInt'(@b, @n) -> bitToInt'#1(@b, @n)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0()))))
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs)
, sub'#5(#false(), @z, @zs) -> ::(@z, @zs)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, sub'#3(tuple#2(@z, @r'), @xs, @ys) ->
sub'#4(sub'(@xs, @ys, @r'), @z)
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r)
, sub'#2(::(@y, @ys), @r, @x, @xs) ->
sub'#3(diff(@x, @y, @r), @xs, @ys)
, compare#2(nil(), @x, @xs) -> #abs(#0())
, compare#2(::(@y, @ys), @x, @xs) ->
compare#3(compare(@xs, @ys), @x, @y)
, sub'#4(tuple#2(@zs, @s), @z) ->
tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s)
, compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0())))
, compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y))
, compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r)
, sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs)
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r)
, compare(@b1, @b2) -> compare#1(@b1, @b2)
, compare#6(#true()) -> #abs(#pos(#s(#0())))
, compare#6(#false()) -> #abs(#0())
, compare#4(#true(), @r, @x, @y) ->
compare#5(#less(@x, @y), @x, @y)
, compare#4(#false(), @r, @x, @y) -> @r
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, compare#1(nil(), @b2) -> #abs(#0())
, compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
The following weak DPs constitute a sub-graph of the DG that is
closed under successors. The DPs are removed.
{ -^#(@x, @y) -> c_1(#sub^#(@x, @y))
, #sub^#(@x, #neg(@y)) -> c_120(#add^#(@x, #pos(@y)))
, #sub^#(@x, #pos(@y)) -> c_121(#add^#(@x, #neg(@y)))
, #sub^#(@x, #0()) -> c_122()
, sub#1^#(tuple#2(@b, @_@1)) -> c_12()
, #abs^#(#neg(@x)) -> c_62()
, #abs^#(#pos(@x)) -> c_63()
, #abs^#(#0()) -> c_64()
, #abs^#(#s(@x)) -> c_65()
, diff#1^#(#true()) -> c_3(#abs^#(#pos(#s(#0()))))
, diff#1^#(#false()) -> c_4(#abs^#(#0()))
, mult#3^#(#false(), @b2, @zs) -> c_43()
, #equal^#(@x, @y) -> c_29(#eq^#(@x, @y))
, div^#(@x, @y) -> c_6(#div^#(@x, @y))
, #div^#(#neg(@x), #neg(@y)) -> c_136(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #pos(@y)) -> c_137(#natdiv^#(@x, @y))
, #div^#(#neg(@x), #0()) -> c_138()
, #div^#(#pos(@x), #neg(@y)) -> c_139(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #pos(@y)) -> c_140(#natdiv^#(@x, @y))
, #div^#(#pos(@x), #0()) -> c_141()
, #div^#(#0(), #neg(@y)) -> c_142()
, #div^#(#0(), #pos(@y)) -> c_143()
, #div^#(#0(), #0()) -> c_144()
, bitToInt'#1^#(nil(), @n) -> c_7(#abs^#(#0()))
, +^#(@x, @y) -> c_21(#add^#(@x, @y))
, *^#(@x, @y) -> c_24(#mult^#(@x, @y))
, sum^#(@x, @y, @r) ->
c_9(sum#1^#(+(+(@x, @y), @r)), +^#(+(@x, @y), @r), +^#(@x, @y))
, sum#1^#(@s) ->
c_20(sum#2^#(#equal(@s, #0()), @s), #equal^#(@s, #0()))
, mod^#(@x, @y) ->
c_10(-^#(@x, *(@x, div(@x, @y))),
*^#(@x, div(@x, @y)),
div^#(@x, @y))
, #less^#(@x, @y) ->
c_27(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #greater^#(@x, @y) ->
c_14(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_70()
, #ckgt^#(#LT()) -> c_71()
, #ckgt^#(#GT()) -> c_72()
, #compare^#(#neg(@x), #neg(@y)) -> c_82(#compare^#(@y, @x))
, #compare^#(#neg(@x), #pos(@y)) -> c_83()
, #compare^#(#neg(@x), #0()) -> c_84()
, #compare^#(#pos(@x), #neg(@y)) -> c_85()
, #compare^#(#pos(@x), #pos(@y)) -> c_86(#compare^#(@x, @y))
, #compare^#(#pos(@x), #0()) -> c_87()
, #compare^#(#0(), #neg(@y)) -> c_88()
, #compare^#(#0(), #pos(@y)) -> c_89()
, #compare^#(#0(), #0()) -> c_90()
, #compare^#(#0(), #s(@y)) -> c_91()
, #compare^#(#s(@x), #0()) -> c_92()
, #compare^#(#s(@x), #s(@y)) -> c_93(#compare^#(@x, @y))
, mult#1^#(nil(), @b2) -> c_49()
, sum#2^#(#true(), @s) -> c_18(#abs^#(#0()), #abs^#(#0()))
, sum#2^#(#false(), @s) ->
c_19(sum#3^#(#equal(@s, #pos(#s(#0()))), @s),
#equal^#(@s, #pos(#s(#0()))))
, sum#3^#(#true(), @s) ->
c_57(#abs^#(#pos(#s(#0()))), #abs^#(#0()))
, sum#3^#(#false(), @s) ->
c_58(sum#4^#(#equal(@s, #pos(#s(#s(#0()))))),
#equal^#(@s, #pos(#s(#s(#0())))))
, #add^#(#neg(#s(#0())), @y) -> c_73(#pred^#(@y))
, #add^#(#neg(#s(#s(@x))), @y) ->
c_74(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> c_75(#succ^#(@y))
, #add^#(#pos(#s(#s(@x))), @y) ->
c_76(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#0(), @y) -> c_77()
, sum#4^#(#true()) -> c_22(#abs^#(#0()), #abs^#(#pos(#s(#0()))))
, sum#4^#(#false()) ->
c_23(#abs^#(#pos(#s(#0()))), #abs^#(#pos(#s(#0()))))
, #mult^#(#neg(@x), #neg(@y)) -> c_123(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #pos(@y)) -> c_124(#natmult^#(@x, @y))
, #mult^#(#neg(@x), #0()) -> c_125()
, #mult^#(#pos(@x), #neg(@y)) -> c_126(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #pos(@y)) -> c_127(#natmult^#(@x, @y))
, #mult^#(#pos(@x), #0()) -> c_128()
, #mult^#(#0(), #neg(@y)) -> c_129()
, #mult^#(#0(), #pos(@y)) -> c_130()
, #mult^#(#0(), #0()) -> c_131()
, sub'#5^#(#true(), @z, @zs) -> c_25(#abs^#(#0()))
, sub'#5^#(#false(), @z, @zs) -> c_26()
, #cklt^#(#EQ()) -> c_117()
, #cklt^#(#LT()) -> c_118()
, #cklt^#(#GT()) -> c_119()
, sub'#4^#(tuple#2(@zs, @s), @z) ->
c_34(sub'#5^#(#equal(@s, #pos(#s(#0()))), @z, @zs),
#equal^#(@s, #pos(#s(#0()))))
, #eq^#(nil(), nil()) -> c_94()
, #eq^#(nil(), tuple#2(@y_1, @y_2)) -> c_95()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_96()
, #eq^#(#neg(@x), #neg(@y)) -> c_97(#eq^#(@x, @y))
, #eq^#(#neg(@x), #pos(@y)) -> c_98()
, #eq^#(#neg(@x), #0()) -> c_99()
, #eq^#(#pos(@x), #neg(@y)) -> c_100()
, #eq^#(#pos(@x), #pos(@y)) -> c_101(#eq^#(@x, @y))
, #eq^#(#pos(@x), #0()) -> c_102()
, #eq^#(tuple#2(@x_1, @x_2), nil()) -> c_103()
, #eq^#(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
c_104(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> c_105()
, #eq^#(::(@x_1, @x_2), nil()) -> c_106()
, #eq^#(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> c_107()
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_108(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(#0(), #neg(@y)) -> c_109()
, #eq^#(#0(), #pos(@y)) -> c_110()
, #eq^#(#0(), #0()) -> c_111()
, #eq^#(#0(), #s(@y)) -> c_112()
, #eq^#(#s(@x), #0()) -> c_113()
, #eq^#(#s(@x), #s(@y)) -> c_114(#eq^#(@x, @y))
, sub'#2^#(nil(), @r, @x, @xs) -> c_30()
, diff^#(@x, @y, @r) ->
c_48(mod^#(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
+^#(+(@x, @y), @r),
+^#(@x, @y),
diff#1^#(#less(-(-(@x, @y), @r), #0())),
#less^#(-(-(@x, @y), @r), #0()),
-^#(-(@x, @y), @r),
-^#(@x, @y))
, compare#2^#(nil(), @x, @xs) -> c_32(#abs^#(#0()))
, compare#3^#(@r, @x, @y) ->
c_37(compare#4^#(#equal(@r, #0()), @r, @x, @y), #equal^#(@r, #0()))
, compare#5^#(#true(), @x, @y) -> c_35(-^#(#0(), #pos(#s(#0()))))
, compare#5^#(#false(), @x, @y) ->
c_36(compare#6^#(#greater(@x, @y)), #greater^#(@x, @y))
, compare#6^#(#true()) -> c_53(#abs^#(#pos(#s(#0()))))
, compare#6^#(#false()) -> c_54(#abs^#(#0()))
, compare#4^#(#true(), @r, @x, @y) ->
c_55(compare#5^#(#less(@x, @y), @x, @y), #less^#(@x, @y))
, compare#4^#(#false(), @r, @x, @y) -> c_56()
, sub'#1^#(nil(), @b2, @r) -> c_40()
, add'#1^#(nil(), @b2, @r) -> c_44()
, add'#2^#(nil(), @r, @x, @xs) -> c_46()
, compare#1^#(nil(), @b2) -> c_60(#abs^#(#0()))
, #natsub^#(@x, #0()) -> c_66()
, #natsub^#(#s(@x), #s(@y)) -> c_67(#natsub^#(@x, @y))
, #natdiv^#(#0(), #0()) -> c_68()
, #natdiv^#(#s(@x), #s(@y)) ->
c_69(#natdiv^#(#natsub(@x, @y), #s(@y)), #natsub^#(@x, @y))
, #pred^#(#neg(#s(@x))) -> c_145()
, #pred^#(#pos(#s(#0()))) -> c_146()
, #pred^#(#pos(#s(#s(@x)))) -> c_147()
, #pred^#(#0()) -> c_148()
, #succ^#(#neg(#s(#0()))) -> c_132()
, #succ^#(#neg(#s(#s(@x)))) -> c_133()
, #succ^#(#pos(#s(@x))) -> c_134()
, #succ^#(#0()) -> c_135()
, #and^#(#true(), #true()) -> c_78()
, #and^#(#true(), #false()) -> c_79()
, #and^#(#false(), #true()) -> c_80()
, #and^#(#false(), #false()) -> c_81()
, #natmult^#(#0(), @y) -> c_115()
, #natmult^#(#s(@x), @y) ->
c_116(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, sub'^#(@b1, @b2, @r) -> c_51(sub'#1^#(@b1, @b2, @r))
, mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, mult#3^#(#true(), @b2, @zs) -> c_42(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, bitToInt'^#(@b, @n) -> c_15(bitToInt'#1^#(@b, @n))
, mult3^#(@b1, @b2, @b3) ->
c_11(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_16(mult#1^#(@b1, @b2))
, leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_52(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, add'^#(@b1, @b2, @r) -> c_59(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_39(add'^#(@xs, @ys, @r'))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_41(sub'#2^#(@b2, @r, @x, @xs))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_45(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r))
, compare#1^#(::(@x, @xs), @b2) ->
c_61(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0())))
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #ckgt(#EQ()) -> #false()
, #ckgt(#LT()) -> #false()
, #ckgt(#GT()) -> #true()
, #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, bitToInt'#1(nil(), @n) -> #abs(#0())
, bitToInt'#1(::(@x, @xs), @n) ->
+(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0()))))))
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2)
, sub#1(tuple#2(@b, @_@1)) -> @b
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0())))
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, bitToInt'(@b, @n) -> bitToInt'#1(@b, @n)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0()))))
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs)
, sub'#5(#false(), @z, @zs) -> ::(@z, @zs)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, sub'#3(tuple#2(@z, @r'), @xs, @ys) ->
sub'#4(sub'(@xs, @ys, @r'), @z)
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r)
, sub'#2(::(@y, @ys), @r, @x, @xs) ->
sub'#3(diff(@x, @y, @r), @xs, @ys)
, compare#2(nil(), @x, @xs) -> #abs(#0())
, compare#2(::(@y, @ys), @x, @xs) ->
compare#3(compare(@xs, @ys), @x, @y)
, sub'#4(tuple#2(@zs, @s), @z) ->
tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s)
, compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0())))
, compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y))
, compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r)
, sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs)
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r)
, compare(@b1, @b2) -> compare#1(@b1, @b2)
, compare#6(#true()) -> #abs(#pos(#s(#0())))
, compare#6(#false()) -> #abs(#0())
, compare#4(#true(), @r, @x, @y) ->
compare#5(#less(@x, @y), @x, @y)
, compare#4(#false(), @r, @x, @y) -> @r
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, compare#1(nil(), @b2) -> #abs(#0())
, compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ sub^#(@b1, @b2) ->
c_2(sub#1^#(sub'(@b1, @b2, #abs(#0()))),
sub'^#(@b1, @b2, #abs(#0())),
#abs^#(#0()))
, mult#2^#(@zs, @b2, @x) ->
c_5(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs),
#equal^#(@x, #pos(#s(#0()))))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_8(+^#(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0())))))),
*^#(@x, @n),
bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))),
*^#(@n, #pos(#s(#s(#0())))))
, leq^#(@b1, @b2) ->
c_13(#less^#(compare(@b1, @b2), #pos(#s(#0()))),
compare^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_50(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
#abs^#(#0()),
mult^#(@xs, @b2))
, bitToInt^#(@b) ->
c_17(bitToInt'^#(@b, #abs(#pos(#s(#0())))), #abs^#(#pos(#s(#0()))))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_28(sub'#4^#(sub'(@xs, @ys, @r'), @z), sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_31(sub'#3^#(diff(@x, @y, @r), @xs, @ys), diff^#(@x, @y, @r))
, compare#2^#(::(@y, @ys), @x, @xs) ->
c_33(compare#3^#(compare(@xs, @ys), @x, @y), compare^#(@xs, @ys))
, add^#(@b1, @b2) ->
c_38(add'^#(@b1, @b2, #abs(#0())), #abs^#(#0()))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_47(add'#3^#(sum(@x, @y, @r), @xs, @ys), sum^#(@x, @y, @r)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, leq^#(@b1, @b2) -> c_9(compare^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, sub(@b1, @b2) -> sub#1(sub'(@b1, @b2, #abs(#0())))
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@y)))
, #ckgt(#EQ()) -> #false()
, #ckgt(#LT()) -> #false()
, #ckgt(#GT()) -> #true()
, #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, bitToInt'#1(nil(), @n) -> #abs(#0())
, bitToInt'#1(::(@x, @xs), @n) ->
+(*(@x, @n), bitToInt'(@xs, *(@n, #pos(#s(#s(#0()))))))
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult3(@b1, @b2, @b3) -> mult(mult(@b1, @b2), @b2)
, sub#1(tuple#2(@b, @_@1)) -> @b
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, leq(@b1, @b2) -> #less(compare(@b1, @b2), #pos(#s(#0())))
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, bitToInt'(@b, @n) -> bitToInt'#1(@b, @n)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, bitToInt(@b) -> bitToInt'(@b, #abs(#pos(#s(#0()))))
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, sub'#5(#true(), @z, @zs) -> ::(#abs(#0()), @zs)
, sub'#5(#false(), @z, @zs) -> ::(@z, @zs)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, sub'#3(tuple#2(@z, @r'), @xs, @ys) ->
sub'#4(sub'(@xs, @ys, @r'), @z)
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, sub'#2(nil(), @r, @x, @xs) -> tuple#2(nil(), @r)
, sub'#2(::(@y, @ys), @r, @x, @xs) ->
sub'#3(diff(@x, @y, @r), @xs, @ys)
, compare#2(nil(), @x, @xs) -> #abs(#0())
, compare#2(::(@y, @ys), @x, @xs) ->
compare#3(compare(@xs, @ys), @x, @y)
, sub'#4(tuple#2(@zs, @s), @z) ->
tuple#2(sub'#5(#equal(@s, #pos(#s(#0()))), @z, @zs), @s)
, compare#5(#true(), @x, @y) -> -(#0(), #pos(#s(#0())))
, compare#5(#false(), @x, @y) -> compare#6(#greater(@x, @y))
, compare#3(@r, @x, @y) -> compare#4(#equal(@r, #0()), @r, @x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, sub'#1(nil(), @b2, @r) -> tuple#2(nil(), @r)
, sub'#1(::(@x, @xs), @b2, @r) -> sub'#2(@b2, @r, @x, @xs)
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sub'(@b1, @b2, @r) -> sub'#1(@b1, @b2, @r)
, compare(@b1, @b2) -> compare#1(@b1, @b2)
, compare#6(#true()) -> #abs(#pos(#s(#0())))
, compare#6(#false()) -> #abs(#0())
, compare#4(#true(), @r, @x, @y) ->
compare#5(#less(@x, @y), @x, @y)
, compare#4(#false(), @r, @x, @y) -> @r
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, compare#1(nil(), @b2) -> #abs(#0())
, compare#1(::(@x, @xs), @b2) -> compare#2(@b2, @x, @xs)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace rewrite rules by usable rules:
Weak Usable Rules:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, leq^#(@b1, @b2) -> c_9(compare^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
Consider the dependency graph
1: sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
-->_1 sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r)) :2
2: sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
-->_1 sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs)) :19
3: mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
-->_1 mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs)) :4
4: mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
-->_1 add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0()))) :16
5: bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
-->_1 bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n)) :6
6: bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
-->_1 bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0())))))) :5
7: mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
-->_2 mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2)) :8
-->_1 mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2)) :8
8: mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
-->_1 mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2)) :11
9: leq^#(@b1, @b2) -> c_9(compare^#(@b1, @b2))
-->_1 compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2)) :10
10: compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
-->_1 compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) :22
11: mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
-->_2 mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2)) :8
-->_1 mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs)) :3
12: bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
-->_1 bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n)) :6
13: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
-->_1 sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r)) :2
14: sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
-->_1 sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r')) :13
15: compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
-->_1 compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2)) :10
16: add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
-->_1 add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r)) :17
17: add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
-->_1 add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs)) :20
18: add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
-->_1 add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r)) :17
19: sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs))
-->_1 sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys)) :14
20: add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
-->_1 add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys)) :21
21: add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys))
-->_1 add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r')) :18
22: compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs))
-->_1 compare#2^#(::(@y, @ys), @x, @xs) ->
c_15(compare^#(@xs, @ys)) :15
Following roots of the dependency graph are removed, as the
considered set of starting terms is closed under reduction with
respect to these rules (modulo compound contexts).
{ leq^#(@b1, @b2) -> c_9(compare^#(@b1, @b2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We analyse the complexity of following sub-problems (R) and (S).
Problem (S) is obtained from the input problem by shifting strict
rules from (R) into the weak component:
Problem (R):
------------
Strict DPs:
{ sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs)) }
Weak DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
StartTerms: basic terms
Strategy: innermost
Problem (S):
------------
Strict DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
StartTerms: basic terms
Strategy: innermost
Overall, the transformation results in the following sub-problem(s):
Generated new problems:
-----------------------
R) Strict DPs:
{ sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs)) }
Weak DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
StartTerms: basic terms
Strategy: innermost
This problem was proven YES(O(1),O(n^1)).
S) Strict DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
StartTerms: basic terms
Strategy: innermost
This problem was proven YES(O(1),O(n^2)).
Proofs for generated problems:
------------------------------
R) We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs)) }
Weak DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
The following weak DPs constitute a sub-graph of the DG that is
closed under successors. The DPs are removed.
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We replace rewrite rules by usable rules:
Weak Usable Rules:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, div(@x, @y) -> #div(@x, @y)
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, +(@x, @y) -> #add(@x, @y)
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, div(@x, @y) -> #div(@x, @y)
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, +(@x, @y) -> #add(@x, @y)
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
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: sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, 2: sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, 5: sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs)) }
Trs: { mod(@x, @y) -> -(@x, *(@x, div(@x, @y))) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(c_1) = {1}, Uargs(c_2) = {1}, Uargs(c_13) = {1},
Uargs(c_14) = {1}, Uargs(c_19) = {1}
TcT has computed the following constructor-based matrix
interpretation satisfying not(EDA).
[#natsub](x1, x2) = [0]
[-](x1, x2) = [0]
[diff#1](x1) = [0]
[#natdiv](x1, x2) = [0]
[#add](x1, x2) = [0]
[div](x1, x2) = [0]
[#EQ] = [0]
[mod](x1, x2) = [7]
[#compare](x1, x2) = [0]
[+](x1, x2) = [0]
[*](x1, x2) = [0]
[#neg](x1) = [0]
[#less](x1, x2) = [0]
[#natmult](x1, x2) = [0]
[#divByZero] = [0]
[#true] = [0]
[#cklt](x1) = [0]
[#sub](x1, x2) = [7] x1 + [0]
[#pos](x1) = [0]
[tuple#2](x1, x2) = [1] x2 + [0]
[diff](x1, x2, x3) = [0]
[#false] = [0]
[::](x1, x2) = [1] x1 + [1] x2 + [2]
[#LT] = [0]
[#mult](x1, x2) = [0]
[#succ](x1) = [0]
[#0] = [0]
[#div](x1, x2) = [0]
[#abs](x1) = [0]
[#pred](x1) = [0]
[#s](x1) = [0]
[#GT] = [0]
[sub^#](x1, x2) = [7] x1 + [7] x2 + [7]
[sub'^#](x1, x2, x3) = [4] x1 + [4] x2 + [1]
[sub'#3^#](x1, x2, x3) = [4] x1 + [4] x2 + [4] x3 + [1]
[sub'#2^#](x1, x2, x3, x4) = [4] x1 + [4] x4 + [0]
[sub'#1^#](x1, x2, x3) = [4] x1 + [4] x2 + [0]
[c_1](x1) = [1] x1 + [4]
[c_2](x1) = [1] x1 + [0]
[c_13](x1) = [1] x1 + [0]
[c_14](x1) = [1] x1 + [7]
[c_19](x1) = [1] x1 + [0]
The order satisfies the following ordering constraints:
[#natsub(@x, #0())] = [0]
? [1] @x + [0]
= [@x]
[#natsub(#s(@x), #s(@y))] = [0]
>= [0]
= [#natsub(@x, @y)]
[-(@x, @y)] = [0]
? [7] @x + [0]
= [#sub(@x, @y)]
[diff#1(#true())] = [0]
>= [0]
= [#abs(#pos(#s(#0())))]
[diff#1(#false())] = [0]
>= [0]
= [#abs(#0())]
[#natdiv(#0(), #0())] = [0]
>= [0]
= [#divByZero()]
[#natdiv(#s(@x), #s(@y))] = [0]
>= [0]
= [#s(#natdiv(#natsub(@x, @y), #s(@y)))]
[#add(#neg(#s(#0())), @y)] = [0]
>= [0]
= [#pred(@y)]
[#add(#neg(#s(#s(@x))), @y)] = [0]
>= [0]
= [#pred(#add(#pos(#s(@x)), @y))]
[#add(#pos(#s(#0())), @y)] = [0]
>= [0]
= [#succ(@y)]
[#add(#pos(#s(#s(@x))), @y)] = [0]
>= [0]
= [#succ(#add(#pos(#s(@x)), @y))]
[#add(#0(), @y)] = [0]
? [1] @y + [0]
= [@y]
[div(@x, @y)] = [0]
>= [0]
= [#div(@x, @y)]
[mod(@x, @y)] = [7]
> [0]
= [-(@x, *(@x, div(@x, @y)))]
[#compare(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [0]
>= [0]
= [#LT()]
[#compare(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#compare(#pos(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#0(), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#0(), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#0(), #0())] = [0]
>= [0]
= [#EQ()]
[#compare(#0(), #s(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#s(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[+(@x, @y)] = [0]
>= [0]
= [#add(@x, @y)]
[*(@x, @y)] = [0]
>= [0]
= [#mult(@x, @y)]
[#less(@x, @y)] = [0]
>= [0]
= [#cklt(#compare(@x, @y))]
[#natmult(#0(), @y)] = [0]
>= [0]
= [#0()]
[#natmult(#s(@x), @y)] = [0]
>= [0]
= [#add(#pos(@y), #natmult(@x, @y))]
[#cklt(#EQ())] = [0]
>= [0]
= [#false()]
[#cklt(#LT())] = [0]
>= [0]
= [#true()]
[#cklt(#GT())] = [0]
>= [0]
= [#false()]
[#sub(@x, #neg(@y))] = [7] @x + [0]
>= [0]
= [#add(@x, #pos(@y))]
[#sub(@x, #pos(@y))] = [7] @x + [0]
>= [0]
= [#add(@x, #neg(@y))]
[#sub(@x, #0())] = [7] @x + [0]
>= [1] @x + [0]
= [@x]
[diff(@x, @y, @r)] = [0]
>= [0]
= [tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))]
[#mult(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#pos(#natmult(@x, @y))]
[#mult(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#neg(#natmult(@x, @y))]
[#mult(#neg(@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))]
[#mult(#pos(@x), #0())] = [0]
>= [0]
= [#0()]
[#mult(#0(), #neg(@y))] = [0]
>= [0]
= [#0()]
[#mult(#0(), #pos(@y))] = [0]
>= [0]
= [#0()]
[#mult(#0(), #0())] = [0]
>= [0]
= [#0()]
[#succ(#neg(#s(#0())))] = [0]
>= [0]
= [#0()]
[#succ(#neg(#s(#s(@x))))] = [0]
>= [0]
= [#neg(#s(@x))]
[#succ(#pos(#s(@x)))] = [0]
>= [0]
= [#pos(#s(#s(@x)))]
[#succ(#0())] = [0]
>= [0]
= [#pos(#s(#0()))]
[#div(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#pos(#natdiv(@x, @y))]
[#div(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#neg(#natdiv(@x, @y))]
[#div(#neg(@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))]
[#div(#pos(@x), #0())] = [0]
>= [0]
= [#divByZero()]
[#div(#0(), #neg(@y))] = [0]
>= [0]
= [#0()]
[#div(#0(), #pos(@y))] = [0]
>= [0]
= [#0()]
[#div(#0(), #0())] = [0]
>= [0]
= [#divByZero()]
[#abs(#neg(@x))] = [0]
>= [0]
= [#pos(@x)]
[#abs(#pos(@x))] = [0]
>= [0]
= [#pos(@x)]
[#abs(#0())] = [0]
>= [0]
= [#0()]
[#abs(#s(@x))] = [0]
>= [0]
= [#pos(#s(@x))]
[#pred(#neg(#s(@x)))] = [0]
>= [0]
= [#neg(#s(#s(@x)))]
[#pred(#pos(#s(#0())))] = [0]
>= [0]
= [#0()]
[#pred(#pos(#s(#s(@x))))] = [0]
>= [0]
= [#pos(#s(@x))]
[#pred(#0())] = [0]
>= [0]
= [#neg(#s(#0()))]
[sub^#(@b1, @b2)] = [7] @b1 + [7] @b2 + [7]
> [4] @b1 + [4] @b2 + [5]
= [c_1(sub'^#(@b1, @b2, #abs(#0())))]
[sub'^#(@b1, @b2, @r)] = [4] @b1 + [4] @b2 + [1]
> [4] @b1 + [4] @b2 + [0]
= [c_2(sub'#1^#(@b1, @b2, @r))]
[sub'#3^#(tuple#2(@z, @r'), @xs, @ys)] = [4] @xs + [4] @ys + [4] @r' + [1]
>= [4] @xs + [4] @ys + [1]
= [c_13(sub'^#(@xs, @ys, @r'))]
[sub'#2^#(::(@y, @ys), @r, @x, @xs)] = [4] @y + [4] @xs + [4] @ys + [8]
>= [4] @xs + [4] @ys + [8]
= [c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))]
[sub'#1^#(::(@x, @xs), @b2, @r)] = [4] @x + [4] @b2 + [4] @xs + [8]
> [4] @b2 + [4] @xs + [0]
= [c_19(sub'#2^#(@b2, @r, @x, @xs))]
We return to the main proof. Consider the set of all dependency
pairs
:
{ 1: sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, 2: sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, 3: sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, 4: sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, 5: sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs)) }
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of dependency
pairs {1,2,5}. These cover all (indirect) predecessors of
dependency pairs {1,2,3,4,5}, their number of application is
equally bounded. The dependency pairs are shifted into the weak
component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Weak DPs:
{ sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, div(@x, @y) -> #div(@x, @y)
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, +(@x, @y) -> #add(@x, @y)
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
The following weak DPs constitute a sub-graph of the DG that is
closed under successors. The DPs are removed.
{ sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, div(@x, @y) -> #div(@x, @y)
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, +(@x, @y) -> #add(@x, @y)
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
No rule is usable, rules are removed from the input problem.
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
S) We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
The following weak DPs constitute a sub-graph of the DG that is
closed under successors. The DPs are removed.
{ sub^#(@b1, @b2) -> c_1(sub'^#(@b1, @b2, #abs(#0())))
, sub'^#(@b1, @b2, @r) -> c_2(sub'#1^#(@b1, @b2, @r))
, sub'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_13(sub'^#(@xs, @ys, @r'))
, sub'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_14(sub'#3^#(diff(@x, @y, @r), @xs, @ys))
, sub'#1^#(::(@x, @xs), @b2, @r) ->
c_19(sub'#2^#(@b2, @r, @x, @xs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We analyse the complexity of following sub-problems (R) and (S).
Problem (S) is obtained from the input problem by shifting strict
rules from (R) into the weak component:
Problem (R):
------------
Strict DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys)) }
Weak DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
StartTerms: basic terms
Strategy: innermost
Problem (S):
------------
Strict DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
StartTerms: basic terms
Strategy: innermost
Overall, the transformation results in the following sub-problem(s):
Generated new problems:
-----------------------
R) Strict DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys)) }
Weak DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
StartTerms: basic terms
Strategy: innermost
This problem was proven YES(O(1),O(n^2)).
S) Strict DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
StartTerms: basic terms
Strategy: innermost
This problem was proven YES(O(1),O(n^1)).
Proofs for generated problems:
------------------------------
R) We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys)) }
Weak DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
The following weak DPs constitute a sub-graph of the DG that is
closed under successors. The DPs are removed.
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace rewrite rules by usable rules:
Weak Usable Rules:
{ #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys)) }
Weak Trs:
{ #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We decompose the input problem according to the dependency graph
into the upper component
{ mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2)) }
and lower component
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys)) }
Further, following extension rules are added to the lower
component.
{ mult3^#(@b1, @b2, @b3) -> mult^#(@b1, @b2)
, mult3^#(@b1, @b2, @b3) -> mult^#(mult(@b1, @b2), @b2)
, mult^#(@b1, @b2) -> mult#1^#(@b1, @b2)
, mult#1^#(::(@x, @xs), @b2) ->
mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, mult#1^#(::(@x, @xs), @b2) -> mult^#(@xs, @b2) }
TcT solves the upper component with certificate 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:
{ mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2)) }
Weak Trs:
{ #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
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: mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, 2: mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, 3: mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2)) }
Trs:
{ #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(#0(), @y) -> @y
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, +(@x, @y) -> #add(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#2(nil(), @r, @x, @xs) -> nil()
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x)) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(c_7) = {1, 2}, Uargs(c_8) = {1}, Uargs(c_11) = {1, 2}
TcT has computed the following constructor-based matrix
interpretation satisfying not(EDA).
[#add](x1, x2) = [2] x1 + [1] x2 + [4]
[mult#2](x1, x2, x3) = [1] x1 + [6]
[sum](x1, x2, x3) = [4]
[#and](x1, x2) = [4]
[nil] = [1]
[mult](x1, x2) = [3] x1 + [7] x2 + [1]
[sum#2](x1, x2) = [4]
[sum#1](x1) = [4]
[+](x1, x2) = [3] x1 + [1] x2 + [7]
[sum#4](x1) = [4]
[#neg](x1) = [1] x1 + [1]
[#equal](x1, x2) = [1] x1 + [2] x2 + [1]
[#eq](x1, x2) = [1] x1 + [2] x2 + [1]
[#true] = [2]
[add](x1, x2) = [1] x2 + [6]
[#pos](x1) = [1] x1 + [0]
[add'#3](x1, x2, x3) = [2] x1 + [1] x3 + [2]
[mult#3](x1, x2, x3) = [1] x3 + [6]
[add'#1](x1, x2, x3) = [1] x2 + [6]
[add'#2](x1, x2, x3, x4) = [1] x1 + [6]
[tuple#2](x1, x2) = [4]
[#false] = [2]
[mult#1](x1, x2) = [3] x1 + [7] x2 + [0]
[::](x1, x2) = [1] x2 + [4]
[#succ](x1) = [1] x1 + [4]
[#0] = [1]
[sum#3](x1, x2) = [4]
[add'](x1, x2, x3) = [1] x2 + [6]
[#abs](x1) = [2] x1 + [0]
[#pred](x1) = [1] x1 + [3]
[#s](x1) = [1] x1 + [2]
[mult#2^#](x1, x2, x3) = [0]
[mult3^#](x1, x2, x3) = [7] x1 + [7] x2 + [2] x3 + [7]
[mult^#](x1, x2) = [1] x1 + [2]
[mult#1^#](x1, x2) = [1] x1 + [1]
[c_7](x1, x2) = [1] x1 + [1] x2 + [0]
[c_8](x1) = [1] x1 + [0]
[c_11](x1, x2) = [4] x1 + [1] x2 + [2]
The order satisfies the following ordering constraints:
[#add(#neg(#s(#0())), @y)] = [1] @y + [12]
> [1] @y + [3]
= [#pred(@y)]
[#add(#neg(#s(#s(@x))), @y)] = [2] @x + [1] @y + [14]
> [2] @x + [1] @y + [11]
= [#pred(#add(#pos(#s(@x)), @y))]
[#add(#pos(#s(#0())), @y)] = [1] @y + [10]
> [1] @y + [4]
= [#succ(@y)]
[#add(#pos(#s(#s(@x))), @y)] = [2] @x + [1] @y + [12]
>= [2] @x + [1] @y + [12]
= [#succ(#add(#pos(#s(@x)), @y))]
[#add(#0(), @y)] = [1] @y + [6]
> [1] @y + [0]
= [@y]
[mult#2(@zs, @b2, @x)] = [1] @zs + [6]
>= [1] @zs + [6]
= [mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)]
[sum(@x, @y, @r)] = [4]
>= [4]
= [sum#1(+(+(@x, @y), @r))]
[#and(#true(), #true())] = [4]
> [2]
= [#true()]
[#and(#true(), #false())] = [4]
> [2]
= [#false()]
[#and(#false(), #true())] = [4]
> [2]
= [#false()]
[#and(#false(), #false())] = [4]
> [2]
= [#false()]
[mult(@b1, @b2)] = [3] @b1 + [7] @b2 + [1]
> [3] @b1 + [7] @b2 + [0]
= [mult#1(@b1, @b2)]
[sum#2(#true(), @s)] = [4]
>= [4]
= [tuple#2(#abs(#0()), #abs(#0()))]
[sum#2(#false(), @s)] = [4]
>= [4]
= [sum#3(#equal(@s, #pos(#s(#0()))), @s)]
[sum#1(@s)] = [4]
>= [4]
= [sum#2(#equal(@s, #0()), @s)]
[+(@x, @y)] = [3] @x + [1] @y + [7]
> [2] @x + [1] @y + [4]
= [#add(@x, @y)]
[sum#4(#true())] = [4]
>= [4]
= [tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))]
[sum#4(#false())] = [4]
>= [4]
= [tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))]
[#equal(@x, @y)] = [1] @x + [2] @y + [1]
>= [1] @x + [2] @y + [1]
= [#eq(@x, @y)]
[#eq(nil(), nil())] = [4]
> [2]
= [#true()]
[#eq(nil(), tuple#2(@y_1, @y_2))] = [10]
> [2]
= [#false()]
[#eq(nil(), ::(@y_1, @y_2))] = [2] @y_2 + [10]
> [2]
= [#false()]
[#eq(#neg(@x), #neg(@y))] = [1] @x + [2] @y + [4]
> [1] @x + [2] @y + [1]
= [#eq(@x, @y)]
[#eq(#neg(@x), #pos(@y))] = [1] @x + [2] @y + [2]
>= [2]
= [#false()]
[#eq(#neg(@x), #0())] = [1] @x + [4]
> [2]
= [#false()]
[#eq(#pos(@x), #neg(@y))] = [1] @x + [2] @y + [3]
> [2]
= [#false()]
[#eq(#pos(@x), #pos(@y))] = [1] @x + [2] @y + [1]
>= [1] @x + [2] @y + [1]
= [#eq(@x, @y)]
[#eq(#pos(@x), #0())] = [1] @x + [3]
> [2]
= [#false()]
[#eq(tuple#2(@x_1, @x_2), nil())] = [7]
> [2]
= [#false()]
[#eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2))] = [13]
> [4]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2))] = [2] @y_2 + [13]
> [2]
= [#false()]
[#eq(::(@x_1, @x_2), nil())] = [1] @x_2 + [7]
> [2]
= [#false()]
[#eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2))] = [1] @x_2 + [13]
> [2]
= [#false()]
[#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [1] @x_2 + [2] @y_2 + [13]
> [4]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(#0(), #neg(@y))] = [2] @y + [4]
> [2]
= [#false()]
[#eq(#0(), #pos(@y))] = [2] @y + [2]
>= [2]
= [#false()]
[#eq(#0(), #0())] = [4]
> [2]
= [#true()]
[#eq(#0(), #s(@y))] = [2] @y + [6]
> [2]
= [#false()]
[#eq(#s(@x), #0())] = [1] @x + [5]
> [2]
= [#false()]
[#eq(#s(@x), #s(@y))] = [1] @x + [2] @y + [7]
> [1] @x + [2] @y + [1]
= [#eq(@x, @y)]
[add(@b1, @b2)] = [1] @b2 + [6]
>= [1] @b2 + [6]
= [add'(@b1, @b2, #abs(#0()))]
[add'#3(tuple#2(@z, @r'), @xs, @ys)] = [1] @ys + [10]
>= [1] @ys + [10]
= [::(@z, add'(@xs, @ys, @r'))]
[mult#3(#true(), @b2, @zs)] = [1] @zs + [6]
>= [1] @zs + [6]
= [add(@b2, @zs)]
[mult#3(#false(), @b2, @zs)] = [1] @zs + [6]
> [1] @zs + [0]
= [@zs]
[add'#1(nil(), @b2, @r)] = [1] @b2 + [6]
> [1]
= [nil()]
[add'#1(::(@x, @xs), @b2, @r)] = [1] @b2 + [6]
>= [1] @b2 + [6]
= [add'#2(@b2, @r, @x, @xs)]
[add'#2(nil(), @r, @x, @xs)] = [7]
> [1]
= [nil()]
[add'#2(::(@y, @ys), @r, @x, @xs)] = [1] @ys + [10]
>= [1] @ys + [10]
= [add'#3(sum(@x, @y, @r), @xs, @ys)]
[mult#1(nil(), @b2)] = [7] @b2 + [3]
> [1]
= [nil()]
[mult#1(::(@x, @xs), @b2)] = [7] @b2 + [3] @xs + [12]
> [7] @b2 + [3] @xs + [11]
= [mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)]
[#succ(#neg(#s(#0())))] = [8]
> [1]
= [#0()]
[#succ(#neg(#s(#s(@x))))] = [1] @x + [9]
> [1] @x + [3]
= [#neg(#s(@x))]
[#succ(#pos(#s(@x)))] = [1] @x + [6]
> [1] @x + [4]
= [#pos(#s(#s(@x)))]
[#succ(#0())] = [5]
> [3]
= [#pos(#s(#0()))]
[sum#3(#true(), @s)] = [4]
>= [4]
= [tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))]
[sum#3(#false(), @s)] = [4]
>= [4]
= [sum#4(#equal(@s, #pos(#s(#s(#0())))))]
[add'(@b1, @b2, @r)] = [1] @b2 + [6]
>= [1] @b2 + [6]
= [add'#1(@b1, @b2, @r)]
[#abs(#neg(@x))] = [2] @x + [2]
> [1] @x + [0]
= [#pos(@x)]
[#abs(#pos(@x))] = [2] @x + [0]
>= [1] @x + [0]
= [#pos(@x)]
[#abs(#0())] = [2]
> [1]
= [#0()]
[#abs(#s(@x))] = [2] @x + [4]
> [1] @x + [2]
= [#pos(#s(@x))]
[#pred(#neg(#s(@x)))] = [1] @x + [6]
> [1] @x + [5]
= [#neg(#s(#s(@x)))]
[#pred(#pos(#s(#0())))] = [6]
> [1]
= [#0()]
[#pred(#pos(#s(#s(@x))))] = [1] @x + [7]
> [1] @x + [2]
= [#pos(#s(@x))]
[#pred(#0())] = [4]
>= [4]
= [#neg(#s(#0()))]
[mult3^#(@b1, @b2, @b3)] = [7] @b1 + [7] @b2 + [2] @b3 + [7]
> [4] @b1 + [7] @b2 + [5]
= [c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))]
[mult^#(@b1, @b2)] = [1] @b1 + [2]
> [1] @b1 + [1]
= [c_8(mult#1^#(@b1, @b2))]
[mult#1^#(::(@x, @xs), @b2)] = [1] @xs + [5]
> [1] @xs + [4]
= [c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))]
The strictly oriented rules are moved into the weak component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Weak DPs:
{ mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2)) }
Weak Trs:
{ #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
The following weak DPs constitute a sub-graph of the DG that is
closed under successors. The DPs are removed.
{ mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Weak Trs:
{ #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
No rule is usable, rules are removed from the input problem.
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 return to the main proof.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys)) }
Weak DPs:
{ mult3^#(@b1, @b2, @b3) -> mult^#(@b1, @b2)
, mult3^#(@b1, @b2, @b3) -> mult^#(mult(@b1, @b2), @b2)
, mult^#(@b1, @b2) -> mult#1^#(@b1, @b2)
, mult#1^#(::(@x, @xs), @b2) ->
mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, mult#1^#(::(@x, @xs), @b2) -> mult^#(@xs, @b2) }
Weak Trs:
{ #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
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:
{ 3: add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, 4: add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, 5: add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, 8: mult3^#(@b1, @b2, @b3) -> mult^#(@b1, @b2)
, 9: mult3^#(@b1, @b2, @b3) -> mult^#(mult(@b1, @b2), @b2)
, 12: mult#1^#(::(@x, @xs), @b2) -> mult^#(@xs, @b2) }
Trs:
{ #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(#0(), @y) -> @y
, +(@x, @y) -> #add(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, #abs(#neg(@x)) -> #pos(@x)
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(c_3) = {1}, Uargs(c_4) = {1}, Uargs(c_16) = {1},
Uargs(c_17) = {1}, Uargs(c_18) = {1}, Uargs(c_20) = {1},
Uargs(c_21) = {1}
TcT has computed the following constructor-based matrix
interpretation satisfying not(EDA).
[#add](x1, x2) = [2] x1 + [1] x2 + [1]
[mult#2](x1, x2, x3) = [1] x1 + [0]
[sum](x1, x2, x3) = [3]
[#and](x1, x2) = [0]
[nil] = [0]
[mult](x1, x2) = [1] x1 + [1] x2 + [0]
[sum#2](x1, x2) = [2] x1 + [1]
[sum#1](x1) = [3]
[+](x1, x2) = [3] x1 + [1] x2 + [4]
[sum#4](x1) = [1]
[#neg](x1) = [1] x1 + [2]
[#equal](x1, x2) = [1] x2 + [1]
[#eq](x1, x2) = [1] x2 + [1]
[#true] = [0]
[add](x1, x2) = [1] x2 + [0]
[#pos](x1) = [1] x1 + [0]
[add'#3](x1, x2, x3) = [1] x3 + [4]
[mult#3](x1, x2, x3) = [1] x3 + [0]
[add'#1](x1, x2, x3) = [1] x2 + [0]
[add'#2](x1, x2, x3, x4) = [1] x1 + [0]
[tuple#2](x1, x2) = [1]
[#false] = [0]
[mult#1](x1, x2) = [1] x1 + [1] x2 + [0]
[::](x1, x2) = [1] x2 + [4]
[#succ](x1) = [1] x1 + [4]
[#0] = [0]
[sum#3](x1, x2) = [1]
[add'](x1, x2, x3) = [1] x2 + [0]
[#abs](x1) = [1] x1 + [0]
[#pred](x1) = [1] x1 + [7]
[#s](x1) = [1] x1 + [2]
[mult#2^#](x1, x2, x3) = [2] x1 + [1] x2 + [5]
[mult#3^#](x1, x2, x3) = [1] x2 + [1] x3 + [5]
[mult3^#](x1, x2, x3) = [7] x1 + [7] x2 + [4] x3 + [7]
[mult^#](x1, x2) = [2] x1 + [3] x2 + [5]
[mult#1^#](x1, x2) = [2] x1 + [3] x2 + [5]
[add^#](x1, x2) = [1] x1 + [1] x2 + [5]
[add'^#](x1, x2, x3) = [1] x1 + [1] x2 + [4]
[add'#3^#](x1, x2, x3) = [3] x1 + [1] x2 + [1] x3 + [2]
[add'#1^#](x1, x2, x3) = [1] x1 + [1] x2 + [3]
[add'#2^#](x1, x2, x3, x4) = [1] x1 + [1] x4 + [7]
[c_3](x1) = [1] x1 + [0]
[c_4](x1) = [1] x1 + [0]
[c_16](x1) = [1] x1 + [0]
[c_17](x1) = [1] x1 + [0]
[c_18](x1) = [1] x1 + [0]
[c_20](x1) = [1] x1 + [0]
[c_21](x1) = [1] x1 + [0]
The order satisfies the following ordering constraints:
[#add(#neg(#s(#0())), @y)] = [1] @y + [9]
> [1] @y + [7]
= [#pred(@y)]
[#add(#neg(#s(#s(@x))), @y)] = [2] @x + [1] @y + [13]
> [2] @x + [1] @y + [12]
= [#pred(#add(#pos(#s(@x)), @y))]
[#add(#pos(#s(#0())), @y)] = [1] @y + [5]
> [1] @y + [4]
= [#succ(@y)]
[#add(#pos(#s(#s(@x))), @y)] = [2] @x + [1] @y + [9]
>= [2] @x + [1] @y + [9]
= [#succ(#add(#pos(#s(@x)), @y))]
[#add(#0(), @y)] = [1] @y + [1]
> [1] @y + [0]
= [@y]
[mult#2(@zs, @b2, @x)] = [1] @zs + [0]
>= [1] @zs + [0]
= [mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)]
[sum(@x, @y, @r)] = [3]
>= [3]
= [sum#1(+(+(@x, @y), @r))]
[#and(#true(), #true())] = [0]
>= [0]
= [#true()]
[#and(#true(), #false())] = [0]
>= [0]
= [#false()]
[#and(#false(), #true())] = [0]
>= [0]
= [#false()]
[#and(#false(), #false())] = [0]
>= [0]
= [#false()]
[mult(@b1, @b2)] = [1] @b1 + [1] @b2 + [0]
>= [1] @b1 + [1] @b2 + [0]
= [mult#1(@b1, @b2)]
[sum#2(#true(), @s)] = [1]
>= [1]
= [tuple#2(#abs(#0()), #abs(#0()))]
[sum#2(#false(), @s)] = [1]
>= [1]
= [sum#3(#equal(@s, #pos(#s(#0()))), @s)]
[sum#1(@s)] = [3]
>= [3]
= [sum#2(#equal(@s, #0()), @s)]
[+(@x, @y)] = [3] @x + [1] @y + [4]
> [2] @x + [1] @y + [1]
= [#add(@x, @y)]
[sum#4(#true())] = [1]
>= [1]
= [tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))]
[sum#4(#false())] = [1]
>= [1]
= [tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))]
[#equal(@x, @y)] = [1] @y + [1]
>= [1] @y + [1]
= [#eq(@x, @y)]
[#eq(nil(), nil())] = [1]
> [0]
= [#true()]
[#eq(nil(), tuple#2(@y_1, @y_2))] = [2]
> [0]
= [#false()]
[#eq(nil(), ::(@y_1, @y_2))] = [1] @y_2 + [5]
> [0]
= [#false()]
[#eq(#neg(@x), #neg(@y))] = [1] @y + [3]
> [1] @y + [1]
= [#eq(@x, @y)]
[#eq(#neg(@x), #pos(@y))] = [1] @y + [1]
> [0]
= [#false()]
[#eq(#neg(@x), #0())] = [1]
> [0]
= [#false()]
[#eq(#pos(@x), #neg(@y))] = [1] @y + [3]
> [0]
= [#false()]
[#eq(#pos(@x), #pos(@y))] = [1] @y + [1]
>= [1] @y + [1]
= [#eq(@x, @y)]
[#eq(#pos(@x), #0())] = [1]
> [0]
= [#false()]
[#eq(tuple#2(@x_1, @x_2), nil())] = [1]
> [0]
= [#false()]
[#eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2))] = [2]
> [0]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2))] = [1] @y_2 + [5]
> [0]
= [#false()]
[#eq(::(@x_1, @x_2), nil())] = [1]
> [0]
= [#false()]
[#eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2))] = [2]
> [0]
= [#false()]
[#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [1] @y_2 + [5]
> [0]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(#0(), #neg(@y))] = [1] @y + [3]
> [0]
= [#false()]
[#eq(#0(), #pos(@y))] = [1] @y + [1]
> [0]
= [#false()]
[#eq(#0(), #0())] = [1]
> [0]
= [#true()]
[#eq(#0(), #s(@y))] = [1] @y + [3]
> [0]
= [#false()]
[#eq(#s(@x), #0())] = [1]
> [0]
= [#false()]
[#eq(#s(@x), #s(@y))] = [1] @y + [3]
> [1] @y + [1]
= [#eq(@x, @y)]
[add(@b1, @b2)] = [1] @b2 + [0]
>= [1] @b2 + [0]
= [add'(@b1, @b2, #abs(#0()))]
[add'#3(tuple#2(@z, @r'), @xs, @ys)] = [1] @ys + [4]
>= [1] @ys + [4]
= [::(@z, add'(@xs, @ys, @r'))]
[mult#3(#true(), @b2, @zs)] = [1] @zs + [0]
>= [1] @zs + [0]
= [add(@b2, @zs)]
[mult#3(#false(), @b2, @zs)] = [1] @zs + [0]
>= [1] @zs + [0]
= [@zs]
[add'#1(nil(), @b2, @r)] = [1] @b2 + [0]
>= [0]
= [nil()]
[add'#1(::(@x, @xs), @b2, @r)] = [1] @b2 + [0]
>= [1] @b2 + [0]
= [add'#2(@b2, @r, @x, @xs)]
[add'#2(nil(), @r, @x, @xs)] = [0]
>= [0]
= [nil()]
[add'#2(::(@y, @ys), @r, @x, @xs)] = [1] @ys + [4]
>= [1] @ys + [4]
= [add'#3(sum(@x, @y, @r), @xs, @ys)]
[mult#1(nil(), @b2)] = [1] @b2 + [0]
>= [0]
= [nil()]
[mult#1(::(@x, @xs), @b2)] = [1] @b2 + [1] @xs + [4]
>= [1] @b2 + [1] @xs + [4]
= [mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)]
[#succ(#neg(#s(#0())))] = [8]
> [0]
= [#0()]
[#succ(#neg(#s(#s(@x))))] = [1] @x + [10]
> [1] @x + [4]
= [#neg(#s(@x))]
[#succ(#pos(#s(@x)))] = [1] @x + [6]
> [1] @x + [4]
= [#pos(#s(#s(@x)))]
[#succ(#0())] = [4]
> [2]
= [#pos(#s(#0()))]
[sum#3(#true(), @s)] = [1]
>= [1]
= [tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))]
[sum#3(#false(), @s)] = [1]
>= [1]
= [sum#4(#equal(@s, #pos(#s(#s(#0())))))]
[add'(@b1, @b2, @r)] = [1] @b2 + [0]
>= [1] @b2 + [0]
= [add'#1(@b1, @b2, @r)]
[#abs(#neg(@x))] = [1] @x + [2]
> [1] @x + [0]
= [#pos(@x)]
[#abs(#pos(@x))] = [1] @x + [0]
>= [1] @x + [0]
= [#pos(@x)]
[#abs(#0())] = [0]
>= [0]
= [#0()]
[#abs(#s(@x))] = [1] @x + [2]
>= [1] @x + [2]
= [#pos(#s(@x))]
[#pred(#neg(#s(@x)))] = [1] @x + [11]
> [1] @x + [6]
= [#neg(#s(#s(@x)))]
[#pred(#pos(#s(#0())))] = [9]
> [0]
= [#0()]
[#pred(#pos(#s(#s(@x))))] = [1] @x + [11]
> [1] @x + [2]
= [#pos(#s(@x))]
[#pred(#0())] = [7]
> [4]
= [#neg(#s(#0()))]
[mult#2^#(@zs, @b2, @x)] = [1] @b2 + [2] @zs + [5]
>= [1] @b2 + [1] @zs + [5]
= [c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))]
[mult#3^#(#true(), @b2, @zs)] = [1] @b2 + [1] @zs + [5]
>= [1] @b2 + [1] @zs + [5]
= [c_4(add^#(@b2, @zs))]
[mult3^#(@b1, @b2, @b3)] = [7] @b1 + [7] @b2 + [4] @b3 + [7]
> [2] @b1 + [3] @b2 + [5]
= [mult^#(@b1, @b2)]
[mult3^#(@b1, @b2, @b3)] = [7] @b1 + [7] @b2 + [4] @b3 + [7]
> [2] @b1 + [5] @b2 + [5]
= [mult^#(mult(@b1, @b2), @b2)]
[mult^#(@b1, @b2)] = [2] @b1 + [3] @b2 + [5]
>= [2] @b1 + [3] @b2 + [5]
= [mult#1^#(@b1, @b2)]
[mult#1^#(::(@x, @xs), @b2)] = [3] @b2 + [2] @xs + [13]
>= [3] @b2 + [2] @xs + [13]
= [mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)]
[mult#1^#(::(@x, @xs), @b2)] = [3] @b2 + [2] @xs + [13]
> [3] @b2 + [2] @xs + [5]
= [mult^#(@xs, @b2)]
[add^#(@b1, @b2)] = [1] @b1 + [1] @b2 + [5]
> [1] @b1 + [1] @b2 + [4]
= [c_16(add'^#(@b1, @b2, #abs(#0())))]
[add'^#(@b1, @b2, @r)] = [1] @b1 + [1] @b2 + [4]
> [1] @b1 + [1] @b2 + [3]
= [c_17(add'#1^#(@b1, @b2, @r))]
[add'#3^#(tuple#2(@z, @r'), @xs, @ys)] = [1] @xs + [1] @ys + [5]
> [1] @xs + [1] @ys + [4]
= [c_18(add'^#(@xs, @ys, @r'))]
[add'#1^#(::(@x, @xs), @b2, @r)] = [1] @b2 + [1] @xs + [7]
>= [1] @b2 + [1] @xs + [7]
= [c_20(add'#2^#(@b2, @r, @x, @xs))]
[add'#2^#(::(@y, @ys), @r, @x, @xs)] = [1] @xs + [1] @ys + [11]
>= [1] @xs + [1] @ys + [11]
= [c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys))]
We return to the main proof. Consider the set of all dependency
pairs
:
{ 1: mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, 2: mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, 3: add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, 4: add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, 5: add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, 6: add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, 7: add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys))
, 8: mult3^#(@b1, @b2, @b3) -> mult^#(@b1, @b2)
, 9: mult3^#(@b1, @b2, @b3) -> mult^#(mult(@b1, @b2), @b2)
, 10: mult^#(@b1, @b2) -> mult#1^#(@b1, @b2)
, 11: mult#1^#(::(@x, @xs), @b2) ->
mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, 12: mult#1^#(::(@x, @xs), @b2) -> mult^#(@xs, @b2) }
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of dependency
pairs {3,4,5,8,9,12}. These cover all (indirect) predecessors of
dependency pairs {1,2,3,4,5,6,7,8,9,10,11,12}, their number of
application is equally bounded. The dependency pairs are shifted
into the weak component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Weak DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, mult3^#(@b1, @b2, @b3) -> mult^#(@b1, @b2)
, mult3^#(@b1, @b2, @b3) -> mult^#(mult(@b1, @b2), @b2)
, mult^#(@b1, @b2) -> mult#1^#(@b1, @b2)
, mult#1^#(::(@x, @xs), @b2) ->
mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, mult#1^#(::(@x, @xs), @b2) -> mult^#(@xs, @b2)
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys)) }
Weak Trs:
{ #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
The following weak DPs constitute a sub-graph of the DG that is
closed under successors. The DPs are removed.
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, mult3^#(@b1, @b2, @b3) -> mult^#(@b1, @b2)
, mult3^#(@b1, @b2, @b3) -> mult^#(mult(@b1, @b2), @b2)
, mult^#(@b1, @b2) -> mult#1^#(@b1, @b2)
, mult#1^#(::(@x, @xs), @b2) ->
mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, mult#1^#(::(@x, @xs), @b2) -> mult^#(@xs, @b2)
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Weak Trs:
{ #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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
No rule is usable, rules are removed from the input problem.
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
S) We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
The following weak DPs constitute a sub-graph of the DG that is
closed under successors. The DPs are removed.
{ mult#2^#(@zs, @b2, @x) ->
c_3(mult#3^#(#equal(@x, #pos(#s(#0()))), @b2, @zs))
, mult#3^#(#true(), @b2, @zs) -> c_4(add^#(@b2, @zs))
, mult3^#(@b1, @b2, @b3) ->
c_7(mult^#(mult(@b1, @b2), @b2), mult^#(@b1, @b2))
, mult^#(@b1, @b2) -> c_8(mult#1^#(@b1, @b2))
, mult#1^#(::(@x, @xs), @b2) ->
c_11(mult#2^#(::(#abs(#0()), mult(@xs, @b2)), @b2, @x),
mult^#(@xs, @b2))
, add^#(@b1, @b2) -> c_16(add'^#(@b1, @b2, #abs(#0())))
, add'^#(@b1, @b2, @r) -> c_17(add'#1^#(@b1, @b2, @r))
, add'#3^#(tuple#2(@z, @r'), @xs, @ys) ->
c_18(add'^#(@xs, @ys, @r'))
, add'#1^#(::(@x, @xs), @b2, @r) ->
c_20(add'#2^#(@b2, @r, @x, @xs))
, add'#2^#(::(@y, @ys), @r, @x, @xs) ->
c_21(add'#3^#(sum(@x, @y, @r), @xs, @ys)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We analyse the complexity of following sub-problems (R) and (S).
Problem (S) is obtained from the input problem by shifting strict
rules from (R) into the weak component:
Problem (R):
------------
Strict DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) }
Weak DPs:
{ compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
StartTerms: basic terms
Strategy: innermost
Problem (S):
------------
Strict DPs:
{ compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
StartTerms: basic terms
Strategy: innermost
Overall, the transformation results in the following sub-problem(s):
Generated new problems:
-----------------------
R) Strict DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) }
Weak DPs:
{ compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
StartTerms: basic terms
Strategy: innermost
This problem was proven YES(O(1),O(n^1)).
S) Strict DPs:
{ compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
StartTerms: basic terms
Strategy: innermost
This problem was proven YES(O(1),O(n^1)).
Proofs for generated problems:
------------------------------
R) We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) }
Weak DPs:
{ compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
The following weak DPs constitute a sub-graph of the DG that is
closed under successors. The DPs are removed.
{ compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We replace rewrite rules by usable rules:
Weak Usable Rules:
{ #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))
, #add(#0(), @y) -> @y
, *(@x, @y) -> #mult(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) }
Weak Trs:
{ #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))
, #add(#0(), @y) -> @y
, *(@x, @y) -> #mult(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
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: bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, 3: bitToInt^#(@b) ->
c_12(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) }
Trs: { *(@x, @y) -> #mult(@x, @y) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(c_5) = {1}, Uargs(c_6) = {1}, Uargs(c_12) = {1}
TcT has computed the following constructor-based matrix
interpretation satisfying not(EDA).
[#add](x1, x2) = [0]
[*](x1, x2) = [4]
[#neg](x1) = [0]
[#natmult](x1, x2) = [0]
[#pos](x1) = [0]
[::](x1, x2) = [1] x2 + [2]
[#mult](x1, x2) = [0]
[#succ](x1) = [0]
[#0] = [0]
[#abs](x1) = [0]
[#pred](x1) = [0]
[#s](x1) = [0]
[bitToInt'#1^#](x1, x2) = [4] x1 + [0]
[bitToInt'^#](x1, x2) = [4] x1 + [1] x2 + [4]
[bitToInt^#](x1) = [7] x1 + [7]
[c_5](x1) = [1] x1 + [0]
[c_6](x1) = [1] x1 + [1]
[c_12](x1) = [1] x1 + [0]
The order satisfies the following ordering constraints:
[#add(#neg(#s(#0())), @y)] = [0]
>= [0]
= [#pred(@y)]
[#add(#neg(#s(#s(@x))), @y)] = [0]
>= [0]
= [#pred(#add(#pos(#s(@x)), @y))]
[#add(#pos(#s(#0())), @y)] = [0]
>= [0]
= [#succ(@y)]
[#add(#pos(#s(#s(@x))), @y)] = [0]
>= [0]
= [#succ(#add(#pos(#s(@x)), @y))]
[#add(#0(), @y)] = [0]
? [1] @y + [0]
= [@y]
[*(@x, @y)] = [4]
> [0]
= [#mult(@x, @y)]
[#natmult(#0(), @y)] = [0]
>= [0]
= [#0()]
[#natmult(#s(@x), @y)] = [0]
>= [0]
= [#add(#pos(@y), #natmult(@x, @y))]
[#mult(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#pos(#natmult(@x, @y))]
[#mult(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#neg(#natmult(@x, @y))]
[#mult(#neg(@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))]
[#mult(#pos(@x), #0())] = [0]
>= [0]
= [#0()]
[#mult(#0(), #neg(@y))] = [0]
>= [0]
= [#0()]
[#mult(#0(), #pos(@y))] = [0]
>= [0]
= [#0()]
[#mult(#0(), #0())] = [0]
>= [0]
= [#0()]
[#succ(#neg(#s(#0())))] = [0]
>= [0]
= [#0()]
[#succ(#neg(#s(#s(@x))))] = [0]
>= [0]
= [#neg(#s(@x))]
[#succ(#pos(#s(@x)))] = [0]
>= [0]
= [#pos(#s(#s(@x)))]
[#succ(#0())] = [0]
>= [0]
= [#pos(#s(#0()))]
[#abs(#neg(@x))] = [0]
>= [0]
= [#pos(@x)]
[#abs(#pos(@x))] = [0]
>= [0]
= [#pos(@x)]
[#abs(#0())] = [0]
>= [0]
= [#0()]
[#abs(#s(@x))] = [0]
>= [0]
= [#pos(#s(@x))]
[#pred(#neg(#s(@x)))] = [0]
>= [0]
= [#neg(#s(#s(@x)))]
[#pred(#pos(#s(#0())))] = [0]
>= [0]
= [#0()]
[#pred(#pos(#s(#s(@x))))] = [0]
>= [0]
= [#pos(#s(@x))]
[#pred(#0())] = [0]
>= [0]
= [#neg(#s(#0()))]
[bitToInt'#1^#(::(@x, @xs), @n)] = [4] @xs + [8]
>= [4] @xs + [8]
= [c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))]
[bitToInt'^#(@b, @n)] = [4] @b + [1] @n + [4]
> [4] @b + [1]
= [c_6(bitToInt'#1^#(@b, @n))]
[bitToInt^#(@b)] = [7] @b + [7]
> [4] @b + [4]
= [c_12(bitToInt'^#(@b, #abs(#pos(#s(#0())))))]
We return to the main proof. Consider the set of all dependency
pairs
:
{ 1: bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, 2: bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, 3: bitToInt^#(@b) ->
c_12(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) }
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of dependency
pairs {2,3}. These cover all (indirect) predecessors of dependency
pairs {1,2,3}, their number of application is equally bounded. The
dependency pairs are shifted into the weak component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Weak DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) }
Weak Trs:
{ #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))
, #add(#0(), @y) -> @y
, *(@x, @y) -> #mult(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
The following weak DPs constitute a sub-graph of the DG that is
closed under successors. The DPs are removed.
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Weak Trs:
{ #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))
, #add(#0(), @y) -> @y
, *(@x, @y) -> #mult(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
No rule is usable, rules are removed from the input problem.
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
S) We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak DPs:
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
The following weak DPs constitute a sub-graph of the DG that is
closed under successors. The DPs are removed.
{ bitToInt'#1^#(::(@x, @xs), @n) ->
c_5(bitToInt'^#(@xs, *(@n, #pos(#s(#s(#0()))))))
, bitToInt'^#(@b, @n) -> c_6(bitToInt'#1^#(@b, @n))
, bitToInt^#(@b) -> c_12(bitToInt'^#(@b, #abs(#pos(#s(#0()))))) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Weak Trs:
{ #natsub(@x, #0()) -> @x
, #natsub(#s(@x), #s(@y)) -> #natsub(@x, @y)
, -(@x, @y) -> #sub(@x, @y)
, diff#1(#true()) -> #abs(#pos(#s(#0())))
, diff#1(#false()) -> #abs(#0())
, #natdiv(#0(), #0()) -> #divByZero()
, #natdiv(#s(@x), #s(@y)) -> #s(#natdiv(#natsub(@x, @y), #s(@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))
, #add(#0(), @y) -> @y
, mult#2(@zs, @b2, @x) ->
mult#3(#equal(@x, #pos(#s(#0()))), @b2, @zs)
, div(@x, @y) -> #div(@x, @y)
, sum(@x, @y, @r) -> sum#1(+(+(@x, @y), @r))
, mod(@x, @y) -> -(@x, *(@x, div(@x, @y)))
, #and(#true(), #true()) -> #true()
, #and(#true(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#false(), #false()) -> #false()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, mult(@b1, @b2) -> mult#1(@b1, @b2)
, sum#2(#true(), @s) -> tuple#2(#abs(#0()), #abs(#0()))
, sum#2(#false(), @s) -> sum#3(#equal(@s, #pos(#s(#0()))), @s)
, sum#1(@s) -> sum#2(#equal(@s, #0()), @s)
, +(@x, @y) -> #add(@x, @y)
, sum#4(#true()) -> tuple#2(#abs(#0()), #abs(#pos(#s(#0()))))
, sum#4(#false()) ->
tuple#2(#abs(#pos(#s(#0()))), #abs(#pos(#s(#0()))))
, *(@x, @y) -> #mult(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(nil(), nil()) -> #true()
, #eq(nil(), tuple#2(@y_1, @y_2)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#pos(@x), #0()) -> #false()
, #eq(tuple#2(@x_1, @x_2), nil()) -> #false()
, #eq(tuple#2(@x_1, @x_2), tuple#2(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(tuple#2(@x_1, @x_2), ::(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), tuple#2(@y_1, @y_2)) -> #false()
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y))
, #cklt(#EQ()) -> #false()
, #cklt(#LT()) -> #true()
, #cklt(#GT()) -> #false()
, add(@b1, @b2) -> add'(@b1, @b2, #abs(#0()))
, #sub(@x, #neg(@y)) -> #add(@x, #pos(@y))
, #sub(@x, #pos(@y)) -> #add(@x, #neg(@y))
, #sub(@x, #0()) -> @x
, add'#3(tuple#2(@z, @r'), @xs, @ys) -> ::(@z, add'(@xs, @ys, @r'))
, mult#3(#true(), @b2, @zs) -> add(@b2, @zs)
, mult#3(#false(), @b2, @zs) -> @zs
, add'#1(nil(), @b2, @r) -> nil()
, add'#1(::(@x, @xs), @b2, @r) -> add'#2(@b2, @r, @x, @xs)
, add'#2(nil(), @r, @x, @xs) -> nil()
, add'#2(::(@y, @ys), @r, @x, @xs) ->
add'#3(sum(@x, @y, @r), @xs, @ys)
, diff(@x, @y, @r) ->
tuple#2(mod(+(+(@x, @y), @r), #pos(#s(#s(#0())))),
diff#1(#less(-(-(@x, @y), @r), #0())))
, mult#1(nil(), @b2) -> nil()
, mult#1(::(@x, @xs), @b2) ->
mult#2(::(#abs(#0()), mult(@xs, @b2)), @b2, @x)
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#neg(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#0(), #0()) -> #0()
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #succ(#0()) -> #pos(#s(#0()))
, sum#3(#true(), @s) -> tuple#2(#abs(#pos(#s(#0()))), #abs(#0()))
, sum#3(#false(), @s) -> sum#4(#equal(@s, #pos(#s(#s(#0())))))
, #div(#neg(@x), #neg(@y)) -> #pos(#natdiv(@x, @y))
, #div(#neg(@x), #pos(@y)) -> #neg(#natdiv(@x, @y))
, #div(#neg(@x), #0()) -> #divByZero()
, #div(#pos(@x), #neg(@y)) -> #neg(#natdiv(@x, @y))
, #div(#pos(@x), #pos(@y)) -> #pos(#natdiv(@x, @y))
, #div(#pos(@x), #0()) -> #divByZero()
, #div(#0(), #neg(@y)) -> #0()
, #div(#0(), #pos(@y)) -> #0()
, #div(#0(), #0()) -> #divByZero()
, add'(@b1, @b2, @r) -> add'#1(@b1, @b2, @r)
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#0()) -> #0()
, #abs(#s(@x)) -> #pos(#s(@x))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #pred(#0()) -> #neg(#s(#0())) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
No rule is usable, rules are removed from the input problem.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
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: compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, 3: compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(c_10) = {1}, Uargs(c_15) = {1}, Uargs(c_22) = {1}
TcT has computed the following constructor-based matrix
interpretation satisfying not(EDA).
[::](x1, x2) = [1] x1 + [1] x2 + [1]
[compare^#](x1, x2) = [4] x1 + [4] x2 + [4]
[compare#2^#](x1, x2, x3) = [4] x1 + [4] x3 + [0]
[compare#1^#](x1, x2) = [4] x1 + [4] x2 + [1]
[c_10](x1) = [1] x1 + [2]
[c_15](x1) = [1] x1 + [0]
[c_22](x1) = [1] x1 + [0]
The order satisfies the following ordering constraints:
[compare^#(@b1, @b2)] = [4] @b1 + [4] @b2 + [4]
> [4] @b1 + [4] @b2 + [3]
= [c_10(compare#1^#(@b1, @b2))]
[compare#2^#(::(@y, @ys), @x, @xs)] = [4] @y + [4] @xs + [4] @ys + [4]
>= [4] @xs + [4] @ys + [4]
= [c_15(compare^#(@xs, @ys))]
[compare#1^#(::(@x, @xs), @b2)] = [4] @x + [4] @b2 + [4] @xs + [5]
> [4] @b2 + [4] @xs + [0]
= [c_22(compare#2^#(@b2, @x, @xs))]
We return to the main proof. Consider the set of all dependency
pairs
:
{ 1: compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, 2: compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, 3: compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of dependency
pairs {1,3}. These cover all (indirect) predecessors of dependency
pairs {1,2,3}, their number of application is equally bounded. The
dependency pairs are shifted into the weak component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Weak DPs:
{ compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
The following weak DPs constitute a sub-graph of the DG that is
closed under successors. The DPs are removed.
{ compare^#(@b1, @b2) -> c_10(compare#1^#(@b1, @b2))
, compare#2^#(::(@y, @ys), @x, @xs) -> c_15(compare^#(@xs, @ys))
, compare#1^#(::(@x, @xs), @b2) ->
c_22(compare#2^#(@b2, @x, @xs)) }
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))