Comment by ramses0
13 hours 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!
pyswip 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://www.swi-prolog.org/pldoc/man?section=janus-call-prol...