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

From: Lutz, Charles D <charles.d.lutz_at_lmco.com>
Date: Fri, 20 Jul 2007 15:37:54 -0400
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.

 

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_lmco.com

 

"A graphic is never an end in itself; it is a moment

in the process of decision making."
     - Jacques Bertin

 
Received on Fri Jul 20 2007 - 20:39:09 CEST

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET