Questions tagged [swi-prolog]

SWI-Prolog is an open source implementation of Prolog that runs on Unix, Windows and Mac.

is an open source implementation of the programming language , commonly used for teaching and semantic web applications. It has a rich set of features and libraries including:

  • Constraint logic programming
  • Multithreading
  • Unit testing
  • GUI
  • Interfacing to Java
  • ODBC and others
  • Literate programming
  • A web server
  • SGML
  • RDF and RDFS

Along with developer tools (including an IDE with a GUI debugger and profiler).

SWI-Prolog runs on Unix, Windows, 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).

http://www.swi-prolog.org/

Useful links

1221 questions
0
votes
0 answers

How to echo the true/false value Prolog returns after a query

I 'd like to pose a question. I tried to connect php with SWI-Prolog using the exec function and my effort was succeful. I have managed to query prolog via php and I was able to echo Prolog's answer. What I want to do but can't figure how to…
Erin
  • 105
  • 1
  • 10
0
votes
1 answer

How to get variable in Prolog?

I have a problem. I cannot figure out this problem for weeks. For example: parent(john,paul). parent(paul,tom). parent(tom,mary). ancestor(X,Y) :- parent(X,Y). ancestor(X,Y) :- parent(X,Z), ancestor(Z,Y). query is : swipl -s…
Tractatus
  • 118
  • 1
  • 1
  • 9
0
votes
1 answer

Calling the listing function in jpl

I was wondering whether anyone had managed to use the 'listing.' command in JPL to examine the contents of the Prolog knowledgebase? JPL requires you construct queries and will return solutions based on the variables which you set in the query. …
Huguenot
  • 2,427
  • 2
  • 17
  • 14
0
votes
1 answer

Compiling C++ program that uses SWI-Prolog Interface

I am compiling the program found here, and at runtime I get an error: Here is what I do to compile it: $ g++ -I/home/jpthomps/Desktop/pl-6.0.2/src main.cpp -L/usr/local/lib/swipl-6.0.2/lib/x86_64-linux -lswipl main.cpp: In function ‘int…
John Thompson
  • 1,674
  • 1
  • 20
  • 35
0
votes
1 answer

Get JPL output into a string in Java

I'm using Prolog in java through JPL, I have some predicates with the format predicate: format("Result ~p, ",[X]), Using JPL in java the output of format goes to the console output in java, how can I retrieve this result into a string variable in…
Naty Bizz
  • 2,262
  • 6
  • 33
  • 52
0
votes
1 answer

Retrieving ERROR and WARNING messages from SWI-Prolog through JPL

I am having some trouble retrieving error and warning messages when using JPL. For example, attempting to consult a non-existing file directly from SWI-Prolog produces the following output: 1 ?- consult('NonExistingFile'). ERROR: source_sink…
Epicurus
  • 2,103
  • 7
  • 29
  • 39
0
votes
0 answers

Querying predicate in Prolog and java

I want to make a query to use Prolog in java through JPL, I want to call a predicate like this in java: predicate_test([X,Y,Z]):- a_predicate(X), another_predicate(Y). I make the query in java to invoque "predicate_test" like this: …
Naty Bizz
  • 2,262
  • 6
  • 33
  • 52
0
votes
1 answer

Depicting a list of objects in XPCE

I want to make an animation in XPCE, consisting of an arbitrary number of moving circles. The circles are given in a Prolog list, containing for each circle its coordinates, radius, and colour. Hence, the list looks like this:…
MirrorMan
  • 13
  • 3
0
votes
1 answer

Prolog and php encoding

I'm creating a interface between swi-prolog and php. The php writes commands it wants prolog to run on a file and then does a system call so prolog runs the file. The problem is that when there's special characters on the file (like á, í, ã, ê and…
0
votes
1 answer

How do I design and load my Prolog source files so I don't have to manually use_module?

I have a source file, openpage.pl, where I call use_module/1 to "import" SWI-Prolog's http_open/3: use_module(library(http/http_open)). request(URL, In) :- http_open(URL, In, []), copy_stream_data(In, user_output), close(In). It loads…
0
votes
1 answer

Missing symbold "_main" when compiling with swipl-ld on OSX Lion

I'm trying to compile a C program to be called from the Prolog Foreign Function Interface. I'm doing some Dynamic Programming, which isn't exactly efficient in Prolog. However, when I try to compile my file, I get the following error: Undefined…
jmite
  • 8,171
  • 6
  • 40
  • 81
0
votes
1 answer

SWI-Prolog CGI cgi_get_form(Arguments) web hidden form

I have a problem passing the input type="hidden" form with the CGI library of SWI-Prolog. Specifically I do:

mll
  • 195
  • 2
  • 13
0
votes
1 answer

Prolog XPCE dialog return a list of selections

i have another Problem with Prolog where i cant find a clue how to solve it. here is my…
0
votes
1 answer

How to install development tools (plld, etc.) in SWI-prolog on OSX Lion

I'm trying to get SWI-prolog and C talking to each other. I have some Dynamic Programming problems that are much faster/simpler in C, and I'd like to be able to call them from prolog. Ther SWi manual gives details on how to do this at…
jmite
  • 8,171
  • 6
  • 40
  • 81
0
votes
1 answer

How do I turn off SWI-Prolog flags?

I'm not sure if flags is the appropriate term, but is there anyway to configure a swi-prolog program to not output true or false on the completion of a query, and instead simply print out another statement determined in the program?
jldavis76
  • 812
  • 2
  • 15
  • 42