Questions tagged [sicstus-prolog]

SICStus Prolog is an ISO-standard compliant Prolog dialect developed at the Swedish Institute of Computer Science (SICS).

SICStus Prolog is an ISO-standard compliant Prolog dialect developed at the Swedish Institute of Computer Science (SICS). As of 2021-01-03, the current version is 4.6.0.

Home page.

135 questions
1
vote
2 answers

remove : prolog

I am trying to compile csp.pl from "Computational Intelligence book" which solves the constraint satisfaction problem. I want to use this as a base to solve crossword puzzle generator. But when I try to run the code it gives Existence error in…
Android_enthusiast
  • 863
  • 5
  • 22
  • 41
1
vote
1 answer

How can two lists be compared in Prolog considering the subterms?

I would like to compare two lists considering and comparing every one of their subterms also. For example, if I have the lists [1, t1(2, t2(3), 4)] and [1, t1(2, t2(2), 4)], the result should be that the first one is greater (>) than the second one,…
Thookes
  • 99
  • 1
  • 7
1
vote
1 answer

how can i add version info to the build .exe file using spld SICStus

I have the following batch program that is used to build my Prolog program. set /p VERSION="Enter Version:" call "c:\Program Files (x86)\SICStus Prolog VC12 4.3.2\bin\sicstus.exe" -l build_program.pl -a %VERSION% call "C:\Program Files…
Mortalus
  • 10,574
  • 11
  • 67
  • 117
1
vote
1 answer

Prolog: a rule containing assert adds only first result to facts

I'm trying to precompute some stuff and save the results as facts at the beginning of my program: (simplified code) :- dynamic cost/2. %recipe(Id,Cost) recipe(1,20). recipe(2,40). assert_all :- recipe(Id,Cost), assert(cost(Id,Cost)). But only the…
Juraj
  • 99
  • 7
1
vote
1 answer

unexpected error "! segmentation violation"

Recently , when I try to compile my project , sometimes an unexpected error has appeared , error : % Execution aborted % source_info | ?- ! segmentation violation Is there an explanation for what happens!
Ans Piter
  • 573
  • 1
  • 5
  • 17
1
vote
0 answers

SICStus Prolog: FFI slow, how to calculate Hamming weight fast?

When I ran the foreign code sample c1/2, as shown in the SICStus Prolog 4.3.2 manual, and compared its runtime to the corresponding Prolog code Y is X+9, I got strange timing results: p(N, X) :- ( true1G, X is N+9, false ; X is N+9 ). q(N, X) :- (…
repeat
  • 18,496
  • 4
  • 54
  • 166
1
vote
2 answers

Split atom using SICStus like atomic_list_concat/3 in SWI

i have an atom like 'id1,id2,id3' and i want to split it into list with same way as the predicate atomic_list_concat/3 in SWI . expected result ?- atomic_list_concat(L, ',', 'id1,id2,id3'). L = [id1, id2,id3] ?- atomic_list_concat([id1,id2,id3],…
Ans Piter
  • 573
  • 1
  • 5
  • 17
1
vote
1 answer

Filtering random-outcomes from maplist/3 result

I wish filter out this list List=['F1',a1,a2,' LF2',a1,a2] with predicate is_upper/2 and maplist/3 below is_upper(Elem,Res) : if Elem is uppercase atom, it will be assigned to Res then i'd like to put all uppercase atom into list List_Upper i try…
Ans Piter
  • 573
  • 1
  • 5
  • 17
1
vote
1 answer

fragmenting data from text file into list of facts to prolog file

I want to separate the data file into list of facts like functor(arg1, arg2, ..., argN) which the name of functor is the uppercase line and the arguments are the lowercase lines that follow them, subsequently, new clauses are saved in a prolog…
Ans Piter
  • 573
  • 1
  • 5
  • 17
1
vote
1 answer

How to use Prolog testing terms?

How to use these expressions? SP_term_type() Accesses term type SP_is_variable() Checks whether term is a variable. SP_is_integer() Checks whether term is an integer. SP_is_float() Checks whether term is a float. SP_is_atom() Checks whether term…
1
vote
2 answers

Code style preferences using Sicstus and Eclipse (Spider)

I am currently using Sicstus Prolog VC9 4.1.1 within Eclipse Galileo (Spider). I have a very newbie question: how would I automatically control indentation and in general code style preferences?
panza
  • 1,341
  • 7
  • 38
  • 68
1
vote
1 answer

Dimensions of micro-benchmarking in Prolog

I want to micro-benchmark predicate int_cntA/2 ... int_cntA(I,W) :- I >= 0, int_cntA0_cntA(I,0,W). int_cntA0_cntA(0,W0,W) :- !, W0 = W. int_cntA0_cntA(I,W0,W) :- I0 is I/\(I-1), W1 is W0+1, int_cntA0_cntA(I0,W1,W). ... against predicate…
repeat
  • 18,496
  • 4
  • 54
  • 166
1
vote
0 answers

Prolog - Constraints - Light-Up/Akari

I'm trying to solve a Light-Up puzzle and I'm having troubles nailing down the constraints. My main predicate is: akari(Rows, Size) :- length(Rows, Size), maplist(length_list(Size), Rows), append(Rows, Board), domain(Board, 0, 2), …
user2993349
  • 491
  • 1
  • 5
  • 16
1
vote
1 answer

Eclipse RCP ClassCastException BundleURLConnection to JarURLConnection

I am trying to use the Jasper interface from SICStus to start a SICStus server from Java as part of an Eclipse RCP Application using the SICStus class and the startServer()…
1
vote
2 answers

Initial guess in labeling

Given this small example: go:- length( X, 200 ), domain( X, 1, 25), postConstraints( X, Y ), labeling( [minimize(Y), X ). If we assume that postConstraints set up some complex constraints. Y is returned from postConstraints and used as…
MortenM
  • 522
  • 2
  • 12
1 2 3
8 9