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
0
votes
1 answer

prolog Existance error: procedure does not exist

Existence error in user:nth1/3 ! procedure user:nth1/3 does not exist I have included module for lists : :- use_module(library(lists)). but still getting this error.. Can anyone please help?
Android_enthusiast
  • 863
  • 5
  • 22
  • 41
0
votes
1 answer

convert comment string to an ASCII character list in sicstus-prolog

currently I am working on comparison between SICStus3 and SICStus4 but I got one issue that is SICStus4 will not consult any cases where the comment string has carriage controls or tab characters etc as given below. Example case as given below.It…
Ayyappa Boligala
  • 1,096
  • 7
  • 7
0
votes
1 answer

Prolog - reload source files

I just finished creating a game in Prolog using Sicstus. During the game I use assert's and retract's to update the values of some variables I use. When the game finishes, if I don't reconsult the source files, and re-run the game, those variables…
Pedro Pereira
  • 312
  • 5
  • 21
0
votes
1 answer

Appending facts into an existing prolog file

I'm having trouble inserting facts into an existing Prolog file, without overwriting the original contents. Suppose I have a file test.pl: :- dynamic born/2. born(john,london). born(tim,manchester). If I load this in prolog, and I assert more…
vuj
  • 15
  • 1
  • 3
0
votes
1 answer

Prolog Constraints -> Solving Puzzle Grid

So guys, I'm learning constraints with prolog, and trying to implement a little puzzle using this new knowledge. The goal of the puzzle is simple: I have a square grid with some numbers on top/below each column and on the right/left of each row. The…
PedroFaria
  • 51
  • 6
0
votes
1 answer

Endtime for machine in cumulatives

I'm working on a scheduling problem which I have used cumulatives/3 to model. Ex: s1(Ss, Es, Ms ) :- Ss = [S1,S2,S3,S4,S5,S6,S7], Es = [E1,E2,E3,E4,E5,E6,E7], Ms = [M1,M2,M3,M4,M5,M6,M7], domain(Ss, 1, 30), domain(Es, 1, 30), …
MortenM
  • 522
  • 2
  • 12
0
votes
2 answers

Prolog, testing labeling heuristics

I'm working on some experiments for comparing different labeling heuristics in Sicstus Prolog. But I keep getting into 'Resource error: insufficient memory'. I'm pretty sure I'm doing something wrong in my testcode. The following code will replicate…
MortenM
  • 522
  • 2
  • 12
0
votes
1 answer

Difference between matrix column and use of all_different

I'm trying to express a relation on transition from one element in a list-of-lists, to another element. What I want to be able to do, is to say that there should exist a certain difference between two arbitrary elements. If we have the list …
MortenM
  • 522
  • 2
  • 12
0
votes
2 answers

how to convert a code that is using atom_to_term from SWI-prolog to SICStus Prolog

I'm trying to write a rule to compare two atoms to see which one is better for example (memory_with_gb_2 is better than memory_with_gb_1) and what I've written and tried in SWI-prolog is the…
0
votes
0 answers

Prolog error: "expected stream, but found '$stream' ..."

I am working on a program for a college assignment, currently I'm trying to write some denials from an abductive procedure written on a file as integrity constraints, but I'm having some problems. My predicates for the task look like…
0
votes
1 answer

is "save_program/1" broken in Sicstus Prolog 4.2 on a Windows7 64bit machine?

I started sicstus from my Cygwin prompt on my Windows7 64bit installation, and created a prolog program. Then I saved it using the following command that created the file "test.sav" in my current folder. save_program(test). When I try to run this…
Rune
  • 698
  • 1
  • 7
  • 22
0
votes
2 answers

What happened to "Compile Prolog Code" (Alt+K) in the SICStus Eclipse SPIDER menu in Juno?

I just upgraded from Eclipse Indigo to the Classic Eclipse 4.2 Juno, by downloading from this URL: ftp://ftp.uninett.no/pub/eclipse/eclipse/downloads/drops4/R-4.2-201206081400/eclipse-SDK-4.2-win32-x86_64.zip I installed the SPIDER in Eclipse Juno,…
Rune
  • 698
  • 1
  • 7
  • 22
0
votes
1 answer

how to find declaration of a predicate in the modules which lie in other directories

For Prolog plugins, such as SICStus spider, proDT and PDT, "find declaration" in eclipse editor can not find predicate definition in the modules which lie in different directories. For example, $HOME/dirA/A.pl: :- module(database,[]). ... …
0
votes
1 answer

Prolog association list

I am writing a simple program safety checker in Prolog and I need a data structure to hold variable valuation. Since I want to detect when I am visiting same state again, this structure must support some reasonable comparison semantics, so I can…
rburny
  • 1,559
  • 1
  • 9
  • 28
-1
votes
2 answers

what is the difference between count /3 and for/3 in prolog?

What is the difference between count/3 and for/3 in prolog ? and how to use for-loop with decrementation -1 like (for(I,9,0,-1))? for example : Dec=-2, Min_bound=0, Max_bound=9 Result => 9,7,5,3,1 …
Ans Piter
  • 573
  • 1
  • 5
  • 17
1 2 3
8
9