next up previous
Next: Constructing Data Structures Up: Adding Computation Domains: CLP Previous: Herbrand Terms: Syntactic Equality

Constructing Data Structures

  $\mbox{$\bullet$}$
Functors can be thought of as representing non-interpreted functions
  $\mbox{$\bullet$}$
This function is applied (but not interpreted) to its arguments
  $\mbox{$\bullet$}$
The main application of functors is as data structure constructors
  $\mbox{$\bullet$}$
Sample program, step by step
  $\mbox{$\bullet$}$
We have a small database of people who are friends:
friends(peter, mark).
friends(anna, marcia).
friends(anna, luca).
?- friends(anna, X).
X = marcia ;
X = luca

?- friends(X, anna).
no
  $\mbox{$\bullet$}$
No friends?



Last modification: Thu Oct 7 12:04:03 MEST 1999 <webmaster@clip.dia.fi.upm.es>