10 Mar 2005
CS 3243 - FOL and Prolog
43
Queries
lCan bind answers to questions to variables
lWho is bob the son of? (X=harry)
l?- son(bob, X).
lWho is male? (X=bob, harry)
l?- male(X).
lIs bob the son of someone? (yes)
l?- son(bob, _).
–No variables bound in this case!
_ = Anonymous variable, don’t care what it’s bound to.