SWI-Prolog
Encyclopedia
SWI-Prolog is an open source
Open source
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...

 implementation of the programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 Prolog
Prolog
Prolog is a general purpose logic programming language associated with artificial intelligence and computational linguistics.Prolog has its roots in first-order logic, a formal logic, and unlike many other programming languages, Prolog is declarative: the program logic is expressed in terms of...

, commonly used for teaching and semantic web
Semantic Web
The Semantic Web is a collaborative movement led by the World Wide Web Consortium that promotes common formats for data on the World Wide Web. By encouraging the inclusion of semantic content in web pages, the Semantic Web aims at converting the current web of unstructured documents into a "web of...

 applications.
It has a rich set of features, libraries
Library (computer science)
In computer science, a library is a collection of resources used to develop software. These may include pre-written code and subroutines, classes, values or type specifications....

 for
constraint logic programming,
multithreading
Thread (computer science)
In computer science, a thread of execution is the smallest unit of processing that can be scheduled by an operating system. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...

,
unit testing,
GUI
Gui
Gui or guee is a generic term to refer to grilled dishes in Korean cuisine. These most commonly have meat or fish as their primary ingredient, but may in some cases also comprise grilled vegetables or other vegetarian ingredients. The term derives from the verb, "gupda" in Korean, which literally...

,
interfacing to Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

, ODBC and others,
literate programming
Literate programming
Literate programming is an approach to programming introduced by Donald Knuth as an alternative to the structured programming paradigm of the 1970s....

,
a web server
Web server
Web server can refer to either the hardware or the software that helps to deliver content that can be accessed through the Internet....

,
SGML, RDF
Resource Description Framework
The Resource Description Framework is a family of World Wide Web Consortium specifications originally designed as a metadata data model...

, RDFS,
developer tools (including an IDE
Integrated development environment
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

 with a GUI debugger
Debugger
A debugger or debugging tool is a computer program that is used to test and debug other programs . The code to be examined might alternatively be running on an instruction set simulator , a technique that allows great power in its ability to halt when specific conditions are encountered but which...

 and GUI profiler), and extensive documentation.

SWI-Prolog runs on Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

, Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

, and Macintosh platforms.

SWI-Prolog has been under continuous development since 1987. Its main author is Jan Wielemaker.
The name SWI is derived from Sociaal-Wetenschappelijke Informatica ("Social Science Informatics"), the former name of the group at the University of Amsterdam, where Wielemaker is employed. The name of this group has changed to HCS (Human-Computer Studies).

User interface

SWI-Prolog is called by a command
swipl


Initially, it expects only queries, each ended by a period. An attempt to write a program will cause an error:
?- human(john).
ERROR: Undefined procedure: human/1

Here ?- is a system prompt. All the system output is shown in red color for illustration purposes.

Programs should be stored in a file and then read into the Prolog interpreter, by means of the query
?-consult(file).
which can be abbreviated
?-[file].

In order to type a program interactively, the following command should be used
?-consult(user).
or
?-[user].
Then everything up to the next Ctrl-D is inserted into the database.

XPCE

XPCE is a platform independent GUI toolkit for SWI-Prolog, Lisp and other interactive and dynamically typed languages. Although XPCE was designed to be language-independent, it has gained popularity most with Prolog. The development XPCE graphic toolkit started in 1987, together with SWI-Prolog.

It supports buttons
Button (computing)
In computing, a button is a user interface element that provides the user a simple way to trigger an event, like searching for a query at a search engine, or to interact with dialog boxes, like confirming an action.-Description:A typical button is a rectangle or rounded rectangle, wider than it is...

, menus
Menu (computing)
In computing and telecommunications, a menu is a list of commands presented to an operator by a computer or communications system. A menu is used in contrast to a command-line interface, where instructions to the computer are given in the form of commands .Choices given from a menu may be selected...

, sliders
Slider (computing)
A slider, also known as track bar in Microsoft literature, is an object in a GUI with which a user may set a value by moving an indicator, usually in a horizontal fashion. In some cases the user may also click on a point on the slider to change the setting...

, tabs
Tab (GUI)
In the area of graphical user interfaces , a tabbed document interface is one that allows multiple documents to be contained within a single window, using tabs as a navigational widget for switching between sets of documents...

 and other basic GUI widgets. XPCE is available for all platforms supported by SWI-Prolog.

PceEmacs

PceEmacs is a SWI-Prolog builtin editor. PceEmacs is an Emacs
Emacs
Emacs is a class of text editors, usually characterized by their extensibility. GNU Emacs has over 1,000 commands. It also allows the user to combine these commands into macros to automate work.Development began in the mid-1970s and continues actively...

 clone implemented in Prolog (and XPCE). It supports proper indentation
Indentation
An indentation may refer to:* A notch, or deep recesses; for instance in a coastline, or a carving in rock* The placement of text farther to the right to separate it from surrounding text....

, syntax highlighting
Syntax highlighting
Syntax highlighting is a feature of some text editors that display text—especially source code—in different colors and fonts according to the category of terms. This feature eases writing in a structured language such as a programming language or a markup language as both structures and...

, full syntax checking by calling the SWI-Prolog parser, warning for singleton variables and finding predicate definitions based on the source-information from the Prolog database.

JPL

JPL is a bidirectional interface between Java and Prolog. It requires both SWI-Prolog and Java SDK. It is installed as a part of SWI-Prolog.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK