pickable_object(pen).
pickable_object(paper).
Now after I add a new fact using pyswip:
prolog.assertz('pickable_object(light)')
The query
for result in prolog.query('pickable_object(X)'):
print(result)
works perfectly and it prints:
{'X': 'pen'} {'X': 'paper'} {'X': 'light'}
But, the assertion does not get written to the '.pl' file. How do I enable this?
As a workaround, I am simply appending the new clause string as a new line, treating as a text file. Is this fine?