# Re: [eclipse-users] Effect of line in "steiner" example

From: Kish Shen <kisshen_at_...5...>
Date: Sat, 21 Jul 2007 00:14:12 +0100
Hi Chuck,

Lutz, Charles D wrote:
>
> Hi folks,
>
> Some of the subtleties of how modeling in ECLiPSe works take a while to
>
> comprehend ;-)
>
> I am trying out the Steiner set example from the integer sets library
> chapter
>
> (10) in the tutorial. The original example is shown below:
>
> :- lib(ic_sets).
>
> :- lib(ic).
>
> steiner(N, Sets) :-
>
> NB is N * (N-1) // 6, % compute number of triplets
>
> intsets(Sets, NB, 1, N), % initialise the set variables
>
> ( foreach(S,Sets) do
>
> #(S,3) % constrain their cardinality
>
> ),
>
> ( fromto(Sets,[S1|Ss],Ss,[]) do
>
> ( foreach(S2,Ss), param(S1) do
>
> #(S1 /\ S2, C), % constrain the cardinality
>
> C #=< 1 % of pairwise intersections
>
> )
>
> ),
>
> label_sets(Sets). % search
>
> label_sets([]).
>
> label_sets([S|Ss]) :-
>
> insetdomain(S,_,_,_),
>
> label_sets(Ss).
>
> I was curious why we needed the “C #=< 1” constraint, if we wanted to
> constrain
>
> the cardinality of S1 /\ S2 to be 1, so I removed it and just replaced
> the “C” in the
>
> cardinality constraint with a 1.
>
C #=< 1 does *not* mean constraining the cardinality to 1, but to *at
most* 1, i.e. it can be either 0 or 1
(cardinality must be non-negative).
C #= 1 would be constraining the cardinality to 1 (and equivalent to

So the difference is because you have changed the specification of the
model, so you are no longer trying to solve the same problem.

Cheers,

Kish
>
> ECLiPSe now seems to run this in an “infinite” loop; I played with
> both versions in
>
> the Tracer but I don’t know the execution details enough yet to tell
> what is going
>
> on.
>
> Thanks,
>
> **Chuck Lutz**
>
> Lockheed Martin
>
> Systems of Systems Engineering
>
> BMC4I Modeling and Simulation
>
> Moorestown, NJ
>
> (856)638-7234 (office)
>
> charles.d.lutz_at_...53... <mailto:charles.d.lutz@...53...>
>
> “A graphic is never an end in itself; it is a moment
>
> in the process of decision making.”
> - Jacques Bertin
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ECLiPSe-Users mailing list
> ECLiPSe-Users_at_...2...
> http://www.crosscoreop.com/mailman/options/eclipse-users
>
Received on Sat Jul 21 2007 - 00:14:29 CEST

This archive was generated by hypermail 2.3.0 : Wed Jun 19 2019 - 06:15:11 CEST