A program as a DAG.... Whoa. That's an interesting concept to try to wrap your mind around.
http://docs.openstack.org/developer/taskflow/
https://pypi.python.org/pypi/taskflow
And yes u can do things like built equation solvers to:
http://docs.openstack.org/developer/taskflow/examples.html#l...
And other neat things: