Hi,
I'm running the following code:
from pyswip import *
prolog = Prolog()
prolog.assertz("smokes(j)")
prolog.assertz("smokes(b)")
prolog.assertz("friends(j,b)")
prolog.assertz("friends(b,j)")
prolog.assertz("cancer(X) :- smokes(X)")
prolog.assertz("smokes(Y) :- friends(X,Y), smokes(X)")
q = prolog.query("smokes(Z)")
print(list(q))
This returns the error "Too many stacked strings". I'm sure there is an obvious problem with my code, but I don't see what the problem in my code is. I'd benefit from any trouble-shooting.
best,
Symon