next up previous
Next: Constructing Recursive Data Structures: Up: Adding Computation Domains: CLP Previous: Constructing Recursive Data Structures

Constructing Recursive Data Structures: Lists

  $\mbox{$\bullet$}$
Lists:
  $\mbox{$\bullet$}$
The functor name usually associated with lists is `.'
  $\mbox{$\bullet$}$
The constant name used to denote the empty list is []
  $\mbox{$\bullet$}$
E.g., .(a, .(b, .(c, []))) is the list comprised by the elements a, b, and c
  $\mbox{$\bullet$}$
When some term is a list:
is_list([]).
is_list(.(Head, Tail)):- is_list(Tail).



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