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

OS system call to Sicstus hangs indefinitely using Python

I'm trying to write a proofchecking application that receives proofs from a user on a website and sends it through to a Prolog script to check its validity. I'm using Django, Python 2.7 and Sicstus. In my server "view.py" file, I call a python…
Tagc
  • 8,736
  • 7
  • 61
  • 114
1
vote
1 answer

SICStus Prolog upgrade in x86 platform

Currently we are using SICStus version :3.12.10 and patch1 (x86-linux-glibc2.3) for 32 bit platform. My requirement: As per new requirement we have to upgrade SICStus Prolog Version 4.2.3 and x86 platform changed from 32 bit to 64 bit. could you…
Ayyappa Boligala
  • 1,096
  • 7
  • 7
1
vote
2 answers

How do I reinstate constraints collected with copy_term/3 in SICStus Prolog?

The documentation says that copy_term(+Term, -Copy, -Body) makes a copy of Term in which all variables have been replaced by new variables that occur nowhere outside the newly created term. If Term contains attributed variables, Body is…
vmg
  • 4,176
  • 2
  • 20
  • 33
1
vote
1 answer

Create prolog list from C

I have a C-program as frontend to a Sicstus Prolog runtime. And I'm trying to create a list in C, fill it out and pass to the Prolog runtime. I have had a look at the C-library, but I don't find any information of how this should be done. I guess…
MortenM
  • 522
  • 2
  • 12
1
vote
1 answer

integer division operator in Prolog

This code is a part of the program that I am writing to solve a cryptarithmatic puzzle in prolog. I am solving this using CLPFD (SICStus Prolog). I am getting an error while using the inbuilt integer division operator "//" (See Below for details). I…
user220751
1
vote
1 answer

Use of clpfd and fdbg

I have the following Prolog code which is using clpfd: :- use_module(library(clpfd)). :- use_module(library(fdbg)). go( X , Y ) :- X = [X1,X2], X1 in 0..10, X2 in 0..10, Y in -1..1, X1 #= X2 #<=> IsNoChange, X1 #> X2 #<=> IsDown, X1 #< X2…
MortenM
  • 522
  • 2
  • 12
1
vote
1 answer

Sicstus Prolog custom labeling by use of variable(Sel) and value(Enum)

Let's say I pass the following list of domain variables to the labeling predicate: Z=[X1,Y1,X2,X3,Y2,X4,Y3.......Xn,Ym], labeling(...., Z). For variable(Sel): Further more I want the labeling to maybe choose all the Y's first before continuing on…
MortenM
  • 522
  • 2
  • 12
1
vote
1 answer

Parsing json request in flask 0.9

(I am a complete beginner when it comes to any back-end development so I apologise if any terms are used wrong) I have some javascript controlling a canvas game and I have a prolog planner which can solve the game. I am now trying to connect the…
bamboo10
  • 133
  • 2
  • 14
1
vote
2 answers

How to specify custom order of values in variable's domain?

Let's assume I have a variable V and value of V can be any number from the range 0..5. However, some values are more preferred than other others therefore it would help me to specify the domain of V as an ordered sequence. Can I do it in SICStus…
MartyIX
  • 27,828
  • 29
  • 136
  • 207
1
vote
1 answer

How to define variables for the following scenario in CLPFD?

I have a set of variables T_1, T_2, ..., T_N and I would like to rewrite the following pseudocode in CLPFD: T_1 in 0..59, T_2 in 0..59, ... T_n in 0..59, all_different([T_1, T_2, ..., T_n]), FOREACH x in 0 to 59 do: IF (x \in [T_1, T_2,…
MartyIX
  • 27,828
  • 29
  • 136
  • 207
1
vote
1 answer

List all relations from a module in SICStus Prolog

Is there any way to get the list of all relations defined in a loaded module in SICStus Prolog interpreter?
Legat
  • 1,379
  • 3
  • 11
  • 20
1
vote
2 answers

How to shorten following program?

I would like to shorten the following program. Just imaging there are tens of variables instead of just X and Y. The problem is that I need to define domain for each variable separately. I don't like it because it makes my program much longer and…
MartyIX
  • 27,828
  • 29
  • 136
  • 207
1
vote
1 answer

Need to get the current year from the system in prolog

I'm new to stackoverflow and to Prolog. I want to get the current year and use it in a comparison like 'BD > currentYear'. From the research I've been doing, I think i need to use 'use_module(library(system))' but i don't know how to... Can you help…
Cheerio
  • 23
  • 1
  • 4
1
vote
1 answer

Predicate not work as expected in Prolog (SICStus)

I have a problem with prolog predicate. I have one board and i want to check when one player dont have pieces with values between 1 and 10 called mobile pieces. The code are showed above: test_board([ [piece(' ',12,blk),piece('R2…
mistic
  • 275
  • 5
  • 15
1
vote
2 answers

Sicstus Prolog: display current bindings during debugging

I'm very new to Prolog and have been using Sicstus to help debug my code. Is there a way to view all the bindings while you are stepping through a query using trace/0? Or is there some other way to print out during the steps?
Jazz
  • 1,090
  • 6
  • 23
  • 55
1 2 3
8 9