ellisk42 / ec

MIT License
482 stars 138 forks source link

Error in New Domains Script incr.py #78

Closed sreejank closed 3 years ago

sreejank commented 3 years ago

Hello! Really love this model and repo. I was trying to run the incr.py example you give and creating new domains and got the following error. I am using the singularity container and am on a Linux machine.

PANIC! Exception in child worker: MAX RAISE Traceback (most recent call last): File "/home/sreej/ec/bin/../dreamcoder/enumeration.py", line 302, in solveForTask_ocaml response = json.loads(response.decode("utf-8")) File "/usr/local/conda/lib/python3.8/json/init.py", line 357, in loads return _default_decoder.decode(s) File "/usr/local/conda/lib/python3.8/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/conda/lib/python3.8/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/sreej/ec/bin/../dreamcoder/enumeration.py", line 238, in _f r = f(*a, **k) File "/home/sreej/ec/bin/../dreamcoder/enumeration.py", line 312, in solveForTask_ocaml assert False, "MAX RAISE" AssertionError: MAX RAISE

Traceback (most recent call last): File "bin/incr.py", line 88, in for i, _ in enumerate(generator): File "/home/sreej/ec/bin/../dreamcoder/dreamcoder.py", line 379, in ecIterator evaluateOnTestingTasks(result, testingTasks, grammar, File "/home/sreej/ec/bin/../dreamcoder/dreamcoder.py", line 526, in evaluateOnTestingTasks testingFrontiers, times = multicoreEnumeration(grammar, testingTasks, File "/home/sreej/ec/bin/../dreamcoder/enumeration.py", line 186, in multicoreEnumeration assert False

sreejank commented 3 years ago

An update: I also get this error when running bin/text.py, but when I re-compile the Ocaml code without the added new primitives, I don't get this error anymore. It seems there is an issue with adding new primitives?

sreejank commented 3 years ago

Figured out the issue. primitive_increment is already defined in program.ml, so when I was following the instructions in the new domains guide, I inadvertently defined it twice. Could be worth mentioning to only add primitive_increment2 in those instructions.