ec icon indicating copy to clipboard operation
ec copied to clipboard

Python enumeration with contextual grammar network?

Open CatherineWong opened this issue 5 years ago • 1 comments

Since Python enumeration was resurrected for Puddleworld - I'm hitting an error now that makes me suspect that python enumeration doesn't work for the ContextualGrammarNetwork, given how primitive indices are stored?


Traceback (most recent call last): File "../ec/dreamcoder/enumeration.py", line 230, in _f r = f(*a, **k) File "../ec/dreamcoder/enumeration.py", line 366, in solveForTask_python lowerBound=lowerBound, upperBound=upperBound) File "../ec/dreamcoder/enumeration.py", line 409, in enumerateForTasks lowerBound=previousBudget): File "../ec/dreamcoder/grammar.py", line 1161, in enumeration maximumDepth=maximumDepth): File "../ec/dreamcoder/grammar.py", line 1182, in enumeration maximumDepth=maximumDepth - 1): File "../ec/dreamcoder/grammar.py", line 1215, in enumerateApplication maximumDepth=maximumDepth): File "../ec/dreamcoder/grammar.py", line 1182, in enumeration maximumDepth=maximumDepth - 1): File "../ec/dreamcoder/grammar.py", line 1227, in enumerateApplication argumentIndex=argumentIndex + 1): File "../ec/dreamcoder/grammar.py", line 1215, in enumerateApplication maximumDepth=maximumDepth): File "../ec/dreamcoder/grammar.py", line 1161, in enumeration maximumDepth=maximumDepth): File "../ec/dreamcoder/grammar.py", line 1166, in enumeration else: g = self.library[parent][parentIndex] TypeError: list indices must be integers or slices, not Primitive

CatherineWong avatar Jul 09 '19 18:07 CatherineWong

Bug should be fixed, but let me know if it doesn't work.

ellisk42 avatar Jul 10 '19 17:07 ellisk42