How do I check if a specific fact exists in my prolog database

Viewed 2506

I'm making a question and answer system in prolog. If I say, "the color of the car is blue," fact(car, color, blue) is added to the database and prolog returns "OK".

How do I check that this specific fact exists? I know you can check if predicates exists, but I want to know how to check that exactly fact(car, color, blue) exists and not that another fact like fact(car, feeling, smooth) exists.

I'm doing this so that when I say, "the color of the car is blue" it returns, "I know," instead of "OK," since the fact is now in the database.

1 Answers
Related