swi-prolog Questions
2
Solved
I'm very confused with prolog, it's way different to any language I've ever used (many languages) How do I go about getting argv[0] from:
current_prolog_flag(argv, Argv),
write(Argv).
Now if I t...
Spool asked 31/3, 2013 at 2:17
1
I'm using the SWI-Prolog foreign language interface for C++, attempting to integrate some other resource.
It mostly works, but any attempt to throw an exception result in a SIGSEGV. Exceptions are...
Overbold asked 15/2, 2012 at 9:17
2
Solved
I'm trying to write a predicate to accept a line from an input file. Every time it's used, it should give the next line, until it reaches the end of the file, at which point it should return false....
Ordinand asked 16/7, 2015 at 20:39
0
I have a problem, I followed this tutorial, but when I upload a file, it remains in memory and is never released.
I use swi-prolog 6.6.6 and I tried with swi-prolog 7.1.36
How I can do to free up...
Grovergroves asked 18/5, 2015 at 13:31
2
Solved
Given the following sample of code:
example(Ls) :-
Ls = [X,Y],
Ls ins 1..2,
Cost #= max((X #= 1)*3 + (Y #= 1)*5,
(X #= 2)*3 + (Y #= 2)*5),
labeling([minimize(Cost)], Ls).
The idea is to fin...
Breeden asked 12/1, 2014 at 13:40
1
I am developing a windows store app which take the user input(mathematical question),process it using prolog and output the answer. I have add Microsoft.VisualStudio.QualityTools.UnitTestFramework....
Diurnal asked 30/1, 2015 at 1:49
1
Solved
I would like to write a small text-based adventure game using Prolog (this might be a dumb idea but I am not here to discuss that).
The only problem is that I can't manage to print text on screen ...
Negotiable asked 23/6, 2014 at 14:3
2
Solved
I want to use
catch(:Goal, +Catcher, :Recover)
where Goal is
call_with_time_limit(+Time, :Goal)
It's messed up and I can't find the right way to know when one of the above happened:
1) Goa...
Uncrowned asked 27/5, 2014 at 23:18
2
Solved
I would like to know what are the best practices for sharing Prolog code / libraries with other programmers (and with oneself between multiple projects). I am using SWI-Prolog myself, but are also ...
Klaipeda asked 8/4, 2014 at 19:11
2
Solved
I am trying to compile a SWI-Prolog program but keep getting test is always true, var (sum) error on line 7. I cant figure out what this means. Can someone please help? This is a program I am hopin...
Workhorse asked 9/4, 2014 at 21:41
3
Solved
I am building a relatively simple program to gather and sort data input by the user. I would like to use a local server running through a web browser for two reasons:
HTML forms are a simple and ...
Adrienneadrift asked 1/10, 2013 at 20:18
2
Solved
I'm using SWI-Prolog Version 6.4.1 on OS X 7, and am experiencing the following unexpected behavior with the predicate current_functor/2:
Given the facts
p(a).
q.
I get these answers to queries...
Hetzel asked 28/10, 2013 at 18:52
4
Solved
As part of a project I need to write a parser that can read a file and parse into facts I can use in my program.
The file structure looks as follows:
property = { el1 , el2 , ... }.
What I wa...
Cotquean asked 24/12, 2012 at 16:50
1
Solved
I downloaded SWI Prolog today but, I am having trouble getting emacs to recognize my prolog files. I am saving my prolog files with the extension .pl however, It keeps thinking they are perl files....
Actinomorphic asked 26/4, 2013 at 20:29
2
Solved
I would appreciate your help after struggling 4 hours to the problem:
I need to create an exe file (on windows) from prolog script.
For example, main.pl has inside:
day(monday).
day(tuesday).
day...
Joo asked 8/2, 2013 at 2:24
3
Solved
I have a standard procedure for determining membership of a list:
member(X, [X|_]).
member(X, [_|T]) :- member(X, T).
What I don't understand is why when I pose the following query:
?- member(...
Decapolis asked 30/1, 2013 at 0:52
1
Solved
I have a program that interfacing SWI-Prolog in Visual Studio. Previously, I used VS2010 (XP) and everything works fine. Then I upgrade my VS to become VS2012 (Win7) and now I have a problem in my ...
Gaucho asked 28/1, 2013 at 3:50
2
Solved
If I've bound my Prolog HTTP server to localhost at port 9000, how can I make Prolog generate the right path for my images? For example, if my .pl files and .jpg or .png files are located on the de...
Ochoa asked 18/1, 2013 at 7:34
5
(I am only an indirect user of the GMP-library primarily through swi-prolog and yap. But I am very much interested in fixing this problem.)
When performing exponentiations with ridiculously large ...
Kioto asked 11/11, 2012 at 3:47
1
Solved
How do I parse the standard input (without buffering)? If I understand correctly, phrase/2 needs a list, and phrase_from_file/2 from library(pure_input) needs a file.
I solved my problem using nor...
Proust asked 19/12, 2012 at 21:23
1
Solved
To grok green cuts in Prolog I am trying to add them to the standard definition of sum in successor arithmetics (see predicate plus in What's the SLD tree for this query?). The idea is to "clean up...
Beichner asked 9/11, 2012 at 0:19
3
Solved
I'm parsing a fairly simple file format consisting of a series of lines, each line having some space separated fields, that looks like this:
l 0x9823 1
s 0x1111 3
l 0x1111 12
⋮
I'm using SWI-Pro...
Censure asked 17/10, 2012 at 17:19
4
Solved
I'm using Prolog for an academic project. I wanted to know if there is a way for Prolog to interact with other programming languages. What I want is an easy input/output redirection of Prolog quest...
Brendonbrenk asked 17/5, 2012 at 11:46
1
Solved
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 s...
Chimera asked 7/5, 2012 at 23:39
2
I have some logic in a C++ program that is not only insanely complex, it requires multiple solutions for which Prolog is ideal. It's sort of like a firewall config script, checking input for action...
Gooding asked 15/2, 2012 at 16:39
© 2022 - 2024 — McMap. All rights reserved.