Lecture 1
Lecture 2
Lecture 3
Lecture 4
Lecture 5

Starting Prolog

  • Start a terminal. (The little icon of a computer screen.)
  • Type pl at the prompt.
  • You should then see something like this on your screen:
    Welcome to SWI-Prolog (Multi-threaded, Version 5.2.13)
    Copyright (c) 1990-2003 University of Amsterdam.
    SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to redistribute it under certain conditions.
    Please visit for details.
    For help, use ?- help(Topic). or ?- apropos(Word).
  • You can now send commands and queries to the Prolog interpreter by typing them in after the ?- prompt.
  • For example, type listing. (don't forget the full stop at the end) and press 'return'.
  • You should get something like:
    %   Foreign: rl_read_init_file/1
    %   Foreign: rl_add_history/1
    listing is a command that makes Prolog show you the facts and rules that are currently loaded. It seems that something has been loaded (Foreign: rl_read_init_file/1 ... ), but you ignore it and except for that the knowledge base is empty. And it should be, since you have not actually loaded anything, yet.

Next: Loading and querying knowledge bases.

Back to the practical session of day 1.