I actually suspect that your "supremum" and "infimum" functions are the
problem here -- they look like they might be accumulating thunks and blowing
your stack. But beyond this, they're also o(n) for what could be effectively
an o(log n) operation at the least, if you used ordered sets.
I'd start i
This is only a guess, but an educated guess: there is no silver bullet
for memoization in Haskell. There are, however, some somewhat more
general approaches you may be interested in. I think this hasn't been
researched extremely throughly yet, but see http://www.cs.utexas.edu/~wcook/Drafts/20
Hello,
I wrote a program in haskell that works with lattice finite automata
(the generalization of notion of finite state automata). Let me post
the source code as it is not that long...
The problem is that my algorithm that computes the run (see function
fun) of an automaton on the given word is