-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to access and edit knowledge base entries? #113
Comments
Regarding editing entries
ref: A Concise Introduction to Prolog - Variables section. I supposed instead of assigning a new values rather would need to create a new instance of Prolog and run all the statements again apart from assigning value to |
This is a question from a total beginner in Prolog.
I know knowledge base entries or facts can be created as follows,
pyswip/examples/father.py
Lines 35 to 37 in 1ad3ce2
I'm wondering how to edit the knowledge base, i.e change the facts.
For instance, I create variable
Position
and assign it a value4
What is the best way to extract the value of
Position
? The way I found iswhich outputs
but it seems a bit strange because I am creating a new variable to access an existing variable. Let's say now I want this value to be different, for instance I already run my queries and now I want
Position
to be8
which outputs
so now
Position
takes two values, both4
and8
. I can imagine why, probably Prolog is just storing what is true and I indicated the true statement for both values... Is there a way to ensure variable takes only one value that can be changed?The text was updated successfully, but these errors were encountered: