Infinite recursion
In this example, we have a cyclic dependency:
orr = Reaction 2 H2 + O2 = 2 H2O: ((free_energy: -4.916) [eV])
H2O = Species H2O ((free_energy: 0.0) [eV/K])
H2 = Species H2 ((free_energy: 0.0 [eV/K]))
O2 = Species O2 (
(free_energy: 2.*H2O.free_energy[0] - 2.*H2.free_energy[0] - orr.free_energy[0])
)
print(O2)
This is, unfortunately, not detected by the model processor that detects cycles statically. This python error occurs (instant, deferred evaluation):
textx.exceptions.TextXError: vre-language/examples/infinite_recursion.vm:1:1: maximum recursion depth exceeded while calling a Python object => 'orr = Reaction 2 H2 + O2 = 2 H2O: ((free_energy: -4.916) [eV])'
In workflow evaluation, the interpreter is hanging - probably collecting fireworks in memory before writing out to database!
The behavior should be like for this program:
c = ('e': a)
a = ('b': c)
Cyclic dependency: vre-language/examples/infinite_recursion.vm:12:11
Cyclic dependency:
variable: c, loc: {'line': 11, 'col': 1, 'filename': 'vre-language/examples/infinite_recursion.vm'}
reference: {'line': 12, 'col': 11, 'filename': 'vre-language/examples/infinite_recursion.vm'}