|
|
|
@ -14,7 +14,7 @@ set of Signals: Eight = { A, B, C, D, E, F, G };
|
|
|
|
|
set of Signals: Nine = { A, B, C, D, F, G };
|
|
|
|
|
array[1..10] of set of Signals: AllSignals = [ Zero, One, Two, Three, Four, Five, Six, Seven, Eight, Nine ];
|
|
|
|
|
|
|
|
|
|
array[int] of set of Signals: Patterns;
|
|
|
|
|
array[1..10] of set of Signals: Patterns;
|
|
|
|
|
% Patterns = [
|
|
|
|
|
% { A, C, E, D, G, F, B },
|
|
|
|
|
% { C, D, F, B, E },
|
|
|
|
@ -31,10 +31,8 @@ array[int] of set of Signals: Patterns;
|
|
|
|
|
array [Signals] of var Signals: Map;
|
|
|
|
|
|
|
|
|
|
constraint alldifferent(Map);
|
|
|
|
|
constraint forall(pattern in Patterns)(
|
|
|
|
|
exists(digit in AllSignals)(
|
|
|
|
|
{ Map[x] | x in pattern } = digit
|
|
|
|
|
)
|
|
|
|
|
constraint forall(pattern in [ { Map[x] | x in pattern } | pattern in Patterns])(
|
|
|
|
|
exists(digit in AllSignals)(pattern = digit)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
output [show(Map)];
|