WORST_CASE(?,O(n^1)) Solution: --------- "0" :: [] -(0)-> "nat"(0) "0" :: [] -(0)-> "nat"(1) "Cons" :: ["__ANY_TYPE__"(7) x "list"(7)] -(7)-> "list"(7) "Cons" :: ["__ANY_TYPE__"(3) x "list"(3)] -(3)-> "list"(3) "ConsTree" :: ["__ANY_TYPE__"(7) x "treelist"(7)] -(7)-> "treelist"(7) "False" :: [] -(0)-> "bool"(3) "False" :: [] -(0)-> "bool"(6) "False" :: [] -(0)-> "bool"(15) "Leaf" :: ["list"(7)] -(7)-> "tree"(7) "Nil" :: [] -(0)-> "list"(7) "Nil" :: [] -(0)-> "list"(3) "NilTree" :: [] -(0)-> "treelist"(7) "Node" :: ["list"(7) x "treelist"(7)] -(0)-> "tree"(7) "S" :: ["nat"(0)] -(0)-> "nat"(0) "S" :: ["nat"(1)] -(1)-> "nat"(1) "True" :: [] -(0)-> "bool"(3) "True" :: [] -(0)-> "bool"(6) "True" :: [] -(0)-> "bool"(15) "anyEq#2" :: ["nat"(0) x "list"(3)] -(8)-> "bool"(13) "bot[0]" :: [] -(0)-> "bool"(5) "bot[1]" :: [] -(0)-> "bool"(5) "eqNat#2" :: ["nat"(0) x "nat"(1)] -(1)-> "bool"(15) "ite#3" :: ["bool"(6) x "bool"(13)] -(1)-> "bool"(13) "ite2#3" :: ["bool"(3) x "bool"(3) x "bool"(3)] -(1)-> "bool"(3) "leqNat#2" :: ["nat"(0) x "nat"(1)] -(8)-> "bool"(14) "lookup#2" :: ["nat"(0) x "tree"(7)] -(4)-> "bool"(3) "main" :: ["nat"(14) x "tree"(9)] -(8)-> "bool"(0) Cost Free Signatures: --------------------- "0" :: [] -(0)-> "nat"_cf(0) "Cons" :: ["__ANY_TYPE__"_cf(0) x "list"_cf(0)] -(0)-> "list"_cf(0) "ConsTree" :: ["__ANY_TYPE__"_cf(0) x "treelist"_cf(0)] -(0)-> "treelist"_cf(0) "False" :: [] -(0)-> "bool"_cf(0) "Leaf" :: ["list"_cf(0)] -(0)-> "tree"_cf(0) "Nil" :: [] -(0)-> "list"_cf(0) "NilTree" :: [] -(0)-> "treelist"_cf(0) "Node" :: ["list"_cf(0) x "treelist"_cf(0)] -(0)-> "tree"_cf(0) "S" :: ["nat"_cf(0)] -(0)-> "nat"_cf(0) "True" :: [] -(0)-> "bool"_cf(0) "anyEq#2" :: ["nat"_cf(0) x "list"_cf(0)] -(0)-> "bool"_cf(0) "bot[0]" :: [] -(0)-> "bool"_cf(0) "bot[1]" :: [] -(0)-> "bool"_cf(0) "eqNat#2" :: ["nat"_cf(0) x "nat"_cf(0)] -(0)-> "bool"_cf(0) "ite#3" :: ["bool"_cf(0) x "bool"_cf(0)] -(0)-> "bool"_cf(0) "ite2#3" :: ["bool"_cf(0) x "bool"_cf(0) x "bool"_cf(0)] -(0)-> "bool"_cf(0) "leqNat#2" :: ["nat"_cf(0) x "nat"_cf(0)] -(0)-> "bool"_cf(0) "lookup#2" :: ["nat"_cf(0) x "tree"_cf(0)] -(0)-> "bool"_cf(0) Base Constructors: ------------------ "\"0\"_nat" :: [] -(0)-> "nat"(1) "\"Cons\"_list" :: ["__ANY_TYPE__"(1) x "list"(1)] -(1)-> "list"(1) "\"ConsTree\"_treelist" :: ["__ANY_TYPE__"(1) x "treelist"(1)] -(1)-> "treelist"(1) "\"False\"_bool" :: [] -(0)-> "bool"(1) "\"Leaf\"_tree" :: ["list"(1)] -(1)-> "tree"(1) "\"Nil\"_list" :: [] -(0)-> "list"(1) "\"NilTree\"_treelist" :: [] -(0)-> "treelist"(1) "\"Node\"_tree" :: ["list"(1) x "treelist"(1)] -(0)-> "tree"(1) "\"S\"_nat" :: ["nat"(1)] -(1)-> "nat"(1) "\"True\"_bool" :: [] -(0)-> "bool"(1) "\"bot[0]\"_bool" :: [] -(0)-> "bool"(1) "\"bot[1]\"_bool" :: [] -(0)-> "bool"(1) Parsed Typed Term Rewrite System: --------------------------------- (STRATEGY INNERMOST) (VAR "v4" "v2" "v6" "v10" "v8" "v48" "v56" "v20" "v16" "v1") (DATATYPES "bool" = < "bot[0]", "bot[1]", "False", "True" > "list" = µX.< "Nil", "Cons"("__ANY_TYPE__", X) > "nat" = µX.< "0", "S"(X) > "tree" = < "Leaf"("list"), "Node"("list", "treelist") > "treelist" = µX.< "ConsTree"("__ANY_TYPE__", X), "NilTree" >) (SIGNATURES "lookup#2" :: ["nat" x "tree"] --> "bool" "anyEq#2" :: ["nat" x "list"] --> "bool" "ite2#3" :: ["bool" x "bool" x "bool"] --> "bool" "ite#3" :: ["bool" x "bool"] --> "bool" "eqNat#2" :: ["nat" x "nat"] --> "bool" "leqNat#2" :: ["nat" x "nat"] --> "bool" "main" :: ["nat" x "tree"] --> "bool") (RULES "lookup#2"("v4","Leaf"("v2")) -> "anyEq#2"("v4","v2") "lookup#2"("v6","Node"("Nil"(),"ConsTree"("v4","v2"))) -> "lookup#2"("v6","v4") "lookup#2"("v2","Node"("Nil"(),"NilTree"())) -> "bot[0]"() "lookup#2"("v10","Node"("Cons"("v8","v6"),"ConsTree"("v4","v2"))) -> "ite2#3"("leqNat#2"("v10","v8"),"lookup#2"("v10","v4"),"lookup#2"("v10","Node"("v6","v2"))) "lookup#2"("v6","Node"("Cons"("v4","v2"),"NilTree"())) -> "bot[1]"() "anyEq#2"("v2","Nil"()) -> "False"() "anyEq#2"("v6","Cons"("v4","v2")) -> "ite#3"("eqNat#2"("v6","v4"),"anyEq#2"("v6","v2")) "ite2#3"("True"(),"v48","v56") -> "v48" "ite2#3"("False"(),"v48","v56") -> "v56" "ite#3"("True"(),"v4") -> "True"() "ite#3"("False"(),"v4") -> "v4" "eqNat#2"("0"(),"0"()) -> "True"() "eqNat#2"("S"("v20"),"0"()) -> "False"() "eqNat#2"("S"("v4"),"S"("v2")) -> "eqNat#2"("v4","v2") "eqNat#2"("0"(),"S"("v20")) -> "False"() "leqNat#2"("v8","0"()) -> "True"() "leqNat#2"("S"("v4"),"S"("v2")) -> "leqNat#2"("v4","v2") "leqNat#2"("0"(),"S"("v16")) -> "False"() "main"("v2","v1") -> "lookup#2"("v2","v1")) WORST_CASE(?,O(n^1))