← Back to context

Comment by dflock

6 hours ago

There are a bunch of libraries that will do this - here's one example of a python one: https://github.com/yuce/pyswip - and a ruby one: https://github.com/preston/ruby-prolog

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!