1
0
This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
Jip J. Dekker fad1b07018 Squashed 'software/minizinc/' content from commit 4f10c8205
git-subtree-dir: software/minizinc
git-subtree-split: 4f10c82056ffcb1041d7ffef29d77a7eef92cf76
2021-06-16 14:06:46 +10:00

75 lines
1.6 KiB
MiniZinc

/***
!Test
expected:
- !Result
solution: !Solution
assignment:
- true
- true
- true
***/
%
% SAT instance based on a DIMACS SAT problem generated by ./dimacs2minizinc.pl
%
% boolean variables
array [1..3] of var bool : assignment;
% formula
array [1..21] of int: Formula = [ 1, 2, 3, 1, 2, -3, 1, -2, 3, 1, -2, -3, -1, 2, 3, -1, 2, -3, -1, -2, 3 ];
%
% constraints
%
% clause 1
constraint (
( ( Formula[1] > 0 ) == assignment[1] ) \/
( ( Formula[2] > 0 ) == assignment[2] ) \/
( ( Formula[3] > 0 ) == assignment[3] )
);
% clause 2
constraint (
( ( Formula[4] > 0 ) == assignment[1] ) \/
( ( Formula[5] > 0 ) == assignment[2] ) \/
( ( Formula[6] > 0 ) == assignment[3] )
);
% clause 3
constraint (
( ( Formula[7] > 0 ) == assignment[1] ) \/
( ( Formula[8] > 0 ) == assignment[2] ) \/
( ( Formula[9] > 0 ) == assignment[3] )
);
% clause 4
constraint (
( ( Formula[10] > 0 ) == assignment[1] ) \/
( ( Formula[11] > 0 ) == assignment[2] ) \/
( ( Formula[12] > 0 ) == assignment[3] )
);
% clause 5
constraint (
( ( Formula[13] > 0 ) == assignment[1] ) \/
( ( Formula[14] > 0 ) == assignment[2] ) \/
( ( Formula[15] > 0 ) == assignment[3] )
);
% clause 6
constraint (
( ( Formula[16] > 0 ) == assignment[1] ) \/
( ( Formula[17] > 0 ) == assignment[2] ) \/
( ( Formula[18] > 0 ) == assignment[3] )
);
% clause 7
constraint (
( ( Formula[19] > 0 ) == assignment[1] ) \/
( ( Formula[20] > 0 ) == assignment[2] ) \/
( ( Formula[21] > 0 ) == assignment[3] )
);
solve satisfy;
output [
"simple sat: ",
show(assignment[1]), " ",
show(assignment[2]), " ",
show(assignment[3]), "\n"
];