2 ms·
Thanks for the reference! `pyswip` is the closest I've seen so far: pl.consult("some-facts.pl") pl.assertz("new(fact)") while pl.Query(...).nextSol
by ramses0 11mo ago
Thanks for the reference! `pyswip` is the closest I've seen so far:
pl.consult("some-facts.pl")
pl.assertz("new(fact)")
while pl.Query(...).nextSolution():
print( X.value )
...will definitely keep it in my back pocket!
- dragonwriter 11mo agopyswip is a one-way python-to-SWI-prolog interface; there's also a first-party (maintained as part of SWI-prolog), two-way one called janus-swi. https://pypi.org/project/janus-swi/ https://pypi.org/project/janus-swi/ https://www.swi-prolog.org/pldoc/man?section=janus-call-prolog https://www.swi-prolog.org/pldoc/man?section=janus-call-prol...