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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
70 views

ECLiPSe Integration with VSCode

I have just spent a three hours trying to configure my working environment for VSCode and ECLiPSe (I am new to VSCode and rusty in ECLiPSe) in Windows. So far I have created a task (and a keyboard ...
Echancrure's user avatar
0 votes
1 answer
101 views

tkeclipse - GUI colors assignments - Edit which file to fix?

The default settings for the installation of tkeclipse are unusable. What I see get is this: Also, I looked thru the menu choices and there is no option there to make required changes. Which file (...
Eric Marceau's user avatar
  • 1,615
1 vote
1 answer
59 views

What is the uncontrollable automatic propagation behavior in ECLIPSe-CLP?

I am trying to research, evaluate, and compare some searching methods in ECLIPSe-CLP. The key method of evaluating complexity and the efficacy of a method in said system is counting backtracks, ...
Hugo Ye's user avatar
  • 21
1 vote
1 answer
52 views

prolog max_min_eval/2 solution issue

I want to create a predicate max_min_eval/2 or max_min_eval(List,Result) which read a list like this [1,min,2,max,4,max,3] -> (((1 min 2) max 4) max 3) in eclipse prolog and put the Result into a ...
Sotiris Sotiriou's user avatar
1 vote
2 answers
168 views

How to read large Prolog files in ECLiPSe?

I generated a large file of paths via eclipse. Each line contains a clause for a list of 27 points. $ wc -l snake_points.pl 240917 snake_points.pl $ ls -lh snake_points.pl -rw-rw-r-- 1 carl carl 72M ...
Carl's user avatar
  • 13
0 votes
2 answers
140 views

How to use Prolog's foreach/2 loop

I am trying to get the foreach/2 loop to work in Prolog (using tkeclipse). I understand it needs an element in the first argument and a list to search for that element within as a second argument. My ...
emir hkima's user avatar
1 vote
1 answer
134 views

ECLiPSe CLP - TSP with Time WIndow. How do i calculate the cost?

I'm working on a variant of a TSP, where each node has a Time Window, but i've some problems calculating the cost function. I'm using a succesors model, so i have a list where each variable rapresents ...
Filipp's user avatar
  • 115
1 vote
1 answer
114 views

Age comparsion for Zebra Riddle

I'm trying to solve a logic riddle similar to the Einstein riddle with ECLiPSe Prolog via CLP: A band has 6 jazz-musicians, no one is younger than 70 years old. Every artist has written a different ...
Patrick's user avatar
  • 168
1 vote
1 answer
66 views

Is there a good source for finding common problems with ECLiPSe?

As a new ECLiPSe user I am running into problems. I was able to consult a .pl file, but when I changed the extension to .ecl I got a file-does-not-exist message. I was even able to run the .pl file,...
RussAbbott's user avatar
  • 2,700
1 vote
0 answers
93 views

Pruning symmetrical solutions in ECLiPSe Prolog with the use of constraints

This is a subproblem of a constraint satisfaction problem I'm currently working on and thus, I've omitted extra constraints that I apply to my variables. Suppose we have a list of 5 variables and ...
Imperator Romanorum's user avatar
2 votes
1 answer
67 views

Is there any explicit support for modulo operation in eplex library

I am using eplex and ic library and trying to solve a problem. I see that the eplex and ic provide explicit support for addition,multiplication and subtraction but there is no support for modulo or ...
learner's user avatar
  • 21
0 votes
1 answer
104 views

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 ...
Luai Ghunim's user avatar
1 vote
1 answer
117 views

Two objective functions

If we have two objective functions in Eclipse CLP that Cost1 is more important than Cost2, is the following true? minimize(minimize(labeling(Vars), Cost1), Costs2).
OmG's user avatar
  • 18.5k
1 vote
2 answers
98 views

How integer suspension will be handled when it is used in head of a condition

I have the following conditions over two variable A and B: [A,B] #:: 1..10, (A #= 3) or (B #= 3), ((A #> 3 or B #>3) -> % expression 1 ; % expression 2 ) %cntd The problem is in ...
OmG's user avatar
  • 18.5k
1 vote
1 answer
118 views

Eclipse CLP: maximum number of constraints/variables

In the Eclipse CLP, how many constraints or variables can I define? I am currently remodeling my scheduling problem - I need to replace a single alldifferent constraint with many atmost constraints. ...
Jan Drozen's user avatar
2 votes
1 answer
92 views

Internal workings of ic_global/occurrences/3

For the QuasiGroup completion problem I implemented two models. One of them is a model based on nothing but channeling constraints (based on a study by Dotu). The other one is a model based on the ...
Bruno Vandekerkhove's user avatar
1 vote
0 answers
57 views

A General Method To Transpile A Code in Eclipse CLP to CHR

My question is a little general but the answer to my specific question could be very helpful. The general question is "Is there any general method to transfer code in Eclipse CLP prolog to a ...
OmG's user avatar
  • 18.5k
1 vote
1 answer
41 views

Enforcing inequality of lists?

For a given CSP I used a variety of viewpoints, one of which is a somewhat more exotic boolean model which uses a variable array of size NxNxN. Then I enforce unequality of various subarrays with this ...
Bruno Vandekerkhove's user avatar
1 vote
1 answer
127 views

Looping through a list which is a subarray

I'm using ECLiPSe 6.1. I have an array of variables of dimension N x N, let's call it Vars. Now I call a procedure with, say, my_procedure(Vars[1..N,1..2]). Inside the procedure (my_procedure(List) :-...
Bruno Vandekerkhove's user avatar
1 vote
1 answer
205 views

Eclipse CLP labeling: exclude permutations

I am solving a scheduling problem (briefly described here: SWI Prolog CLP(FD) scheduling switched to ECLP). I am able to get some solution quickly, but now I want to incorporate some optimization ...
Jan Drozen's user avatar
2 votes
1 answer
61 views

CLP: Efficient model of 'not three same values'

I need to model this (simple) constraint in Eclipse CLP: Given three domain variables, lets say D1, D2, and D3 and I want to ensure that these three variables will not end up with the same value. Two ...
Jan Drozen's user avatar
0 votes
1 answer
251 views

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 ...
OmG's user avatar
  • 18.5k
0 votes
2 answers
125 views

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's user avatar
  • 43
0 votes
0 answers
95 views

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's user avatar
  • 43
0 votes
1 answer
747 views

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 '=') | ...
ARZ's user avatar
  • 43
1 vote
1 answer
83 views

Possible bug with nth1 predicate in Eclipse-clp?

I'm writing a sudoku solver in Prolog. The sudoku itself is given as a vector of vectors: P = [[1,_,_, _,_,_, _,_,_], [_,_,2, 7,4,_, _,_,_], [_,_,_, 5,_,_, _,_,4], [_,3,_, _,_,_, ...
SJoos's user avatar
  • 91
1 vote
1 answer
48 views

What value should be written to run the code correctly?

What value should be written to run the code correctly. I give any amount I do not see any output. f(T, Y) :-Y is sqrt(abs(T)) + 5*T^3. main :- read(As), length(As, N), reverse(As , Rs), ...
ARZ's user avatar
  • 43
0 votes
1 answer
104 views

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 : ∑(...
ARZ's user avatar
  • 43
0 votes
1 answer
226 views

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 ...
OmG's user avatar
  • 18.5k
1 vote
1 answer
83 views

Integer range suspension in prolog

I have the following query: ?- Remainder :: 0..8, Qoutient #:: 0..Dividened, Dividened #= Qoutient * 9 + Remainder, Dividened = 12. As you can see I have an integer suspension Qoutient #:: 0.....
OmG's user avatar
  • 18.5k
1 vote
1 answer
120 views

Constraint over the integer division

I have the following statement in prolog (Eclipse CLP): ?-X::1..100, X/5 #= 2, X = 12. The result is No.. I want to check that the integer division of X over 5 is equal to 2 or not. If I write the ...
OmG's user avatar
  • 18.5k
0 votes
1 answer
27 views

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, ...
ARZ's user avatar
  • 43
3 votes
1 answer
518 views

The difference between dollar sign ($) and number (or hash) sign (#) in Prolog

As I found I can use from $ and # in the shortened version of the suspend in Prolog. Hence, I can write the following query: ?- X $> 2, X = 2.5. And the result is: X = 2.5 Yes (0.11s cpu) So ...
OmG's user avatar
  • 18.5k
1 vote
3 answers
152 views

Avoid findall overflow with n-fractions problem

I am trying to print all solutions of the n-fractions problem for n=4: :- lib(ic). fractions(Digits) :- Digits = [A,B,C,D,E,F,G,H,I,J,K,L], Digits #:: 1..9, ic:alldifferent(Digits), X ...
Codefather's user avatar
0 votes
1 answer
159 views

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 -> ...
lavra's user avatar
  • 11
0 votes
0 answers
81 views

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) ...
Sohail's user avatar
  • 587
0 votes
1 answer
82 views

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 ...
Divyak's user avatar
  • 3
0 votes
2 answers
111 views

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, ...
T. S. Larsen's user avatar
1 vote
1 answer
182 views

Handle huge numeric values prolog

I'm working with prolog and i need to handle huge numerical values (i know, prolog is not originaly designed to handle numbers). I'm using ECLiPSe 6.1 and the documentation of some built in predicates ...
damianodamiano's user avatar
1 vote
1 answer
308 views

Print minimize steps prolog

I'm working on a prolog program (CLPFD) with ECLiPSe 6.1. The program has a lot of variables and i want to minimize a certain value but (obviously) the minimization steps takes a lot of time. How can ...
damianodamiano's user avatar
3 votes
3 answers
220 views

How do I specify to Prolog that all the elements of a list have to be 1 or 0?

How do I make sure that all the elements of a prolog list are either 0 or 1? I need to generate a list of given length and make sure it has only these 2 numbers in it: E.g. [0,0,0,0,0,0], [1,0,0,1,...
Zap's user avatar
  • 324
1 vote
1 answer
98 views

ECLiPSe CLP produces variable with unexpected range

I have a question regarding the following code: :-lib(ic). buggy_pred(Result, In0, In1, In2, In3, In4, In5, In6, In7) :- Args = [In0, In1, In2, In3, In4, In5, In6, In7], Args :: [0..255], ...
krzysiekb's user avatar
1 vote
1 answer
140 views

Listing all constraints in Eclipse CLP in a readable form

I have an ECLiPSe script whose goal is to encode my problem into a set of arithmetic constraints. In REPL, I eventually get a list of delayed goals which looks as follows: -(_2941{4 .. 7}) + _2900{...
Alek81's user avatar
  • 23
8 votes
3 answers
1k views

Example channelling constraints ECLiPSe

Can someone provide a simple example of channelling constraints? Channelling constraints are used to combine viewpoints of a constraint problem. Handbook of Constraint Programming gives a good ...
Stanko's user avatar
  • 4,365
1 vote
0 answers
127 views

ECLiPSe CLP : slow combined occurrence/3 constraint behaviour

As a subset of a larger problem, I'm trying to write the 2 following constraints for an NxN board (containing N² cells): Each row/col contains exactly N occurrences of integer K given by pre-defined ...
SND's user avatar
  • 1,562
1 vote
1 answer
817 views

Active vs Passive constraints in ECLiPSe CLP

What is the difference between active and passive constraints in the ECLiPSe CLP language? And how/when can I use one or the other?
The Oddler's user avatar
  • 6,406
0 votes
1 answer
220 views

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)...
svdc's user avatar
  • 154
1 vote
0 answers
108 views

Strange behaviour by heuristics when solving a CSP

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)...
svdc's user avatar
  • 154
3 votes
1 answer
440 views

How do you check the elements of a submatrix in Prolog

I am trying to write a Shikaku solver in EclipsE Prolog. My contraints are defined as follow: solve(Problemname):- writeln("Start shikaku."), problem(Problemname, Width, Height, Hints), shikaku(Width,...
JorenV's user avatar
  • 352
2 votes
1 answer
272 views

Simple Arithmetic Constraint on List ECLiPSe clp

I want to do a simple constraint over all values of a list, I want each index of each row of an array to have the following (ic) constraint: 500 #= 2^X1 + 2^X2 + 2^X3 + ... + 2^X9 I try to do the ...
revolution64's user avatar