It provides access to whether optional features are available on this version, operating system, foreigncode environment, commandline arguments, version, as well as runtime flags to control the runtime behaviour of certain. Its performance is comparable to 2, both on success and early failure. It is widely used in research and education as well as for commercial applications. Vu university amsterdam university of amsterdam swiprolog. Introduction to prolog programming homepages of uvafnwi staff. Prolog realizes highorder programming with metacalling.
The primary database is defined by the predicate predicate 5 we will make hyperlinks for the predicates pointing to their documentation. Product information, documentation and additional resources specific to. Swi prolog started back in 1986 with the requirement for a prolog that could handle recursive inter action with the clanguage. As swi prolog provides autoloading, there is little difference between library predicates and builtin predicates. The application range includes prolog course material, metainterpreters, simulation of parallel prolog, learning systems, natural language processing and two large workbenches for knowledge engineering.
Tag confusing pages with docneedshelp tags are associated to your profile if you are logged in. The intention was to build a prolog environment which offers enough power and. This is the official reference manual for the latest version of swi prolog. Swi prolog 53 reference manual initialising and managing a. Resources however can be represented in two different formats. A typical application may define a small pool of threads with large stacks for computation intensive tasks, and a large pool of threads with small stacks to serve media. Aim of this lecture 2 2 introduce other concepts, such as the role of logic unification with the help of variables begin the systematic study of prolog by defining terms atoms, and variables. Keeping operators in modules and using controlled importexport of operators as described with the module 2 directive keep the issues manageable. Part of the library is therefore documented in the rest of the manual. They have been introduced to make translation of old code easier, but also because they provide for a faster mechanism for returning data to prolog.
Plain prolog can thus be regarded as a special case of clp. A description of this syntax can be found in the prolog. To reach at a compiled cprogram with swiprolog as an embedded application is very similar to creating a statically linked swiprolog executable as described in section 5. Xpce is used at swi for the development of knowledgeintensive graphical applications. The swiprolog implementation is cyclesafe and can deal with variables that are shared between the left and right argument. The main design objectives of the foreign language interface are flexibility and performance. Plain prolog can be regarded as clph, where h stands for herbrand terms. Swi prolog syntax is close to iso prolog standard syntax, which is closely compatible with edinburgh prolog syntax. In section 2 we describe the development of swiprolog, with a particular. Swi kruislaan 419, 1098 va amsterdam the netherlands tel. A foreign predicate is a c function that has the same number of arguments as the predicate represented. Swiprolog has been designed and implemented such that it.
These notes have originally been developed for a course i taught at kings college london in 1999 and 2000. Commercial users may consider contacting the developers 6 mailto. This predicate is known by the name variant 2 in some. The application range includes prolog course material, metainterpreters, simulation of parallel prolog,learningsystems,naturallanguageprocessing,complexinteractivesystems,webserverandwebserver components. The functions of this sections unify terms with other terms or translated cdata structures. Swi prolog is a comprehensive and portable implementation of the prolog programming language. Library predicates differ from builtin predicates in the following ways. Unlike edinburgh prolog systems, telling1 and seeing1 do not return the filename of the current inputoutput but rather the stream identifier, to ensure the design pattern below works under all circumstances. Swi prolog extends the minimal set of instructions described in bowen et al. There are dedicated constraint solvers for several important domains. In swiprolog, operators are local to a module see also section 6. As soon as you start up swi prolog, you will see the message. That means that it documents the system, but it does not explain the basics of the prolog language and it leaves many details of the syntax, semantics and builtin primitives undefined where swi prolog follows the standards.
Over this domain, 2 and dif 2 are the most important constraints that express, respectively, equality and disequality of terms. Swi prolog offers a comprehensive and portable freesoftware prolog programming environment for more than 25 years now. As swi prolog became more popular, a large usercommunity provided requirements. The module system provides the operators from table 5 and these operators cannot be modified. Swi prolog 53 reference manual initialising and managing a prolog project 3 from cs 91. This manual is intended for people that are familiar with prolog. The declaration could be the one below, allowing for max 3 concurrent solvers and a maximum backlog of 5 and 30 tasks creating image thumbnails. The optional unify port allows the user to inspect the result after unification of the head. This can be used to define higherorder predicates such as ignore1 or forall 2. The core predicate of this is call1, which simply calls its argument. Swi prolog aims to be a robust and scalable implementation supporting a. In the following example we will generate a table of prolog predicates we find from the swiprolog help system based on a keyword.