[cduce-users] Function takes more than 5 minutes to compile

Alain Frisch Alain.Frisch at inria.fr
Mon May 29 14:35:47 CEST 2006


Artur Miguel Dias wrote:
> I tried to isolate in a small function a problem a student of mine found
> in cduce 0.4. This silly function takes more than 5 minutes to compile.
> 
> let f(p : [Any*]) : [Any*] =
>   let res = (
>    xtransform p with
>       <t>[<a>[]] -> []
>     | <t>[<t>[]] -> [<t>[]]
>     | <t>[x] -> [<a>[x]]
>    ) in res
> ;;
> 
> I generated cduce 0.4 using godi in Ubuntu 6.06.

Thanks for the very focused bug report. This is now fixed in the CVS.

Generally speaking, I would advise to give an explicit type annotation
on the result of an xtransform before pattern matching it. The reason is
that the result type of an xtransform is usually quite complex, which
might in some situations put too much pressure on the pattern matching
compiler. (Of course, this should not happen when the pattern matching
has a single match-all branch as above.)

-- Alain



More information about the Cduce-users mailing list