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
1 answer

Use String in SWI Prolog

I'm a little bit confused. I would like to use the split_string function which can be seen here. But I just don't know how to import or use this function. Do I have this pl File already on my PC? I can only find strings.pl in C:\Program…
Tim
  • 193
  • 4
  • 15
0
votes
1 answer

argv Memory Allocation

I was wondering if someone could tell me what I am doing wrong that I get this Unhandled Exception error message: 0xC0000005: Access violation reading location 0x0000000c. with a green pointer pointing at my first Prolog code (fid_t): Here is my…
user285372
0
votes
1 answer

SWI Prolog: Ask for consulted files

Is there a way in SWI Prolog to ask for consulted files? For example, I consulted two files with: consult('load.pl'). consult('main.pl'). Now I need a predicate that give me all consulted files, because I want to check, if they are already loaded…
Studiosus
  • 143
  • 1
  • 11
0
votes
0 answers

Executing Prolog from SWI and using the output in PHP

I have SWI Prolog working in my vm where I'm going to be working on a PHP/HTML website. I've been following this guide: http://www.j-paine.org/dobbs/prolog_from_php.html#appendix to set up my php file to receive the output from the executed prolog…
user3361594
0
votes
1 answer

XPCE Prolog command causing error in VS2008 C++

Upon loading into a C++ program a Prolog program that contains the command 'send' (xpce graphics), I get error messages of type: Syntax Error: Operator Expected. Here is an example command that causes the errors: send( Dialog, append,…
user285372
0
votes
1 answer

How to execute SWI-prolog command from shell?

As a follow up to this, now I am wondering if there is a way to execute/evaluate a prolog predicate/expression straight from the shell, something like this: $ swipl --eval "-:pack_install(something)" Is something like that possible? Like in…
Lance
  • 75,200
  • 93
  • 289
  • 503
0
votes
1 answer

How do I set the last modified date of a file in Prolog?

I only find a predicate time_file/2 to access the last modified date of a file. time_file(+File, -Time) Unify the last modification time of File with Time. http://www.swi-prolog.org/pldoc/doc_for?object=time_file/2 How could I explicitly set…
user502187
0
votes
1 answer

flushing database cache in SWI-Prolog

We are using swi-prolog to run our testcases. Whenever the test starts, I am opening the connection to MYSQL database and storing the Name of the Test hat is being done and then closing the DB. These tests run for about 2 days continuously. After…
JPro
  • 6,292
  • 13
  • 57
  • 83
0
votes
1 answer

prolog use post parameter properly

I want to create a dynamic question site, with some scroll, check, and whatever boxes. After the user send the form, i want to use the informations, to create dynamicly an answer. I tried a lot, but couldn't get it to work properly. So I hope, you…
HexXx
  • 252
  • 3
  • 8
0
votes
1 answer

Read csv file from prolog and change to facts/clause

I use csv_read_file to read a csv file, which is: csv file: "nsubj(love-1, carol-2)" "nsubj(like-3, carol-2)" code: csv_read_file('test.csv',L) I got things like: L = [row('nsubj(love-1, carol-2)'), row('nsubj(like-3, carol-2)')] But what I need…
ba9el
  • 28
  • 4
0
votes
1 answer

Consulting a Prolog Source Code from within a VS2008 Solution File

I have a Prolog file (Hanoi.pl) containing the code for solving the Hanoi Towers puzzle: hanoi( N ):- move( N, left, middle, right ). move( 0, _, _, _ ):- !. move( N, A, B, C ):- M is N-1, move( M, A, C, B ), inform( A, B ), …
user285372
0
votes
0 answers

Two different behaviors of the same Prolog code with and without debugging

I am using the latets stable version 6.6.6 64 bit of SWI-Prolog for windows. The code is following: start :- new(Frame, frame('Test')), send(Frame, open), send(Frame, append, new(Pic, picture)), send(Pic, height, 600), send(Pic,…
Fibo Kowalsky
  • 1,198
  • 12
  • 23
0
votes
1 answer

How to load prolog files with rules on Mac OSX

I'm using SWI-Prolog and I have a .pl file but cannot load it correctly. Not sure if I'm looking in the right places but can't find any info running it on Mac OSX. I should be able to right click on my .pl file and open with Prolog and it should…
user2318083
  • 567
  • 1
  • 8
  • 27
0
votes
2 answers

How to build with swipl on sublime

I'm trying to compile prolog's code on sublime text 3 but I always get [Errno 2] No such file or directory: 'swipl' [cmd: ['swipl', '-f', '', '-t', 'main', '--quiet']] [dir: /Applications/Sublime Text.app/Contents/MacOS] [path:…
0
votes
1 answer

Connect SWI-Prolog with HTML5. Is that possible?

Is there any guide, tool or something else to connect SWI-Prolog with HTML5 to create a web interface?
Sergio Calderon
  • 837
  • 1
  • 13
  • 32