
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.Īfter running the file, all rules and facts are stored in prolog. In query mode you ask questions about relations described in the program. This mode is represented by the sign ? - at the begining of the line. When you launch a program you are in query modequery mode. A QUERY is predicate0, predicate1,, predicateN A non-empty sequence of predicates. Given a prolog program we invoke a computation by entering a QUERY. The order in which the rules appear in the file is important. It contains all the relations that make this program. Prolog Programa and Queries A Prolog program is specified by writing a set of rules. Step 3: New webpage will open, click on Stable release. Step 2: Click on Download which is adjacent to Home, dropdown list will appear then click on SWI-Prolog. Perlu diingat dalam penamaan nama file harus sama persis dengan nama yang sudah dibuat sebelumnya. Installing SWI Prolog onWindows: Follow the below steps to install SWI Prolog on Windows: Step 1: Visit website using any web browser. Buka jendela baru dalam bentuk notepad deangan nama file yang sudah kita beri nama sebelumnya. 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.įirst you have to create a facts and rules file which can be done by using notepad. Pilih File New (Beri nama file bebas dengan extension. SWI-Prolog runs on Unix, Windows, and Macintosh platforms. 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
