Sunday, 18 January 2009

SWI-Prolog

SWI-Prolog is an open source implementation of the programming language Prolog, commonly used for teaching and semantic web applications, which is designed by Jan Wielemaker in 1987
SWI-Prolog runs on Unix, Windows, and Macintosh platforms.
SWI-Prolog can be downloaded from “http://www.swi-prolog.org”.


The program, sometimes called database is a text file (*.pl or *.pro) that contain the facts and rules that will be used by the user of the program.
First you have to create a facts and rules file which can be done by using notepad.
It contains all the relations that make this program.
When you launch a program you are in query modequery mode.
This mode is represented by the sign ? - at the begining of the line.
In query mode you ask questions about relations described in the program.

You can run the facts and rules file by double clicking, after running SWI-Prolog, by using “Consult” menu via “File” menu or typing the file name after ?- sign.
After running the file, all rules and facts are stored in prolog.
You can now use queries.

No comments:

Post a Comment