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

Reachability constraint in SWI/CLP(FD)

I'm trying to determine that shape of a directed graph by solving constraints on presence of nodes and arcs, e.g., binary variable V1V2 is 1 if there is an arc from node V1 to V2. I would like to express the reachability constraint (or,…
2
votes
1 answer

How do I show Variable Bindings in SICSTUS' "SPIDER" IDE?

I'm using the "SPIDER" IDE for SICSTUS Prolog development, as instructed by the SICSTUS Manual and the documentation on the SPIDER IDE itself. When debugging, under the 'SICSTUS Debugging' perspective, the variables do not show on the Variables…
vmg
  • 4,176
  • 2
  • 20
  • 33
2
votes
1 answer

How to assign value to a variable in CLPFD?

There is the predicate indomain/1 in manual that assigns values to a variable (let's call it X) in increasing order via backtracking. I would like to change the order of values that are assigned to the variable X as I try writing a custom labeling…
MartyIX
  • 27,828
  • 29
  • 136
  • 207
2
votes
2 answers

Using in_set/2 Constraint

I am trying to use constrain X to not being a value in a list. From the SICStus Prolog manual: ?X in_set +FDSet I can't figure out how to convert a list to a FDSet, though. I have a list of integers [2,3,8,9] and I want to constrain the domain of…
Rory Flast
  • 83
  • 6
1
vote
2 answers

Creating a standalone exe file from sictus prolog pl file windows

I have a sictus prolog file (.pl-file) that I would like to export as an exe-file to run on another computer. Searching through SICS documentation and playing around with spld gave me an exe file which didn't work on antoher computer(running windows…
Johan Wikström
  • 4,033
  • 4
  • 28
  • 31
1
vote
1 answer

Solving jigsaw puzzle with restriction in prolog

I am starting to learn restrictions in prolog at the moment using SICStus Prolog. Though I know how solve simpe problems using this, I have one exercise where I must solve a Jigsaw puzzle. However I have no idea how to solve this since I will have…
user697110
  • 589
  • 10
  • 25
1
vote
2 answers

maplist/2 vs extra recursion predicate with SICStus Prolog

Consider the following simple interaction with SICStus Prolog: $ sicstus -f SICStus 4.8.0 (x86_64-linux-glibc2.28): Sun Dec 4 13:17:41 UTC 2022 [...] | ?- use_module(library(between)), use_module(library(lists)). [...] | ?- compile(user). %…
repeat
  • 18,496
  • 4
  • 54
  • 166
1
vote
1 answer

Spurious attribute_goal/2 in SICStus Prolog 4.7.1

Given the following minimalistic "solver" in SICStus Prolog ... :- module(attach, [attach/1]). :- use_module(library(atts)). :- attribute a/0. attach(X) :- put_atts(X,a). verify_attribute(_,_,[]). attribute_goal(V,attach(V)) :- get_atts(V,a),…
repeat
  • 18,496
  • 4
  • 54
  • 166
1
vote
1 answer

Peeking past end-of-file with SICStus Prolog

Suppose I have an empty file (imaginatively called empty) in the current directory and run the following query. Using SICStus Prolog 4.7.1 (Intel x86-64): | ?- open(empty,read,S,[eof_action(eof_code)]), …
repeat
  • 18,496
  • 4
  • 54
  • 166
1
vote
1 answer

Simulating occurs_check=error in SICStus Prolog

It turns out that SICStus Prolog doesn't have an occurs_check Prolog flag. At least we couldn't find one, and this here gives an error message: /* SICStus 4.6.0 (x86_64-win32-nt-4) */ ?- set_prolog_flag(occurs_check, true). Domain error in argument…
user502187
1
vote
1 answer

Proper subsumes_term/2 in SWI-Prolog?

Lets assume SICStus Prolog is the benchmark for the implementation of certain predicates, even ISO core standard predicates. Especially in connection with attributed variables. I then find these examples here. It's from SICStus 4 and not only…
user502187
1
vote
1 answer

create_mutable/2 in SICStus Prolog

The SICStus Prolog manual page on mutable terms states that: [...] the effect of unifying two mutables is undefined. Then, why does create_mutable(data,x) fail? Shouldn't that rather raise an uninstantiation_error? I cannot think of a situation…
repeat
  • 18,496
  • 4
  • 54
  • 166
1
vote
0 answers

Using https with library(pillow) in SICStus Prolog

Recently, when I wanted to assemble and crunch some StackOverflow meta data, using library(pillow) appeared the right thing to me. After the first toy uses (which worked ok), I encountered failure. A quick peek into the sources suggests that the…
repeat
  • 18,496
  • 4
  • 54
  • 166
1
vote
0 answers

All different Global Constraint in Prolog clpfd

I am trying to craete a custom clpfd global constraint, which is very similar to the all_diferent constraint. The constraint should allow only lists with different non-zero items (so there can be multiple zeros). Here is a working example in SICSTUS…
Tomas Nekvinda
  • 524
  • 1
  • 5
  • 15
1
vote
1 answer

Prolog Restrictions Minimize Error. labeling/2 argument 1 error

I have an application to develop at school that consists in generating work groups for a subject. The restrictions I have to fulfill are the following: Students having similar GPAs should be on the same group. Students that previously have worked…
1 2 3
8 9