Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using eclipse for Prolog

I have to use eclipse (with ProDT) for running swi-prolog. I installed ProDT via help->install new software, opened the prolog perspective, made a new prolog project and a new file called HelloProlog.pl with the lines I was given:

% helloprolog.pl
hello :- write('Hello Prolog World!').

Then whenever I tried to run the file (by pressing the green play button) I got the message Unable to launch; The selection cannot be launched, and there are no recent launches.

I did check Windows->Preferences->Prolog->Interpreters and added the swipl.exe of the swi-prolog directory, but nothing changed.

I suspect the problem is that there are no Run configurations for Prolog (Prolog is not in that list), but I have now idea how to set those up.

Can anyone tell me what I'm doing wrong?

like image 752
flawr Avatar asked Jun 07 '26 17:06

flawr


1 Answers

Perhaps you can try the following (taken from here):

Create or Select a Prolog Process

After opening the Prolog Perspective, create or select a Prolog process in the Prolog Console View .

  • Select: Click on the first icon in the Prolog Console's toolbar (“Process Switcher”) to see which Prolog processes are currently running. Select one of them.

  • Create: Click on the second icon in the toolbar (“Create Process”) and enter a name (any string).

The name of the selected or newly created process will appear in the top left corner of the Prolog Console. If the process was newly created, you will see the welcome message displayed below.

Now you can use the Prolog Console to run your Prolog queries.

like image 156
SND Avatar answered Jun 10 '26 14:06

SND



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!