tct
MAYBE
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0()) }
Weak Trs:
{ #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We add following dependency tuples
Strict DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, +^#(@x, @y) -> #add^#(@x, @y)
, firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, firstline#1^#(nil()) -> c_10()
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, right^#(@l) -> right#1^#(@l)
, right#1^#(::(@x, @xs)) -> c_38()
, right#1^#(nil()) -> #abs^#(#0())
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, newline#6^#(@elem, @nl) -> c_37()
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) }
Weak DPs:
{ #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
and replace the set of basic marked basic terms accordingly.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, +^#(@x, @y) -> #add^#(@x, @y)
, firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, firstline#1^#(nil()) -> c_10()
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, right^#(@l) -> right#1^#(@l)
, right#1^#(::(@x, @xs)) -> c_38()
, right#1^#(nil()) -> #abs^#(#0())
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, newline#6^#(@elem, @nl) -> c_37()
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) }
Weak DPs:
{ #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: #abs^#(#0()) -> c_1()
2: #abs^#(#neg(@x)) -> c_2()
3: #abs^#(#pos(@x)) -> c_3()
4: #abs^#(#s(@x)) -> c_4()
5: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :52
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :49
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :45
-->_1 #eq^#(nil(), nil()) -> c_55() :55
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :54
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :53
-->_1 #eq^#(#s(@x), #0()) -> c_50() :50
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :48
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :47
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :46
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :44
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :42
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :41
-->_1 #eq^#(#0(), #0()) -> c_40() :40
6: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :70
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :68
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :64
-->_2 #compare^#(#s(@x), #0()) -> c_66() :69
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_64() :67
-->_2 #compare^#(#pos(@x), #0()) -> c_63() :66
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_62() :65
-->_2 #compare^#(#neg(@x), #0()) -> c_60() :63
-->_2 #compare^#(#0(), #s(@y)) -> c_59() :62
-->_2 #compare^#(#0(), #pos(@y)) -> c_58() :61
-->_2 #compare^#(#0(), #neg(@y)) -> c_57() :60
-->_2 #compare^#(#0(), #0()) -> c_56() :59
-->_1 #ckgt^#(#LT()) -> c_70() :58
-->_1 #ckgt^#(#GT()) -> c_69() :57
-->_1 #ckgt^#(#EQ()) -> c_68() :56
7: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :75
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :74
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :73
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :72
-->_1 #add^#(#0(), @y) -> c_71() :71
8: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs)) :9
-->_1 firstline#1^#(nil()) -> c_10() :10
9: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
-->_2 firstline^#(@l) -> firstline#1^#(@l) :8
-->_1 #abs^#(#0()) -> c_1() :1
10: firstline#1^#(nil()) -> c_10()
11: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :13
-->_1 lcs#1^#(@m) -> lcs#2^#(@m) :12
12: lcs#1^#(@m) -> lcs#2^#(@m)
-->_1 lcs#2^#(nil()) -> #abs^#(#0()) :17
-->_1 lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1) :16
13: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :15
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :14
14: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :20
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :13
15: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :8
16: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
-->_1 lcs#3^#(nil()) -> #abs^#(#0()) :19
-->_1 lcs#3^#(::(@len, @_@1)) -> c_16() :18
17: lcs#2^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :1
18: lcs#3^#(::(@len, @_@1)) -> c_16()
19: lcs#3^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :1
20: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :21
-->_1 lcstable#3^#(nil(), @l2, @x) -> c_22() :22
21: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :23
22: lcstable#3^#(nil(), @l2, @x) -> c_22()
23: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :24
-->_1 newline#1^#(nil(), @lastline, @y) -> c_28() :25
24: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) :29
-->_1 newline#2^#(nil(), @x, @xs, @y) -> c_30() :30
25: newline#1^#(nil(), @lastline, @y) -> c_28()
26: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
-->_1 max#1^#(#true(), @a, @b) -> c_26() :28
-->_1 max#1^#(#false(), @a, @b) -> c_25() :27
-->_2 #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :6
27: max#1^#(#false(), @a, @b) -> c_25()
28: max#1^#(#true(), @a, @b) -> c_26()
29: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
-->_1 newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl)) :31
-->_2 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :23
30: newline#2^#(nil(), @x, @xs, @y) -> c_30()
31: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
-->_2 right^#(@l) -> right#1^#(@l) :33
-->_1 newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline')) :32
32: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
-->_1 newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y)) :36
-->_2 right^#(@l) -> right#1^#(@l) :33
33: right^#(@l) -> right#1^#(@l)
-->_1 right#1^#(nil()) -> #abs^#(#0()) :35
-->_1 right#1^#(::(@x, @xs)) -> c_38() :34
34: right#1^#(::(@x, @xs)) -> c_38()
35: right#1^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :1
36: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
-->_2 newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) :39
-->_2 newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal) :38
-->_1 newline#6^#(@elem, @nl) -> c_37() :37
-->_3 #equal^#(@x, @y) -> #eq^#(@x, @y) :5
37: newline#6^#(@elem, @nl) -> c_37()
38: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
-->_1 max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b)) :26
39: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :7
40: #eq^#(#0(), #0()) -> c_40()
41: #eq^#(#0(), #neg(@y)) -> c_41()
42: #eq^#(#0(), #pos(@y)) -> c_42()
43: #eq^#(#0(), #s(@y)) -> c_43()
44: #eq^#(#neg(@x), #0()) -> c_44()
45: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :52
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :49
-->_1 #eq^#(nil(), nil()) -> c_55() :55
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :54
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :53
-->_1 #eq^#(#s(@x), #0()) -> c_50() :50
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :48
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :47
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :46
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :45
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :44
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :42
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :41
-->_1 #eq^#(#0(), #0()) -> c_40() :40
46: #eq^#(#neg(@x), #pos(@y)) -> c_46()
47: #eq^#(#pos(@x), #0()) -> c_47()
48: #eq^#(#pos(@x), #neg(@y)) -> c_48()
49: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :52
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(nil(), nil()) -> c_55() :55
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :54
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :53
-->_1 #eq^#(#s(@x), #0()) -> c_50() :50
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :49
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :48
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :47
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :46
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :45
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :44
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :42
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :41
-->_1 #eq^#(#0(), #0()) -> c_40() :40
50: #eq^#(#s(@x), #0()) -> c_50()
51: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :52
-->_1 #eq^#(nil(), nil()) -> c_55() :55
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :54
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :53
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(#s(@x), #0()) -> c_50() :50
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :49
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :48
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :47
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :46
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :45
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :44
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :42
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :41
-->_1 #eq^#(#0(), #0()) -> c_40() :40
52: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_1 #and^#(#true(), #true()) -> c_87() :79
-->_1 #and^#(#true(), #false()) -> c_86() :78
-->_1 #and^#(#false(), #true()) -> c_85() :77
-->_1 #and^#(#false(), #false()) -> c_84() :76
-->_3 #eq^#(nil(), nil()) -> c_55() :55
-->_2 #eq^#(nil(), nil()) -> c_55() :55
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :54
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :54
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :53
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :53
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :52
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :52
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :51
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :51
-->_3 #eq^#(#s(@x), #0()) -> c_50() :50
-->_2 #eq^#(#s(@x), #0()) -> c_50() :50
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :49
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :49
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_48() :48
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_48() :48
-->_3 #eq^#(#pos(@x), #0()) -> c_47() :47
-->_2 #eq^#(#pos(@x), #0()) -> c_47() :47
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_46() :46
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_46() :46
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :45
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :45
-->_3 #eq^#(#neg(@x), #0()) -> c_44() :44
-->_2 #eq^#(#neg(@x), #0()) -> c_44() :44
-->_3 #eq^#(#0(), #s(@y)) -> c_43() :43
-->_2 #eq^#(#0(), #s(@y)) -> c_43() :43
-->_3 #eq^#(#0(), #pos(@y)) -> c_42() :42
-->_2 #eq^#(#0(), #pos(@y)) -> c_42() :42
-->_3 #eq^#(#0(), #neg(@y)) -> c_41() :41
-->_2 #eq^#(#0(), #neg(@y)) -> c_41() :41
-->_3 #eq^#(#0(), #0()) -> c_40() :40
-->_2 #eq^#(#0(), #0()) -> c_40() :40
53: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
54: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
55: #eq^#(nil(), nil()) -> c_55()
56: #ckgt^#(#EQ()) -> c_68()
57: #ckgt^#(#GT()) -> c_69()
58: #ckgt^#(#LT()) -> c_70()
59: #compare^#(#0(), #0()) -> c_56()
60: #compare^#(#0(), #neg(@y)) -> c_57()
61: #compare^#(#0(), #pos(@y)) -> c_58()
62: #compare^#(#0(), #s(@y)) -> c_59()
63: #compare^#(#neg(@x), #0()) -> c_60()
64: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :70
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :68
-->_1 #compare^#(#s(@x), #0()) -> c_66() :69
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :67
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :66
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :65
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :64
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :63
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :62
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :61
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :60
-->_1 #compare^#(#0(), #0()) -> c_56() :59
65: #compare^#(#neg(@x), #pos(@y)) -> c_62()
66: #compare^#(#pos(@x), #0()) -> c_63()
67: #compare^#(#pos(@x), #neg(@y)) -> c_64()
68: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :70
-->_1 #compare^#(#s(@x), #0()) -> c_66() :69
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :68
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :67
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :66
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :65
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :64
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :63
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :62
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :61
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :60
-->_1 #compare^#(#0(), #0()) -> c_56() :59
69: #compare^#(#s(@x), #0()) -> c_66()
70: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :70
-->_1 #compare^#(#s(@x), #0()) -> c_66() :69
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :68
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :67
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :66
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :65
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :64
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :63
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :62
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :61
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :60
-->_1 #compare^#(#0(), #0()) -> c_56() :59
71: #add^#(#0(), @y) -> c_71()
72: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
73: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :75
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :74
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
74: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
75: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :75
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :74
76: #and^#(#false(), #false()) -> c_84()
77: #and^#(#false(), #true()) -> c_85()
78: #and^#(#true(), #false()) -> c_86()
79: #and^#(#true(), #true()) -> c_87()
80: #pred^#(#0()) -> c_76()
81: #pred^#(#neg(#s(@x))) -> c_77()
82: #pred^#(#pos(#s(#0()))) -> c_78()
83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
84: #succ^#(#0()) -> c_80()
85: #succ^#(#neg(#s(#0()))) -> c_81()
86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
87: #succ^#(#pos(#s(@x))) -> c_83()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {18} and add Pre({18}) = {16} to the strict component.
- We remove {22} and add Pre({22}) = {20} to the strict component.
- We remove {25} and add Pre({25}) = {23} to the strict component.
- We remove {30} and add Pre({30}) = {24} to the strict component.
- We remove {37} and add Pre({37}) = {36} to the strict component.
- We remove {27} and add Pre({27}) = {26} to the strict component.
- We remove {28} and add Pre({28}) = {26} to the strict component.
- We remove {34} and add Pre({34}) = {33} to the strict component.
- We remove {10} and add Pre({10}) = {8} to the strict component.
- We remove {7} and add Pre({7}) = {39} to the strict component.
- We remove {6} and add Pre({6}) = {26} to the strict component.
- We remove {5} and add Pre({5}) = {36} to the strict component.
- We remove {4} and add Pre({4}) = {} to the strict component.
- We remove {3} and add Pre({3}) = {} to the strict component.
- We remove {2} and add Pre({2}) = {} to the strict component.
- We remove {1} and add Pre({1}) = {35,19,17,9} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, right^#(@l) -> right#1^#(@l)
, right#1^#(nil()) -> #abs^#(#0())
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, firstline#1^#(nil()) -> c_10()
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, right#1^#(::(@x, @xs)) -> c_38()
, newline#6^#(@elem, @nl) -> c_37()
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs)) :2
-->_1 firstline#1^#(nil()) -> c_10() :67
2: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
-->_1 #abs^#(#0()) -> c_1() :24
-->_2 firstline^#(@l) -> firstline#1^#(@l) :1
3: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :5
-->_1 lcs#1^#(@m) -> lcs#2^#(@m) :4
4: lcs#1^#(@m) -> lcs#2^#(@m)
-->_1 lcs#2^#(nil()) -> #abs^#(#0()) :9
-->_1 lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1) :8
5: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :7
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :6
6: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :11
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :5
7: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
8: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
-->_1 lcs#3^#(nil()) -> #abs^#(#0()) :10
-->_1 lcs#3^#(::(@len, @_@1)) -> c_16() :68
9: lcs#2^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :24
10: lcs#3^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :24
11: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :12
-->_1 lcstable#3^#(nil(), @l2, @x) -> c_22() :69
12: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :13
13: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :14
-->_1 newline#1^#(nil(), @lastline, @y) -> c_28() :70
14: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) :16
-->_1 newline#2^#(nil(), @x, @xs, @y) -> c_30() :73
15: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
-->_2 #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :45
-->_1 max#1^#(#true(), @a, @b) -> c_26() :72
-->_1 max#1^#(#false(), @a, @b) -> c_25() :71
16: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
-->_1 newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl)) :17
-->_2 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :13
17: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
-->_2 right^#(@l) -> right#1^#(@l) :19
-->_1 newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline')) :18
18: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
-->_1 newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y)) :21
-->_2 right^#(@l) -> right#1^#(@l) :19
19: right^#(@l) -> right#1^#(@l)
-->_1 right#1^#(nil()) -> #abs^#(#0()) :20
-->_1 right#1^#(::(@x, @xs)) -> c_38() :74
20: right#1^#(nil()) -> #abs^#(#0())
-->_1 #abs^#(#0()) -> c_1() :24
21: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
-->_3 #equal^#(@x, @y) -> #eq^#(@x, @y) :28
-->_2 newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) :23
-->_2 newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal) :22
-->_1 newline#6^#(@elem, @nl) -> c_37() :75
22: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
-->_1 max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b)) :15
23: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :61
24: #abs^#(#0()) -> c_1()
25: #abs^#(#neg(@x)) -> c_2()
26: #abs^#(#pos(@x)) -> c_3()
27: #abs^#(#s(@x)) -> c_4()
28: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :41
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :40
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :38
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :34
-->_1 #eq^#(nil(), nil()) -> c_55() :44
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :43
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :42
-->_1 #eq^#(#s(@x), #0()) -> c_50() :39
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :37
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :36
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :35
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :33
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :32
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :31
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :30
-->_1 #eq^#(#0(), #0()) -> c_40() :29
29: #eq^#(#0(), #0()) -> c_40()
30: #eq^#(#0(), #neg(@y)) -> c_41()
31: #eq^#(#0(), #pos(@y)) -> c_42()
32: #eq^#(#0(), #s(@y)) -> c_43()
33: #eq^#(#neg(@x), #0()) -> c_44()
34: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :41
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :40
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :38
-->_1 #eq^#(nil(), nil()) -> c_55() :44
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :43
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :42
-->_1 #eq^#(#s(@x), #0()) -> c_50() :39
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :37
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :36
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :35
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :34
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :33
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :32
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :31
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :30
-->_1 #eq^#(#0(), #0()) -> c_40() :29
35: #eq^#(#neg(@x), #pos(@y)) -> c_46()
36: #eq^#(#pos(@x), #0()) -> c_47()
37: #eq^#(#pos(@x), #neg(@y)) -> c_48()
38: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :41
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :40
-->_1 #eq^#(nil(), nil()) -> c_55() :44
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :43
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :42
-->_1 #eq^#(#s(@x), #0()) -> c_50() :39
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :38
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :37
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :36
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :35
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :34
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :33
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :32
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :31
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :30
-->_1 #eq^#(#0(), #0()) -> c_40() :29
39: #eq^#(#s(@x), #0()) -> c_50()
40: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :41
-->_1 #eq^#(nil(), nil()) -> c_55() :44
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :43
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :42
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :40
-->_1 #eq^#(#s(@x), #0()) -> c_50() :39
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :38
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :37
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :36
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :35
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :34
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :33
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :32
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :31
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :30
-->_1 #eq^#(#0(), #0()) -> c_40() :29
41: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_1 #and^#(#true(), #true()) -> c_87() :79
-->_1 #and^#(#true(), #false()) -> c_86() :78
-->_1 #and^#(#false(), #true()) -> c_85() :77
-->_1 #and^#(#false(), #false()) -> c_84() :76
-->_3 #eq^#(nil(), nil()) -> c_55() :44
-->_2 #eq^#(nil(), nil()) -> c_55() :44
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :43
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :43
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :42
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :42
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :41
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :41
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :40
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :40
-->_3 #eq^#(#s(@x), #0()) -> c_50() :39
-->_2 #eq^#(#s(@x), #0()) -> c_50() :39
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :38
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :38
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_48() :37
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_48() :37
-->_3 #eq^#(#pos(@x), #0()) -> c_47() :36
-->_2 #eq^#(#pos(@x), #0()) -> c_47() :36
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_46() :35
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_46() :35
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :34
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :34
-->_3 #eq^#(#neg(@x), #0()) -> c_44() :33
-->_2 #eq^#(#neg(@x), #0()) -> c_44() :33
-->_3 #eq^#(#0(), #s(@y)) -> c_43() :32
-->_2 #eq^#(#0(), #s(@y)) -> c_43() :32
-->_3 #eq^#(#0(), #pos(@y)) -> c_42() :31
-->_2 #eq^#(#0(), #pos(@y)) -> c_42() :31
-->_3 #eq^#(#0(), #neg(@y)) -> c_41() :30
-->_2 #eq^#(#0(), #neg(@y)) -> c_41() :30
-->_3 #eq^#(#0(), #0()) -> c_40() :29
-->_2 #eq^#(#0(), #0()) -> c_40() :29
42: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
43: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
44: #eq^#(nil(), nil()) -> c_55()
45: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :60
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :58
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :54
-->_2 #compare^#(#s(@x), #0()) -> c_66() :59
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_64() :57
-->_2 #compare^#(#pos(@x), #0()) -> c_63() :56
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_62() :55
-->_2 #compare^#(#neg(@x), #0()) -> c_60() :53
-->_2 #compare^#(#0(), #s(@y)) -> c_59() :52
-->_2 #compare^#(#0(), #pos(@y)) -> c_58() :51
-->_2 #compare^#(#0(), #neg(@y)) -> c_57() :50
-->_2 #compare^#(#0(), #0()) -> c_56() :49
-->_1 #ckgt^#(#LT()) -> c_70() :48
-->_1 #ckgt^#(#GT()) -> c_69() :47
-->_1 #ckgt^#(#EQ()) -> c_68() :46
46: #ckgt^#(#EQ()) -> c_68()
47: #ckgt^#(#GT()) -> c_69()
48: #ckgt^#(#LT()) -> c_70()
49: #compare^#(#0(), #0()) -> c_56()
50: #compare^#(#0(), #neg(@y)) -> c_57()
51: #compare^#(#0(), #pos(@y)) -> c_58()
52: #compare^#(#0(), #s(@y)) -> c_59()
53: #compare^#(#neg(@x), #0()) -> c_60()
54: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :60
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :58
-->_1 #compare^#(#s(@x), #0()) -> c_66() :59
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :57
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :56
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :55
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :54
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :53
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :52
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :51
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :50
-->_1 #compare^#(#0(), #0()) -> c_56() :49
55: #compare^#(#neg(@x), #pos(@y)) -> c_62()
56: #compare^#(#pos(@x), #0()) -> c_63()
57: #compare^#(#pos(@x), #neg(@y)) -> c_64()
58: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :60
-->_1 #compare^#(#s(@x), #0()) -> c_66() :59
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :58
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :57
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :56
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :55
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :54
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :53
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :52
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :51
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :50
-->_1 #compare^#(#0(), #0()) -> c_56() :49
59: #compare^#(#s(@x), #0()) -> c_66()
60: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :60
-->_1 #compare^#(#s(@x), #0()) -> c_66() :59
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :58
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :57
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :56
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :55
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :54
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :53
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :52
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :51
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :50
-->_1 #compare^#(#0(), #0()) -> c_56() :49
61: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :66
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :65
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :64
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :63
-->_1 #add^#(#0(), @y) -> c_71() :62
62: #add^#(#0(), @y) -> c_71()
63: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
64: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :66
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :65
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
65: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
66: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :66
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :65
67: firstline#1^#(nil()) -> c_10()
68: lcs#3^#(::(@len, @_@1)) -> c_16()
69: lcstable#3^#(nil(), @l2, @x) -> c_22()
70: newline#1^#(nil(), @lastline, @y) -> c_28()
71: max#1^#(#false(), @a, @b) -> c_25()
72: max#1^#(#true(), @a, @b) -> c_26()
73: newline#2^#(nil(), @x, @xs, @y) -> c_30()
74: right#1^#(::(@x, @xs)) -> c_38()
75: newline#6^#(@elem, @nl) -> c_37()
76: #and^#(#false(), #false()) -> c_84()
77: #and^#(#false(), #true()) -> c_85()
78: #and^#(#true(), #false()) -> c_86()
79: #and^#(#true(), #true()) -> c_87()
80: #pred^#(#0()) -> c_76()
81: #pred^#(#neg(#s(@x))) -> c_77()
82: #pred^#(#pos(#s(#0()))) -> c_78()
83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
84: #succ^#(#0()) -> c_80()
85: #succ^#(#neg(#s(#0()))) -> c_81()
86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
87: #succ^#(#pos(#s(@x))) -> c_83()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {10} and add Pre({10}) = {8} to the strict component.
- We remove {9} and add Pre({9}) = {4} to the strict component.
- We remove {15} and add Pre({15}) = {22} to the strict component.
- We remove {23} and add Pre({23}) = {21} to the strict component.
- We remove {20} and add Pre({20}) = {19} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, right^#(@l) -> right#1^#(@l)
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, firstline#1^#(nil()) -> c_10()
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, right#1^#(::(@x, @xs)) -> c_38()
, right#1^#(nil()) -> #abs^#(#0())
, newline#6^#(@elem, @nl) -> c_37()
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs)) :2
-->_1 firstline#1^#(nil()) -> c_10() :62
2: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
-->_1 #abs^#(#0()) -> c_1() :19
-->_2 firstline^#(@l) -> firstline#1^#(@l) :1
3: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :5
-->_1 lcs#1^#(@m) -> lcs#2^#(@m) :4
4: lcs#1^#(@m) -> lcs#2^#(@m)
-->_1 lcs#2^#(nil()) -> #abs^#(#0()) :63
-->_1 lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1) :8
5: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :7
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :6
6: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :9
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :5
7: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
8: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
-->_1 lcs#3^#(nil()) -> #abs^#(#0()) :65
-->_1 lcs#3^#(::(@len, @_@1)) -> c_16() :64
9: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :10
-->_1 lcstable#3^#(nil(), @l2, @x) -> c_22() :66
10: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :11
11: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :12
-->_1 newline#1^#(nil(), @lastline, @y) -> c_28() :67
12: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) :13
-->_1 newline#2^#(nil(), @x, @xs, @y) -> c_30() :71
13: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
-->_1 newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl)) :14
-->_2 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :11
14: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
-->_2 right^#(@l) -> right#1^#(@l) :16
-->_1 newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline')) :15
15: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
-->_1 newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y)) :17
-->_2 right^#(@l) -> right#1^#(@l) :16
16: right^#(@l) -> right#1^#(@l)
-->_1 right#1^#(nil()) -> #abs^#(#0()) :73
-->_1 right#1^#(::(@x, @xs)) -> c_38() :72
17: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
-->_2 newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) :75
-->_3 #equal^#(@x, @y) -> #eq^#(@x, @y) :23
-->_2 newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal) :18
-->_1 newline#6^#(@elem, @nl) -> c_37() :74
18: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
-->_1 max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b)) :68
19: #abs^#(#0()) -> c_1()
20: #abs^#(#neg(@x)) -> c_2()
21: #abs^#(#pos(@x)) -> c_3()
22: #abs^#(#s(@x)) -> c_4()
23: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :36
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :35
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(nil(), nil()) -> c_55() :39
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :38
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :37
-->_1 #eq^#(#s(@x), #0()) -> c_50() :34
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :32
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :31
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :30
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :28
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :27
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :26
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :25
-->_1 #eq^#(#0(), #0()) -> c_40() :24
24: #eq^#(#0(), #0()) -> c_40()
25: #eq^#(#0(), #neg(@y)) -> c_41()
26: #eq^#(#0(), #pos(@y)) -> c_42()
27: #eq^#(#0(), #s(@y)) -> c_43()
28: #eq^#(#neg(@x), #0()) -> c_44()
29: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :36
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :35
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(nil(), nil()) -> c_55() :39
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :38
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :37
-->_1 #eq^#(#s(@x), #0()) -> c_50() :34
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :32
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :31
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :30
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :28
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :27
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :26
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :25
-->_1 #eq^#(#0(), #0()) -> c_40() :24
30: #eq^#(#neg(@x), #pos(@y)) -> c_46()
31: #eq^#(#pos(@x), #0()) -> c_47()
32: #eq^#(#pos(@x), #neg(@y)) -> c_48()
33: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :36
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :35
-->_1 #eq^#(nil(), nil()) -> c_55() :39
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :38
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :37
-->_1 #eq^#(#s(@x), #0()) -> c_50() :34
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :32
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :31
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :30
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :28
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :27
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :26
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :25
-->_1 #eq^#(#0(), #0()) -> c_40() :24
34: #eq^#(#s(@x), #0()) -> c_50()
35: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :36
-->_1 #eq^#(nil(), nil()) -> c_55() :39
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :38
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :37
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :35
-->_1 #eq^#(#s(@x), #0()) -> c_50() :34
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :32
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :31
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :30
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :28
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :27
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :26
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :25
-->_1 #eq^#(#0(), #0()) -> c_40() :24
36: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_1 #and^#(#true(), #true()) -> c_87() :79
-->_1 #and^#(#true(), #false()) -> c_86() :78
-->_1 #and^#(#false(), #true()) -> c_85() :77
-->_1 #and^#(#false(), #false()) -> c_84() :76
-->_3 #eq^#(nil(), nil()) -> c_55() :39
-->_2 #eq^#(nil(), nil()) -> c_55() :39
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :38
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :38
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :37
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :37
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :36
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :36
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :35
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :35
-->_3 #eq^#(#s(@x), #0()) -> c_50() :34
-->_2 #eq^#(#s(@x), #0()) -> c_50() :34
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :33
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :33
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_48() :32
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_48() :32
-->_3 #eq^#(#pos(@x), #0()) -> c_47() :31
-->_2 #eq^#(#pos(@x), #0()) -> c_47() :31
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_46() :30
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_46() :30
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :29
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :29
-->_3 #eq^#(#neg(@x), #0()) -> c_44() :28
-->_2 #eq^#(#neg(@x), #0()) -> c_44() :28
-->_3 #eq^#(#0(), #s(@y)) -> c_43() :27
-->_2 #eq^#(#0(), #s(@y)) -> c_43() :27
-->_3 #eq^#(#0(), #pos(@y)) -> c_42() :26
-->_2 #eq^#(#0(), #pos(@y)) -> c_42() :26
-->_3 #eq^#(#0(), #neg(@y)) -> c_41() :25
-->_2 #eq^#(#0(), #neg(@y)) -> c_41() :25
-->_3 #eq^#(#0(), #0()) -> c_40() :24
-->_2 #eq^#(#0(), #0()) -> c_40() :24
37: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
38: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
39: #eq^#(nil(), nil()) -> c_55()
40: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :55
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :53
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :49
-->_2 #compare^#(#s(@x), #0()) -> c_66() :54
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_64() :52
-->_2 #compare^#(#pos(@x), #0()) -> c_63() :51
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_62() :50
-->_2 #compare^#(#neg(@x), #0()) -> c_60() :48
-->_2 #compare^#(#0(), #s(@y)) -> c_59() :47
-->_2 #compare^#(#0(), #pos(@y)) -> c_58() :46
-->_2 #compare^#(#0(), #neg(@y)) -> c_57() :45
-->_2 #compare^#(#0(), #0()) -> c_56() :44
-->_1 #ckgt^#(#LT()) -> c_70() :43
-->_1 #ckgt^#(#GT()) -> c_69() :42
-->_1 #ckgt^#(#EQ()) -> c_68() :41
41: #ckgt^#(#EQ()) -> c_68()
42: #ckgt^#(#GT()) -> c_69()
43: #ckgt^#(#LT()) -> c_70()
44: #compare^#(#0(), #0()) -> c_56()
45: #compare^#(#0(), #neg(@y)) -> c_57()
46: #compare^#(#0(), #pos(@y)) -> c_58()
47: #compare^#(#0(), #s(@y)) -> c_59()
48: #compare^#(#neg(@x), #0()) -> c_60()
49: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :55
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :53
-->_1 #compare^#(#s(@x), #0()) -> c_66() :54
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :52
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :51
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :50
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :49
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :48
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :47
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :46
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :45
-->_1 #compare^#(#0(), #0()) -> c_56() :44
50: #compare^#(#neg(@x), #pos(@y)) -> c_62()
51: #compare^#(#pos(@x), #0()) -> c_63()
52: #compare^#(#pos(@x), #neg(@y)) -> c_64()
53: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :55
-->_1 #compare^#(#s(@x), #0()) -> c_66() :54
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :53
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :52
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :51
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :50
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :49
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :48
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :47
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :46
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :45
-->_1 #compare^#(#0(), #0()) -> c_56() :44
54: #compare^#(#s(@x), #0()) -> c_66()
55: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :55
-->_1 #compare^#(#s(@x), #0()) -> c_66() :54
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :53
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :52
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :51
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :50
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :49
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :48
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :47
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :46
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :45
-->_1 #compare^#(#0(), #0()) -> c_56() :44
56: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :61
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :60
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :59
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :58
-->_1 #add^#(#0(), @y) -> c_71() :57
57: #add^#(#0(), @y) -> c_71()
58: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
59: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :61
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :60
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
60: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
61: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :61
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :60
62: firstline#1^#(nil()) -> c_10()
63: lcs#2^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :19
64: lcs#3^#(::(@len, @_@1)) -> c_16()
65: lcs#3^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :19
66: lcstable#3^#(nil(), @l2, @x) -> c_22()
67: newline#1^#(nil(), @lastline, @y) -> c_28()
68: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
-->_1 max#1^#(#true(), @a, @b) -> c_26() :70
-->_1 max#1^#(#false(), @a, @b) -> c_25() :69
-->_2 #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :40
69: max#1^#(#false(), @a, @b) -> c_25()
70: max#1^#(#true(), @a, @b) -> c_26()
71: newline#2^#(nil(), @x, @xs, @y) -> c_30()
72: right#1^#(::(@x, @xs)) -> c_38()
73: right#1^#(nil()) -> #abs^#(#0())
-->_1 #abs^#(#0()) -> c_1() :19
74: newline#6^#(@elem, @nl) -> c_37()
75: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :56
76: #and^#(#false(), #false()) -> c_84()
77: #and^#(#false(), #true()) -> c_85()
78: #and^#(#true(), #false()) -> c_86()
79: #and^#(#true(), #true()) -> c_87()
80: #pred^#(#0()) -> c_76()
81: #pred^#(#neg(#s(@x))) -> c_77()
82: #pred^#(#pos(#s(#0()))) -> c_78()
83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
84: #succ^#(#0()) -> c_80()
85: #succ^#(#neg(#s(#0()))) -> c_81()
86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
87: #succ^#(#pos(#s(@x))) -> c_83()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {8} and add Pre({8}) = {4} to the strict component.
- We remove {18} and add Pre({18}) = {17} to the strict component.
- We remove {16} and add Pre({16}) = {15,14} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y)) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, firstline#1^#(nil()) -> c_10()
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, right^#(@l) -> right#1^#(@l)
, right#1^#(::(@x, @xs)) -> c_38()
, right#1^#(nil()) -> #abs^#(#0())
, newline#6^#(@elem, @nl) -> c_37()
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs)) :2
-->_1 firstline#1^#(nil()) -> c_10() :59
2: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
-->_1 #abs^#(#0()) -> c_1() :16
-->_2 firstline^#(@l) -> firstline#1^#(@l) :1
3: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :5
-->_1 lcs#1^#(@m) -> lcs#2^#(@m) :4
4: lcs#1^#(@m) -> lcs#2^#(@m)
-->_1 lcs#2^#(nil()) -> #abs^#(#0()) :61
-->_1 lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1) :60
5: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :7
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :6
6: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :8
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :5
7: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
8: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :9
-->_1 lcstable#3^#(nil(), @l2, @x) -> c_22() :64
9: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :10
10: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :11
-->_1 newline#1^#(nil(), @lastline, @y) -> c_28() :65
11: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) :12
-->_1 newline#2^#(nil(), @x, @xs, @y) -> c_30() :69
12: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
-->_1 newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl)) :13
-->_2 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :10
13: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
-->_2 right^#(@l) -> right#1^#(@l) :70
-->_1 newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline')) :14
14: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
-->_2 right^#(@l) -> right#1^#(@l) :70
-->_1 newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y)) :15
15: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
-->_2 newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) :75
-->_2 newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal) :74
-->_3 #equal^#(@x, @y) -> #eq^#(@x, @y) :20
-->_1 newline#6^#(@elem, @nl) -> c_37() :73
16: #abs^#(#0()) -> c_1()
17: #abs^#(#neg(@x)) -> c_2()
18: #abs^#(#pos(@x)) -> c_3()
19: #abs^#(#s(@x)) -> c_4()
20: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :33
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :32
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(nil(), nil()) -> c_55() :36
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :35
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :34
-->_1 #eq^#(#s(@x), #0()) -> c_50() :31
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :27
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :25
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :24
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :23
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :22
-->_1 #eq^#(#0(), #0()) -> c_40() :21
21: #eq^#(#0(), #0()) -> c_40()
22: #eq^#(#0(), #neg(@y)) -> c_41()
23: #eq^#(#0(), #pos(@y)) -> c_42()
24: #eq^#(#0(), #s(@y)) -> c_43()
25: #eq^#(#neg(@x), #0()) -> c_44()
26: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :33
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :32
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(nil(), nil()) -> c_55() :36
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :35
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :34
-->_1 #eq^#(#s(@x), #0()) -> c_50() :31
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :27
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :25
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :24
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :23
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :22
-->_1 #eq^#(#0(), #0()) -> c_40() :21
27: #eq^#(#neg(@x), #pos(@y)) -> c_46()
28: #eq^#(#pos(@x), #0()) -> c_47()
29: #eq^#(#pos(@x), #neg(@y)) -> c_48()
30: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :33
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :32
-->_1 #eq^#(nil(), nil()) -> c_55() :36
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :35
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :34
-->_1 #eq^#(#s(@x), #0()) -> c_50() :31
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :27
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :25
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :24
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :23
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :22
-->_1 #eq^#(#0(), #0()) -> c_40() :21
31: #eq^#(#s(@x), #0()) -> c_50()
32: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :33
-->_1 #eq^#(nil(), nil()) -> c_55() :36
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :35
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :34
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :32
-->_1 #eq^#(#s(@x), #0()) -> c_50() :31
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :27
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :25
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :24
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :23
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :22
-->_1 #eq^#(#0(), #0()) -> c_40() :21
33: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_1 #and^#(#true(), #true()) -> c_87() :79
-->_1 #and^#(#true(), #false()) -> c_86() :78
-->_1 #and^#(#false(), #true()) -> c_85() :77
-->_1 #and^#(#false(), #false()) -> c_84() :76
-->_3 #eq^#(nil(), nil()) -> c_55() :36
-->_2 #eq^#(nil(), nil()) -> c_55() :36
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :35
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :35
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :34
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :34
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :33
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :33
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :32
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :32
-->_3 #eq^#(#s(@x), #0()) -> c_50() :31
-->_2 #eq^#(#s(@x), #0()) -> c_50() :31
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_48() :29
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_48() :29
-->_3 #eq^#(#pos(@x), #0()) -> c_47() :28
-->_2 #eq^#(#pos(@x), #0()) -> c_47() :28
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_46() :27
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_46() :27
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_3 #eq^#(#neg(@x), #0()) -> c_44() :25
-->_2 #eq^#(#neg(@x), #0()) -> c_44() :25
-->_3 #eq^#(#0(), #s(@y)) -> c_43() :24
-->_2 #eq^#(#0(), #s(@y)) -> c_43() :24
-->_3 #eq^#(#0(), #pos(@y)) -> c_42() :23
-->_2 #eq^#(#0(), #pos(@y)) -> c_42() :23
-->_3 #eq^#(#0(), #neg(@y)) -> c_41() :22
-->_2 #eq^#(#0(), #neg(@y)) -> c_41() :22
-->_3 #eq^#(#0(), #0()) -> c_40() :21
-->_2 #eq^#(#0(), #0()) -> c_40() :21
34: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
35: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
36: #eq^#(nil(), nil()) -> c_55()
37: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :52
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :50
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :46
-->_2 #compare^#(#s(@x), #0()) -> c_66() :51
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_64() :49
-->_2 #compare^#(#pos(@x), #0()) -> c_63() :48
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_62() :47
-->_2 #compare^#(#neg(@x), #0()) -> c_60() :45
-->_2 #compare^#(#0(), #s(@y)) -> c_59() :44
-->_2 #compare^#(#0(), #pos(@y)) -> c_58() :43
-->_2 #compare^#(#0(), #neg(@y)) -> c_57() :42
-->_2 #compare^#(#0(), #0()) -> c_56() :41
-->_1 #ckgt^#(#LT()) -> c_70() :40
-->_1 #ckgt^#(#GT()) -> c_69() :39
-->_1 #ckgt^#(#EQ()) -> c_68() :38
38: #ckgt^#(#EQ()) -> c_68()
39: #ckgt^#(#GT()) -> c_69()
40: #ckgt^#(#LT()) -> c_70()
41: #compare^#(#0(), #0()) -> c_56()
42: #compare^#(#0(), #neg(@y)) -> c_57()
43: #compare^#(#0(), #pos(@y)) -> c_58()
44: #compare^#(#0(), #s(@y)) -> c_59()
45: #compare^#(#neg(@x), #0()) -> c_60()
46: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :52
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :50
-->_1 #compare^#(#s(@x), #0()) -> c_66() :51
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :49
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :48
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :47
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :46
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :45
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :44
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :43
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :42
-->_1 #compare^#(#0(), #0()) -> c_56() :41
47: #compare^#(#neg(@x), #pos(@y)) -> c_62()
48: #compare^#(#pos(@x), #0()) -> c_63()
49: #compare^#(#pos(@x), #neg(@y)) -> c_64()
50: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :52
-->_1 #compare^#(#s(@x), #0()) -> c_66() :51
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :50
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :49
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :48
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :47
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :46
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :45
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :44
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :43
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :42
-->_1 #compare^#(#0(), #0()) -> c_56() :41
51: #compare^#(#s(@x), #0()) -> c_66()
52: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :52
-->_1 #compare^#(#s(@x), #0()) -> c_66() :51
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :50
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :49
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :48
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :47
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :46
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :45
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :44
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :43
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :42
-->_1 #compare^#(#0(), #0()) -> c_56() :41
53: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :58
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :57
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :56
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :55
-->_1 #add^#(#0(), @y) -> c_71() :54
54: #add^#(#0(), @y) -> c_71()
55: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
56: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :58
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :57
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
57: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
58: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :58
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :57
59: firstline#1^#(nil()) -> c_10()
60: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
-->_1 lcs#3^#(nil()) -> #abs^#(#0()) :63
-->_1 lcs#3^#(::(@len, @_@1)) -> c_16() :62
61: lcs#2^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :16
62: lcs#3^#(::(@len, @_@1)) -> c_16()
63: lcs#3^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :16
64: lcstable#3^#(nil(), @l2, @x) -> c_22()
65: newline#1^#(nil(), @lastline, @y) -> c_28()
66: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
-->_1 max#1^#(#true(), @a, @b) -> c_26() :68
-->_1 max#1^#(#false(), @a, @b) -> c_25() :67
-->_2 #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :37
67: max#1^#(#false(), @a, @b) -> c_25()
68: max#1^#(#true(), @a, @b) -> c_26()
69: newline#2^#(nil(), @x, @xs, @y) -> c_30()
70: right^#(@l) -> right#1^#(@l)
-->_1 right#1^#(nil()) -> #abs^#(#0()) :72
-->_1 right#1^#(::(@x, @xs)) -> c_38() :71
71: right#1^#(::(@x, @xs)) -> c_38()
72: right#1^#(nil()) -> #abs^#(#0())
-->_1 #abs^#(#0()) -> c_1() :16
73: newline#6^#(@elem, @nl) -> c_37()
74: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
-->_1 max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b)) :66
75: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :53
76: #and^#(#false(), #false()) -> c_84()
77: #and^#(#false(), #true()) -> c_85()
78: #and^#(#true(), #false()) -> c_86()
79: #and^#(#true(), #true()) -> c_87()
80: #pred^#(#0()) -> c_76()
81: #pred^#(#neg(#s(@x))) -> c_77()
82: #pred^#(#pos(#s(#0()))) -> c_78()
83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
84: #succ^#(#0()) -> c_80()
85: #succ^#(#neg(#s(#0()))) -> c_81()
86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
87: #succ^#(#pos(#s(@x))) -> c_83()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
- We remove {15} and add Pre({15}) = {14} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline')) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, firstline#1^#(nil()) -> c_10()
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, right^#(@l) -> right#1^#(@l)
, right#1^#(::(@x, @xs)) -> c_38()
, right#1^#(nil()) -> #abs^#(#0())
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, newline#6^#(@elem, @nl) -> c_37()
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs)) :2
-->_1 firstline#1^#(nil()) -> c_10() :57
2: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
-->_1 #abs^#(#0()) -> c_1() :14
-->_2 firstline^#(@l) -> firstline#1^#(@l) :1
3: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
-->_1 lcs#1^#(@m) -> lcs#2^#(@m) :58
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
4: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :5
5: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :7
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
7: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :8
-->_1 lcstable#3^#(nil(), @l2, @x) -> c_22() :63
8: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :9
9: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :10
-->_1 newline#1^#(nil(), @lastline, @y) -> c_28() :64
10: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) :11
-->_1 newline#2^#(nil(), @x, @xs, @y) -> c_30() :68
11: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
-->_1 newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl)) :12
-->_2 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :9
12: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
-->_2 right^#(@l) -> right#1^#(@l) :69
-->_1 newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline')) :13
13: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
-->_1 newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y)) :72
-->_2 right^#(@l) -> right#1^#(@l) :69
14: #abs^#(#0()) -> c_1()
15: #abs^#(#neg(@x)) -> c_2()
16: #abs^#(#pos(@x)) -> c_3()
17: #abs^#(#s(@x)) -> c_4()
18: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :31
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :28
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(nil(), nil()) -> c_55() :34
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :33
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :32
-->_1 #eq^#(#s(@x), #0()) -> c_50() :29
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :27
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :26
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :25
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :23
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :22
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :21
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :20
-->_1 #eq^#(#0(), #0()) -> c_40() :19
19: #eq^#(#0(), #0()) -> c_40()
20: #eq^#(#0(), #neg(@y)) -> c_41()
21: #eq^#(#0(), #pos(@y)) -> c_42()
22: #eq^#(#0(), #s(@y)) -> c_43()
23: #eq^#(#neg(@x), #0()) -> c_44()
24: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :31
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :28
-->_1 #eq^#(nil(), nil()) -> c_55() :34
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :33
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :32
-->_1 #eq^#(#s(@x), #0()) -> c_50() :29
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :27
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :26
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :25
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :23
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :22
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :21
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :20
-->_1 #eq^#(#0(), #0()) -> c_40() :19
25: #eq^#(#neg(@x), #pos(@y)) -> c_46()
26: #eq^#(#pos(@x), #0()) -> c_47()
27: #eq^#(#pos(@x), #neg(@y)) -> c_48()
28: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :31
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(nil(), nil()) -> c_55() :34
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :33
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :32
-->_1 #eq^#(#s(@x), #0()) -> c_50() :29
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :28
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :27
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :26
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :25
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :23
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :22
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :21
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :20
-->_1 #eq^#(#0(), #0()) -> c_40() :19
29: #eq^#(#s(@x), #0()) -> c_50()
30: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :31
-->_1 #eq^#(nil(), nil()) -> c_55() :34
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :33
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :32
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#s(@x), #0()) -> c_50() :29
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :28
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :27
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :26
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :25
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :23
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :22
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :21
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :20
-->_1 #eq^#(#0(), #0()) -> c_40() :19
31: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_1 #and^#(#true(), #true()) -> c_87() :79
-->_1 #and^#(#true(), #false()) -> c_86() :78
-->_1 #and^#(#false(), #true()) -> c_85() :77
-->_1 #and^#(#false(), #false()) -> c_84() :76
-->_3 #eq^#(nil(), nil()) -> c_55() :34
-->_2 #eq^#(nil(), nil()) -> c_55() :34
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :33
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :33
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :32
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :32
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :31
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :31
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :30
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :30
-->_3 #eq^#(#s(@x), #0()) -> c_50() :29
-->_2 #eq^#(#s(@x), #0()) -> c_50() :29
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :28
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :28
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_48() :27
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_48() :27
-->_3 #eq^#(#pos(@x), #0()) -> c_47() :26
-->_2 #eq^#(#pos(@x), #0()) -> c_47() :26
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_46() :25
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_46() :25
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :24
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :24
-->_3 #eq^#(#neg(@x), #0()) -> c_44() :23
-->_2 #eq^#(#neg(@x), #0()) -> c_44() :23
-->_3 #eq^#(#0(), #s(@y)) -> c_43() :22
-->_2 #eq^#(#0(), #s(@y)) -> c_43() :22
-->_3 #eq^#(#0(), #pos(@y)) -> c_42() :21
-->_2 #eq^#(#0(), #pos(@y)) -> c_42() :21
-->_3 #eq^#(#0(), #neg(@y)) -> c_41() :20
-->_2 #eq^#(#0(), #neg(@y)) -> c_41() :20
-->_3 #eq^#(#0(), #0()) -> c_40() :19
-->_2 #eq^#(#0(), #0()) -> c_40() :19
32: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
33: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
34: #eq^#(nil(), nil()) -> c_55()
35: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :50
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :48
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :44
-->_2 #compare^#(#s(@x), #0()) -> c_66() :49
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_64() :47
-->_2 #compare^#(#pos(@x), #0()) -> c_63() :46
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_62() :45
-->_2 #compare^#(#neg(@x), #0()) -> c_60() :43
-->_2 #compare^#(#0(), #s(@y)) -> c_59() :42
-->_2 #compare^#(#0(), #pos(@y)) -> c_58() :41
-->_2 #compare^#(#0(), #neg(@y)) -> c_57() :40
-->_2 #compare^#(#0(), #0()) -> c_56() :39
-->_1 #ckgt^#(#LT()) -> c_70() :38
-->_1 #ckgt^#(#GT()) -> c_69() :37
-->_1 #ckgt^#(#EQ()) -> c_68() :36
36: #ckgt^#(#EQ()) -> c_68()
37: #ckgt^#(#GT()) -> c_69()
38: #ckgt^#(#LT()) -> c_70()
39: #compare^#(#0(), #0()) -> c_56()
40: #compare^#(#0(), #neg(@y)) -> c_57()
41: #compare^#(#0(), #pos(@y)) -> c_58()
42: #compare^#(#0(), #s(@y)) -> c_59()
43: #compare^#(#neg(@x), #0()) -> c_60()
44: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :50
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :48
-->_1 #compare^#(#s(@x), #0()) -> c_66() :49
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :47
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :46
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :45
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :44
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :43
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :42
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :41
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :40
-->_1 #compare^#(#0(), #0()) -> c_56() :39
45: #compare^#(#neg(@x), #pos(@y)) -> c_62()
46: #compare^#(#pos(@x), #0()) -> c_63()
47: #compare^#(#pos(@x), #neg(@y)) -> c_64()
48: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :50
-->_1 #compare^#(#s(@x), #0()) -> c_66() :49
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :48
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :47
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :46
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :45
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :44
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :43
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :42
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :41
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :40
-->_1 #compare^#(#0(), #0()) -> c_56() :39
49: #compare^#(#s(@x), #0()) -> c_66()
50: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :50
-->_1 #compare^#(#s(@x), #0()) -> c_66() :49
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :48
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :47
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :46
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :45
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :44
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :43
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :42
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :41
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :40
-->_1 #compare^#(#0(), #0()) -> c_56() :39
51: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :56
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :55
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :54
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :53
-->_1 #add^#(#0(), @y) -> c_71() :52
52: #add^#(#0(), @y) -> c_71()
53: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
54: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :56
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :55
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
55: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
56: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :56
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :55
57: firstline#1^#(nil()) -> c_10()
58: lcs#1^#(@m) -> lcs#2^#(@m)
-->_1 lcs#2^#(nil()) -> #abs^#(#0()) :60
-->_1 lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1) :59
59: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
-->_1 lcs#3^#(nil()) -> #abs^#(#0()) :62
-->_1 lcs#3^#(::(@len, @_@1)) -> c_16() :61
60: lcs#2^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :14
61: lcs#3^#(::(@len, @_@1)) -> c_16()
62: lcs#3^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :14
63: lcstable#3^#(nil(), @l2, @x) -> c_22()
64: newline#1^#(nil(), @lastline, @y) -> c_28()
65: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
-->_1 max#1^#(#true(), @a, @b) -> c_26() :67
-->_1 max#1^#(#false(), @a, @b) -> c_25() :66
-->_2 #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :35
66: max#1^#(#false(), @a, @b) -> c_25()
67: max#1^#(#true(), @a, @b) -> c_26()
68: newline#2^#(nil(), @x, @xs, @y) -> c_30()
69: right^#(@l) -> right#1^#(@l)
-->_1 right#1^#(nil()) -> #abs^#(#0()) :71
-->_1 right#1^#(::(@x, @xs)) -> c_38() :70
70: right#1^#(::(@x, @xs)) -> c_38()
71: right#1^#(nil()) -> #abs^#(#0())
-->_1 #abs^#(#0()) -> c_1() :14
72: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
-->_2 newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) :75
-->_2 newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal) :74
-->_1 newline#6^#(@elem, @nl) -> c_37() :73
-->_3 #equal^#(@x, @y) -> #eq^#(@x, @y) :18
73: newline#6^#(@elem, @nl) -> c_37()
74: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
-->_1 max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b)) :65
75: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :51
76: #and^#(#false(), #false()) -> c_84()
77: #and^#(#false(), #true()) -> c_85()
78: #and^#(#true(), #false()) -> c_86()
79: #and^#(#true(), #true()) -> c_87()
80: #pred^#(#0()) -> c_76()
81: #pred^#(#neg(#s(@x))) -> c_77()
82: #pred^#(#pos(#s(#0()))) -> c_78()
83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
84: #succ^#(#0()) -> c_80()
85: #succ^#(#neg(#s(#0()))) -> c_81()
86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
87: #succ^#(#pos(#s(@x))) -> c_83()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {13} and add Pre({13}) = {12} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl)) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, firstline#1^#(nil()) -> c_10()
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, right^#(@l) -> right#1^#(@l)
, right#1^#(::(@x, @xs)) -> c_38()
, right#1^#(nil()) -> #abs^#(#0())
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, newline#6^#(@elem, @nl) -> c_37()
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs)) :2
-->_1 firstline#1^#(nil()) -> c_10() :56
2: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
-->_1 #abs^#(#0()) -> c_1() :13
-->_2 firstline^#(@l) -> firstline#1^#(@l) :1
3: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
-->_1 lcs#1^#(@m) -> lcs#2^#(@m) :57
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
4: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :5
5: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :7
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
7: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :8
-->_1 lcstable#3^#(nil(), @l2, @x) -> c_22() :62
8: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :9
9: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :10
-->_1 newline#1^#(nil(), @lastline, @y) -> c_28() :63
10: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) :11
-->_1 newline#2^#(nil(), @x, @xs, @y) -> c_30() :67
11: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
-->_1 newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl)) :12
-->_2 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :9
12: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
-->_2 right^#(@l) -> right#1^#(@l) :69
-->_1 newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline')) :68
13: #abs^#(#0()) -> c_1()
14: #abs^#(#neg(@x)) -> c_2()
15: #abs^#(#pos(@x)) -> c_3()
16: #abs^#(#s(@x)) -> c_4()
17: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :30
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(nil(), nil()) -> c_55() :33
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :32
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :31
-->_1 #eq^#(#s(@x), #0()) -> c_50() :28
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :26
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :25
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :24
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :22
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :21
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :20
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :19
-->_1 #eq^#(#0(), #0()) -> c_40() :18
18: #eq^#(#0(), #0()) -> c_40()
19: #eq^#(#0(), #neg(@y)) -> c_41()
20: #eq^#(#0(), #pos(@y)) -> c_42()
21: #eq^#(#0(), #s(@y)) -> c_43()
22: #eq^#(#neg(@x), #0()) -> c_44()
23: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :30
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(nil(), nil()) -> c_55() :33
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :32
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :31
-->_1 #eq^#(#s(@x), #0()) -> c_50() :28
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :26
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :25
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :24
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :22
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :21
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :20
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :19
-->_1 #eq^#(#0(), #0()) -> c_40() :18
24: #eq^#(#neg(@x), #pos(@y)) -> c_46()
25: #eq^#(#pos(@x), #0()) -> c_47()
26: #eq^#(#pos(@x), #neg(@y)) -> c_48()
27: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :30
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(nil(), nil()) -> c_55() :33
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :32
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :31
-->_1 #eq^#(#s(@x), #0()) -> c_50() :28
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :26
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :25
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :24
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :22
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :21
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :20
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :19
-->_1 #eq^#(#0(), #0()) -> c_40() :18
28: #eq^#(#s(@x), #0()) -> c_50()
29: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :30
-->_1 #eq^#(nil(), nil()) -> c_55() :33
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :32
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :31
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(#s(@x), #0()) -> c_50() :28
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :26
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :25
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :24
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :22
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :21
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :20
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :19
-->_1 #eq^#(#0(), #0()) -> c_40() :18
30: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_1 #and^#(#true(), #true()) -> c_87() :79
-->_1 #and^#(#true(), #false()) -> c_86() :78
-->_1 #and^#(#false(), #true()) -> c_85() :77
-->_1 #and^#(#false(), #false()) -> c_84() :76
-->_3 #eq^#(nil(), nil()) -> c_55() :33
-->_2 #eq^#(nil(), nil()) -> c_55() :33
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :32
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :32
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :31
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :31
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :30
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :30
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :29
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :29
-->_3 #eq^#(#s(@x), #0()) -> c_50() :28
-->_2 #eq^#(#s(@x), #0()) -> c_50() :28
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :27
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :27
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_48() :26
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_48() :26
-->_3 #eq^#(#pos(@x), #0()) -> c_47() :25
-->_2 #eq^#(#pos(@x), #0()) -> c_47() :25
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_46() :24
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_46() :24
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :23
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :23
-->_3 #eq^#(#neg(@x), #0()) -> c_44() :22
-->_2 #eq^#(#neg(@x), #0()) -> c_44() :22
-->_3 #eq^#(#0(), #s(@y)) -> c_43() :21
-->_2 #eq^#(#0(), #s(@y)) -> c_43() :21
-->_3 #eq^#(#0(), #pos(@y)) -> c_42() :20
-->_2 #eq^#(#0(), #pos(@y)) -> c_42() :20
-->_3 #eq^#(#0(), #neg(@y)) -> c_41() :19
-->_2 #eq^#(#0(), #neg(@y)) -> c_41() :19
-->_3 #eq^#(#0(), #0()) -> c_40() :18
-->_2 #eq^#(#0(), #0()) -> c_40() :18
31: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
32: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
33: #eq^#(nil(), nil()) -> c_55()
34: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :49
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :47
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :43
-->_2 #compare^#(#s(@x), #0()) -> c_66() :48
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_64() :46
-->_2 #compare^#(#pos(@x), #0()) -> c_63() :45
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_62() :44
-->_2 #compare^#(#neg(@x), #0()) -> c_60() :42
-->_2 #compare^#(#0(), #s(@y)) -> c_59() :41
-->_2 #compare^#(#0(), #pos(@y)) -> c_58() :40
-->_2 #compare^#(#0(), #neg(@y)) -> c_57() :39
-->_2 #compare^#(#0(), #0()) -> c_56() :38
-->_1 #ckgt^#(#LT()) -> c_70() :37
-->_1 #ckgt^#(#GT()) -> c_69() :36
-->_1 #ckgt^#(#EQ()) -> c_68() :35
35: #ckgt^#(#EQ()) -> c_68()
36: #ckgt^#(#GT()) -> c_69()
37: #ckgt^#(#LT()) -> c_70()
38: #compare^#(#0(), #0()) -> c_56()
39: #compare^#(#0(), #neg(@y)) -> c_57()
40: #compare^#(#0(), #pos(@y)) -> c_58()
41: #compare^#(#0(), #s(@y)) -> c_59()
42: #compare^#(#neg(@x), #0()) -> c_60()
43: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :49
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :47
-->_1 #compare^#(#s(@x), #0()) -> c_66() :48
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :46
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :45
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :44
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :43
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :42
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :41
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :40
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :39
-->_1 #compare^#(#0(), #0()) -> c_56() :38
44: #compare^#(#neg(@x), #pos(@y)) -> c_62()
45: #compare^#(#pos(@x), #0()) -> c_63()
46: #compare^#(#pos(@x), #neg(@y)) -> c_64()
47: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :49
-->_1 #compare^#(#s(@x), #0()) -> c_66() :48
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :47
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :46
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :45
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :44
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :43
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :42
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :41
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :40
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :39
-->_1 #compare^#(#0(), #0()) -> c_56() :38
48: #compare^#(#s(@x), #0()) -> c_66()
49: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :49
-->_1 #compare^#(#s(@x), #0()) -> c_66() :48
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :47
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :46
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :45
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :44
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :43
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :42
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :41
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :40
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :39
-->_1 #compare^#(#0(), #0()) -> c_56() :38
50: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :55
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :54
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :53
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :52
-->_1 #add^#(#0(), @y) -> c_71() :51
51: #add^#(#0(), @y) -> c_71()
52: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
53: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :55
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :54
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
54: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
55: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :55
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :54
56: firstline#1^#(nil()) -> c_10()
57: lcs#1^#(@m) -> lcs#2^#(@m)
-->_1 lcs#2^#(nil()) -> #abs^#(#0()) :59
-->_1 lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1) :58
58: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
-->_1 lcs#3^#(nil()) -> #abs^#(#0()) :61
-->_1 lcs#3^#(::(@len, @_@1)) -> c_16() :60
59: lcs#2^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :13
60: lcs#3^#(::(@len, @_@1)) -> c_16()
61: lcs#3^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :13
62: lcstable#3^#(nil(), @l2, @x) -> c_22()
63: newline#1^#(nil(), @lastline, @y) -> c_28()
64: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
-->_1 max#1^#(#true(), @a, @b) -> c_26() :66
-->_1 max#1^#(#false(), @a, @b) -> c_25() :65
-->_2 #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :34
65: max#1^#(#false(), @a, @b) -> c_25()
66: max#1^#(#true(), @a, @b) -> c_26()
67: newline#2^#(nil(), @x, @xs, @y) -> c_30()
68: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
-->_1 newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y)) :72
-->_2 right^#(@l) -> right#1^#(@l) :69
69: right^#(@l) -> right#1^#(@l)
-->_1 right#1^#(nil()) -> #abs^#(#0()) :71
-->_1 right#1^#(::(@x, @xs)) -> c_38() :70
70: right#1^#(::(@x, @xs)) -> c_38()
71: right#1^#(nil()) -> #abs^#(#0())
-->_1 #abs^#(#0()) -> c_1() :13
72: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
-->_2 newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) :75
-->_2 newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal) :74
-->_1 newline#6^#(@elem, @nl) -> c_37() :73
-->_3 #equal^#(@x, @y) -> #eq^#(@x, @y) :17
73: newline#6^#(@elem, @nl) -> c_37()
74: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
-->_1 max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b)) :64
75: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :50
76: #and^#(#false(), #false()) -> c_84()
77: #and^#(#false(), #true()) -> c_85()
78: #and^#(#true(), #false()) -> c_86()
79: #and^#(#true(), #true()) -> c_87()
80: #pred^#(#0()) -> c_76()
81: #pred^#(#neg(#s(@x))) -> c_77()
82: #pred^#(#pos(#s(#0()))) -> c_78()
83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
84: #succ^#(#0()) -> c_80()
85: #succ^#(#neg(#s(#0()))) -> c_81()
86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
87: #succ^#(#pos(#s(@x))) -> c_83()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {12} and add Pre({12}) = {11} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, firstline#1^#(nil()) -> c_10()
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, right^#(@l) -> right#1^#(@l)
, right#1^#(::(@x, @xs)) -> c_38()
, right#1^#(nil()) -> #abs^#(#0())
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, newline#6^#(@elem, @nl) -> c_37()
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the the dependency graph
->4:{3}
|
|->5:{4,5}
| |
| |->70:{6}
| | |
| | `->76:{1,2}
| | |
| | |->78:{12} Weak SCC
| | |
| | `->77:{55} Weak SCC
| |
| `->6:{7}
| |
| |->8:{8}
| | |
| | `->9:{9,11,10}
| | |
| | |->10:{62} Weak SCC
| | |
| | |->11:{66} Weak SCC
| | |
| | `->12:{67} Weak SCC
| | |
| | |->13:{68} Weak SCC
| | | |
| | | |->67:{69} Weak SCC
| | | | |
| | | | |->68:{70} Weak SCC
| | | | |
| | | | `->69:{71} Weak SCC
| | | | |
| | | | `->78:{12}
Weak SCC
| | | |
| | | `->14:{72} Weak SCC
| | | |
| | | |->15:{16} Weak SCC
| | | | |
| | | | |->17:{17}
Weak SCC
| | | | |
| | | | |->18:{18}
Weak SCC
| | | | |
| | | | |->19:{19}
Weak SCC
| | | | |
| | | | |->20:{20}
Weak SCC
| | | | |
| | | | |->21:{21}
Weak SCC
| | | | |
| | | | |->22:{23}
Weak SCC
| | | | |
| | | | |->23:{24}
Weak SCC
| | | | |
| | | | |->24:{25}
Weak SCC
| | | | |
| | | | |->25:{27}
Weak SCC
| | | | |
| | | | |->16:{29,28,26,22}
Weak SCC
| | | | | |
| | | | | |->17:{17}
Weak SCC
| | | | | |
| | | | | |->18:{18}
Weak SCC
| | | | | |
| | | | | |->19:{19}
Weak SCC
| | | | | |
| | | | | |->20:{20}
Weak SCC
| | | | | |
| | | | | |->21:{21}
Weak SCC
| | | | | |
| | | | | |->22:{23}
Weak SCC
| | | | | |
| | | | | |->23:{24}
Weak SCC
| | | | | |
| | | | | |->24:{25}
Weak SCC
| | | | | |
| | | | | |->25:{27}
Weak SCC
| | | | | |
| | | | | |->26:{30}
Weak SCC
| | | | | |
| | | | | |->27:{31}
Weak SCC
| | | | | |
| | | | | |->28:{32}
Weak SCC
| | | | | |
| | | | | |->29:{76}
Weak SCC
| | | | | |
| | | | | |->30:{77}
Weak SCC
| | | | | |
| | | | | |->31:{78}
Weak SCC
| | | | | |
| | | | | `->32:{79}
Weak SCC
| | | | |
| | | | |->26:{30}
Weak SCC
| | | | |
| | | | |->27:{31}
Weak SCC
| | | | |
| | | | `->28:{32}
Weak SCC
| | | |
| | | |->33:{73} Weak SCC
| | | |
| | | |->34:{74} Weak SCC
| | | | |
| | | | `->35:{63}
Weak SCC
| | | | |
| | | | |->36:{33}
Weak SCC
| | | | | |
| | | | | |->37:{34}
Weak SCC
| | | | | |
| | | | | |->38:{35}
Weak SCC
| | | | | |
| | | | | |->39:{36}
Weak SCC
| | | | | |
| | | | | |->41:{37}
Weak SCC
| | | | | |
| | | | | |->42:{38}
Weak SCC
| | | | | |
| | | | | |->43:{39}
Weak SCC
| | | | | |
| | | | | |->44:{40}
Weak SCC
| | | | | |
| | | | | |->45:{41}
Weak SCC
| | | | | |
| | | | | |->46:{43}
Weak SCC
| | | | | |
| | | | | |->47:{44}
Weak SCC
| | | | | |
| | | | | |->48:{45}
Weak SCC
| | | | | |
| | | | | |->49:{47}
Weak SCC
| | | | | |
| | | | | `->40:{48,46,42}
Weak SCC
| | | | | |
| | | | | |->41:{37}
Weak SCC
| | | | | |
| | | | | |->42:{38}
Weak SCC
| | | | | |
| | | | | |->43:{39}
Weak SCC
| | | | | |
| | | | | |->44:{40}
Weak SCC
| | | | | |
| | | | | |->45:{41}
Weak SCC
| | | | | |
| | | | | |->46:{43}
Weak SCC
| | | | | |
| | | | | |->47:{44}
Weak SCC
| | | | | |
| | | | | |->48:{45}
Weak SCC
| | | | | |
| | | | | `->49:{47}
Weak SCC
| | | | |
| | | | |->50:{64}
Weak SCC
| | | | |
| | | | `->51:{65}
Weak SCC
| | | |
| | | `->52:{75} Weak SCC
| | | |
| | | `->53:{49}
Weak SCC
| | | |
| | | |->54:{50}
Weak SCC
| | | |
| | | |->55:{51}
Weak SCC
| | | | |
| | | | |->57:{80}
Weak SCC
| | | | |
| | | | |->58:{81}
Weak SCC
| | | | |
| | | | |->59:{82}
Weak SCC
| | | | |
| | | | `->60:{83}
Weak SCC
| | | |
| | | |->56:{52}
Weak SCC
| | | | |
| | | | |->62:{53}
Weak SCC
| | | | | |
| | | | | |->63:{84}
Weak SCC
| | | | | |
| | | | | |->64:{85}
Weak SCC
| | | | | |
| | | | | |->65:{86}
Weak SCC
| | | | | |
| | | | | `->66:{87}
Weak SCC
| | | | |
| | | | |->61:{54}
Weak SCC
| | | | | |
| | | | | |->62:{53}
Weak SCC
| | | | | | |
| | | | | | |->63:{84}
Weak SCC
| | | | | | |
| | | | | | |->64:{85}
Weak SCC
| | | | | | |
| | | | | | |->65:{86}
Weak SCC
| | | | | | |
| | | | | | `->66:{87}
Weak SCC
| | | | | |
| | | | | |->63:{84}
Weak SCC
| | | | | |
| | | | | |->64:{85}
Weak SCC
| | | | | |
| | | | | |->65:{86}
Weak SCC
| | | | | |
| | | | | `->66:{87}
Weak SCC
| | | | |
| | | | |->57:{80}
Weak SCC
| | | | |
| | | | |->58:{81}
Weak SCC
| | | | |
| | | | |->59:{82}
Weak SCC
| | | | |
| | | | `->60:{83}
Weak SCC
| | | |
| | | |->62:{53}
Weak SCC
| | | | |
| | | | |->63:{84}
Weak SCC
| | | | |
| | | | |->64:{85}
Weak SCC
| | | | |
| | | | |->65:{86}
Weak SCC
| | | | |
| | | | `->66:{87}
Weak SCC
| | | |
| | | `->61:{54}
Weak SCC
| | | |
| | | |->62:{53}
Weak SCC
| | | | |
| | | | |->63:{84}
Weak SCC
| | | | |
| | | | |->64:{85}
Weak SCC
| | | | |
| | | | |->65:{86}
Weak SCC
| | | | |
| | | | `->66:{87}
Weak SCC
| | | |
| | | |->63:{84}
Weak SCC
| | | |
| | | |->64:{85}
Weak SCC
| | | |
| | | |->65:{86}
Weak SCC
| | | |
| | | `->66:{87}
Weak SCC
| | |
| | `->67:{69} Weak SCC
| | |
| | |->68:{70} Weak SCC
| | |
| | `->69:{71} Weak SCC
| | |
| | `->78:{12} Weak SCC
| |
| `->7:{61} Weak SCC
|
`->71:{56} Weak SCC
|
|->72:{57} Weak SCC
| |
| |->73:{59} Weak SCC
| |
| `->74:{60} Weak SCC
| |
| `->78:{12} Weak SCC
|
`->75:{58} Weak SCC
|
`->78:{12} Weak SCC
->3:{13} Weak SCC
->2:{14} Weak SCC
->1:{15} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: firstline^#(@l) -> firstline#1^#(@l)
, 2: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
, 3: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, 4: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, 5: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, 6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, 7: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, 8: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, 9: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, 10: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, 11: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) }
Weak DPs:
{ 12: #abs^#(#0()) -> c_1()
, 13: #abs^#(#neg(@x)) -> c_2()
, 14: #abs^#(#pos(@x)) -> c_3()
, 15: #abs^#(#s(@x)) -> c_4()
, 16: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 17: #eq^#(#0(), #0()) -> c_40()
, 18: #eq^#(#0(), #neg(@y)) -> c_41()
, 19: #eq^#(#0(), #pos(@y)) -> c_42()
, 20: #eq^#(#0(), #s(@y)) -> c_43()
, 21: #eq^#(#neg(@x), #0()) -> c_44()
, 22: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 23: #eq^#(#neg(@x), #pos(@y)) -> c_46()
, 24: #eq^#(#pos(@x), #0()) -> c_47()
, 25: #eq^#(#pos(@x), #neg(@y)) -> c_48()
, 26: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 27: #eq^#(#s(@x), #0()) -> c_50()
, 28: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 29: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 30: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, 31: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, 32: #eq^#(nil(), nil()) -> c_55()
, 33: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 34: #ckgt^#(#EQ()) -> c_68()
, 35: #ckgt^#(#GT()) -> c_69()
, 36: #ckgt^#(#LT()) -> c_70()
, 37: #compare^#(#0(), #0()) -> c_56()
, 38: #compare^#(#0(), #neg(@y)) -> c_57()
, 39: #compare^#(#0(), #pos(@y)) -> c_58()
, 40: #compare^#(#0(), #s(@y)) -> c_59()
, 41: #compare^#(#neg(@x), #0()) -> c_60()
, 42: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 43: #compare^#(#neg(@x), #pos(@y)) -> c_62()
, 44: #compare^#(#pos(@x), #0()) -> c_63()
, 45: #compare^#(#pos(@x), #neg(@y)) -> c_64()
, 46: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 47: #compare^#(#s(@x), #0()) -> c_66()
, 48: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 49: +^#(@x, @y) -> #add^#(@x, @y)
, 50: #add^#(#0(), @y) -> c_71()
, 51: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 52: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 53: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 54: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 55: firstline#1^#(nil()) -> c_10()
, 56: lcs#1^#(@m) -> lcs#2^#(@m)
, 57: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, 58: lcs#2^#(nil()) -> #abs^#(#0())
, 59: lcs#3^#(::(@len, @_@1)) -> c_16()
, 60: lcs#3^#(nil()) -> #abs^#(#0())
, 61: lcstable#3^#(nil(), @l2, @x) -> c_22()
, 62: newline#1^#(nil(), @lastline, @y) -> c_28()
, 63: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, 64: max#1^#(#false(), @a, @b) -> c_25()
, 65: max#1^#(#true(), @a, @b) -> c_26()
, 66: newline#2^#(nil(), @x, @xs, @y) -> c_30()
, 67: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, 68: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, 69: right^#(@l) -> right#1^#(@l)
, 70: right#1^#(::(@x, @xs)) -> c_38()
, 71: right#1^#(nil()) -> #abs^#(#0())
, 72: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, 73: newline#6^#(@elem, @nl) -> c_37()
, 74: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, 75: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
, 76: #and^#(#false(), #false()) -> c_84()
, 77: #and^#(#false(), #true()) -> c_85()
, 78: #and^#(#true(), #false()) -> c_86()
, 79: #and^#(#true(), #true()) -> c_87()
, 80: #pred^#(#0()) -> c_76()
, 81: #pred^#(#neg(#s(@x))) -> c_77()
, 82: #pred^#(#pos(#s(#0()))) -> c_78()
, 83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
, 84: #succ^#(#0()) -> c_80()
, 85: #succ^#(#neg(#s(#0()))) -> c_81()
, 86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
, 87: #succ^#(#pos(#s(@x))) -> c_83() }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 15: #abs^#(#s(@x)) -> c_4()
, 14: #abs^#(#pos(@x)) -> c_3()
, 13: #abs^#(#neg(@x)) -> c_2()
, 61: lcstable#3^#(nil(), @l2, @x) -> c_22()
, 62: newline#1^#(nil(), @lastline, @y) -> c_28()
, 66: newline#2^#(nil(), @x, @xs, @y) -> c_30()
, 67: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, 68: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, 72: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, 16: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 29: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 28: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 26: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 22: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 17: #eq^#(#0(), #0()) -> c_40()
, 18: #eq^#(#0(), #neg(@y)) -> c_41()
, 19: #eq^#(#0(), #pos(@y)) -> c_42()
, 20: #eq^#(#0(), #s(@y)) -> c_43()
, 21: #eq^#(#neg(@x), #0()) -> c_44()
, 23: #eq^#(#neg(@x), #pos(@y)) -> c_46()
, 24: #eq^#(#pos(@x), #0()) -> c_47()
, 25: #eq^#(#pos(@x), #neg(@y)) -> c_48()
, 27: #eq^#(#s(@x), #0()) -> c_50()
, 30: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, 31: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, 32: #eq^#(nil(), nil()) -> c_55()
, 76: #and^#(#false(), #false()) -> c_84()
, 77: #and^#(#false(), #true()) -> c_85()
, 78: #and^#(#true(), #false()) -> c_86()
, 79: #and^#(#true(), #true()) -> c_87()
, 73: newline#6^#(@elem, @nl) -> c_37()
, 74: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, 63: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, 33: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 34: #ckgt^#(#EQ()) -> c_68()
, 35: #ckgt^#(#GT()) -> c_69()
, 36: #ckgt^#(#LT()) -> c_70()
, 48: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 46: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 42: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 37: #compare^#(#0(), #0()) -> c_56()
, 38: #compare^#(#0(), #neg(@y)) -> c_57()
, 39: #compare^#(#0(), #pos(@y)) -> c_58()
, 40: #compare^#(#0(), #s(@y)) -> c_59()
, 41: #compare^#(#neg(@x), #0()) -> c_60()
, 43: #compare^#(#neg(@x), #pos(@y)) -> c_62()
, 44: #compare^#(#pos(@x), #0()) -> c_63()
, 45: #compare^#(#pos(@x), #neg(@y)) -> c_64()
, 47: #compare^#(#s(@x), #0()) -> c_66()
, 64: max#1^#(#false(), @a, @b) -> c_25()
, 65: max#1^#(#true(), @a, @b) -> c_26()
, 75: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
, 49: +^#(@x, @y) -> #add^#(@x, @y)
, 50: #add^#(#0(), @y) -> c_71()
, 51: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 52: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 80: #pred^#(#0()) -> c_76()
, 81: #pred^#(#neg(#s(@x))) -> c_77()
, 82: #pred^#(#pos(#s(#0()))) -> c_78()
, 83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
, 54: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 53: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 84: #succ^#(#0()) -> c_80()
, 85: #succ^#(#neg(#s(#0()))) -> c_81()
, 86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
, 87: #succ^#(#pos(#s(@x))) -> c_83()
, 69: right^#(@l) -> right#1^#(@l)
, 70: right#1^#(::(@x, @xs)) -> c_38()
, 71: right#1^#(nil()) -> #abs^#(#0())
, 56: lcs#1^#(@m) -> lcs#2^#(@m)
, 57: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, 59: lcs#3^#(::(@len, @_@1)) -> c_16()
, 60: lcs#3^#(nil()) -> #abs^#(#0())
, 58: lcs#2^#(nil()) -> #abs^#(#0())
, 55: firstline#1^#(nil()) -> c_10()
, 12: #abs^#(#0()) -> c_1() }
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the following dependency-graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs)) :2
2: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
-->_2 firstline^#(@l) -> firstline#1^#(@l) :1
3: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
4: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :5
5: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :7
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
7: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :8
8: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :9
9: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :10
10: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) :11
11: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
-->_2 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :9
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) }
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We employ 'linear path analysis' using the following approximated
dependency graph:
->1:{3} [ ? ]
|
`->2:{4,5} [ ? ]
|
|->6:{6} [ ? ]
| |
| `->7:{1,2} [ YES(O(1),O(n^1)) ]
|
`->3:{7} [ ? ]
|
`->4:{8} [ ? ]
|
`->5:{9,11,10} [ MAYBE ]
Here dependency-pairs are as follows:
Strict DPs:
{ 1: firstline^#(@l) -> firstline#1^#(@l)
, 2: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, 3: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 4: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, 5: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, 6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, 7: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, 8: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, 9: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, 10: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, 11: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
* Path 1:{3}->2:{4,5}->6:{6}->7:{1,2}: YES(O(1),O(n^1))
-----------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) :2
2: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
3: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
4: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :5
5: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
Weak DPs: { firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) :6
2: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :3
3: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :5
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :4
4: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :3
5: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
6: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) }
Weak DPs:
{ firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) :5
2: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :3
3: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :4
4: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :3
5: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) :4
2: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :3
3: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :5
4: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
5: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :3
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) :3
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :5
3: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
4: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
5: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
No rule is usable.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
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: firstline^#(@l) -> firstline#1^#(@l)
, 3: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, 4: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {}, Uargs(::) = {},
Uargs(#abs^#) = {}, Uargs(#equal^#) = {}, Uargs(#eq^#) = {},
Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(+^#) = {}, Uargs(#add^#) = {},
Uargs(firstline^#) = {}, Uargs(firstline#1^#) = {},
Uargs(lcs^#) = {}, Uargs(lcs#1^#) = {}, Uargs(lcstable^#) = {},
Uargs(lcstable#1^#) = {}, Uargs(lcs#2^#) = {}, Uargs(lcs#3^#) = {},
Uargs(lcstable#2^#) = {}, Uargs(lcstable#3^#) = {},
Uargs(newline^#) = {}, Uargs(newline#1^#) = {}, Uargs(max^#) = {},
Uargs(max#1^#) = {}, Uargs(newline#2^#) = {},
Uargs(newline#3^#) = {}, Uargs(newline#4^#) = {},
Uargs(right^#) = {}, Uargs(right#1^#) = {},
Uargs(newline#5^#) = {}, Uargs(newline#6^#) = {},
Uargs(newline#7^#) = {}, Uargs(#and^#) = {}, Uargs(#pred^#) = {},
Uargs(#succ^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [0]
[#neg](x1) = [0]
[#pos](x1) = [0]
[#s](x1) = [0]
[::](x1, x2) = [1] x2 + [2]
[nil] = [0]
[#false] = [0]
[#true] = [0]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#abs^#](x1) = [0]
[#equal^#](x1, x2) = [0]
[#eq^#](x1, x2) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[+^#](x1, x2) = [0]
[#add^#](x1, x2) = [0]
[firstline^#](x1) = [2] x1 + [1]
[firstline#1^#](x1) = [2] x1 + [0]
[lcs^#](x1, x2) = [3] x1 + [3] x2 + [3]
[lcs#1^#](x1) = [0]
[lcstable^#](x1, x2) = [3] x2 + [1]
[lcstable#1^#](x1, x2) = [3] x2 + [1]
[lcs#2^#](x1) = [0]
[lcs#3^#](x1) = [0]
[lcstable#2^#](x1, x2, x3) = [0]
[lcstable#3^#](x1, x2, x3) = [0]
[newline^#](x1, x2, x3) = [0]
[newline#1^#](x1, x2, x3) = [0]
[max^#](x1, x2) = [0]
[max#1^#](x1, x2, x3) = [0]
[newline#2^#](x1, x2, x3, x4) = [0]
[newline#3^#](x1, x2, x3, x4, x5) = [0]
[newline#4^#](x1, x2, x3, x4, x5, x6) = [0]
[right^#](x1) = [0]
[right#1^#](x1) = [0]
[newline#5^#](x1, x2, x3, x4, x5, x6) = [0]
[newline#6^#](x1, x2) = [0]
[newline#7^#](x1, x2, x3, x4) = [0]
[#and^#](x1, x2) = [0]
[#pred^#](x1) = [0]
[#succ^#](x1) = [0]
This order satisfies following ordering constraints
[firstline^#(@l)] = [2] @l + [1]
> [2] @l + [0]
= [firstline#1^#(@l)]
[firstline#1^#(::(@x, @xs))] = [2] @xs + [4]
> [2] @xs + [1]
= [firstline^#(@xs)]
[lcs^#(@l1, @l2)] = [3] @l1 + [3] @l2 + [3]
> [3] @l2 + [1]
= [lcstable^#(@l1, @l2)]
[lcstable^#(@l1, @l2)] = [3] @l2 + [1]
>= [3] @l2 + [1]
= [lcstable#1^#(@l1, @l2)]
[lcstable#1^#(::(@x, @xs), @l2)] = [3] @l2 + [1]
>= [3] @l2 + [1]
= [lcstable^#(@xs, @l2)]
[lcstable#1^#(nil(), @l2)] = [3] @l2 + [1]
>= [2] @l2 + [1]
= [firstline^#(@l2)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{1,3,4}. Here rules are labeled according to the (estimated)
dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) :3
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) :5
3: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
4: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
5: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
Overall, we obtain that the number of applications of rules {1,3,4}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Strict DPs: { lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{4} Weak SCC
|
`->2:{1,5}
|
`->3:{6} Weak SCC
|
`->4:{2,3} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ 2: firstline^#(@l) -> firstline#1^#(@l)
, 3: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, 4: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 5: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
, 6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, 2: firstline^#(@l) -> firstline#1^#(@l)
, 3: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) }
We apply the transformation 'simpKP' on the sub-problem:
Strict DPs: { lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
StartTerms: basic terms
Strategy: innermost
We use the processor 'matrix interpretation of dimension 1' to
orient following rules strictly.
DPs:
{ 2: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 3: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {}, Uargs(::) = {},
Uargs(#abs^#) = {}, Uargs(#equal^#) = {}, Uargs(#eq^#) = {},
Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(+^#) = {}, Uargs(#add^#) = {},
Uargs(firstline^#) = {}, Uargs(firstline#1^#) = {},
Uargs(lcs^#) = {}, Uargs(lcs#1^#) = {}, Uargs(lcstable^#) = {},
Uargs(lcstable#1^#) = {}, Uargs(lcs#2^#) = {}, Uargs(lcs#3^#) = {},
Uargs(lcstable#2^#) = {}, Uargs(lcstable#3^#) = {},
Uargs(newline^#) = {}, Uargs(newline#1^#) = {}, Uargs(max^#) = {},
Uargs(max#1^#) = {}, Uargs(newline#2^#) = {},
Uargs(newline#3^#) = {}, Uargs(newline#4^#) = {},
Uargs(right^#) = {}, Uargs(right#1^#) = {},
Uargs(newline#5^#) = {}, Uargs(newline#6^#) = {},
Uargs(newline#7^#) = {}, Uargs(#and^#) = {}, Uargs(#pred^#) = {},
Uargs(#succ^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [0]
[#neg](x1) = [0]
[#pos](x1) = [0]
[#s](x1) = [0]
[::](x1, x2) = [1] x2 + [2]
[nil] = [0]
[#false] = [0]
[#true] = [0]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#abs^#](x1) = [0]
[#equal^#](x1, x2) = [0]
[#eq^#](x1, x2) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[+^#](x1, x2) = [0]
[#add^#](x1, x2) = [0]
[firstline^#](x1) = [0]
[firstline#1^#](x1) = [0]
[lcs^#](x1, x2) = [3] x1 + [3] x2 + [3]
[lcs#1^#](x1) = [0]
[lcstable^#](x1, x2) = [2] x1 + [0]
[lcstable#1^#](x1, x2) = [2] x1 + [0]
[lcs#2^#](x1) = [0]
[lcs#3^#](x1) = [0]
[lcstable#2^#](x1, x2, x3) = [0]
[lcstable#3^#](x1, x2, x3) = [0]
[newline^#](x1, x2, x3) = [0]
[newline#1^#](x1, x2, x3) = [0]
[max^#](x1, x2) = [0]
[max#1^#](x1, x2, x3) = [0]
[newline#2^#](x1, x2, x3, x4) = [0]
[newline#3^#](x1, x2, x3, x4, x5) = [0]
[newline#4^#](x1, x2, x3, x4, x5, x6) = [0]
[right^#](x1) = [0]
[right#1^#](x1) = [0]
[newline#5^#](x1, x2, x3, x4, x5, x6) = [0]
[newline#6^#](x1, x2) = [0]
[newline#7^#](x1, x2, x3, x4) = [0]
[#and^#](x1, x2) = [0]
[#pred^#](x1) = [0]
[#succ^#](x1) = [0]
This order satisfies following ordering constraints
[lcs^#(@l1, @l2)] = [3] @l1 + [3] @l2 + [3]
> [2] @l1 + [0]
= [lcstable^#(@l1, @l2)]
[lcstable^#(@l1, @l2)] = [2] @l1 + [0]
>= [2] @l1 + [0]
= [lcstable#1^#(@l1, @l2)]
[lcstable#1^#(::(@x, @xs), @l2)] = [2] @xs + [4]
> [2] @xs + [0]
= [lcstable^#(@xs, @l2)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules {2,3}.
Here rules are labeled according to the (estimated) dependency
graph
1: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) :3
2: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :1
3: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :1
- The rules {2,3} have known complexity. These cover all
predecessors of {1}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules {1,2,3}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1} Weak SCC
|
`->2:{2,3} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, 3: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, 3: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
We apply the transformation 'usablerules' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
* Path 1:{3}->2:{4,5}->3:{7}->4:{8}->5:{9,11,10}: MAYBE
-----------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :3
3: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :4
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
4: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :5
5: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :6
6: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :7
7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) :8
8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :6
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {8} and add Pre({8}) = {7} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) }
Weak DPs:
{ newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :3
3: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :4
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
4: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :5
5: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :6
6: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :7
7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) :8
8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :6
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {7} and add Pre({7}) = {6} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y) }
Weak DPs:
{ newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :3
3: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :4
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
4: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :5
5: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :6
6: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :7
7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) :8
8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :6
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {4} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y) }
Weak DPs:
{ lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :3
3: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :4
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
4: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :6
5: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :7
6: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :5
7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) :8
8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :5
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y) }
Weak DPs:
{ lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :3
3: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :5
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
4: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :7
5: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :6
6: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :4
7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) :8
8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :4
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y) }
Weak DPs:
{ lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :4
3: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :7
4: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :5
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
5: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :6
6: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :3
7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) :8
8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :3
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {1} and add Pre({1}) = {} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y) }
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y) }
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
None of the processors succeeded.
Details of failed attempt(s):
-----------------------------
1) 'empty' failed due to the following reason:
Empty strict component of the problem is NOT empty.
2) 'With Problem ...' failed due to the following reason:
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Remaining Rules (B):
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs:
{ newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y) }
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
lcstable#2^#(lcstable(@xs, @l2), @l2, @x)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) }
Weak DPs: { lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^1)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) }
Weak DPs: { lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :2
2: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :1
3: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :3
2: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :1
3: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
No rule is usable.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'Small Polynomial Path Order (PS,1-bounded)'
to orient following rules strictly.
DPs:
{ 2: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 3: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
Sub-proof:
----------
The input was oriented with the instance of 'Small Polynomial Path
Order (PS,1-bounded)' as induced by the safe mapping
safe(#0) = {}, safe(#abs) = {}, safe(#neg) = {1}, safe(#pos) = {1},
safe(#s) = {1}, safe(#equal) = {}, safe(#eq) = {},
safe(#greater) = {}, safe(#compare) = {}, safe(#ckgt) = {},
safe(+) = {}, safe(#add) = {}, safe(firstline) = {},
safe(firstline#1) = {}, safe(::) = {1, 2}, safe(nil) = {},
safe(lcstable) = {}, safe(lcstable#1) = {}, safe(lcstable#2) = {},
safe(lcstable#3) = {}, safe(newline) = {}, safe(max) = {},
safe(max#1) = {}, safe(#false) = {}, safe(#true) = {},
safe(newline#1) = {}, safe(newline#2) = {}, safe(newline#3) = {},
safe(right) = {}, safe(newline#4) = {}, safe(newline#5) = {},
safe(newline#7) = {}, safe(newline#6) = {}, safe(right#1) = {},
safe(#pred) = {}, safe(#succ) = {}, safe(#and) = {},
safe(#EQ) = {}, safe(#GT) = {}, safe(#LT) = {}, safe(#abs^#) = {},
safe(#equal^#) = {}, safe(#eq^#) = {}, safe(#greater^#) = {},
safe(#ckgt^#) = {}, safe(#compare^#) = {}, safe(+^#) = {},
safe(#add^#) = {}, safe(firstline^#) = {},
safe(firstline#1^#) = {}, safe(lcs^#) = {1}, safe(lcs#1^#) = {},
safe(lcstable^#) = {}, safe(lcstable#1^#) = {}, safe(lcs#2^#) = {},
safe(lcs#3^#) = {}, safe(lcstable#2^#) = {},
safe(lcstable#3^#) = {}, safe(newline^#) = {},
safe(newline#1^#) = {}, safe(max^#) = {}, safe(max#1^#) = {},
safe(newline#2^#) = {}, safe(newline#3^#) = {},
safe(newline#4^#) = {}, safe(right^#) = {}, safe(right#1^#) = {},
safe(newline#5^#) = {}, safe(newline#6^#) = {},
safe(newline#7^#) = {}, safe(#and^#) = {}, safe(#pred^#) = {},
safe(#succ^#) = {}, safe(c_1) = {}, safe(c) = {}
and precedence
empty .
Following symbols are considered recursive:
{}
The recursion depth is 0.
Further, following argument filtering is employed:
pi(#0) = [], pi(#abs) = [], pi(#neg) = [], pi(#pos) = [],
pi(#s) = [], pi(#equal) = [], pi(#eq) = [], pi(#greater) = [],
pi(#compare) = [], pi(#ckgt) = [], pi(+) = [], pi(#add) = [],
pi(firstline) = [], pi(firstline#1) = [], pi(::) = [2],
pi(nil) = [], pi(lcstable) = [], pi(lcstable#1) = [],
pi(lcstable#2) = [], pi(lcstable#3) = [], pi(newline) = [],
pi(max) = [], pi(max#1) = [], pi(#false) = [], pi(#true) = [],
pi(newline#1) = [], pi(newline#2) = [], pi(newline#3) = [],
pi(right) = [], pi(newline#4) = [], pi(newline#5) = [],
pi(newline#7) = [], pi(newline#6) = [], pi(right#1) = [],
pi(#pred) = [], pi(#succ) = [], pi(#and) = [], pi(#EQ) = [],
pi(#GT) = [], pi(#LT) = [], pi(#abs^#) = [], pi(#equal^#) = [],
pi(#eq^#) = [], pi(#greater^#) = [], pi(#ckgt^#) = [],
pi(#compare^#) = [], pi(+^#) = [], pi(#add^#) = [],
pi(firstline^#) = [], pi(firstline#1^#) = [], pi(lcs^#) = [1, 2],
pi(lcs#1^#) = [], pi(lcstable^#) = 1, pi(lcstable#1^#) = 1,
pi(lcs#2^#) = [], pi(lcs#3^#) = [], pi(lcstable#2^#) = [],
pi(lcstable#3^#) = [], pi(newline^#) = [], pi(newline#1^#) = [],
pi(max^#) = [], pi(max#1^#) = [], pi(newline#2^#) = [],
pi(newline#3^#) = [], pi(newline#4^#) = [], pi(right^#) = [],
pi(right#1^#) = [], pi(newline#5^#) = [], pi(newline#6^#) = [],
pi(newline#7^#) = [], pi(#and^#) = [], pi(#pred^#) = [],
pi(#succ^#) = [], pi(c_1) = [], pi(c) = []
Usable defined function symbols are a subset of:
{}
For your convenience, here are the satisfied ordering constraints:
pi(lcs^#(@l1, @l2)) = lcs^#(@l2; @l1)
> @l1
= pi(lcstable^#(@l1, @l2))
pi(lcstable^#(@l1, @l2)) = @l1
>= @l1
= pi(lcstable#1^#(@l1, @l2))
pi(lcstable#1^#(::(@x, @xs), @l2)) = ::(; @xs)
> @xs
= pi(lcstable^#(@xs, @l2))
Processor 'Small Polynomial Path Order (PS,1-bounded)' induces the
complexity certificate YES(?,O(n^1)) on application of rules {2,3}.
Here rules are labeled according to the (estimated) dependency
graph
1: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) :3
2: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :1
3: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :1
- The rules {2,3} have known complexity. These cover all
predecessors of {1}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules {1,2,3}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1} Weak SCC
|
`->2:{2,3} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, 3: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, 3: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
We apply the transformation 'usablerules' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y) }
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
lcstable#2^#(lcstable(@xs, @l2), @l2, @x)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
MAYBE
None of the processors succeeded.
Details of failed attempt(s):
-----------------------------
1) 'empty' failed due to the following reason:
Empty strict component of the problem is NOT empty.
2) 'empty' failed due to the following reason:
Empty strict component of the problem is NOT empty.
Arrrr..
tct-popstar
YES(?,O(n^2))
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0()) }
Weak Trs:
{ #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We add following dependency tuples
Strict DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, +^#(@x, @y) -> #add^#(@x, @y)
, firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, firstline#1^#(nil()) -> c_10()
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, right^#(@l) -> right#1^#(@l)
, right#1^#(::(@x, @xs)) -> c_38()
, right#1^#(nil()) -> #abs^#(#0())
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, newline#6^#(@elem, @nl) -> c_37()
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) }
Weak DPs:
{ #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
and replace the set of basic marked basic terms accordingly.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, +^#(@x, @y) -> #add^#(@x, @y)
, firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, firstline#1^#(nil()) -> c_10()
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, right^#(@l) -> right#1^#(@l)
, right#1^#(::(@x, @xs)) -> c_38()
, right#1^#(nil()) -> #abs^#(#0())
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, newline#6^#(@elem, @nl) -> c_37()
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) }
Weak DPs:
{ #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the (estimated) dependency graph
1: #abs^#(#0()) -> c_1()
2: #abs^#(#neg(@x)) -> c_2()
3: #abs^#(#pos(@x)) -> c_3()
4: #abs^#(#s(@x)) -> c_4()
5: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :52
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :49
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :45
-->_1 #eq^#(nil(), nil()) -> c_55() :55
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :54
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :53
-->_1 #eq^#(#s(@x), #0()) -> c_50() :50
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :48
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :47
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :46
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :44
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :42
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :41
-->_1 #eq^#(#0(), #0()) -> c_40() :40
6: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :70
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :68
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :64
-->_2 #compare^#(#s(@x), #0()) -> c_66() :69
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_64() :67
-->_2 #compare^#(#pos(@x), #0()) -> c_63() :66
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_62() :65
-->_2 #compare^#(#neg(@x), #0()) -> c_60() :63
-->_2 #compare^#(#0(), #s(@y)) -> c_59() :62
-->_2 #compare^#(#0(), #pos(@y)) -> c_58() :61
-->_2 #compare^#(#0(), #neg(@y)) -> c_57() :60
-->_2 #compare^#(#0(), #0()) -> c_56() :59
-->_1 #ckgt^#(#LT()) -> c_70() :58
-->_1 #ckgt^#(#GT()) -> c_69() :57
-->_1 #ckgt^#(#EQ()) -> c_68() :56
7: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :75
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :74
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :73
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :72
-->_1 #add^#(#0(), @y) -> c_71() :71
8: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs)) :9
-->_1 firstline#1^#(nil()) -> c_10() :10
9: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
-->_2 firstline^#(@l) -> firstline#1^#(@l) :8
-->_1 #abs^#(#0()) -> c_1() :1
10: firstline#1^#(nil()) -> c_10()
11: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :13
-->_1 lcs#1^#(@m) -> lcs#2^#(@m) :12
12: lcs#1^#(@m) -> lcs#2^#(@m)
-->_1 lcs#2^#(nil()) -> #abs^#(#0()) :17
-->_1 lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1) :16
13: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :15
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :14
14: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :20
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :13
15: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :8
16: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
-->_1 lcs#3^#(nil()) -> #abs^#(#0()) :19
-->_1 lcs#3^#(::(@len, @_@1)) -> c_16() :18
17: lcs#2^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :1
18: lcs#3^#(::(@len, @_@1)) -> c_16()
19: lcs#3^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :1
20: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :21
-->_1 lcstable#3^#(nil(), @l2, @x) -> c_22() :22
21: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :23
22: lcstable#3^#(nil(), @l2, @x) -> c_22()
23: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :24
-->_1 newline#1^#(nil(), @lastline, @y) -> c_28() :25
24: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) :29
-->_1 newline#2^#(nil(), @x, @xs, @y) -> c_30() :30
25: newline#1^#(nil(), @lastline, @y) -> c_28()
26: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
-->_1 max#1^#(#true(), @a, @b) -> c_26() :28
-->_1 max#1^#(#false(), @a, @b) -> c_25() :27
-->_2 #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :6
27: max#1^#(#false(), @a, @b) -> c_25()
28: max#1^#(#true(), @a, @b) -> c_26()
29: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
-->_1 newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl)) :31
-->_2 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :23
30: newline#2^#(nil(), @x, @xs, @y) -> c_30()
31: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
-->_2 right^#(@l) -> right#1^#(@l) :33
-->_1 newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline')) :32
32: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
-->_1 newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y)) :36
-->_2 right^#(@l) -> right#1^#(@l) :33
33: right^#(@l) -> right#1^#(@l)
-->_1 right#1^#(nil()) -> #abs^#(#0()) :35
-->_1 right#1^#(::(@x, @xs)) -> c_38() :34
34: right#1^#(::(@x, @xs)) -> c_38()
35: right#1^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :1
36: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
-->_2 newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) :39
-->_2 newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal) :38
-->_1 newline#6^#(@elem, @nl) -> c_37() :37
-->_3 #equal^#(@x, @y) -> #eq^#(@x, @y) :5
37: newline#6^#(@elem, @nl) -> c_37()
38: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
-->_1 max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b)) :26
39: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :7
40: #eq^#(#0(), #0()) -> c_40()
41: #eq^#(#0(), #neg(@y)) -> c_41()
42: #eq^#(#0(), #pos(@y)) -> c_42()
43: #eq^#(#0(), #s(@y)) -> c_43()
44: #eq^#(#neg(@x), #0()) -> c_44()
45: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :52
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :49
-->_1 #eq^#(nil(), nil()) -> c_55() :55
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :54
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :53
-->_1 #eq^#(#s(@x), #0()) -> c_50() :50
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :48
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :47
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :46
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :45
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :44
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :42
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :41
-->_1 #eq^#(#0(), #0()) -> c_40() :40
46: #eq^#(#neg(@x), #pos(@y)) -> c_46()
47: #eq^#(#pos(@x), #0()) -> c_47()
48: #eq^#(#pos(@x), #neg(@y)) -> c_48()
49: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :52
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(nil(), nil()) -> c_55() :55
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :54
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :53
-->_1 #eq^#(#s(@x), #0()) -> c_50() :50
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :49
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :48
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :47
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :46
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :45
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :44
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :42
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :41
-->_1 #eq^#(#0(), #0()) -> c_40() :40
50: #eq^#(#s(@x), #0()) -> c_50()
51: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :52
-->_1 #eq^#(nil(), nil()) -> c_55() :55
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :54
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :53
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(#s(@x), #0()) -> c_50() :50
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :49
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :48
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :47
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :46
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :45
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :44
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :42
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :41
-->_1 #eq^#(#0(), #0()) -> c_40() :40
52: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_1 #and^#(#true(), #true()) -> c_87() :79
-->_1 #and^#(#true(), #false()) -> c_86() :78
-->_1 #and^#(#false(), #true()) -> c_85() :77
-->_1 #and^#(#false(), #false()) -> c_84() :76
-->_3 #eq^#(nil(), nil()) -> c_55() :55
-->_2 #eq^#(nil(), nil()) -> c_55() :55
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :54
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :54
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :53
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :53
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :52
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :52
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :51
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :51
-->_3 #eq^#(#s(@x), #0()) -> c_50() :50
-->_2 #eq^#(#s(@x), #0()) -> c_50() :50
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :49
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :49
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_48() :48
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_48() :48
-->_3 #eq^#(#pos(@x), #0()) -> c_47() :47
-->_2 #eq^#(#pos(@x), #0()) -> c_47() :47
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_46() :46
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_46() :46
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :45
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :45
-->_3 #eq^#(#neg(@x), #0()) -> c_44() :44
-->_2 #eq^#(#neg(@x), #0()) -> c_44() :44
-->_3 #eq^#(#0(), #s(@y)) -> c_43() :43
-->_2 #eq^#(#0(), #s(@y)) -> c_43() :43
-->_3 #eq^#(#0(), #pos(@y)) -> c_42() :42
-->_2 #eq^#(#0(), #pos(@y)) -> c_42() :42
-->_3 #eq^#(#0(), #neg(@y)) -> c_41() :41
-->_2 #eq^#(#0(), #neg(@y)) -> c_41() :41
-->_3 #eq^#(#0(), #0()) -> c_40() :40
-->_2 #eq^#(#0(), #0()) -> c_40() :40
53: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
54: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
55: #eq^#(nil(), nil()) -> c_55()
56: #ckgt^#(#EQ()) -> c_68()
57: #ckgt^#(#GT()) -> c_69()
58: #ckgt^#(#LT()) -> c_70()
59: #compare^#(#0(), #0()) -> c_56()
60: #compare^#(#0(), #neg(@y)) -> c_57()
61: #compare^#(#0(), #pos(@y)) -> c_58()
62: #compare^#(#0(), #s(@y)) -> c_59()
63: #compare^#(#neg(@x), #0()) -> c_60()
64: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :70
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :68
-->_1 #compare^#(#s(@x), #0()) -> c_66() :69
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :67
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :66
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :65
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :64
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :63
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :62
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :61
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :60
-->_1 #compare^#(#0(), #0()) -> c_56() :59
65: #compare^#(#neg(@x), #pos(@y)) -> c_62()
66: #compare^#(#pos(@x), #0()) -> c_63()
67: #compare^#(#pos(@x), #neg(@y)) -> c_64()
68: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :70
-->_1 #compare^#(#s(@x), #0()) -> c_66() :69
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :68
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :67
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :66
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :65
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :64
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :63
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :62
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :61
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :60
-->_1 #compare^#(#0(), #0()) -> c_56() :59
69: #compare^#(#s(@x), #0()) -> c_66()
70: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :70
-->_1 #compare^#(#s(@x), #0()) -> c_66() :69
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :68
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :67
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :66
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :65
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :64
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :63
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :62
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :61
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :60
-->_1 #compare^#(#0(), #0()) -> c_56() :59
71: #add^#(#0(), @y) -> c_71()
72: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
73: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :75
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :74
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
74: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
75: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :75
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :74
76: #and^#(#false(), #false()) -> c_84()
77: #and^#(#false(), #true()) -> c_85()
78: #and^#(#true(), #false()) -> c_86()
79: #and^#(#true(), #true()) -> c_87()
80: #pred^#(#0()) -> c_76()
81: #pred^#(#neg(#s(@x))) -> c_77()
82: #pred^#(#pos(#s(#0()))) -> c_78()
83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
84: #succ^#(#0()) -> c_80()
85: #succ^#(#neg(#s(#0()))) -> c_81()
86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
87: #succ^#(#pos(#s(@x))) -> c_83()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {18} and add Pre({18}) = {16} to the strict component.
- We remove {22} and add Pre({22}) = {20} to the strict component.
- We remove {25} and add Pre({25}) = {23} to the strict component.
- We remove {30} and add Pre({30}) = {24} to the strict component.
- We remove {37} and add Pre({37}) = {36} to the strict component.
- We remove {27} and add Pre({27}) = {26} to the strict component.
- We remove {28} and add Pre({28}) = {26} to the strict component.
- We remove {34} and add Pre({34}) = {33} to the strict component.
- We remove {10} and add Pre({10}) = {8} to the strict component.
- We remove {7} and add Pre({7}) = {39} to the strict component.
- We remove {6} and add Pre({6}) = {26} to the strict component.
- We remove {5} and add Pre({5}) = {36} to the strict component.
- We remove {4} and add Pre({4}) = {} to the strict component.
- We remove {3} and add Pre({3}) = {} to the strict component.
- We remove {2} and add Pre({2}) = {} to the strict component.
- We remove {1} and add Pre({1}) = {35,19,17,9} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, right^#(@l) -> right#1^#(@l)
, right#1^#(nil()) -> #abs^#(#0())
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, firstline#1^#(nil()) -> c_10()
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, right#1^#(::(@x, @xs)) -> c_38()
, newline#6^#(@elem, @nl) -> c_37()
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs)) :2
-->_1 firstline#1^#(nil()) -> c_10() :67
2: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
-->_1 #abs^#(#0()) -> c_1() :24
-->_2 firstline^#(@l) -> firstline#1^#(@l) :1
3: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :5
-->_1 lcs#1^#(@m) -> lcs#2^#(@m) :4
4: lcs#1^#(@m) -> lcs#2^#(@m)
-->_1 lcs#2^#(nil()) -> #abs^#(#0()) :9
-->_1 lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1) :8
5: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :7
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :6
6: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :11
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :5
7: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
8: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
-->_1 lcs#3^#(nil()) -> #abs^#(#0()) :10
-->_1 lcs#3^#(::(@len, @_@1)) -> c_16() :68
9: lcs#2^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :24
10: lcs#3^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :24
11: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :12
-->_1 lcstable#3^#(nil(), @l2, @x) -> c_22() :69
12: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :13
13: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :14
-->_1 newline#1^#(nil(), @lastline, @y) -> c_28() :70
14: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) :16
-->_1 newline#2^#(nil(), @x, @xs, @y) -> c_30() :73
15: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
-->_2 #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :45
-->_1 max#1^#(#true(), @a, @b) -> c_26() :72
-->_1 max#1^#(#false(), @a, @b) -> c_25() :71
16: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
-->_1 newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl)) :17
-->_2 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :13
17: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
-->_2 right^#(@l) -> right#1^#(@l) :19
-->_1 newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline')) :18
18: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
-->_1 newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y)) :21
-->_2 right^#(@l) -> right#1^#(@l) :19
19: right^#(@l) -> right#1^#(@l)
-->_1 right#1^#(nil()) -> #abs^#(#0()) :20
-->_1 right#1^#(::(@x, @xs)) -> c_38() :74
20: right#1^#(nil()) -> #abs^#(#0())
-->_1 #abs^#(#0()) -> c_1() :24
21: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
-->_3 #equal^#(@x, @y) -> #eq^#(@x, @y) :28
-->_2 newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) :23
-->_2 newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal) :22
-->_1 newline#6^#(@elem, @nl) -> c_37() :75
22: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
-->_1 max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b)) :15
23: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :61
24: #abs^#(#0()) -> c_1()
25: #abs^#(#neg(@x)) -> c_2()
26: #abs^#(#pos(@x)) -> c_3()
27: #abs^#(#s(@x)) -> c_4()
28: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :41
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :40
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :38
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :34
-->_1 #eq^#(nil(), nil()) -> c_55() :44
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :43
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :42
-->_1 #eq^#(#s(@x), #0()) -> c_50() :39
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :37
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :36
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :35
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :33
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :32
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :31
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :30
-->_1 #eq^#(#0(), #0()) -> c_40() :29
29: #eq^#(#0(), #0()) -> c_40()
30: #eq^#(#0(), #neg(@y)) -> c_41()
31: #eq^#(#0(), #pos(@y)) -> c_42()
32: #eq^#(#0(), #s(@y)) -> c_43()
33: #eq^#(#neg(@x), #0()) -> c_44()
34: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :41
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :40
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :38
-->_1 #eq^#(nil(), nil()) -> c_55() :44
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :43
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :42
-->_1 #eq^#(#s(@x), #0()) -> c_50() :39
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :37
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :36
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :35
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :34
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :33
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :32
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :31
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :30
-->_1 #eq^#(#0(), #0()) -> c_40() :29
35: #eq^#(#neg(@x), #pos(@y)) -> c_46()
36: #eq^#(#pos(@x), #0()) -> c_47()
37: #eq^#(#pos(@x), #neg(@y)) -> c_48()
38: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :41
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :40
-->_1 #eq^#(nil(), nil()) -> c_55() :44
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :43
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :42
-->_1 #eq^#(#s(@x), #0()) -> c_50() :39
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :38
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :37
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :36
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :35
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :34
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :33
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :32
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :31
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :30
-->_1 #eq^#(#0(), #0()) -> c_40() :29
39: #eq^#(#s(@x), #0()) -> c_50()
40: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :41
-->_1 #eq^#(nil(), nil()) -> c_55() :44
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :43
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :42
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :40
-->_1 #eq^#(#s(@x), #0()) -> c_50() :39
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :38
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :37
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :36
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :35
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :34
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :33
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :32
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :31
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :30
-->_1 #eq^#(#0(), #0()) -> c_40() :29
41: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_1 #and^#(#true(), #true()) -> c_87() :79
-->_1 #and^#(#true(), #false()) -> c_86() :78
-->_1 #and^#(#false(), #true()) -> c_85() :77
-->_1 #and^#(#false(), #false()) -> c_84() :76
-->_3 #eq^#(nil(), nil()) -> c_55() :44
-->_2 #eq^#(nil(), nil()) -> c_55() :44
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :43
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :43
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :42
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :42
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :41
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :41
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :40
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :40
-->_3 #eq^#(#s(@x), #0()) -> c_50() :39
-->_2 #eq^#(#s(@x), #0()) -> c_50() :39
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :38
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :38
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_48() :37
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_48() :37
-->_3 #eq^#(#pos(@x), #0()) -> c_47() :36
-->_2 #eq^#(#pos(@x), #0()) -> c_47() :36
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_46() :35
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_46() :35
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :34
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :34
-->_3 #eq^#(#neg(@x), #0()) -> c_44() :33
-->_2 #eq^#(#neg(@x), #0()) -> c_44() :33
-->_3 #eq^#(#0(), #s(@y)) -> c_43() :32
-->_2 #eq^#(#0(), #s(@y)) -> c_43() :32
-->_3 #eq^#(#0(), #pos(@y)) -> c_42() :31
-->_2 #eq^#(#0(), #pos(@y)) -> c_42() :31
-->_3 #eq^#(#0(), #neg(@y)) -> c_41() :30
-->_2 #eq^#(#0(), #neg(@y)) -> c_41() :30
-->_3 #eq^#(#0(), #0()) -> c_40() :29
-->_2 #eq^#(#0(), #0()) -> c_40() :29
42: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
43: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
44: #eq^#(nil(), nil()) -> c_55()
45: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :60
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :58
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :54
-->_2 #compare^#(#s(@x), #0()) -> c_66() :59
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_64() :57
-->_2 #compare^#(#pos(@x), #0()) -> c_63() :56
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_62() :55
-->_2 #compare^#(#neg(@x), #0()) -> c_60() :53
-->_2 #compare^#(#0(), #s(@y)) -> c_59() :52
-->_2 #compare^#(#0(), #pos(@y)) -> c_58() :51
-->_2 #compare^#(#0(), #neg(@y)) -> c_57() :50
-->_2 #compare^#(#0(), #0()) -> c_56() :49
-->_1 #ckgt^#(#LT()) -> c_70() :48
-->_1 #ckgt^#(#GT()) -> c_69() :47
-->_1 #ckgt^#(#EQ()) -> c_68() :46
46: #ckgt^#(#EQ()) -> c_68()
47: #ckgt^#(#GT()) -> c_69()
48: #ckgt^#(#LT()) -> c_70()
49: #compare^#(#0(), #0()) -> c_56()
50: #compare^#(#0(), #neg(@y)) -> c_57()
51: #compare^#(#0(), #pos(@y)) -> c_58()
52: #compare^#(#0(), #s(@y)) -> c_59()
53: #compare^#(#neg(@x), #0()) -> c_60()
54: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :60
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :58
-->_1 #compare^#(#s(@x), #0()) -> c_66() :59
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :57
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :56
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :55
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :54
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :53
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :52
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :51
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :50
-->_1 #compare^#(#0(), #0()) -> c_56() :49
55: #compare^#(#neg(@x), #pos(@y)) -> c_62()
56: #compare^#(#pos(@x), #0()) -> c_63()
57: #compare^#(#pos(@x), #neg(@y)) -> c_64()
58: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :60
-->_1 #compare^#(#s(@x), #0()) -> c_66() :59
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :58
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :57
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :56
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :55
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :54
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :53
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :52
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :51
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :50
-->_1 #compare^#(#0(), #0()) -> c_56() :49
59: #compare^#(#s(@x), #0()) -> c_66()
60: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :60
-->_1 #compare^#(#s(@x), #0()) -> c_66() :59
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :58
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :57
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :56
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :55
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :54
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :53
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :52
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :51
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :50
-->_1 #compare^#(#0(), #0()) -> c_56() :49
61: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :66
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :65
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :64
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :63
-->_1 #add^#(#0(), @y) -> c_71() :62
62: #add^#(#0(), @y) -> c_71()
63: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
64: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :66
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :65
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
65: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
66: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :66
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :65
67: firstline#1^#(nil()) -> c_10()
68: lcs#3^#(::(@len, @_@1)) -> c_16()
69: lcstable#3^#(nil(), @l2, @x) -> c_22()
70: newline#1^#(nil(), @lastline, @y) -> c_28()
71: max#1^#(#false(), @a, @b) -> c_25()
72: max#1^#(#true(), @a, @b) -> c_26()
73: newline#2^#(nil(), @x, @xs, @y) -> c_30()
74: right#1^#(::(@x, @xs)) -> c_38()
75: newline#6^#(@elem, @nl) -> c_37()
76: #and^#(#false(), #false()) -> c_84()
77: #and^#(#false(), #true()) -> c_85()
78: #and^#(#true(), #false()) -> c_86()
79: #and^#(#true(), #true()) -> c_87()
80: #pred^#(#0()) -> c_76()
81: #pred^#(#neg(#s(@x))) -> c_77()
82: #pred^#(#pos(#s(#0()))) -> c_78()
83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
84: #succ^#(#0()) -> c_80()
85: #succ^#(#neg(#s(#0()))) -> c_81()
86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
87: #succ^#(#pos(#s(@x))) -> c_83()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {10} and add Pre({10}) = {8} to the strict component.
- We remove {9} and add Pre({9}) = {4} to the strict component.
- We remove {15} and add Pre({15}) = {22} to the strict component.
- We remove {23} and add Pre({23}) = {21} to the strict component.
- We remove {20} and add Pre({20}) = {19} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, right^#(@l) -> right#1^#(@l)
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, firstline#1^#(nil()) -> c_10()
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, right#1^#(::(@x, @xs)) -> c_38()
, right#1^#(nil()) -> #abs^#(#0())
, newline#6^#(@elem, @nl) -> c_37()
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs)) :2
-->_1 firstline#1^#(nil()) -> c_10() :62
2: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
-->_1 #abs^#(#0()) -> c_1() :19
-->_2 firstline^#(@l) -> firstline#1^#(@l) :1
3: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :5
-->_1 lcs#1^#(@m) -> lcs#2^#(@m) :4
4: lcs#1^#(@m) -> lcs#2^#(@m)
-->_1 lcs#2^#(nil()) -> #abs^#(#0()) :63
-->_1 lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1) :8
5: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :7
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :6
6: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :9
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :5
7: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
8: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
-->_1 lcs#3^#(nil()) -> #abs^#(#0()) :65
-->_1 lcs#3^#(::(@len, @_@1)) -> c_16() :64
9: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :10
-->_1 lcstable#3^#(nil(), @l2, @x) -> c_22() :66
10: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :11
11: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :12
-->_1 newline#1^#(nil(), @lastline, @y) -> c_28() :67
12: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) :13
-->_1 newline#2^#(nil(), @x, @xs, @y) -> c_30() :71
13: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
-->_1 newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl)) :14
-->_2 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :11
14: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
-->_2 right^#(@l) -> right#1^#(@l) :16
-->_1 newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline')) :15
15: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
-->_1 newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y)) :17
-->_2 right^#(@l) -> right#1^#(@l) :16
16: right^#(@l) -> right#1^#(@l)
-->_1 right#1^#(nil()) -> #abs^#(#0()) :73
-->_1 right#1^#(::(@x, @xs)) -> c_38() :72
17: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
-->_2 newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) :75
-->_3 #equal^#(@x, @y) -> #eq^#(@x, @y) :23
-->_2 newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal) :18
-->_1 newline#6^#(@elem, @nl) -> c_37() :74
18: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
-->_1 max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b)) :68
19: #abs^#(#0()) -> c_1()
20: #abs^#(#neg(@x)) -> c_2()
21: #abs^#(#pos(@x)) -> c_3()
22: #abs^#(#s(@x)) -> c_4()
23: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :36
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :35
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(nil(), nil()) -> c_55() :39
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :38
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :37
-->_1 #eq^#(#s(@x), #0()) -> c_50() :34
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :32
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :31
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :30
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :28
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :27
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :26
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :25
-->_1 #eq^#(#0(), #0()) -> c_40() :24
24: #eq^#(#0(), #0()) -> c_40()
25: #eq^#(#0(), #neg(@y)) -> c_41()
26: #eq^#(#0(), #pos(@y)) -> c_42()
27: #eq^#(#0(), #s(@y)) -> c_43()
28: #eq^#(#neg(@x), #0()) -> c_44()
29: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :36
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :35
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(nil(), nil()) -> c_55() :39
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :38
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :37
-->_1 #eq^#(#s(@x), #0()) -> c_50() :34
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :32
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :31
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :30
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :28
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :27
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :26
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :25
-->_1 #eq^#(#0(), #0()) -> c_40() :24
30: #eq^#(#neg(@x), #pos(@y)) -> c_46()
31: #eq^#(#pos(@x), #0()) -> c_47()
32: #eq^#(#pos(@x), #neg(@y)) -> c_48()
33: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :36
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :35
-->_1 #eq^#(nil(), nil()) -> c_55() :39
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :38
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :37
-->_1 #eq^#(#s(@x), #0()) -> c_50() :34
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :32
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :31
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :30
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :28
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :27
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :26
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :25
-->_1 #eq^#(#0(), #0()) -> c_40() :24
34: #eq^#(#s(@x), #0()) -> c_50()
35: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :36
-->_1 #eq^#(nil(), nil()) -> c_55() :39
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :38
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :37
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :35
-->_1 #eq^#(#s(@x), #0()) -> c_50() :34
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :32
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :31
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :30
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :28
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :27
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :26
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :25
-->_1 #eq^#(#0(), #0()) -> c_40() :24
36: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_1 #and^#(#true(), #true()) -> c_87() :79
-->_1 #and^#(#true(), #false()) -> c_86() :78
-->_1 #and^#(#false(), #true()) -> c_85() :77
-->_1 #and^#(#false(), #false()) -> c_84() :76
-->_3 #eq^#(nil(), nil()) -> c_55() :39
-->_2 #eq^#(nil(), nil()) -> c_55() :39
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :38
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :38
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :37
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :37
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :36
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :36
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :35
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :35
-->_3 #eq^#(#s(@x), #0()) -> c_50() :34
-->_2 #eq^#(#s(@x), #0()) -> c_50() :34
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :33
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :33
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_48() :32
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_48() :32
-->_3 #eq^#(#pos(@x), #0()) -> c_47() :31
-->_2 #eq^#(#pos(@x), #0()) -> c_47() :31
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_46() :30
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_46() :30
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :29
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :29
-->_3 #eq^#(#neg(@x), #0()) -> c_44() :28
-->_2 #eq^#(#neg(@x), #0()) -> c_44() :28
-->_3 #eq^#(#0(), #s(@y)) -> c_43() :27
-->_2 #eq^#(#0(), #s(@y)) -> c_43() :27
-->_3 #eq^#(#0(), #pos(@y)) -> c_42() :26
-->_2 #eq^#(#0(), #pos(@y)) -> c_42() :26
-->_3 #eq^#(#0(), #neg(@y)) -> c_41() :25
-->_2 #eq^#(#0(), #neg(@y)) -> c_41() :25
-->_3 #eq^#(#0(), #0()) -> c_40() :24
-->_2 #eq^#(#0(), #0()) -> c_40() :24
37: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
38: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
39: #eq^#(nil(), nil()) -> c_55()
40: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :55
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :53
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :49
-->_2 #compare^#(#s(@x), #0()) -> c_66() :54
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_64() :52
-->_2 #compare^#(#pos(@x), #0()) -> c_63() :51
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_62() :50
-->_2 #compare^#(#neg(@x), #0()) -> c_60() :48
-->_2 #compare^#(#0(), #s(@y)) -> c_59() :47
-->_2 #compare^#(#0(), #pos(@y)) -> c_58() :46
-->_2 #compare^#(#0(), #neg(@y)) -> c_57() :45
-->_2 #compare^#(#0(), #0()) -> c_56() :44
-->_1 #ckgt^#(#LT()) -> c_70() :43
-->_1 #ckgt^#(#GT()) -> c_69() :42
-->_1 #ckgt^#(#EQ()) -> c_68() :41
41: #ckgt^#(#EQ()) -> c_68()
42: #ckgt^#(#GT()) -> c_69()
43: #ckgt^#(#LT()) -> c_70()
44: #compare^#(#0(), #0()) -> c_56()
45: #compare^#(#0(), #neg(@y)) -> c_57()
46: #compare^#(#0(), #pos(@y)) -> c_58()
47: #compare^#(#0(), #s(@y)) -> c_59()
48: #compare^#(#neg(@x), #0()) -> c_60()
49: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :55
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :53
-->_1 #compare^#(#s(@x), #0()) -> c_66() :54
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :52
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :51
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :50
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :49
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :48
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :47
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :46
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :45
-->_1 #compare^#(#0(), #0()) -> c_56() :44
50: #compare^#(#neg(@x), #pos(@y)) -> c_62()
51: #compare^#(#pos(@x), #0()) -> c_63()
52: #compare^#(#pos(@x), #neg(@y)) -> c_64()
53: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :55
-->_1 #compare^#(#s(@x), #0()) -> c_66() :54
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :53
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :52
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :51
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :50
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :49
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :48
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :47
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :46
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :45
-->_1 #compare^#(#0(), #0()) -> c_56() :44
54: #compare^#(#s(@x), #0()) -> c_66()
55: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :55
-->_1 #compare^#(#s(@x), #0()) -> c_66() :54
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :53
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :52
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :51
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :50
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :49
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :48
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :47
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :46
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :45
-->_1 #compare^#(#0(), #0()) -> c_56() :44
56: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :61
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :60
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :59
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :58
-->_1 #add^#(#0(), @y) -> c_71() :57
57: #add^#(#0(), @y) -> c_71()
58: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
59: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :61
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :60
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
60: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
61: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :61
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :60
62: firstline#1^#(nil()) -> c_10()
63: lcs#2^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :19
64: lcs#3^#(::(@len, @_@1)) -> c_16()
65: lcs#3^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :19
66: lcstable#3^#(nil(), @l2, @x) -> c_22()
67: newline#1^#(nil(), @lastline, @y) -> c_28()
68: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
-->_1 max#1^#(#true(), @a, @b) -> c_26() :70
-->_1 max#1^#(#false(), @a, @b) -> c_25() :69
-->_2 #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :40
69: max#1^#(#false(), @a, @b) -> c_25()
70: max#1^#(#true(), @a, @b) -> c_26()
71: newline#2^#(nil(), @x, @xs, @y) -> c_30()
72: right#1^#(::(@x, @xs)) -> c_38()
73: right#1^#(nil()) -> #abs^#(#0())
-->_1 #abs^#(#0()) -> c_1() :19
74: newline#6^#(@elem, @nl) -> c_37()
75: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :56
76: #and^#(#false(), #false()) -> c_84()
77: #and^#(#false(), #true()) -> c_85()
78: #and^#(#true(), #false()) -> c_86()
79: #and^#(#true(), #true()) -> c_87()
80: #pred^#(#0()) -> c_76()
81: #pred^#(#neg(#s(@x))) -> c_77()
82: #pred^#(#pos(#s(#0()))) -> c_78()
83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
84: #succ^#(#0()) -> c_80()
85: #succ^#(#neg(#s(#0()))) -> c_81()
86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
87: #succ^#(#pos(#s(@x))) -> c_83()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {8} and add Pre({8}) = {4} to the strict component.
- We remove {18} and add Pre({18}) = {17} to the strict component.
- We remove {16} and add Pre({16}) = {15,14} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y)) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, firstline#1^#(nil()) -> c_10()
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, right^#(@l) -> right#1^#(@l)
, right#1^#(::(@x, @xs)) -> c_38()
, right#1^#(nil()) -> #abs^#(#0())
, newline#6^#(@elem, @nl) -> c_37()
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs)) :2
-->_1 firstline#1^#(nil()) -> c_10() :59
2: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
-->_1 #abs^#(#0()) -> c_1() :16
-->_2 firstline^#(@l) -> firstline#1^#(@l) :1
3: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :5
-->_1 lcs#1^#(@m) -> lcs#2^#(@m) :4
4: lcs#1^#(@m) -> lcs#2^#(@m)
-->_1 lcs#2^#(nil()) -> #abs^#(#0()) :61
-->_1 lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1) :60
5: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :7
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :6
6: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :8
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :5
7: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
8: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :9
-->_1 lcstable#3^#(nil(), @l2, @x) -> c_22() :64
9: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :10
10: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :11
-->_1 newline#1^#(nil(), @lastline, @y) -> c_28() :65
11: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) :12
-->_1 newline#2^#(nil(), @x, @xs, @y) -> c_30() :69
12: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
-->_1 newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl)) :13
-->_2 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :10
13: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
-->_2 right^#(@l) -> right#1^#(@l) :70
-->_1 newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline')) :14
14: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
-->_2 right^#(@l) -> right#1^#(@l) :70
-->_1 newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y)) :15
15: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
-->_2 newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) :75
-->_2 newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal) :74
-->_3 #equal^#(@x, @y) -> #eq^#(@x, @y) :20
-->_1 newline#6^#(@elem, @nl) -> c_37() :73
16: #abs^#(#0()) -> c_1()
17: #abs^#(#neg(@x)) -> c_2()
18: #abs^#(#pos(@x)) -> c_3()
19: #abs^#(#s(@x)) -> c_4()
20: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :33
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :32
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(nil(), nil()) -> c_55() :36
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :35
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :34
-->_1 #eq^#(#s(@x), #0()) -> c_50() :31
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :27
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :25
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :24
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :23
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :22
-->_1 #eq^#(#0(), #0()) -> c_40() :21
21: #eq^#(#0(), #0()) -> c_40()
22: #eq^#(#0(), #neg(@y)) -> c_41()
23: #eq^#(#0(), #pos(@y)) -> c_42()
24: #eq^#(#0(), #s(@y)) -> c_43()
25: #eq^#(#neg(@x), #0()) -> c_44()
26: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :33
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :32
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(nil(), nil()) -> c_55() :36
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :35
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :34
-->_1 #eq^#(#s(@x), #0()) -> c_50() :31
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :27
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :25
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :24
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :23
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :22
-->_1 #eq^#(#0(), #0()) -> c_40() :21
27: #eq^#(#neg(@x), #pos(@y)) -> c_46()
28: #eq^#(#pos(@x), #0()) -> c_47()
29: #eq^#(#pos(@x), #neg(@y)) -> c_48()
30: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :33
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :32
-->_1 #eq^#(nil(), nil()) -> c_55() :36
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :35
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :34
-->_1 #eq^#(#s(@x), #0()) -> c_50() :31
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :27
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :25
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :24
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :23
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :22
-->_1 #eq^#(#0(), #0()) -> c_40() :21
31: #eq^#(#s(@x), #0()) -> c_50()
32: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :33
-->_1 #eq^#(nil(), nil()) -> c_55() :36
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :35
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :34
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :32
-->_1 #eq^#(#s(@x), #0()) -> c_50() :31
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :29
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :28
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :27
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :25
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :24
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :23
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :22
-->_1 #eq^#(#0(), #0()) -> c_40() :21
33: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_1 #and^#(#true(), #true()) -> c_87() :79
-->_1 #and^#(#true(), #false()) -> c_86() :78
-->_1 #and^#(#false(), #true()) -> c_85() :77
-->_1 #and^#(#false(), #false()) -> c_84() :76
-->_3 #eq^#(nil(), nil()) -> c_55() :36
-->_2 #eq^#(nil(), nil()) -> c_55() :36
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :35
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :35
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :34
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :34
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :33
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :33
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :32
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :32
-->_3 #eq^#(#s(@x), #0()) -> c_50() :31
-->_2 #eq^#(#s(@x), #0()) -> c_50() :31
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :30
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_48() :29
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_48() :29
-->_3 #eq^#(#pos(@x), #0()) -> c_47() :28
-->_2 #eq^#(#pos(@x), #0()) -> c_47() :28
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_46() :27
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_46() :27
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :26
-->_3 #eq^#(#neg(@x), #0()) -> c_44() :25
-->_2 #eq^#(#neg(@x), #0()) -> c_44() :25
-->_3 #eq^#(#0(), #s(@y)) -> c_43() :24
-->_2 #eq^#(#0(), #s(@y)) -> c_43() :24
-->_3 #eq^#(#0(), #pos(@y)) -> c_42() :23
-->_2 #eq^#(#0(), #pos(@y)) -> c_42() :23
-->_3 #eq^#(#0(), #neg(@y)) -> c_41() :22
-->_2 #eq^#(#0(), #neg(@y)) -> c_41() :22
-->_3 #eq^#(#0(), #0()) -> c_40() :21
-->_2 #eq^#(#0(), #0()) -> c_40() :21
34: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
35: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
36: #eq^#(nil(), nil()) -> c_55()
37: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :52
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :50
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :46
-->_2 #compare^#(#s(@x), #0()) -> c_66() :51
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_64() :49
-->_2 #compare^#(#pos(@x), #0()) -> c_63() :48
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_62() :47
-->_2 #compare^#(#neg(@x), #0()) -> c_60() :45
-->_2 #compare^#(#0(), #s(@y)) -> c_59() :44
-->_2 #compare^#(#0(), #pos(@y)) -> c_58() :43
-->_2 #compare^#(#0(), #neg(@y)) -> c_57() :42
-->_2 #compare^#(#0(), #0()) -> c_56() :41
-->_1 #ckgt^#(#LT()) -> c_70() :40
-->_1 #ckgt^#(#GT()) -> c_69() :39
-->_1 #ckgt^#(#EQ()) -> c_68() :38
38: #ckgt^#(#EQ()) -> c_68()
39: #ckgt^#(#GT()) -> c_69()
40: #ckgt^#(#LT()) -> c_70()
41: #compare^#(#0(), #0()) -> c_56()
42: #compare^#(#0(), #neg(@y)) -> c_57()
43: #compare^#(#0(), #pos(@y)) -> c_58()
44: #compare^#(#0(), #s(@y)) -> c_59()
45: #compare^#(#neg(@x), #0()) -> c_60()
46: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :52
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :50
-->_1 #compare^#(#s(@x), #0()) -> c_66() :51
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :49
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :48
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :47
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :46
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :45
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :44
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :43
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :42
-->_1 #compare^#(#0(), #0()) -> c_56() :41
47: #compare^#(#neg(@x), #pos(@y)) -> c_62()
48: #compare^#(#pos(@x), #0()) -> c_63()
49: #compare^#(#pos(@x), #neg(@y)) -> c_64()
50: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :52
-->_1 #compare^#(#s(@x), #0()) -> c_66() :51
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :50
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :49
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :48
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :47
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :46
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :45
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :44
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :43
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :42
-->_1 #compare^#(#0(), #0()) -> c_56() :41
51: #compare^#(#s(@x), #0()) -> c_66()
52: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :52
-->_1 #compare^#(#s(@x), #0()) -> c_66() :51
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :50
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :49
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :48
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :47
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :46
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :45
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :44
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :43
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :42
-->_1 #compare^#(#0(), #0()) -> c_56() :41
53: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :58
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :57
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :56
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :55
-->_1 #add^#(#0(), @y) -> c_71() :54
54: #add^#(#0(), @y) -> c_71()
55: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
56: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :58
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :57
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
57: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
58: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :58
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :57
59: firstline#1^#(nil()) -> c_10()
60: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
-->_1 lcs#3^#(nil()) -> #abs^#(#0()) :63
-->_1 lcs#3^#(::(@len, @_@1)) -> c_16() :62
61: lcs#2^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :16
62: lcs#3^#(::(@len, @_@1)) -> c_16()
63: lcs#3^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :16
64: lcstable#3^#(nil(), @l2, @x) -> c_22()
65: newline#1^#(nil(), @lastline, @y) -> c_28()
66: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
-->_1 max#1^#(#true(), @a, @b) -> c_26() :68
-->_1 max#1^#(#false(), @a, @b) -> c_25() :67
-->_2 #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :37
67: max#1^#(#false(), @a, @b) -> c_25()
68: max#1^#(#true(), @a, @b) -> c_26()
69: newline#2^#(nil(), @x, @xs, @y) -> c_30()
70: right^#(@l) -> right#1^#(@l)
-->_1 right#1^#(nil()) -> #abs^#(#0()) :72
-->_1 right#1^#(::(@x, @xs)) -> c_38() :71
71: right#1^#(::(@x, @xs)) -> c_38()
72: right#1^#(nil()) -> #abs^#(#0())
-->_1 #abs^#(#0()) -> c_1() :16
73: newline#6^#(@elem, @nl) -> c_37()
74: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
-->_1 max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b)) :66
75: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :53
76: #and^#(#false(), #false()) -> c_84()
77: #and^#(#false(), #true()) -> c_85()
78: #and^#(#true(), #false()) -> c_86()
79: #and^#(#true(), #true()) -> c_87()
80: #pred^#(#0()) -> c_76()
81: #pred^#(#neg(#s(@x))) -> c_77()
82: #pred^#(#pos(#s(#0()))) -> c_78()
83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
84: #succ^#(#0()) -> c_80()
85: #succ^#(#neg(#s(#0()))) -> c_81()
86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
87: #succ^#(#pos(#s(@x))) -> c_83()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
- We remove {15} and add Pre({15}) = {14} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline')) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, firstline#1^#(nil()) -> c_10()
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, right^#(@l) -> right#1^#(@l)
, right#1^#(::(@x, @xs)) -> c_38()
, right#1^#(nil()) -> #abs^#(#0())
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, newline#6^#(@elem, @nl) -> c_37()
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs)) :2
-->_1 firstline#1^#(nil()) -> c_10() :57
2: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
-->_1 #abs^#(#0()) -> c_1() :14
-->_2 firstline^#(@l) -> firstline#1^#(@l) :1
3: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
-->_1 lcs#1^#(@m) -> lcs#2^#(@m) :58
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
4: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :5
5: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :7
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
7: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :8
-->_1 lcstable#3^#(nil(), @l2, @x) -> c_22() :63
8: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :9
9: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :10
-->_1 newline#1^#(nil(), @lastline, @y) -> c_28() :64
10: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) :11
-->_1 newline#2^#(nil(), @x, @xs, @y) -> c_30() :68
11: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
-->_1 newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl)) :12
-->_2 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :9
12: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
-->_2 right^#(@l) -> right#1^#(@l) :69
-->_1 newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline')) :13
13: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
-->_1 newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y)) :72
-->_2 right^#(@l) -> right#1^#(@l) :69
14: #abs^#(#0()) -> c_1()
15: #abs^#(#neg(@x)) -> c_2()
16: #abs^#(#pos(@x)) -> c_3()
17: #abs^#(#s(@x)) -> c_4()
18: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :31
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :28
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(nil(), nil()) -> c_55() :34
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :33
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :32
-->_1 #eq^#(#s(@x), #0()) -> c_50() :29
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :27
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :26
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :25
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :23
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :22
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :21
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :20
-->_1 #eq^#(#0(), #0()) -> c_40() :19
19: #eq^#(#0(), #0()) -> c_40()
20: #eq^#(#0(), #neg(@y)) -> c_41()
21: #eq^#(#0(), #pos(@y)) -> c_42()
22: #eq^#(#0(), #s(@y)) -> c_43()
23: #eq^#(#neg(@x), #0()) -> c_44()
24: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :31
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :28
-->_1 #eq^#(nil(), nil()) -> c_55() :34
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :33
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :32
-->_1 #eq^#(#s(@x), #0()) -> c_50() :29
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :27
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :26
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :25
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :23
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :22
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :21
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :20
-->_1 #eq^#(#0(), #0()) -> c_40() :19
25: #eq^#(#neg(@x), #pos(@y)) -> c_46()
26: #eq^#(#pos(@x), #0()) -> c_47()
27: #eq^#(#pos(@x), #neg(@y)) -> c_48()
28: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :31
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(nil(), nil()) -> c_55() :34
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :33
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :32
-->_1 #eq^#(#s(@x), #0()) -> c_50() :29
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :28
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :27
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :26
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :25
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :23
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :22
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :21
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :20
-->_1 #eq^#(#0(), #0()) -> c_40() :19
29: #eq^#(#s(@x), #0()) -> c_50()
30: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :31
-->_1 #eq^#(nil(), nil()) -> c_55() :34
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :33
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :32
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :30
-->_1 #eq^#(#s(@x), #0()) -> c_50() :29
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :28
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :27
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :26
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :25
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :24
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :23
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :22
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :21
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :20
-->_1 #eq^#(#0(), #0()) -> c_40() :19
31: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_1 #and^#(#true(), #true()) -> c_87() :79
-->_1 #and^#(#true(), #false()) -> c_86() :78
-->_1 #and^#(#false(), #true()) -> c_85() :77
-->_1 #and^#(#false(), #false()) -> c_84() :76
-->_3 #eq^#(nil(), nil()) -> c_55() :34
-->_2 #eq^#(nil(), nil()) -> c_55() :34
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :33
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :33
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :32
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :32
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :31
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :31
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :30
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :30
-->_3 #eq^#(#s(@x), #0()) -> c_50() :29
-->_2 #eq^#(#s(@x), #0()) -> c_50() :29
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :28
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :28
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_48() :27
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_48() :27
-->_3 #eq^#(#pos(@x), #0()) -> c_47() :26
-->_2 #eq^#(#pos(@x), #0()) -> c_47() :26
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_46() :25
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_46() :25
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :24
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :24
-->_3 #eq^#(#neg(@x), #0()) -> c_44() :23
-->_2 #eq^#(#neg(@x), #0()) -> c_44() :23
-->_3 #eq^#(#0(), #s(@y)) -> c_43() :22
-->_2 #eq^#(#0(), #s(@y)) -> c_43() :22
-->_3 #eq^#(#0(), #pos(@y)) -> c_42() :21
-->_2 #eq^#(#0(), #pos(@y)) -> c_42() :21
-->_3 #eq^#(#0(), #neg(@y)) -> c_41() :20
-->_2 #eq^#(#0(), #neg(@y)) -> c_41() :20
-->_3 #eq^#(#0(), #0()) -> c_40() :19
-->_2 #eq^#(#0(), #0()) -> c_40() :19
32: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
33: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
34: #eq^#(nil(), nil()) -> c_55()
35: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :50
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :48
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :44
-->_2 #compare^#(#s(@x), #0()) -> c_66() :49
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_64() :47
-->_2 #compare^#(#pos(@x), #0()) -> c_63() :46
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_62() :45
-->_2 #compare^#(#neg(@x), #0()) -> c_60() :43
-->_2 #compare^#(#0(), #s(@y)) -> c_59() :42
-->_2 #compare^#(#0(), #pos(@y)) -> c_58() :41
-->_2 #compare^#(#0(), #neg(@y)) -> c_57() :40
-->_2 #compare^#(#0(), #0()) -> c_56() :39
-->_1 #ckgt^#(#LT()) -> c_70() :38
-->_1 #ckgt^#(#GT()) -> c_69() :37
-->_1 #ckgt^#(#EQ()) -> c_68() :36
36: #ckgt^#(#EQ()) -> c_68()
37: #ckgt^#(#GT()) -> c_69()
38: #ckgt^#(#LT()) -> c_70()
39: #compare^#(#0(), #0()) -> c_56()
40: #compare^#(#0(), #neg(@y)) -> c_57()
41: #compare^#(#0(), #pos(@y)) -> c_58()
42: #compare^#(#0(), #s(@y)) -> c_59()
43: #compare^#(#neg(@x), #0()) -> c_60()
44: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :50
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :48
-->_1 #compare^#(#s(@x), #0()) -> c_66() :49
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :47
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :46
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :45
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :44
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :43
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :42
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :41
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :40
-->_1 #compare^#(#0(), #0()) -> c_56() :39
45: #compare^#(#neg(@x), #pos(@y)) -> c_62()
46: #compare^#(#pos(@x), #0()) -> c_63()
47: #compare^#(#pos(@x), #neg(@y)) -> c_64()
48: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :50
-->_1 #compare^#(#s(@x), #0()) -> c_66() :49
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :48
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :47
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :46
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :45
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :44
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :43
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :42
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :41
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :40
-->_1 #compare^#(#0(), #0()) -> c_56() :39
49: #compare^#(#s(@x), #0()) -> c_66()
50: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :50
-->_1 #compare^#(#s(@x), #0()) -> c_66() :49
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :48
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :47
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :46
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :45
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :44
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :43
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :42
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :41
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :40
-->_1 #compare^#(#0(), #0()) -> c_56() :39
51: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :56
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :55
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :54
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :53
-->_1 #add^#(#0(), @y) -> c_71() :52
52: #add^#(#0(), @y) -> c_71()
53: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
54: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :56
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :55
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
55: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
56: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :56
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :55
57: firstline#1^#(nil()) -> c_10()
58: lcs#1^#(@m) -> lcs#2^#(@m)
-->_1 lcs#2^#(nil()) -> #abs^#(#0()) :60
-->_1 lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1) :59
59: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
-->_1 lcs#3^#(nil()) -> #abs^#(#0()) :62
-->_1 lcs#3^#(::(@len, @_@1)) -> c_16() :61
60: lcs#2^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :14
61: lcs#3^#(::(@len, @_@1)) -> c_16()
62: lcs#3^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :14
63: lcstable#3^#(nil(), @l2, @x) -> c_22()
64: newline#1^#(nil(), @lastline, @y) -> c_28()
65: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
-->_1 max#1^#(#true(), @a, @b) -> c_26() :67
-->_1 max#1^#(#false(), @a, @b) -> c_25() :66
-->_2 #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :35
66: max#1^#(#false(), @a, @b) -> c_25()
67: max#1^#(#true(), @a, @b) -> c_26()
68: newline#2^#(nil(), @x, @xs, @y) -> c_30()
69: right^#(@l) -> right#1^#(@l)
-->_1 right#1^#(nil()) -> #abs^#(#0()) :71
-->_1 right#1^#(::(@x, @xs)) -> c_38() :70
70: right#1^#(::(@x, @xs)) -> c_38()
71: right#1^#(nil()) -> #abs^#(#0())
-->_1 #abs^#(#0()) -> c_1() :14
72: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
-->_2 newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) :75
-->_2 newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal) :74
-->_1 newline#6^#(@elem, @nl) -> c_37() :73
-->_3 #equal^#(@x, @y) -> #eq^#(@x, @y) :18
73: newline#6^#(@elem, @nl) -> c_37()
74: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
-->_1 max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b)) :65
75: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :51
76: #and^#(#false(), #false()) -> c_84()
77: #and^#(#false(), #true()) -> c_85()
78: #and^#(#true(), #false()) -> c_86()
79: #and^#(#true(), #true()) -> c_87()
80: #pred^#(#0()) -> c_76()
81: #pred^#(#neg(#s(@x))) -> c_77()
82: #pred^#(#pos(#s(#0()))) -> c_78()
83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
84: #succ^#(#0()) -> c_80()
85: #succ^#(#neg(#s(#0()))) -> c_81()
86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
87: #succ^#(#pos(#s(@x))) -> c_83()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {13} and add Pre({13}) = {12} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl)) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, firstline#1^#(nil()) -> c_10()
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, right^#(@l) -> right#1^#(@l)
, right#1^#(::(@x, @xs)) -> c_38()
, right#1^#(nil()) -> #abs^#(#0())
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, newline#6^#(@elem, @nl) -> c_37()
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs)) :2
-->_1 firstline#1^#(nil()) -> c_10() :56
2: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
-->_1 #abs^#(#0()) -> c_1() :13
-->_2 firstline^#(@l) -> firstline#1^#(@l) :1
3: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
-->_1 lcs#1^#(@m) -> lcs#2^#(@m) :57
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
4: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :5
5: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :7
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
7: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :8
-->_1 lcstable#3^#(nil(), @l2, @x) -> c_22() :62
8: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :9
9: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :10
-->_1 newline#1^#(nil(), @lastline, @y) -> c_28() :63
10: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) :11
-->_1 newline#2^#(nil(), @x, @xs, @y) -> c_30() :67
11: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
-->_1 newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl)) :12
-->_2 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :9
12: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
-->_2 right^#(@l) -> right#1^#(@l) :69
-->_1 newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline')) :68
13: #abs^#(#0()) -> c_1()
14: #abs^#(#neg(@x)) -> c_2()
15: #abs^#(#pos(@x)) -> c_3()
16: #abs^#(#s(@x)) -> c_4()
17: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :30
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(nil(), nil()) -> c_55() :33
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :32
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :31
-->_1 #eq^#(#s(@x), #0()) -> c_50() :28
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :26
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :25
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :24
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :22
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :21
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :20
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :19
-->_1 #eq^#(#0(), #0()) -> c_40() :18
18: #eq^#(#0(), #0()) -> c_40()
19: #eq^#(#0(), #neg(@y)) -> c_41()
20: #eq^#(#0(), #pos(@y)) -> c_42()
21: #eq^#(#0(), #s(@y)) -> c_43()
22: #eq^#(#neg(@x), #0()) -> c_44()
23: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :30
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(nil(), nil()) -> c_55() :33
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :32
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :31
-->_1 #eq^#(#s(@x), #0()) -> c_50() :28
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :26
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :25
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :24
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :22
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :21
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :20
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :19
-->_1 #eq^#(#0(), #0()) -> c_40() :18
24: #eq^#(#neg(@x), #pos(@y)) -> c_46()
25: #eq^#(#pos(@x), #0()) -> c_47()
26: #eq^#(#pos(@x), #neg(@y)) -> c_48()
27: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :30
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(nil(), nil()) -> c_55() :33
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :32
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :31
-->_1 #eq^#(#s(@x), #0()) -> c_50() :28
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :26
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :25
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :24
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :22
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :21
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :20
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :19
-->_1 #eq^#(#0(), #0()) -> c_40() :18
28: #eq^#(#s(@x), #0()) -> c_50()
29: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :30
-->_1 #eq^#(nil(), nil()) -> c_55() :33
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :32
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :31
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :29
-->_1 #eq^#(#s(@x), #0()) -> c_50() :28
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_48() :26
-->_1 #eq^#(#pos(@x), #0()) -> c_47() :25
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_46() :24
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :23
-->_1 #eq^#(#neg(@x), #0()) -> c_44() :22
-->_1 #eq^#(#0(), #s(@y)) -> c_43() :21
-->_1 #eq^#(#0(), #pos(@y)) -> c_42() :20
-->_1 #eq^#(#0(), #neg(@y)) -> c_41() :19
-->_1 #eq^#(#0(), #0()) -> c_40() :18
30: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_1 #and^#(#true(), #true()) -> c_87() :79
-->_1 #and^#(#true(), #false()) -> c_86() :78
-->_1 #and^#(#false(), #true()) -> c_85() :77
-->_1 #and^#(#false(), #false()) -> c_84() :76
-->_3 #eq^#(nil(), nil()) -> c_55() :33
-->_2 #eq^#(nil(), nil()) -> c_55() :33
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :32
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_54() :32
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :31
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_53() :31
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :30
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :30
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :29
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :29
-->_3 #eq^#(#s(@x), #0()) -> c_50() :28
-->_2 #eq^#(#s(@x), #0()) -> c_50() :28
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :27
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :27
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_48() :26
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_48() :26
-->_3 #eq^#(#pos(@x), #0()) -> c_47() :25
-->_2 #eq^#(#pos(@x), #0()) -> c_47() :25
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_46() :24
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_46() :24
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :23
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :23
-->_3 #eq^#(#neg(@x), #0()) -> c_44() :22
-->_2 #eq^#(#neg(@x), #0()) -> c_44() :22
-->_3 #eq^#(#0(), #s(@y)) -> c_43() :21
-->_2 #eq^#(#0(), #s(@y)) -> c_43() :21
-->_3 #eq^#(#0(), #pos(@y)) -> c_42() :20
-->_2 #eq^#(#0(), #pos(@y)) -> c_42() :20
-->_3 #eq^#(#0(), #neg(@y)) -> c_41() :19
-->_2 #eq^#(#0(), #neg(@y)) -> c_41() :19
-->_3 #eq^#(#0(), #0()) -> c_40() :18
-->_2 #eq^#(#0(), #0()) -> c_40() :18
31: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
32: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
33: #eq^#(nil(), nil()) -> c_55()
34: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :49
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :47
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :43
-->_2 #compare^#(#s(@x), #0()) -> c_66() :48
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_64() :46
-->_2 #compare^#(#pos(@x), #0()) -> c_63() :45
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_62() :44
-->_2 #compare^#(#neg(@x), #0()) -> c_60() :42
-->_2 #compare^#(#0(), #s(@y)) -> c_59() :41
-->_2 #compare^#(#0(), #pos(@y)) -> c_58() :40
-->_2 #compare^#(#0(), #neg(@y)) -> c_57() :39
-->_2 #compare^#(#0(), #0()) -> c_56() :38
-->_1 #ckgt^#(#LT()) -> c_70() :37
-->_1 #ckgt^#(#GT()) -> c_69() :36
-->_1 #ckgt^#(#EQ()) -> c_68() :35
35: #ckgt^#(#EQ()) -> c_68()
36: #ckgt^#(#GT()) -> c_69()
37: #ckgt^#(#LT()) -> c_70()
38: #compare^#(#0(), #0()) -> c_56()
39: #compare^#(#0(), #neg(@y)) -> c_57()
40: #compare^#(#0(), #pos(@y)) -> c_58()
41: #compare^#(#0(), #s(@y)) -> c_59()
42: #compare^#(#neg(@x), #0()) -> c_60()
43: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :49
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :47
-->_1 #compare^#(#s(@x), #0()) -> c_66() :48
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :46
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :45
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :44
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :43
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :42
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :41
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :40
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :39
-->_1 #compare^#(#0(), #0()) -> c_56() :38
44: #compare^#(#neg(@x), #pos(@y)) -> c_62()
45: #compare^#(#pos(@x), #0()) -> c_63()
46: #compare^#(#pos(@x), #neg(@y)) -> c_64()
47: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :49
-->_1 #compare^#(#s(@x), #0()) -> c_66() :48
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :47
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :46
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :45
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :44
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :43
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :42
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :41
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :40
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :39
-->_1 #compare^#(#0(), #0()) -> c_56() :38
48: #compare^#(#s(@x), #0()) -> c_66()
49: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :49
-->_1 #compare^#(#s(@x), #0()) -> c_66() :48
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :47
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_64() :46
-->_1 #compare^#(#pos(@x), #0()) -> c_63() :45
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_62() :44
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :43
-->_1 #compare^#(#neg(@x), #0()) -> c_60() :42
-->_1 #compare^#(#0(), #s(@y)) -> c_59() :41
-->_1 #compare^#(#0(), #pos(@y)) -> c_58() :40
-->_1 #compare^#(#0(), #neg(@y)) -> c_57() :39
-->_1 #compare^#(#0(), #0()) -> c_56() :38
50: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :55
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :54
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :53
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :52
-->_1 #add^#(#0(), @y) -> c_71() :51
51: #add^#(#0(), @y) -> c_71()
52: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
53: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :55
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :54
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_79() :83
-->_1 #pred^#(#pos(#s(#0()))) -> c_78() :82
-->_1 #pred^#(#neg(#s(@x))) -> c_77() :81
-->_1 #pred^#(#0()) -> c_76() :80
54: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
55: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_83() :87
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_82() :86
-->_1 #succ^#(#neg(#s(#0()))) -> c_81() :85
-->_1 #succ^#(#0()) -> c_80() :84
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :55
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :54
56: firstline#1^#(nil()) -> c_10()
57: lcs#1^#(@m) -> lcs#2^#(@m)
-->_1 lcs#2^#(nil()) -> #abs^#(#0()) :59
-->_1 lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1) :58
58: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
-->_1 lcs#3^#(nil()) -> #abs^#(#0()) :61
-->_1 lcs#3^#(::(@len, @_@1)) -> c_16() :60
59: lcs#2^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :13
60: lcs#3^#(::(@len, @_@1)) -> c_16()
61: lcs#3^#(nil()) -> #abs^#(#0()) -->_1 #abs^#(#0()) -> c_1() :13
62: lcstable#3^#(nil(), @l2, @x) -> c_22()
63: newline#1^#(nil(), @lastline, @y) -> c_28()
64: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
-->_1 max#1^#(#true(), @a, @b) -> c_26() :66
-->_1 max#1^#(#false(), @a, @b) -> c_25() :65
-->_2 #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :34
65: max#1^#(#false(), @a, @b) -> c_25()
66: max#1^#(#true(), @a, @b) -> c_26()
67: newline#2^#(nil(), @x, @xs, @y) -> c_30()
68: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
-->_1 newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y)) :72
-->_2 right^#(@l) -> right#1^#(@l) :69
69: right^#(@l) -> right#1^#(@l)
-->_1 right#1^#(nil()) -> #abs^#(#0()) :71
-->_1 right#1^#(::(@x, @xs)) -> c_38() :70
70: right#1^#(::(@x, @xs)) -> c_38()
71: right#1^#(nil()) -> #abs^#(#0())
-->_1 #abs^#(#0()) -> c_1() :13
72: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
-->_2 newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0()))) :75
-->_2 newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal) :74
-->_1 newline#6^#(@elem, @nl) -> c_37() :73
-->_3 #equal^#(@x, @y) -> #eq^#(@x, @y) :17
73: newline#6^#(@elem, @nl) -> c_37()
74: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
-->_1 max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b)) :64
75: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :50
76: #and^#(#false(), #false()) -> c_84()
77: #and^#(#false(), #true()) -> c_85()
78: #and^#(#true(), #false()) -> c_86()
79: #and^#(#true(), #true()) -> c_87()
80: #pred^#(#0()) -> c_76()
81: #pred^#(#neg(#s(@x))) -> c_77()
82: #pred^#(#pos(#s(#0()))) -> c_78()
83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
84: #succ^#(#0()) -> c_80()
85: #succ^#(#neg(#s(#0()))) -> c_81()
86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
87: #succ^#(#pos(#s(@x))) -> c_83()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {12} and add Pre({12}) = {11} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(#0(), #0()) -> c_40()
, #eq^#(#0(), #neg(@y)) -> c_41()
, #eq^#(#0(), #pos(@y)) -> c_42()
, #eq^#(#0(), #s(@y)) -> c_43()
, #eq^#(#neg(@x), #0()) -> c_44()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_46()
, #eq^#(#pos(@x), #0()) -> c_47()
, #eq^#(#pos(@x), #neg(@y)) -> c_48()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_50()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, #eq^#(nil(), nil()) -> c_55()
, #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_68()
, #ckgt^#(#GT()) -> c_69()
, #ckgt^#(#LT()) -> c_70()
, #compare^#(#0(), #0()) -> c_56()
, #compare^#(#0(), #neg(@y)) -> c_57()
, #compare^#(#0(), #pos(@y)) -> c_58()
, #compare^#(#0(), #s(@y)) -> c_59()
, #compare^#(#neg(@x), #0()) -> c_60()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_62()
, #compare^#(#pos(@x), #0()) -> c_63()
, #compare^#(#pos(@x), #neg(@y)) -> c_64()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_66()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_71()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, firstline#1^#(nil()) -> c_10()
, lcs#1^#(@m) -> lcs#2^#(@m)
, lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, lcs#2^#(nil()) -> #abs^#(#0())
, lcs#3^#(::(@len, @_@1)) -> c_16()
, lcs#3^#(nil()) -> #abs^#(#0())
, lcstable#3^#(nil(), @l2, @x) -> c_22()
, newline#1^#(nil(), @lastline, @y) -> c_28()
, max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, max#1^#(#false(), @a, @b) -> c_25()
, max#1^#(#true(), @a, @b) -> c_26()
, newline#2^#(nil(), @x, @xs, @y) -> c_30()
, newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, right^#(@l) -> right#1^#(@l)
, right#1^#(::(@x, @xs)) -> c_38()
, right#1^#(nil()) -> #abs^#(#0())
, newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, newline#6^#(@elem, @nl) -> c_37()
, newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
, #and^#(#false(), #false()) -> c_84()
, #and^#(#false(), #true()) -> c_85()
, #and^#(#true(), #false()) -> c_86()
, #and^#(#true(), #true()) -> c_87()
, #pred^#(#0()) -> c_76()
, #pred^#(#neg(#s(@x))) -> c_77()
, #pred^#(#pos(#s(#0()))) -> c_78()
, #pred^#(#pos(#s(#s(@x)))) -> c_79()
, #succ^#(#0()) -> c_80()
, #succ^#(#neg(#s(#0()))) -> c_81()
, #succ^#(#neg(#s(#s(@x)))) -> c_82()
, #succ^#(#pos(#s(@x))) -> c_83() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the the dependency graph
->4:{3}
|
|->5:{4,5}
| |
| |->70:{6}
| | |
| | `->76:{1,2}
| | |
| | |->78:{12} Weak SCC
| | |
| | `->77:{55} Weak SCC
| |
| `->6:{7}
| |
| |->8:{8}
| | |
| | `->9:{9,11,10}
| | |
| | |->10:{62} Weak SCC
| | |
| | |->11:{66} Weak SCC
| | |
| | `->12:{67} Weak SCC
| | |
| | |->13:{68} Weak SCC
| | | |
| | | |->67:{69} Weak SCC
| | | | |
| | | | |->68:{70} Weak SCC
| | | | |
| | | | `->69:{71} Weak SCC
| | | | |
| | | | `->78:{12}
Weak SCC
| | | |
| | | `->14:{72} Weak SCC
| | | |
| | | |->15:{16} Weak SCC
| | | | |
| | | | |->17:{17}
Weak SCC
| | | | |
| | | | |->18:{18}
Weak SCC
| | | | |
| | | | |->19:{19}
Weak SCC
| | | | |
| | | | |->20:{20}
Weak SCC
| | | | |
| | | | |->21:{21}
Weak SCC
| | | | |
| | | | |->22:{23}
Weak SCC
| | | | |
| | | | |->23:{24}
Weak SCC
| | | | |
| | | | |->24:{25}
Weak SCC
| | | | |
| | | | |->25:{27}
Weak SCC
| | | | |
| | | | |->16:{29,28,26,22}
Weak SCC
| | | | | |
| | | | | |->17:{17}
Weak SCC
| | | | | |
| | | | | |->18:{18}
Weak SCC
| | | | | |
| | | | | |->19:{19}
Weak SCC
| | | | | |
| | | | | |->20:{20}
Weak SCC
| | | | | |
| | | | | |->21:{21}
Weak SCC
| | | | | |
| | | | | |->22:{23}
Weak SCC
| | | | | |
| | | | | |->23:{24}
Weak SCC
| | | | | |
| | | | | |->24:{25}
Weak SCC
| | | | | |
| | | | | |->25:{27}
Weak SCC
| | | | | |
| | | | | |->26:{30}
Weak SCC
| | | | | |
| | | | | |->27:{31}
Weak SCC
| | | | | |
| | | | | |->28:{32}
Weak SCC
| | | | | |
| | | | | |->29:{76}
Weak SCC
| | | | | |
| | | | | |->30:{77}
Weak SCC
| | | | | |
| | | | | |->31:{78}
Weak SCC
| | | | | |
| | | | | `->32:{79}
Weak SCC
| | | | |
| | | | |->26:{30}
Weak SCC
| | | | |
| | | | |->27:{31}
Weak SCC
| | | | |
| | | | `->28:{32}
Weak SCC
| | | |
| | | |->33:{73} Weak SCC
| | | |
| | | |->34:{74} Weak SCC
| | | | |
| | | | `->35:{63}
Weak SCC
| | | | |
| | | | |->36:{33}
Weak SCC
| | | | | |
| | | | | |->37:{34}
Weak SCC
| | | | | |
| | | | | |->38:{35}
Weak SCC
| | | | | |
| | | | | |->39:{36}
Weak SCC
| | | | | |
| | | | | |->41:{37}
Weak SCC
| | | | | |
| | | | | |->42:{38}
Weak SCC
| | | | | |
| | | | | |->43:{39}
Weak SCC
| | | | | |
| | | | | |->44:{40}
Weak SCC
| | | | | |
| | | | | |->45:{41}
Weak SCC
| | | | | |
| | | | | |->46:{43}
Weak SCC
| | | | | |
| | | | | |->47:{44}
Weak SCC
| | | | | |
| | | | | |->48:{45}
Weak SCC
| | | | | |
| | | | | |->49:{47}
Weak SCC
| | | | | |
| | | | | `->40:{48,46,42}
Weak SCC
| | | | | |
| | | | | |->41:{37}
Weak SCC
| | | | | |
| | | | | |->42:{38}
Weak SCC
| | | | | |
| | | | | |->43:{39}
Weak SCC
| | | | | |
| | | | | |->44:{40}
Weak SCC
| | | | | |
| | | | | |->45:{41}
Weak SCC
| | | | | |
| | | | | |->46:{43}
Weak SCC
| | | | | |
| | | | | |->47:{44}
Weak SCC
| | | | | |
| | | | | |->48:{45}
Weak SCC
| | | | | |
| | | | | `->49:{47}
Weak SCC
| | | | |
| | | | |->50:{64}
Weak SCC
| | | | |
| | | | `->51:{65}
Weak SCC
| | | |
| | | `->52:{75} Weak SCC
| | | |
| | | `->53:{49}
Weak SCC
| | | |
| | | |->54:{50}
Weak SCC
| | | |
| | | |->55:{51}
Weak SCC
| | | | |
| | | | |->57:{80}
Weak SCC
| | | | |
| | | | |->58:{81}
Weak SCC
| | | | |
| | | | |->59:{82}
Weak SCC
| | | | |
| | | | `->60:{83}
Weak SCC
| | | |
| | | |->56:{52}
Weak SCC
| | | | |
| | | | |->62:{53}
Weak SCC
| | | | | |
| | | | | |->63:{84}
Weak SCC
| | | | | |
| | | | | |->64:{85}
Weak SCC
| | | | | |
| | | | | |->65:{86}
Weak SCC
| | | | | |
| | | | | `->66:{87}
Weak SCC
| | | | |
| | | | |->61:{54}
Weak SCC
| | | | | |
| | | | | |->62:{53}
Weak SCC
| | | | | | |
| | | | | | |->63:{84}
Weak SCC
| | | | | | |
| | | | | | |->64:{85}
Weak SCC
| | | | | | |
| | | | | | |->65:{86}
Weak SCC
| | | | | | |
| | | | | | `->66:{87}
Weak SCC
| | | | | |
| | | | | |->63:{84}
Weak SCC
| | | | | |
| | | | | |->64:{85}
Weak SCC
| | | | | |
| | | | | |->65:{86}
Weak SCC
| | | | | |
| | | | | `->66:{87}
Weak SCC
| | | | |
| | | | |->57:{80}
Weak SCC
| | | | |
| | | | |->58:{81}
Weak SCC
| | | | |
| | | | |->59:{82}
Weak SCC
| | | | |
| | | | `->60:{83}
Weak SCC
| | | |
| | | |->62:{53}
Weak SCC
| | | | |
| | | | |->63:{84}
Weak SCC
| | | | |
| | | | |->64:{85}
Weak SCC
| | | | |
| | | | |->65:{86}
Weak SCC
| | | | |
| | | | `->66:{87}
Weak SCC
| | | |
| | | `->61:{54}
Weak SCC
| | | |
| | | |->62:{53}
Weak SCC
| | | | |
| | | | |->63:{84}
Weak SCC
| | | | |
| | | | |->64:{85}
Weak SCC
| | | | |
| | | | |->65:{86}
Weak SCC
| | | | |
| | | | `->66:{87}
Weak SCC
| | | |
| | | |->63:{84}
Weak SCC
| | | |
| | | |->64:{85}
Weak SCC
| | | |
| | | |->65:{86}
Weak SCC
| | | |
| | | `->66:{87}
Weak SCC
| | |
| | `->67:{69} Weak SCC
| | |
| | |->68:{70} Weak SCC
| | |
| | `->69:{71} Weak SCC
| | |
| | `->78:{12} Weak SCC
| |
| `->7:{61} Weak SCC
|
`->71:{56} Weak SCC
|
|->72:{57} Weak SCC
| |
| |->73:{59} Weak SCC
| |
| `->74:{60} Weak SCC
| |
| `->78:{12} Weak SCC
|
`->75:{58} Weak SCC
|
`->78:{12} Weak SCC
->3:{13} Weak SCC
->2:{14} Weak SCC
->1:{15} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: firstline^#(@l) -> firstline#1^#(@l)
, 2: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
, 3: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, 4: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, 5: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, 6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, 7: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, 8: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, 9: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, 10: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, 11: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) }
Weak DPs:
{ 12: #abs^#(#0()) -> c_1()
, 13: #abs^#(#neg(@x)) -> c_2()
, 14: #abs^#(#pos(@x)) -> c_3()
, 15: #abs^#(#s(@x)) -> c_4()
, 16: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 17: #eq^#(#0(), #0()) -> c_40()
, 18: #eq^#(#0(), #neg(@y)) -> c_41()
, 19: #eq^#(#0(), #pos(@y)) -> c_42()
, 20: #eq^#(#0(), #s(@y)) -> c_43()
, 21: #eq^#(#neg(@x), #0()) -> c_44()
, 22: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 23: #eq^#(#neg(@x), #pos(@y)) -> c_46()
, 24: #eq^#(#pos(@x), #0()) -> c_47()
, 25: #eq^#(#pos(@x), #neg(@y)) -> c_48()
, 26: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 27: #eq^#(#s(@x), #0()) -> c_50()
, 28: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 29: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 30: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, 31: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, 32: #eq^#(nil(), nil()) -> c_55()
, 33: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 34: #ckgt^#(#EQ()) -> c_68()
, 35: #ckgt^#(#GT()) -> c_69()
, 36: #ckgt^#(#LT()) -> c_70()
, 37: #compare^#(#0(), #0()) -> c_56()
, 38: #compare^#(#0(), #neg(@y)) -> c_57()
, 39: #compare^#(#0(), #pos(@y)) -> c_58()
, 40: #compare^#(#0(), #s(@y)) -> c_59()
, 41: #compare^#(#neg(@x), #0()) -> c_60()
, 42: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 43: #compare^#(#neg(@x), #pos(@y)) -> c_62()
, 44: #compare^#(#pos(@x), #0()) -> c_63()
, 45: #compare^#(#pos(@x), #neg(@y)) -> c_64()
, 46: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 47: #compare^#(#s(@x), #0()) -> c_66()
, 48: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 49: +^#(@x, @y) -> #add^#(@x, @y)
, 50: #add^#(#0(), @y) -> c_71()
, 51: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 52: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 53: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 54: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 55: firstline#1^#(nil()) -> c_10()
, 56: lcs#1^#(@m) -> lcs#2^#(@m)
, 57: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, 58: lcs#2^#(nil()) -> #abs^#(#0())
, 59: lcs#3^#(::(@len, @_@1)) -> c_16()
, 60: lcs#3^#(nil()) -> #abs^#(#0())
, 61: lcstable#3^#(nil(), @l2, @x) -> c_22()
, 62: newline#1^#(nil(), @lastline, @y) -> c_28()
, 63: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, 64: max#1^#(#false(), @a, @b) -> c_25()
, 65: max#1^#(#true(), @a, @b) -> c_26()
, 66: newline#2^#(nil(), @x, @xs, @y) -> c_30()
, 67: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, 68: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, 69: right^#(@l) -> right#1^#(@l)
, 70: right#1^#(::(@x, @xs)) -> c_38()
, 71: right#1^#(nil()) -> #abs^#(#0())
, 72: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, 73: newline#6^#(@elem, @nl) -> c_37()
, 74: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, 75: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
, 76: #and^#(#false(), #false()) -> c_84()
, 77: #and^#(#false(), #true()) -> c_85()
, 78: #and^#(#true(), #false()) -> c_86()
, 79: #and^#(#true(), #true()) -> c_87()
, 80: #pred^#(#0()) -> c_76()
, 81: #pred^#(#neg(#s(@x))) -> c_77()
, 82: #pred^#(#pos(#s(#0()))) -> c_78()
, 83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
, 84: #succ^#(#0()) -> c_80()
, 85: #succ^#(#neg(#s(#0()))) -> c_81()
, 86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
, 87: #succ^#(#pos(#s(@x))) -> c_83() }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 15: #abs^#(#s(@x)) -> c_4()
, 14: #abs^#(#pos(@x)) -> c_3()
, 13: #abs^#(#neg(@x)) -> c_2()
, 61: lcstable#3^#(nil(), @l2, @x) -> c_22()
, 62: newline#1^#(nil(), @lastline, @y) -> c_28()
, 66: newline#2^#(nil(), @x, @xs, @y) -> c_30()
, 67: newline#3^#(@nl, @belowVal, @lastline', @x, @y) ->
c_31(newline#4^#(right(@nl), @belowVal, @lastline', @nl, @x, @y),
right^#(@nl))
, 68: newline#4^#(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
c_33(newline#5^#(right(@lastline'),
@belowVal,
@nl,
@rightVal,
@x,
@y),
right^#(@lastline'))
, 72: newline#5^#(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
c_34(newline#6^#(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl),
newline#7^#(#equal(@x, @y), @belowVal, @diagVal, @rightVal),
#equal^#(@x, @y))
, 16: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 29: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_52(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 28: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 26: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 22: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 17: #eq^#(#0(), #0()) -> c_40()
, 18: #eq^#(#0(), #neg(@y)) -> c_41()
, 19: #eq^#(#0(), #pos(@y)) -> c_42()
, 20: #eq^#(#0(), #s(@y)) -> c_43()
, 21: #eq^#(#neg(@x), #0()) -> c_44()
, 23: #eq^#(#neg(@x), #pos(@y)) -> c_46()
, 24: #eq^#(#pos(@x), #0()) -> c_47()
, 25: #eq^#(#pos(@x), #neg(@y)) -> c_48()
, 27: #eq^#(#s(@x), #0()) -> c_50()
, 30: #eq^#(::(@x_1, @x_2), nil()) -> c_53()
, 31: #eq^#(nil(), ::(@y_1, @y_2)) -> c_54()
, 32: #eq^#(nil(), nil()) -> c_55()
, 76: #and^#(#false(), #false()) -> c_84()
, 77: #and^#(#false(), #true()) -> c_85()
, 78: #and^#(#true(), #false()) -> c_86()
, 79: #and^#(#true(), #true()) -> c_87()
, 73: newline#6^#(@elem, @nl) -> c_37()
, 74: newline#7^#(#false(), @belowVal, @diagVal, @rightVal) ->
max^#(@belowVal, @rightVal)
, 63: max^#(@a, @b) ->
c_24(max#1^#(#greater(@a, @b), @a, @b), #greater^#(@a, @b))
, 33: #greater^#(@x, @y) ->
c_6(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 34: #ckgt^#(#EQ()) -> c_68()
, 35: #ckgt^#(#GT()) -> c_69()
, 36: #ckgt^#(#LT()) -> c_70()
, 48: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 46: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 42: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 37: #compare^#(#0(), #0()) -> c_56()
, 38: #compare^#(#0(), #neg(@y)) -> c_57()
, 39: #compare^#(#0(), #pos(@y)) -> c_58()
, 40: #compare^#(#0(), #s(@y)) -> c_59()
, 41: #compare^#(#neg(@x), #0()) -> c_60()
, 43: #compare^#(#neg(@x), #pos(@y)) -> c_62()
, 44: #compare^#(#pos(@x), #0()) -> c_63()
, 45: #compare^#(#pos(@x), #neg(@y)) -> c_64()
, 47: #compare^#(#s(@x), #0()) -> c_66()
, 64: max#1^#(#false(), @a, @b) -> c_25()
, 65: max#1^#(#true(), @a, @b) -> c_26()
, 75: newline#7^#(#true(), @belowVal, @diagVal, @rightVal) ->
+^#(@diagVal, #pos(#s(#0())))
, 49: +^#(@x, @y) -> #add^#(@x, @y)
, 50: #add^#(#0(), @y) -> c_71()
, 51: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 52: #add^#(#neg(#s(#s(@x))), @y) ->
c_73(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 80: #pred^#(#0()) -> c_76()
, 81: #pred^#(#neg(#s(@x))) -> c_77()
, 82: #pred^#(#pos(#s(#0()))) -> c_78()
, 83: #pred^#(#pos(#s(#s(@x)))) -> c_79()
, 54: #add^#(#pos(#s(#s(@x))), @y) ->
c_75(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 53: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 84: #succ^#(#0()) -> c_80()
, 85: #succ^#(#neg(#s(#0()))) -> c_81()
, 86: #succ^#(#neg(#s(#s(@x)))) -> c_82()
, 87: #succ^#(#pos(#s(@x))) -> c_83()
, 69: right^#(@l) -> right#1^#(@l)
, 70: right#1^#(::(@x, @xs)) -> c_38()
, 71: right#1^#(nil()) -> #abs^#(#0())
, 56: lcs#1^#(@m) -> lcs#2^#(@m)
, 57: lcs#2^#(::(@l1, @_@2)) -> lcs#3^#(@l1)
, 59: lcs#3^#(::(@len, @_@1)) -> c_16()
, 60: lcs#3^#(nil()) -> #abs^#(#0())
, 58: lcs#2^#(nil()) -> #abs^#(#0())
, 55: firstline#1^#(nil()) -> c_10()
, 12: #abs^#(#0()) -> c_1() }
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the following dependency-graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs)) :2
2: firstline#1^#(::(@x, @xs)) ->
c_9(#abs^#(#0()), firstline^#(@xs))
-->_2 firstline^#(@l) -> firstline#1^#(@l) :1
3: lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
4: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :5
5: lcstable#1^#(::(@x, @xs), @l2) ->
c_18(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :7
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
7: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :8
8: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :9
9: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :10
10: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) :11
11: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs))
-->_2 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :9
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ firstline#1^#(::(@x, @xs)) -> c_9(#abs^#(#0()), firstline^#(@xs))
, lcs^#(@l1, @l2) ->
c_11(lcs#1^#(lcstable(@l1, @l2)), lcstable^#(@l1, @l2))
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
c_29(newline#3^#(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y),
newline^#(@y, @lastline', @xs)) }
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We employ 'linear path analysis' using the following approximated
dependency graph:
->1:{3} [ ? ]
|
`->2:{4,5} [ ? ]
|
|->6:{6} [ ? ]
| |
| `->7:{1,2} [ YES(O(1),O(n^1)) ]
|
`->3:{7} [ ? ]
|
`->4:{8} [ ? ]
|
`->5:{9,11,10} [ YES(O(1),O(n^2)) ]
Here dependency-pairs are as follows:
Strict DPs:
{ 1: firstline^#(@l) -> firstline#1^#(@l)
, 2: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, 3: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 4: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, 5: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, 6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, 7: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, 8: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, 9: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, 10: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, 11: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
* Path 1:{3}->2:{4,5}->6:{6}->7:{1,2}: YES(O(1),O(n^1))
-----------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) :2
2: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
3: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
4: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :5
5: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :4
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
Weak DPs: { firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) :6
2: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :3
3: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :5
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :4
4: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :3
5: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
6: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) }
Weak DPs:
{ firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) :5
2: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :3
3: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :4
4: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :3
5: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) :4
2: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :3
3: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :5
4: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
5: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :3
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) :3
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :5
3: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
4: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
5: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
No rule is usable.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'Small Polynomial Path Order (PS,1-bounded)'
to orient following rules strictly.
DPs:
{ 3: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, 6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
Sub-proof:
----------
The input was oriented with the instance of 'Small Polynomial Path
Order (PS,1-bounded)' as induced by the safe mapping
safe(#0) = {}, safe(#neg) = {1}, safe(#pos) = {1}, safe(#s) = {1},
safe(::) = {1, 2}, safe(nil) = {}, safe(#false) = {},
safe(#true) = {}, safe(#EQ) = {}, safe(#GT) = {}, safe(#LT) = {},
safe(#abs^#) = {}, safe(#equal^#) = {}, safe(#eq^#) = {},
safe(#greater^#) = {}, safe(#ckgt^#) = {}, safe(#compare^#) = {},
safe(+^#) = {}, safe(#add^#) = {}, safe(firstline^#) = {},
safe(firstline#1^#) = {}, safe(lcs^#) = {}, safe(lcs#1^#) = {},
safe(lcstable^#) = {}, safe(lcstable#1^#) = {}, safe(lcs#2^#) = {},
safe(lcs#3^#) = {}, safe(lcstable#2^#) = {},
safe(lcstable#3^#) = {}, safe(newline^#) = {},
safe(newline#1^#) = {}, safe(max^#) = {}, safe(max#1^#) = {},
safe(newline#2^#) = {}, safe(newline#3^#) = {},
safe(newline#4^#) = {}, safe(right^#) = {}, safe(right#1^#) = {},
safe(newline#5^#) = {}, safe(newline#6^#) = {},
safe(newline#7^#) = {}, safe(#and^#) = {}, safe(#pred^#) = {},
safe(#succ^#) = {}
and precedence
firstline^# ~ firstline#1^#, lcs^# ~ lcstable^#,
lcstable^# ~ lcstable#1^# .
Following symbols are considered recursive:
{}
The recursion depth is 0.
Further, following argument filtering is employed:
pi(#0) = [], pi(#neg) = [], pi(#pos) = [], pi(#s) = [],
pi(::) = [2], pi(nil) = [], pi(#false) = [], pi(#true) = [],
pi(#EQ) = [], pi(#GT) = [], pi(#LT) = [], pi(#abs^#) = [],
pi(#equal^#) = [], pi(#eq^#) = [], pi(#greater^#) = [],
pi(#ckgt^#) = [], pi(#compare^#) = [], pi(+^#) = [],
pi(#add^#) = [], pi(firstline^#) = 1, pi(firstline#1^#) = 1,
pi(lcs^#) = [2], pi(lcs#1^#) = [], pi(lcstable^#) = [2],
pi(lcstable#1^#) = [2], pi(lcs#2^#) = [], pi(lcs#3^#) = [],
pi(lcstable#2^#) = [], pi(lcstable#3^#) = [], pi(newline^#) = [],
pi(newline#1^#) = [], pi(max^#) = [], pi(max#1^#) = [],
pi(newline#2^#) = [], pi(newline#3^#) = [], pi(newline#4^#) = [],
pi(right^#) = [], pi(right#1^#) = [], pi(newline#5^#) = [],
pi(newline#6^#) = [], pi(newline#7^#) = [], pi(#and^#) = [],
pi(#pred^#) = [], pi(#succ^#) = []
Usable defined function symbols are a subset of:
{}
For your convenience, here are the satisfied ordering constraints:
pi(firstline^#(@l)) = @l
>= @l
= pi(firstline#1^#(@l))
pi(firstline#1^#(::(@x, @xs))) = ::(; @xs)
> @xs
= pi(firstline^#(@xs))
pi(lcs^#(@l1, @l2)) = lcs^#(@l2;)
>= lcstable^#(@l2;)
= pi(lcstable^#(@l1, @l2))
pi(lcstable^#(@l1, @l2)) = lcstable^#(@l2;)
>= lcstable#1^#(@l2;)
= pi(lcstable#1^#(@l1, @l2))
pi(lcstable#1^#(::(@x, @xs), @l2)) = lcstable#1^#(@l2;)
>= lcstable^#(@l2;)
= pi(lcstable^#(@xs, @l2))
pi(lcstable#1^#(nil(), @l2)) = lcstable#1^#(@l2;)
> @l2
= pi(firstline^#(@l2))
Processor 'Small Polynomial Path Order (PS,1-bounded)' induces the
complexity certificate YES(?,O(n^1)) on application of rules {3,6}.
Here rules are labeled according to the (estimated) dependency
graph
1: firstline^#(@l) -> firstline#1^#(@l)
-->_1 firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) :3
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(nil(), @l2) -> firstline^#(@l2) :6
-->_1 lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) :5
3: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
4: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
5: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
-->_1 firstline^#(@l) -> firstline#1^#(@l) :1
- The rules {3,6} have known complexity. These cover all
predecessors of {1,4}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,3,4,6} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Strict DPs: { lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ firstline^#(@l) -> firstline#1^#(@l)
, firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
, lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{4} Weak SCC
|
`->2:{1,5}
|
`->3:{6} Weak SCC
|
`->4:{2,3} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ 2: firstline^#(@l) -> firstline#1^#(@l)
, 3: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs)
, 4: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 5: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
, 6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 6: lcstable#1^#(nil(), @l2) -> firstline^#(@l2)
, 2: firstline^#(@l) -> firstline#1^#(@l)
, 3: firstline#1^#(::(@x, @xs)) -> firstline^#(@xs) }
We apply the transformation 'simpKP' on the sub-problem:
Strict DPs: { lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) }
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
StartTerms: basic terms
Strategy: innermost
We use the processor 'Small Polynomial Path Order (PS,1-bounded)'
to orient following rules strictly.
DPs:
{ 2: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 3: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
Sub-proof:
----------
The input was oriented with the instance of 'Small Polynomial Path
Order (PS,1-bounded)' as induced by the safe mapping
safe(#0) = {}, safe(#neg) = {1}, safe(#pos) = {1}, safe(#s) = {1},
safe(::) = {1, 2}, safe(nil) = {}, safe(#false) = {},
safe(#true) = {}, safe(#EQ) = {}, safe(#GT) = {}, safe(#LT) = {},
safe(#abs^#) = {}, safe(#equal^#) = {}, safe(#eq^#) = {},
safe(#greater^#) = {}, safe(#ckgt^#) = {}, safe(#compare^#) = {},
safe(+^#) = {}, safe(#add^#) = {}, safe(firstline^#) = {},
safe(firstline#1^#) = {}, safe(lcs^#) = {1}, safe(lcs#1^#) = {},
safe(lcstable^#) = {}, safe(lcstable#1^#) = {}, safe(lcs#2^#) = {},
safe(lcs#3^#) = {}, safe(lcstable#2^#) = {},
safe(lcstable#3^#) = {}, safe(newline^#) = {},
safe(newline#1^#) = {}, safe(max^#) = {}, safe(max#1^#) = {},
safe(newline#2^#) = {}, safe(newline#3^#) = {},
safe(newline#4^#) = {}, safe(right^#) = {}, safe(right#1^#) = {},
safe(newline#5^#) = {}, safe(newline#6^#) = {},
safe(newline#7^#) = {}, safe(#and^#) = {}, safe(#pred^#) = {},
safe(#succ^#) = {}
and precedence
empty .
Following symbols are considered recursive:
{}
The recursion depth is 0.
Further, following argument filtering is employed:
pi(#0) = [], pi(#neg) = [], pi(#pos) = [], pi(#s) = [],
pi(::) = [2], pi(nil) = [], pi(#false) = [], pi(#true) = [],
pi(#EQ) = [], pi(#GT) = [], pi(#LT) = [], pi(#abs^#) = [],
pi(#equal^#) = [], pi(#eq^#) = [], pi(#greater^#) = [],
pi(#ckgt^#) = [], pi(#compare^#) = [], pi(+^#) = [],
pi(#add^#) = [], pi(firstline^#) = [], pi(firstline#1^#) = [],
pi(lcs^#) = [1, 2], pi(lcs#1^#) = [], pi(lcstable^#) = 1,
pi(lcstable#1^#) = 1, pi(lcs#2^#) = [], pi(lcs#3^#) = [],
pi(lcstable#2^#) = [], pi(lcstable#3^#) = [], pi(newline^#) = [],
pi(newline#1^#) = [], pi(max^#) = [], pi(max#1^#) = [],
pi(newline#2^#) = [], pi(newline#3^#) = [], pi(newline#4^#) = [],
pi(right^#) = [], pi(right#1^#) = [], pi(newline#5^#) = [],
pi(newline#6^#) = [], pi(newline#7^#) = [], pi(#and^#) = [],
pi(#pred^#) = [], pi(#succ^#) = []
Usable defined function symbols are a subset of:
{}
For your convenience, here are the satisfied ordering constraints:
pi(lcs^#(@l1, @l2)) = lcs^#(@l2; @l1)
> @l1
= pi(lcstable^#(@l1, @l2))
pi(lcstable^#(@l1, @l2)) = @l1
>= @l1
= pi(lcstable#1^#(@l1, @l2))
pi(lcstable#1^#(::(@x, @xs), @l2)) = ::(; @xs)
> @xs
= pi(lcstable^#(@xs, @l2))
Processor 'Small Polynomial Path Order (PS,1-bounded)' induces the
complexity certificate YES(?,O(n^1)) on application of rules {2,3}.
Here rules are labeled according to the (estimated) dependency
graph
1: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) :3
2: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :1
3: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :1
- The rules {2,3} have known complexity. These cover all
predecessors of {1}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules {1,2,3}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1} Weak SCC
|
`->2:{2,3} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, 3: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, 3: lcstable#1^#(::(@x, @xs), @l2) -> lcstable^#(@xs, @l2) }
We apply the transformation 'usablerules' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
* Path 1:{3}->2:{4,5}->3:{7}->4:{8}->5:{9,11,10}: YES(O(1),O(n^2))
----------------------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :3
3: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :4
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
4: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :5
5: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :6
6: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :7
7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) :8
8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :6
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {8} and add Pre({8}) = {7} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) }
Weak DPs:
{ newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :3
3: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :4
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
4: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :5
5: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :6
6: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :7
7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) :8
8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :6
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {7} and add Pre({7}) = {6} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y) }
Weak DPs:
{ newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :3
3: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :4
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
4: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :5
5: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :6
6: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :7
7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) :8
8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :6
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {4} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y) }
Weak DPs:
{ lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :3
3: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :4
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
4: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :6
5: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :7
6: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :5
7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) :8
8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :5
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y) }
Weak DPs:
{ lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :3
3: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :5
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
4: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :7
5: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :6
6: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :4
7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) :8
8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :4
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y) }
Weak DPs:
{ lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :4
3: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :7
4: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :5
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :2
5: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :6
6: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :3
7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) :8
8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :3
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {1} and add Pre({1}) = {} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y) }
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcs(@l1, @l2) -> lcs#1(lcstable(@l1, @l2))
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcs#1(@m) -> lcs#2(@m)
, lcs#2(::(@l1, @_@2)) -> lcs#3(@l1)
, lcs#2(nil()) -> #abs(#0())
, lcs#3(::(@len, @_@1)) -> @len
, lcs#3(nil()) -> #abs(#0())
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y) }
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We use the processor 'Small Polynomial Path Order (PS,2-bounded)'
to orient following rules strictly.
DPs:
{ 3: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 4: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, 5: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, 6: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, 7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) }
Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x)) }
Sub-proof:
----------
The input was oriented with the instance of 'Small Polynomial Path
Order (PS,2-bounded)' as induced by the safe mapping
safe(#0) = {}, safe(#abs) = {}, safe(#neg) = {1}, safe(#pos) = {1},
safe(#s) = {1}, safe(#equal) = {}, safe(#eq) = {1, 2},
safe(#greater) = {}, safe(#compare) = {1}, safe(#ckgt) = {},
safe(+) = {}, safe(#add) = {}, safe(firstline) = {},
safe(firstline#1) = {}, safe(::) = {1, 2}, safe(nil) = {},
safe(lcstable) = {}, safe(lcstable#1) = {2},
safe(lcstable#2) = {1, 2}, safe(lcstable#3) = {1, 3},
safe(newline) = {2, 3}, safe(max) = {}, safe(max#1) = {1, 3},
safe(#false) = {}, safe(#true) = {}, safe(newline#1) = {},
safe(newline#2) = {1, 2, 3, 4}, safe(newline#3) = {1, 4},
safe(right) = {}, safe(newline#4) = {1, 3, 6},
safe(newline#5) = {1, 3, 5}, safe(newline#7) = {1, 4},
safe(newline#6) = {1}, safe(right#1) = {}, safe(#pred) = {1},
safe(#succ) = {}, safe(#and) = {}, safe(#EQ) = {}, safe(#GT) = {},
safe(#LT) = {}, safe(#abs^#) = {}, safe(#equal^#) = {},
safe(#eq^#) = {}, safe(#greater^#) = {}, safe(#ckgt^#) = {},
safe(#compare^#) = {}, safe(+^#) = {}, safe(#add^#) = {},
safe(firstline^#) = {}, safe(firstline#1^#) = {}, safe(lcs^#) = {},
safe(lcs#1^#) = {}, safe(lcstable^#) = {}, safe(lcstable#1^#) = {},
safe(lcs#2^#) = {}, safe(lcs#3^#) = {}, safe(lcstable#2^#) = {1},
safe(lcstable#3^#) = {1, 2}, safe(newline^#) = {},
safe(newline#1^#) = {2, 3}, safe(max^#) = {}, safe(max#1^#) = {},
safe(newline#2^#) = {3}, safe(newline#3^#) = {},
safe(newline#4^#) = {}, safe(right^#) = {}, safe(right#1^#) = {},
safe(newline#5^#) = {}, safe(newline#6^#) = {},
safe(newline#7^#) = {}, safe(#and^#) = {}, safe(#pred^#) = {},
safe(#succ^#) = {}, safe(c_1) = {}
and precedence
#eq > #and, #greater > #compare, firstline#1 > #abs,
firstline#1 > firstline, lcstable > lcstable#1,
newline#2 > newline#3, newline#5 > newline#6, lcs^# > lcstable^#,
lcstable#1^# > lcstable#2^#, lcstable#2^# > lcstable#3^#,
newline^# > newline#1^#, #add ~ #pred, #add ~ #succ,
lcstable#1 ~ lcstable#2, max ~ max#1, lcstable^# ~ lcstable#1^#,
newline^# ~ newline#2^# .
Following symbols are considered recursive:
{lcstable#1, lcstable#2, lcstable^#, lcstable#1^#}
The recursion depth is 1.
Further, following argument filtering is employed:
pi(#0) = [], pi(#abs) = [], pi(#neg) = [], pi(#pos) = [],
pi(#s) = [], pi(#equal) = 2, pi(#eq) = [1, 2], pi(#greater) = [],
pi(#compare) = [1], pi(#ckgt) = [], pi(+) = [], pi(#add) = 2,
pi(firstline) = 1, pi(firstline#1) = 1, pi(::) = [1, 2],
pi(nil) = [], pi(lcstable) = [1, 2], pi(lcstable#1) = [1, 2],
pi(lcstable#2) = [1], pi(lcstable#3) = [1], pi(newline) = 2,
pi(max) = [], pi(max#1) = [1, 3], pi(#false) = [], pi(#true) = [],
pi(newline#1) = [], pi(newline#2) = [1, 2, 3, 4],
pi(newline#3) = [1, 2, 4], pi(right) = [],
pi(newline#4) = [1, 3, 6], pi(newline#5) = [1, 3, 5],
pi(newline#7) = [4], pi(newline#6) = [1, 2], pi(right#1) = [],
pi(#pred) = 1, pi(#succ) = 1, pi(#and) = [2], pi(#EQ) = [],
pi(#GT) = [], pi(#LT) = [], pi(#abs^#) = [], pi(#equal^#) = [],
pi(#eq^#) = [], pi(#greater^#) = [], pi(#ckgt^#) = [],
pi(#compare^#) = [], pi(+^#) = [], pi(#add^#) = [],
pi(firstline^#) = [], pi(firstline#1^#) = [], pi(lcs^#) = [1, 2],
pi(lcs#1^#) = [], pi(lcstable^#) = [1, 2],
pi(lcstable#1^#) = [1, 2], pi(lcs#2^#) = [], pi(lcs#3^#) = [],
pi(lcstable#2^#) = [2], pi(lcstable#3^#) = [2], pi(newline^#) = 3,
pi(newline#1^#) = 1, pi(max^#) = [], pi(max#1^#) = [],
pi(newline#2^#) = 3, pi(newline#3^#) = [], pi(newline#4^#) = [],
pi(right^#) = [], pi(right#1^#) = [], pi(newline#5^#) = [],
pi(newline#6^#) = [], pi(newline#7^#) = [], pi(#and^#) = [],
pi(#pred^#) = [], pi(#succ^#) = [], pi(c_1) = [1, 2]
Usable defined function symbols are a subset of:
{#abs}
For your convenience, here are the satisfied ordering constraints:
pi(lcs^#(@l1, @l2)) = lcs^#(@l1, @l2;)
> lcstable^#(@l1, @l2;)
= pi(lcstable^#(@l1, @l2))
pi(lcstable^#(@l1, @l2)) = lcstable^#(@l1, @l2;)
>= lcstable#1^#(@l1, @l2;)
= pi(lcstable#1^#(@l1, @l2))
pi(lcstable#1^#(::(@x, @xs), @l2)) = lcstable#1^#(::(; @x, @xs), @l2;)
> c_1(lcstable#2^#(@l2;), lcstable^#(@xs, @l2;);)
= pi(c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)))
pi(lcstable#2^#(@m, @l2, @x)) = lcstable#2^#(@l2;)
> lcstable#3^#(; @l2)
= pi(lcstable#3^#(@m, @l2, @x))
pi(lcstable#3^#(::(@l, @ls), @l2, @x)) = lcstable#3^#(; @l2)
> @l2
= pi(newline^#(@x, @l, @l2))
pi(newline^#(@y, @lastline, @l)) = @l
>= @l
= pi(newline#1^#(@l, @lastline, @y))
pi(newline#1^#(::(@x, @xs), @lastline, @y)) = ::(; @x, @xs)
> @xs
= pi(newline#2^#(@lastline, @x, @xs, @y))
pi(newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y)) = @xs
>= @xs
= pi(newline^#(@y, @lastline', @xs))
pi(#abs(#0())) = #abs()
> #0()
= pi(#0())
pi(#abs(#neg(@x))) = #abs()
> #pos()
= pi(#pos(@x))
pi(#abs(#pos(@x))) = #abs()
> #pos()
= pi(#pos(@x))
pi(#abs(#s(@x))) = #abs()
> #pos()
= pi(#pos(#s(@x)))
Processor 'Small Polynomial Path Order (PS,2-bounded)' induces the
complexity certificate YES(?,O(n^2)) on application of rules
{3,4,5,6,7}. Here rules are labeled according to the (estimated)
dependency graph
1: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
-->_1 lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2)) :4
2: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
-->_1 newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) :7
3: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
-->_1 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :1
4: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
-->_1 lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x) :5
-->_2 lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2) :1
5: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
-->_1 lcstable#3^#(::(@l, @ls), @l2, @x) ->
newline^#(@x, @l, @l2) :6
6: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :2
7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
-->_1 newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) :8
8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs)
-->_1 newline^#(@y, @lastline, @l) ->
newline#1^#(@l, @lastline, @y) :2
- The rules {3,4,5,6,7} have known complexity. These cover all
predecessors of {1,8}, their complexity is equally bounded.
- The rules {1,3,4,5,6,7,8} have known complexity. These cover all
predecessors of {2}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7,8} is given by YES(?,O(n^2)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1} Weak SCC
|
`->2:{2,3} Weak SCC
|
`->3:{4} Weak SCC
|
`->4:{5} Weak SCC
|
`->5:{6,8,7} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, 3: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, 4: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, 5: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, 6: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, 7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y)
, 8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: lcs^#(@l1, @l2) -> lcstable^#(@l1, @l2)
, 2: lcstable^#(@l1, @l2) -> lcstable#1^#(@l1, @l2)
, 3: lcstable#1^#(::(@x, @xs), @l2) ->
c_1(lcstable#2^#(lcstable(@xs, @l2), @l2, @x),
lcstable^#(@xs, @l2))
, 4: lcstable#2^#(@m, @l2, @x) -> lcstable#3^#(@m, @l2, @x)
, 5: lcstable#3^#(::(@l, @ls), @l2, @x) -> newline^#(@x, @l, @l2)
, 6: newline^#(@y, @lastline, @l) -> newline#1^#(@l, @lastline, @y)
, 8: newline#2^#(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline^#(@y, @lastline', @xs)
, 7: newline#1^#(::(@x, @xs), @lastline, @y) ->
newline#2^#(@lastline, @x, @xs, @y) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #equal(@x, @y) -> #eq(@x, @y)
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, firstline(@l) -> firstline#1(@l)
, firstline#1(::(@x, @xs)) -> ::(#abs(#0()), firstline(@xs))
, firstline#1(nil()) -> nil()
, lcstable(@l1, @l2) -> lcstable#1(@l1, @l2)
, lcstable#1(::(@x, @xs), @l2) ->
lcstable#2(lcstable(@xs, @l2), @l2, @x)
, lcstable#1(nil(), @l2) -> ::(firstline(@l2), nil())
, lcstable#2(@m, @l2, @x) -> lcstable#3(@m, @l2, @x)
, lcstable#3(::(@l, @ls), @l2, @x) ->
::(newline(@x, @l, @l2), ::(@l, @ls))
, lcstable#3(nil(), @l2, @x) -> nil()
, newline(@y, @lastline, @l) -> newline#1(@l, @lastline, @y)
, max(@a, @b) -> max#1(#greater(@a, @b), @a, @b)
, max#1(#false(), @a, @b) -> @b
, max#1(#true(), @a, @b) -> @a
, newline#1(::(@x, @xs), @lastline, @y) ->
newline#2(@lastline, @x, @xs, @y)
, newline#1(nil(), @lastline, @y) -> nil()
, newline#2(::(@belowVal, @lastline'), @x, @xs, @y) ->
newline#3(newline(@y, @lastline', @xs),
@belowVal,
@lastline',
@x,
@y)
, newline#2(nil(), @x, @xs, @y) -> nil()
, newline#3(@nl, @belowVal, @lastline', @x, @y) ->
newline#4(right(@nl), @belowVal, @lastline', @nl, @x, @y)
, right(@l) -> right#1(@l)
, newline#4(@rightVal, @belowVal, @lastline', @nl, @x, @y) ->
newline#5(right(@lastline'), @belowVal, @nl, @rightVal, @x, @y)
, newline#5(@diagVal, @belowVal, @nl, @rightVal, @x, @y) ->
newline#6(newline#7(#equal(@x, @y),
@belowVal,
@diagVal,
@rightVal),
@nl)
, newline#7(#false(), @belowVal, @diagVal, @rightVal) ->
max(@belowVal, @rightVal)
, newline#7(#true(), @belowVal, @diagVal, @rightVal) ->
+(@diagVal, #pos(#s(#0())))
, newline#6(@elem, @nl) -> ::(@elem, @nl)
, right#1(::(@x, @xs)) -> @x
, right#1(nil()) -> #abs(#0())
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
Hurray, we answered YES(?,O(n^2))