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

make/0 functionality for SICStus

How can I ensure that all modules (and ideally also all other files that have been loaded or included) are up-to-date? When issuing use_module(mymodule), SICStus compares the modification date of the file mymodule.pl and reloads it, if newer. Also…
false
  • 10,264
  • 13
  • 101
  • 209
5
votes
2 answers

Use of cumulatives

I'm working on a problem where I use the cumulatives/[2,3] predicate. But I get very bad performance when I try to combine this with minimize in labeling I have the following demo. 10 task, all with duration 1, 4 machines, all with capacity=1. My…
MortenM
  • 522
  • 2
  • 12
5
votes
3 answers

Memory leak Sicstus Prolog

This question is a followup from this question. I'm running a large number of tests in Sicstus prolog: runtest:- t1, t2, t3, . . t100. Each test is standalone and will print its result to the screen. There is no releation between the tests,…
MortenM
  • 522
  • 2
  • 12
4
votes
1 answer

library(samsort) in SICStus Prolog

In SICStus Prolog there's library(samsort), a library for generic sorting. The library exports the predicates samsort/2, samsort/3, samkeysort/2, and others. I can see the use of these predicates, but I'm somewhat puzzled by the name prefix…
repeat
  • 18,496
  • 4
  • 54
  • 166
4
votes
1 answer

problems to deploy a java application

I just finished a Java application to link to Sicstus prolog. Now I need to deploy it but I'm having the following problem, the Sicstus library to link with Java requires that the application be called with the following sintax: java…
Aerozeek
  • 495
  • 1
  • 3
  • 11
4
votes
1 answer

Verify_attributes in SICStus Prolog

Attribute variables permit to extend unification. The following is about arcane details of the interface. Let's cut right to the chase! In sicstus-prolog library(atts) provides predicates for using attributed variables. I think I get what the…
repeat
  • 18,496
  • 4
  • 54
  • 166
4
votes
1 answer

Equivalent of nvalue/2 from SICStus in SWIProlog

The SICStus manual for the CLP(FD) library says: nvalue(?N, +Variables) where Variables is a list of domain variables with finite bounds or integers, and N is an integer or a domain variable. True if N is the number of distinct values taken by …
Hugo Sereno Ferreira
  • 8,600
  • 7
  • 46
  • 92
4
votes
1 answer

How to simulate atom_to_term(+Atom, -Term, -Bindings) of SWI-Prolog in SICStus Prolog?

I am using SICStus Prolog to write a Dali agent and I need to convert an atom to a term but I can't use atom_to_term which is built in in SWI-Prolog
4
votes
1 answer

How to debug clpfd programs?

I have a program in SICStus Prolog (clpfd) and I would like to see what is going on during labeling. I tried trace but it is too verbose which makes it hard to understand what is really going on (what values are assigned to which variables, how are…
MartyIX
  • 27,828
  • 29
  • 136
  • 207
4
votes
3 answers

Is there a library/technique to collect statistics for optimal clause ordering in Prolog?

I'm writing a program where I need to see if strings match a particular pattern. Right now I've got this implemented in Prolog as a rule matchesPattern(S), with well over 20 different definition. I end up running all the binary strings up to a…
jmite
  • 8,171
  • 6
  • 40
  • 81
3
votes
0 answers

Implicit module initialization in SICStus Prolog

When I use a previously unused module f, the module is initialized and is known afterwards: | ?- current_module(f). no | ?- assert(f:x). yes | ?- current_module(f). yes This also happens if I try to use a non-existent procedure: | ?-…
repeat
  • 18,496
  • 4
  • 54
  • 166
3
votes
1 answer

current_predicate in SICStus Prolog

SICStus Prolog offers both current_predicate/1 and current_predicate/2. The manual page states: current_predicate(?PredSpec) Unifies PredSpec with a predicate specifications of the form Name/Arity. current_predicate(?Name, ?Term) Unifies Name with…
repeat
  • 18,496
  • 4
  • 54
  • 166
3
votes
1 answer

Internal predicates evaluate/2 and evaluate2/2

The execution profiler of SICStus Prolog 4.5.1 reported the following to me: | ?- print_profile. insns try/retry called name ---------------------------------------------------------------- …
repeat
  • 18,496
  • 4
  • 54
  • 166
3
votes
1 answer

How can I localize the reasons for excessive goal expansion?

The execution profiler of SICStus Prolog 4.5.1 gave me the following output: | ?- print_profile. insns try/retry called name ---------------------------------------------------------------- …
repeat
  • 18,496
  • 4
  • 54
  • 166
3
votes
1 answer

Testing goal expansion of meta-predicate maplist

Q: How can we get rid of maplist overhead—like SWI's apply_macros—in SICStus Prolog? A: Goal expansion. First, we define the auxiliary predicates we'll need. In the following we use SICStus Prolog 4.5.0. :- module(maplist_macros, [maplist/2,…
repeat
  • 18,496
  • 4
  • 54
  • 166
1
2
3
8 9