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

How to find the set intersection from two lists using Prolog/Eclipse language?

So before I start, here is the problem: I have an example List Xs = [1,2,3] and List Ys = [2,3,4]. The two common elemental members from these two lists are [2,3]. So I'm trying to create a predicate setIntersection(Xs, Ys, Zs), where the resulting…
0
votes
3 answers

The result of Sum is floor(Col + Row + 1) is never an integer and I don't know why

I have to write a piece of prolog where I have to calculate which position in an array is used to store a value. However the result of these calculations should return an integer, so I use the floor/1 predicate to get myself the integer of the value…
Delko
  • 25
  • 4
0
votes
2 answers

Using trigonometric functions in eclipse clp

I'm new to eclipse CLP and I want to implement a predicate that gets all the angles equivalent to a specific sinusoidal function, something like :- lib(ic). solve(L) :- L = [X,Y,Z], L::[-180..180], cos(X) #= sin(Y) + sin(Z), labeling(L). I know…
Poka Yoke
  • 373
  • 3
  • 8
  • 27
0
votes
1 answer

Porting ECLiPSe to Prolog

I've solved a problem about the assignment of the articles in a conference, using ECLiPSe. The goal is: similar articles should be in the same sessions. This is the solution that works in ECLiPSe: :- lib(fd). paper(1, 'An Empirical Study on…
user840718
  • 1,563
  • 6
  • 29
  • 54
0
votes
1 answer

Clp ECLiPSe Prolog Dynamic Constraint

I have this constraint: B #> P1*V1 + P2*V2 + P3*V3+ P4*V4 + P5*V5 + P6*V6 +P7*V7 + P8*V8 + P9*V9 + P10*V10 with P=[1,2,3,4,5,6,7,8,9,10] and V=[V1,V2,V3,....], V::0..1 I want implement this constraint in dynamic way with N elements (cardinality of…
-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
votes
1 answer

How to use the labeling function of Prolog (ECLIPSE program) within the SEND+MORE = MONEY program?

So I managed to write the SEND + MORE = MONEY program for Prolog and I'm having trouble labeling the results. Any ideas on how to do that? I keep using the labeling function but it still wouldn't work. I'm lost here. :- lib(ic). puzzle(List) :- …
-1
votes
1 answer

How can I access an element in a list for prolog?

So I'm having trouble trying to obtain a single element from a list using Prolog without using recursion, only relying on loops, such as foreach, foreachelem, etc.... So I have a list Xs = [1,2,3], and I want to obtain each element individually. The…
1 2 3 4 5
6