47

I need to write some Prolog programs for a class.

Any recommendations?

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Marcos Lara
  • 1,883
  • 5
  • 18
  • 20

14 Answers14

23

Prolog mode for (X)Emacs.

See http://bruda.ca/emacs-prolog/

Marcos Lara
  • 1,883
  • 5
  • 18
  • 20
16

As mentioned you can use SWI-Prolog. If you like Eclipse there is an Eclipse plug-in that integrates SWI-Prolog into Eclipse. This way you have the best of both worlds, for example the SVN etc functions of Eclipse and the graphic debugger of SWI-Prolog. Worth checking out.

http://sewiki.iai.uni-bonn.de/research/pdt/start

BernardMarx
  • 916
  • 8
  • 17
  • @user2278330 - Welcome to Stack Overflow. If you have a question, please [open a new thread](http://stackoverflow.com/questions/ask), rather than modifying an existing answer. You can include a link to this response if its relevant. – Leigh Apr 13 '13 at 21:24
14

SWI-Prolog comes with excellent IDE tools, an Emacs-clone text editor, interactive debugger, complete browseable help system and docs. Give it a try.

ThomasH
  • 22,276
  • 13
  • 61
  • 62
7

I've not tried it (mostly because I never thought to combine the words "Prolog" and "NetBeans" before now), but there appears to be Prolog support for NetBeans. It's not a simple plugin, but a tutorial that shows how to add Prolog support to NetBeans.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
  • I'd say NetBeans was _way_ overkill for Prolog. I find any old text editor (gedit does okay, but I use a Mac with SubEthaEdit). If you can change a mode so that comments are marked, there isn't really much syntax to highlight! – Matthew Schinckel Nov 12 '08 at 12:28
  • If you were already using NetBeans for Java, C++, or Ruby, though, you'd be familiar with it and want to use it for Prolog too. – Bill the Lizard Nov 12 '08 at 12:51
  • NB ide doesn't support Prolog. What you refer to is how to create an IDE that supports Prolog based on NB Platform. – simpatico Jul 12 '10 at 13:24
  • @simpatico: Thanks, I updated my answer to try and make it more clear that the link goes to a tutorial, not a plugin. – Bill the Lizard Jul 12 '10 at 13:46
7

A good point to start is to use Emacs' default Prolog mode plus the additions described here. You can also try ediprolog, which aims for a tighter Emacs-Prolog integration.

titusfx
  • 1,896
  • 27
  • 36
Ryszard Szopa
  • 5,431
  • 8
  • 33
  • 43
6

Ideone supports Prolog. You can use it online just with a browser.

kuszi
  • 2,069
  • 29
  • 36
5

Prolog Development Tools (ProDT) is a Prolog Integrated Development Environment (IDE) aiming to be as rich in functionality as the Eclipse's java IDE, giving the developer a single environment where it can control the development of a Prolog project from code edition, test execution, etc...

This project stands on top of Eclipse's projects to take advantage of its already existent features and its extensibility and works on any environment Eclipse works including windows, linux and mac OSX.

It support as underlying interpreters: SWI-prolog, XSB prolog, B-prolog

The site has more information about the project including installation and features list: http://prodevtools.sourceforge.net/

Hope you can find it useful!!! :)

Metal Fan
  • 71
  • 1
  • 2
  • Fantastic recommendation, and it worked for me (MacBook Pro) right out of the box. I had a lot of trouble with Swi-Prolog's built-in one. – Dave Jan 29 '11 at 16:33
5

SPIDER is a Eclipse-based IDE for SICStus Prolog. SICStus Prolog also has a very useful Emacs mode.

JesperE
  • 63,317
  • 21
  • 138
  • 197
3

If you are used to an Emacs environment I would recommend the Ciao distribution. Go to: http://ciaohome.org/

mll
  • 195
  • 2
  • 13
3

swi prolog and emacs extension is preinstalled in almost every linux distribution. You can check this using e.g., the commands below in and X11-enabled (graphical) environment. This should open a new window with the built-in Emacs clone.

% swipl
?- emacs.

http://www.swi-prolog.org/build/LinuxDistro.txt

Karl Adler
  • 15,780
  • 10
  • 70
  • 88
2

Visual Prolog (works with Wine).

cdmckay
  • 31,832
  • 25
  • 83
  • 114
Ville Laitila
  • 1,187
  • 11
  • 18
1

I just use Vim or jEdit. Prolog as a language doesn't really lend itself to strong IDE support. For one thing, it's dynamically typed, which throws a huge wrench into tooling. For another, it's a logic-based language, which means that the "code flow" (order in which you construct the program) is non-linear. Existing techniques for building highly advanced IDEs just don't apply to that sort of paradigm.

Daniel Spiewak
  • 54,515
  • 14
  • 108
  • 120
  • 3
    I don't agree. Prolog is a fundamentally different language that say OO, but that doesn't mean that it doesn't lend itself to strong IDE support. One problem with many languages which cause trouble when doing an IDE is that the existing language implementations do not expose a powerful enough API to access things like the AST and program semantics. Eclipse has a Java compiler explicitly designed to interact with an IDE which makes it much easier to do things like advanced refactoring. – JesperE Sep 04 '10 at 06:28
  • Daniel, you may want to check e.g. PDT, available at https://sewiki.iai.uni-bonn.de/research/pdt/start – Paulo Moura Apr 22 '12 at 21:21
1

You could use Gprolog, we use that in our class. Use consult('filename') to load the database.

Javed Ahamed
  • 2,804
  • 6
  • 32
  • 41
0

Honestly, I can't see an 'IDE' helping out much on prolog. It'll only aid in finding syntax errors. The rest is in the debugging and the thought process.

Get syntax-highlighting with any editor and you're set to go.

Ehtesh Choudhury
  • 7,452
  • 5
  • 42
  • 48