PPT Slide
Facts are about relations on objects which are constants.
Queries can also contain variables.
| ? - teaches( shapiro , X ) .
| ? - teaches( X , cse341 ) .
X = shapiro ; X = notkin ; no
Queries with variables are called existential queries in logic.
corresponds to asking Prolog to prove the theorem
X: teaches( shapiro , X )
Prolog proves the theorem by searching the database to find a matching fact.