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
2 answers

Get a date as user input and parse it in prolog

I want to get the user birthday as a input and break in to parts. like year, month , date. how to do it. Please help me. I have no idea how to do it. Thanks in advance.
Daybreaker
  • 1,037
  • 5
  • 20
  • 42
0
votes
1 answer

Nonsense in SWI Prolog trace

I am using SWI Prolog 6.6.4 on Windows 7. When I run programs with trace, all I seem to get is a load of jumbled Chinese/Arabic characters. Example output includes lines like: Call: (6) ...锠销锿销锠销 ꀊꀀ Call: (7) ...꜠꜀ꜿ꜀꜠꜀ꀀꁥꀀꁥꀀꁰꀀ ꀊꀀ Exit: (7)…
Rhidian
  • 65
  • 1
  • 5
0
votes
0 answers

SWI prolog in Xcode5

How do I write a SWI-Prolog program on Xcode 5? If Xcode does not support Prolog I can execute it through terminal, but which file format of Xcode should I use for writing the code.
Palak Jain
  • 143
  • 1
  • 3
  • 14
0
votes
2 answers

Why am I not able to load this C code in Prolog in Ubuntu 12.04, but I am able in OS X

I am trying to understand how to link C code with SWI-Prolog, but I am having some difficulties. When I compile the following code and load it it works perfectly on OS X, but when I move the exact same code over to Ubuntu 12.04 it doesn't work. I…
ljos
  • 315
  • 3
  • 9
0
votes
1 answer

How to get started in swi-prolog in linux mint

My teacher has asked us to learn SWI-Prolog for AI. I am new to SWI-Prolog. I cannot find out how do I get started. I have installed SWI-Prolog. But where should I write the database. How do I save the database. How do I load the database with the…
odbhut.shei.chhele
  • 5,834
  • 16
  • 69
  • 109
0
votes
3 answers

Prolog - SWI specifically - where is pl located?

I'm trying to set up an environment with interprolog and SWI prolog, interprolog needs the location of swi's "pl" but i cant find it. All i can find is swipl or plrc and neither work with interprolog. If i type pl into the terminal(this should run…
KP65
  • 13,315
  • 13
  • 45
  • 46
0
votes
2 answers

How can I fix Prolog Syntax error: Operator expected error?

PROLOG: “Syntax error: Operator expected” ERROR: c:/users/zulfekarali/Desktop/KBS/kbs.pl:2:3: Syntax error: Operator expected % c:/Users/ZulfekarAli/Desktop/KBS/kbs.pl compiled 0.00 sec, 27 clauses -------- domains disease,indication = symbol …
user3386191
  • 1
  • 1
  • 1
0
votes
2 answers

how to connect a program in Prolog to a program in Java

I am new to Prolog and Java,at this point I am using JPL, SWI-Prolog and Eclipse. I was able to write and consult my Prolog program from Eclipse(Java) but how do I write a program in Prolog that will consult a Java program? What will be the elements…
0
votes
0 answers

SWI-Prolog C# iterating through List as a Result

I have in my file a few predicates. cam_curto(User1,User2,Cam):-cam_curto(User1,User2,[User1],Cam). cam_curto(User1,User1,LA,Cam):-reverse(LA,Cam). cam_curto(User1,User2,LA,Cam):- liga(User1,Z,_,_), \+ member(Z,LA),…
João Cunha
  • 9,929
  • 4
  • 40
  • 61
0
votes
1 answer

How does `random_variable `random_value` work in SWI-Prolog's labeling/2?

I've seen it's possible to label cplfd variables using a random method by adding the following options to labeling/2: labeling([random_variable(N),random_value(M)],List). Where M and N are supposed to be integers, I think. However I am not able to…
Carles Araguz
  • 1,157
  • 1
  • 17
  • 37
0
votes
1 answer

portray_clause to variable in Prolog

Is there a way so that portray_clause is written to a variable instead of standard output? ?- portray_clause(f(x):app(X, Y, Z)). f(x):app(_, _, _). true. ?- portray_clause(Output, f(x):-app(X, Y, Z)). ERROR: Arguments are not sufficiently…
0
votes
1 answer

Shell commands from the top-level

Apparently, I can use some shell commands from the top-level, ?- pwd. /home/boris true. Others that work are ls, cd. Any idea where those are documented, or what others there are? (This is on Linux, can't check if it also work on Windows).
user1812457
0
votes
2 answers

how to convert a code that is using atom_to_term from SWI-prolog to SICStus Prolog

I'm trying to write a rule to compare two atoms to see which one is better for example (memory_with_gb_2 is better than memory_with_gb_1) and what I've written and tried in SWI-prolog is the…
0
votes
3 answers

Prolog Count The Unique Identifiers In Fact

We have facts studies(cse, plc). studies(cse, da). studies(it, se). studies(it, plc). where studies(x,y) means that branch x studies module y . Now I Want to define Rule To count number of modules in all. like here it will be 3.that are…
Hacker688
  • 93
  • 8
0
votes
1 answer

Open .pl file and close current one in SWI - Prolog

I have created two different .pl files in SWI-Prolog for a text adventure game. They are two different missions. Is there any way at the end of the first mission to open the second mission (the second .pl file) and close the first one? Also, what…
Shevliaskovic
  • 1,562
  • 4
  • 26
  • 43