swi-prolog Questions
2
I want to use a Python script as a frontend to a Prolog program that uses the SWI-PL engine.
So, the components of the setup are:
Python (2.7 or higher)
SWI-PL: website here
I've been looking ...
Domitiladomonic asked 26/6, 2013 at 17:24
3
Solved
I would like to hear from people who have real world programming experience in using SWI-Prolog's semantic library.
Edit: The reason for this question is, among the many people I talked to with pro...
Ivanivana asked 26/1, 2011 at 16:52
1
Solved
I found an example of shift-reset delimited continuations in Haskell here:
resetT $ do
alfa
bravo
x <- shiftT $ \esc -> do
charlie
lift $ esc 1
delta
lift $ esc 2
return 0
zulu x
T...
Adorn asked 24/5, 2022 at 12:26
7
Solved
I read somewhere that you can think of modules as objects in Prolog. I am trying to get my head around this, and if it a good way to code.
If I have two files, one defining a class dog and then an...
Forecast asked 26/1, 2015 at 16:14
2
Solved
I am trying to execute a prolog script from teh command line. I am basing my attempts on what I found at How to run SWI-Prolog from the command line?
however that is not working for any non-trivial...
Degradation asked 14/11, 2019 at 22:51
5
Solved
I was wondering if you know of any way to use prolog for stream processing, that is, some kind of reactive programming, or at least to let a query run on a knowledge base that is continuously updat...
Geomancer asked 16/10, 2013 at 15:40
3
Solved
First I load the file with SWI-Prolog
$ swipl file.pl
then I modify the file and save.
Now how do I reload the file like
?- reload
for this modified file.pl?
Psychro asked 30/11, 2016 at 14:23
2
I'm learning Prolog by doing the Advent of Code challenges.
Spoilers for Advent of Code 2021 day 7 below:
The objective is: given a list of natural numbers n_1,..., n_k, find
min_(x\in \N) \sum_i=0...
Philharmonic asked 7/12, 2021 at 21:39
5
Solved
I'd like to read a plain text file and apply a predicate to each line (the predicates contain write which does the output). How would I do that?
Shafer asked 26/1, 2011 at 14:24
4
Solved
Is there a built-in predicate or a easy way to remove from the knowledge database of prolog a source files that has already been consulted? I've gone through the reference manual and didn't find an...
Caterina asked 13/6, 2012 at 20:59
1
Solved
Having a list List filled with numbers, I want to obtain a list of pairs Pairs, where each pair in Pairs is in the form <number>-0, i.e., each number of List should be followed by -0.
I came ...
Gilliette asked 12/6, 2021 at 7:25
2
Solved
I try to implement efficient exclusive-or (XOR) in Prolog CLPFD. This should be simple predicate like:
xor(A, B, AxorB).
A, B, AxorB are natural numbers (with 0) and AxorB is a result of A xor B...
Institutionalism asked 17/5, 2014 at 21:39
6
Solved
I have an interest in playing and fuxing with prolog, I have installed the swi-prolog and added the repository, just in case anyone is interested on which one commands I used:
% sudo apt-add-repos...
Ailee asked 7/12, 2013 at 23:24
3
Solved
As far as I can tell, with sound unification, SLD resolution should not create cyclic data structures (Is this correct?)
If so, one could, in theory, implement Prolog in such a way that it wouldn't...
Pilothouse asked 15/11, 2020 at 2:38
2
Solved
To quote the SICStus Prolog manual:
The usual mathematical theory behind Logic Programming forbids the
creation of cyclic terms, dictating that an occurs-check should be
done each time a variable ...
Lagena asked 6/1, 2021 at 17:12
4
I'm trying to use call_with_depth_limit/3 in SWI-Prolog to implement iterative deepening and either I don't understand how it works or it's misbehaving. I have an example where the following happen...
Vincenz asked 21/12, 2020 at 14:35
3
Solved
Are there any up-to-date Prolog implementation benchmarks (with results)?
I found this on the mercury web site. Surprisingly, it shows a 20-fold gap between swi-prolog and Aquarius. I suspect that ...
Quickman asked 20/12, 2020 at 1:22
1
How can an SWL-Prolog terminal be added in VSCode?
Like PowerShell but SWI-Prolog terminal.
Tetartohedral asked 13/12, 2020 at 10:23
2
I want to run swi-prolog program on the machine (actually a server) where there is no prolog installed.
The prolog code swipl_test.pl:
main :- write('Hello, world\n').
On the local machine 4.4...
Segovia asked 8/3, 2017 at 15:9
5
Solved
I'm using SWI-Prolog and I'm trying to print a list but if the list has more than 9 items - it look like that -
[1, 15, 8, 22, 5, 19, 12, 25, 3|...]
is there a way to show the whole list?
Inchoation asked 22/11, 2011 at 18:23
1
Solved
?- assertz(:- module(foo1, [f/1])).
true.
?- foo1:assertz(f(1)).
true.
?- foo1:f(1).
true.
?- foo2:f(1).
Correct to: "foo1:f(1)"? no
ERROR: Undefined procedure: foo2:f/1
ERROR: In:
ERROR: [8] fo...
Wengert asked 30/4, 2020 at 3:37
1
I'd like to see (SWI)Prolog advertised as a NoSQL 'serious contender'.
(SWI)Prolog has awesome data bindings features, and lot of power - of course - to write logic against such big data.
With re...
Impi asked 31/10, 2015 at 17:36
1
I have a CSV file that look something like below: i.e. not in Prolog format
james,facebook,intel,samsung
rebecca,intel,samsung,facebook
Ian,samsung,facebook,intel
I am trying to write a Prolog p...
Valonia asked 20/3, 2020 at 18:25
4
When I press up/down, I should get - just like unix - the previous commands, but instead I get:
Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 6.0.0)
Copyright (c) 1990-2011 University of...
Overtop asked 27/2, 2012 at 10:33
3
in SWI Prolog terminal how do I view the current working directory and change the current working directory?
I found:
working_directory(CWD, CWD)
but I dont think its what I need
Intense asked 24/7, 2012 at 14:34
1 Next >
© 2022 - 2024 — McMap. All rights reserved.