next up previous
Next: No Directionality! Up: CS206 Lecture 01 Formal Previous: Querying a Logic Program

Queries with Variables

Queries can also be of the form:

?- plus(2,3,X).
?- plus(2,4,Y).
where uppercase letters denote variables.

Now the interpreter will answer

 X = 5
for first query and
 Y = 6
for second query.

This seems to be doing some computing.

But nothing new from imperative or functional programming yet.



G. Sivakumar 2002-12-31