WORST_CASE(?,O(n^1)) Solution: --------- "Cons" :: ["__ANY_TYPE__"(0) x "list"(0)] -(0)-> "list"(0) "Cons" :: ["__ANY_TYPE__"(0) x "list"(1)] -(1)-> "list"(1) "Cons" :: ["__ANY_TYPE__"(0) x "list"(4)] -(4)-> "list"(4) "Leaf" :: ["__ANY_TYPE__"(0)] -(9)-> "tree"(9) "Nil" :: [] -(0)-> "list"(1) "Nil" :: [] -(0)-> "list"(14) "Node" :: ["tree"(9) x "tree"(9)] -(9)-> "tree"(9) "dfsAcc#3" :: ["tree"(9) x "list"(4)] -(0)-> "list"(4) "main" :: ["tree"(15)] -(16)-> "list"(0) "revApp#2" :: ["list"(1) x "list"(0)] -(15)-> "list"(0) Cost Free Signatures: --------------------- "Cons" :: ["__ANY_TYPE__"_cf(0) x "list"_cf(0)] -(0)-> "list"_cf(0) "Leaf" :: ["__ANY_TYPE__"_cf(0)] -(0)-> "tree"_cf(0) "Nil" :: [] -(0)-> "list"_cf(0) "Node" :: ["tree"_cf(0) x "tree"_cf(0)] -(0)-> "tree"_cf(0) "dfsAcc#3" :: ["tree"_cf(0) x "list"_cf(0)] -(0)-> "list"_cf(0) "revApp#2" :: ["list"_cf(0) x "list"_cf(0)] -(0)-> "list"_cf(0) Base Constructors: ------------------ "\"Cons\"_list" :: ["__ANY_TYPE__"(0) x "list"(1)] -(1)-> "list"(1) "\"Leaf\"_tree" :: ["__ANY_TYPE__"(0)] -(1)-> "tree"(1) "\"Nil\"_list" :: [] -(0)-> "list"(1) "\"Node\"_tree" :: ["tree"(1) x "tree"(1)] -(1)-> "tree"(1) Parsed Typed Term Rewrite System: --------------------------------- (STRATEGY INNERMOST) (VAR "v1" "v2" "v6" "v4" "v8" "v16") (DATATYPES "list" = µX.< "Nil", "Cons"("__ANY_TYPE__", X) > "tree" = µX.< "Leaf"("__ANY_TYPE__"), "Node"(X, X) >) (SIGNATURES "revApp#2" :: ["list" x "list"] --> "list" "dfsAcc#3" :: ["tree" x "list"] --> "list" "main" :: ["tree"] --> "list") (RULES "revApp#2"("Nil"(),"Cons"("v1","v2")) -> "Cons"("v1","v2") "revApp#2"("Cons"("v6","v4"),"v2") -> "revApp#2"("v4","Cons"("v6","v2")) "dfsAcc#3"("Leaf"("v8"),"v16") -> "Cons"("v8","v16") "dfsAcc#3"("Node"("v6","v4"),"v2") -> "dfsAcc#3"("v4","dfsAcc#3"("v6","v2")) "main"("v1") -> "revApp#2"("dfsAcc#3"("v1","Nil"()),"Nil"())) WORST_CASE(?,O(n^1))