10 Mar 2005
CS 3243 - FOL and Prolog
43
Queries
l
Can bind answers to questions to variables
l
Who is bob the son of? (X=harry)
l
?- son(bob, X).
l
Who is male? (X=bob, harry)
l
?- male(X).
l
Is 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.