Questions tagged [eclipse-clp]

ECLiPSe is a constraint logic programming system that works with Prolog as a basic engine. It includes modules for integer constraint logic programming as well as floating points. It also supports a large number of global constraints.

Books

A free downloadable pdf

A Gentle Guide to Constraint Logic Programming via ECLiPSe

83 questions
0
votes
1 answer

Is it possible to delay an assignment operation

I have a small script/code and i want to impose some active constraints. In the code shown below, i have P[I,J] #= E and in the next line Result[I,E] #= J but this is throwing an instantiation error because E is not instantiated. For these…
Luai Ghunim
  • 976
  • 7
  • 14
0
votes
1 answer

Apply OR constraint over the variables in a list

Suppose we have a list of variables. We want to apply a constraint over the variables, but the relation of these constraints are or. How we can do this in Eclipse CLP (prolog)? We should notice that if the list is short like A is [X, Y, Z] the…
OmG
  • 18,337
  • 10
  • 57
  • 90
0
votes
2 answers

How can use data file with Eclipse-clp program

How can use data file with Eclipse-clp or Prolog program. for Variables and Array values. for example if you want to give data to program as an big Array.How can read this data from a data files?
ARZ
  • 43
  • 7
0
votes
0 answers

How to implement these Sigma notations in ECLIPSE-CLP or Prolog

Is it possible for someone to tell me how to implement these sigmas in ECLiPSe-CLP or Prolog or at least give me guidance on how to implement and solve them.
ARZ
  • 43
  • 7
0
votes
1 answer

why this code cannot be run?what is "syntax error: postfix/infix operator expected" error in ECLiPSe-clp

When I want to run this code in ECLiPSe-CLP I get the following Error Error: string stream 27: syntax error: postfix/infix operator expected | 4 $= X^2 + Y^2, (Error Mark is under '=') | Code: circles(X, Y) :- 4 $= X^2 + Y^2, …
ARZ
  • 43
  • 7
0
votes
1 answer

How to implement This MP problem in ECLIPSE CLP or Prolog?

I want to implement this Summations as Objective and Constraints(1-6) Could anyone help me that how I can Implement them? OBJ: Min ∑(i=1..N)∑(j=1..N) Cij * ∑(k=1..K)Xijk constraint : ∑(k=1..K) Yik=1 (for all i in N)
ARZ
  • 43
  • 7
0
votes
1 answer

instantiation fault in indomain

I have a board solver which its general form of the solver likes the below: solver(Board):- constraints(Board), search(Board). It passes the constraint predicate, but there is an error in the search part which comes in the…
OmG
  • 18,337
  • 10
  • 57
  • 90
0
votes
1 answer

How To write a query for testing the following code that written with eplex Lib in ECLiPSe-CLP

I am new in ECLiPSe and have a follwing problem. when I write and compile this simple program: --------------------------------- :- lib(eplex). main1(Cost, Vars) :- Vars = [A1, A2, A3, B1, B2, B3, C1, C2, C3, D1, D2, D3], Vars :: 0.0..inf, …
ARZ
  • 43
  • 7
0
votes
1 answer

How to suspend in ECLiPSe CLP until full list is instantiated?

ECLiPSe CLP has a built-in predicate suspend(+Goal, +Prio, +CondList) whereby CondList often is of the form X -> inst. But how can you suspend until a whole list is instantiated? If you do List -> inst, it will succeed from the moment one element is…
lavra
  • 11
0
votes
0 answers

make display matrix prolog tkeclipse

I am new to prolog and want to generate a display matrix from the below prolog code as given in the image The image below is generated from the given prolog code using tkEclipse (Eclipse for prolog) Following is the code of constraint…
Sohail
  • 587
  • 7
  • 25
0
votes
1 answer

Constructing an array of ground data from list of integers in ECLiPSe

I'm trying to use the make_graph_symbolic/3 from the graph_algorithms library, which requires for the Nodes to be an array of ground data. As I'm constructing this graph from a matrix, the nodenames are XY, where X is the row and Y the column of a…
Divyak
  • 3
  • 2
0
votes
2 answers

Why a bignumber is shown incomplete in ECLiPSe Prolog?

I use the latest version of ECLiPSe Prolog 64-bit for Windows, then I compile the code: :- op(200, yf, !). !(N, F) :- fac(N, 1, F). fac(0, F0, F) :- !, F=F0. fac(N, F0, F) :- N1 is N-1, F1 is F0*N, fac(N1, F1, F). Query entered: ?- X is 100000 !. X…
0
votes
1 answer

Custom heuristic in ECLiPSe CLP

Consider the following puzzle: A cell is either marked or unmarked. Numbers along the right and bottom side of the puzzle denote the total sum for a certain row or column. Cells contribute (if marked) to the sum in its row and column: a cell in…
svdc
  • 154
  • 2
  • 10
0
votes
1 answer

How does subscript work?

In this first picture I get the first element of the array by using: subscript(array,[1],First) In this second picture I try the same but then for the second element but it gets everything from the second element to the end of the array. I just…
Stanko
  • 4,275
  • 3
  • 23
  • 51
0
votes
1 answer

For this currency code in Prolog, how can I make sure that the total number of coins are between 1 and 99 cents?

So here is a currency problem which calculates the fewest amount of coins to carry. There are 4 different kinds of coins (1 cent, 5 cent, 10 cent, and 25 cent). So when I ran the program the result gave me this: ?- questionFour(Coins, X). Coins =…