Remove recursion in the DAG functions
gabriel-barrett opened this issue · comments
Gabriel Barreto commented
The Term<->DAG conversion functions, DAG clone and printing, free_dead_node
, upcopy
and clean_up
are all recursive. These functions will potentially overflow the stack when the DAG is large enough. To solve this, we need to remove recursion and instead do BFS or DFS search with an explicit stack.
John Chandler Burnham commented
linking to #43
nothingnesses commented
Is this being worked on? If not, I can try to make a start on it. The gist of this is that the functions mentioned above have to be rewritten to use loops that modify some data instead of recursions, right?