Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: