next up previous
Next: Test Sample Program Up: prolog Previous: Structure of Prolog Programs

Sample Program

likes(mary,food).
likes(mary,wine).
likes(john,food).
likes(john,wine).
% End of program - this is a one-line comment.
/* This is a multi-line comment.
   Note that you can add white space anywhere except between predicate name
   and ``(''. */

This program enters four statements into Prolog.
Store this in intro.pl.