Send Close Add comments: (status displays here)
Got it!  This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
TuProlog IDE


1. TuProlog IDE

2. Command line
TuProlog can be used in command line mode in the traditional edit-run cycle.

3. IDE
There is a simple IDE (Integrated Development Environment) for TuProlog as described in the PDF manuel. This page provides some additional details. Here is the command from the manual.
java -jar 2p.jar


4. Java
If java cannot be found, then it needs to be installed or a complete path to java may be needed.

For more on installing and using Java, see Java .

5. TuProlog
If 2p.jar cannot be found, then it needs to be downloaded and extracted or a complete path to 2p.jar is needed.

For more on installing and using TuProlog, see tuprolog .

6. IDE
tuProlog IDEThe IDE is written in Java so is portable to Windows, Linux, Apple, etc. The IDE looks similar to what is pictured here.

In the IDE, the Prolog program text is referred to as the "Theory"

7. Hello world
Here is program in TuProlog to enumerate and output the values for three logical variables.

Here is the Prolog code.

Here is the output of the Prolog code.


8. IDE use
tuProlog IDE with loaded textCopy the above text and paste it into the top edit area in the IDE. Note: One would normally type and make changes here.

Note that double quoted string literals will be automatically converted to singe quote string literals.

There are two edit buttons for "Undo Edit Action" and "Redo Edit Action".

9. Save the program text
Click the "Save" button to provide a name and save the text as a Prolog text file.

10. Run the program text
To "Run" the program one needs to do the following.

11. Output
TuProlog IDE outputThe output in the "output" tab is as follows.
X Y Z ----- 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1

This the expected output.

12. Solution
To avoid the "no" in the "solution" one can add the following predicate to the program after the "go" predicate.
go.

This tells Prolog that after backtracking on a fail the last thing to try is the second "go" which succeeds.

The "solution" tab now displays the following text.
yes. Solution: solve


13. End of page

14. Acronyms and/or initialisms for this page