WORST_CASE(?,O(n^1)) Solution: --------- "0" :: [] -(0)-> "nat"(6) "0" :: [] -(0)-> "nat"(5) "0" :: [] -(0)-> "nat"(7) "Cons" :: ["__ANY_TYPE__"(14) x "list"(14)] -(14)-> "list"(14) "Cons" :: ["__ANY_TYPE__"(12) x "list"(12)] -(12)-> "list"(12) "Nil" :: [] -(0)-> "list"(14) "Nil" :: [] -(0)-> "list"(12) "Nil" :: [] -(0)-> "list"(15) "S" :: ["nat"(6)] -(6)-> "nat"(6) "S" :: ["nat"(2)] -(2)-> "nat"(2) "comp_f_g" :: ["nat"(6) x "nat"(6)] -(6)-> "nat"(6) "comp_f_g#1" :: ["nat"(6) x "nat"(6)] -(7)-> "nat"(2) "foldr#3" :: ["list"(12)] -(8)-> "nat"(6) "foldr_f#3" :: ["list"(12)] -(9)-> "nat"(0) "id" :: [] -(0)-> "nat"(6) "id" :: [] -(0)-> "nat"(13) "main" :: ["list"(14)] -(16)-> "nat"(0) "map#2" :: ["list"(14)] -(1)-> "list"(12) "plus_x" :: ["nat"(6)] -(0)-> "nat"(6) "plus_x" :: ["nat"(12)] -(0)-> "nat"(12) "plus_x" :: ["nat"(9)] -(0)-> "nat"(9) "plus_x#1" :: ["nat"(6) x "nat"(2)] -(4)-> "nat"(2) Cost Free Signatures: --------------------- Base Constructors: ------------------ "\"0\"_nat" :: [] -(0)-> "nat"(1) "\"Cons\"_list" :: ["__ANY_TYPE__"(1) x "list"(1)] -(1)-> "list"(1) "\"Nil\"_list" :: [] -(0)-> "list"(1) "\"S\"_nat" :: ["nat"(1)] -(1)-> "nat"(1) "\"comp_f_g\"_nat" :: ["nat"(0) x "nat"(0)] -(1)-> "nat"(1) "\"id\"_nat" :: [] -(0)-> "nat"(1) "\"plus_x\"_nat" :: ["nat"(0)] -(0)-> "nat"(1) Parsed Typed Term Rewrite System: --------------------------------- (STRATEGY INNERMOST) (VAR "v3" "v2" "v1" "v16" "v6" "v8" "v10") (DATATYPES "list" = µX.< "Nil", "Cons"("__ANY_TYPE__", X) > "nat" = µX.< "plus_x"(X), "comp_f_g"(X, X), "id", "0", "S"(X) >) (SIGNATURES "comp_f_g#1" :: ["nat" x "nat"] --> "nat" "map#2" :: ["list"] --> "list" "plus_x#1" :: ["nat" x "nat"] --> "nat" "foldr_f#3" :: ["list"] --> "nat" "foldr#3" :: ["list"] --> "nat" "main" :: ["list"] --> "nat") (RULES "comp_f_g#1"("plus_x"("v3"),"comp_f_g"("plus_x"("v2"),"v1")) -> "plus_x#1"("v3","comp_f_g#1"("plus_x"("v2"),"v1")) "comp_f_g#1"("plus_x"("v3"),"id"()) -> "plus_x#1"("v3","0"()) "map#2"("Nil"()) -> "Nil"() "map#2"("Cons"("v16","v6")) -> "Cons"("plus_x"("v16"),"map#2"("v6")) "plus_x#1"("0"(),"v6") -> "v6" "plus_x#1"("S"("v8"),"v10") -> "S"("plus_x#1"("v8","v10")) "foldr_f#3"("Nil"()) -> "0"() "foldr_f#3"("Cons"("plus_x"("v2"),"v1")) -> "comp_f_g#1"("plus_x"("v2"),"foldr#3"("v1")) "foldr#3"("Nil"()) -> "id"() "foldr#3"("Cons"("plus_x"("v2"),"v1")) -> "comp_f_g"("plus_x"("v2"),"foldr#3"("v1")) "main"("v3") -> "foldr_f#3"("map#2"("v3"))) WORST_CASE(?,O(n^1))