Metarules example doesn't work in version 4
Closed this issue · 1 comments
viyx commented
Hi, I try to learn from metarules. There was an example in version v2 of Popper called Metarules, but it doesn't work in version 4. Could you provide right example[s] for metarules.
Error stack from version 4
(popper3.9) (base) vii@Vitaliis-MacBook-Air Popper % python popper.py examples/metarules
10:53:57 Generating programs of size: 3
Traceback (most recent call last):
File "/Users/vii/Documents/prolog/repos/Popper/popper.py", line 8, in <module>
prog, score, stats = learn_solution(settings)
File "/Users/vii/Documents/prolog/repos/Popper/popper/loop.py", line 1716, in learn_solution
timeout(settings, popper, (settings, tester, bkcons), timeout_duration=int(settings.timeout-time_so_far),)
File "/Users/vii/Documents/prolog/repos/Popper/popper/util.py", line 81, in timeout
result = func(*args, **kwargs)
File "/Users/vii/Documents/prolog/repos/Popper/popper/loop.py", line 1641, in popper
Popper(settings, tester).run(bkcons)
File "/Users/vii/Documents/prolog/repos/Popper/popper/loop.py", line 324, in run
cons_ = tuple(self.explain_incomplete(prog))
File "/Users/vii/Documents/prolog/repos/Popper/popper/loop.py", line 988, in explain_incomplete
unsat_cores = self.explain_totally_incomplete(prog)
File "/Users/vii/Documents/prolog/repos/Popper/popper/loop.py", line 1379, in explain_totally_incomplete
return list(self.explain_totally_incomplete_aux2(prog, set(), set()))
File "/Users/vii/Documents/prolog/repos/Popper/popper/loop.py", line 1478, in explain_totally_incomplete_aux2
if self.tester.is_body_sat(body):
File "/Users/vii/Documents/prolog/repos/Popper/popper/tester.py", line 245, in is_body_sat
return bool_query(query)
File "/Users/vii/Documents/prolog/repos/Popper/popper/tester.py", line 23, in bool_query
return query_once(query)['truth']
File "/Users/vii/mambaforge/envs/popper3.9/lib/python3.9/site-packages/janus_swi/janus.py", line 245, in query_once
return _swipl.call(query, inputs, keep)
janus_swi.janus.PrologError: '$c_call_prolog'/0: Domain error: `py_term' expected, found `w(_14810,_14924)'
andrewcropper commented
Hi,
I am sorry for the long delay in replying. Thanks for spotting this issue. It should now be fixed with this commit bf7bdd5
Kind regards,
Andrew