SPIDER Getting Started

SPIDER is the new SICStus Prolog IDE, based on Eclipse.

The following assumes that you have already installed SPIDER.

The screenshots below are from Eclipse 3.5 on Windows Vista but both SICStus and Eclipse looks almost the same on other platforms, such as Linux and Mac OS X, and the same or similar steps should be performed on all platforms. Note that current versions of SPIDER requires Eclipse 3.7 or later.

Full-size versions of the screenshots will open in a separate window when the thumbnail is clicked.

Hello World

There is a cheat sheet for creating a simple prolog project. This cheat sheet can be opened from the list of cheat sheets via the Help menu. It can also be opened as the final step in the "Initial set up ..." cheat sheet, as described in Setting up the SICStus IDE.

The cheat sheet will help you to create a Prolog "Project" with some initial contents, including a Prolog file.

In Eclipse, a Project is a collection of related files and folders, e.g. share the same settings and are compiled together.

Another important Eclipse concept is "Perspective". A Perspective is a layout of views and menus designed for a particular kind of task. SPIDER has two perspective "SICStus Prolog Development", for writing Prolog code, and "SICStus Prolog Debugging" for using the Prolog debugger.

Eclipse will automatically ask you whether you want to switch perspective. If you want you can modify a perspective by changing the layout and by adding or removing views. You can also manually open a Perspective from the Windows menu.

Start the SICStus Top-Level

To start the SICStus top-level you need to bring the SICStus top-level view to the front and then press the "Restart Prolog" button. You can do this with Open Top-level from the SICStus menu.

SICStus runs within Eclipse and interacts via the SICStus top-level view.

Some special commands are available by using the buttons at the top-right of the view. There is an interrupt button (with a "Pause" icon) as well as a command history mechanism.

There is a, currently invisible, divide between the input area at the bottom of the SICStus view and the output area. The output area is read-only, you can only enter new text in the input area.

Compile your Prolog Code

You compile (or consult) your code from the pop-up menu you can access by right clicking on a Prolog file (either in an editor or from the Project Explorer). You can also do this from the SICStus menu.

Of course, it is also possible to call compile/1 et al. directly from SICStus.

Run your Prolog Code

You run your code from the SICStus top-level, as usual.

Work With Existing Prolog Code

If you have existing Prolog code in some folder you can add a "link" to the existing external folder to allow Eclipse to work with the Prolog files in that folder without moving the folder contents.

First select (or create) a project and a folder within that project where you would like the link to the external folder to appear. Then chose New Folder from the File menu.

In the New Folder dialog the Advanced button will allow you to create the folder as a link to your existing folder.

Work With the Debugger

You enable the debugger using the trace/0 command etc. as usual.

When you then enter the Prolog debugger Eclipse will ask whether you want to switch to the SICStus Prolog Debug Perspective, a Perspective optimized for debugging. You should let Eclipse switch perspective.

You can switch between perspectives using the Window menu or by using the perspective buttons in the upper right corner of the Eclipse Window.

The debug perspective shows the Debug view in the upper right-hand corner. Its buttons correspond to variants of common Prolog debugger commands.

The Breakpoints view shows breakpoints. You can set spy-points and line breakpoints by double clicking in the left margin in a Prolog editor window (setting a breakpoint at the first like of a predicate will create a spy-point, other lines will create a line breakpoint).

The Variables view shows bindings for variables at the current debugger location.


Send feedback on SPIDER.