geoffchu / chuffed Goto Github PK
View Code? Open in Web Editor NEWThe CP solver Chuffed
License: MIT License
The CP solver Chuffed
License: MIT License
... e.g., on the Challenge 2012 instance ../challenge_from2012/mznc12-problems/parity-learning/parity-learning.mzn ../challenge_from2012/mznc12-problems/parity-learning/44_22_5.2.dzn
Possible add-on to redefinitions.mzn:
predicate array_bool_xor(array[int] of var bool: a) =
let { var 0..(length(a)-1) div 2: m,
var 1..((length(a)-1) div 2)*2+1: ss = sum(i in index_set(a))( bool2int(a[i]) ) }
in
ss == 1 + 2 * m;
Hi,
Welcome to GitHub! I'm glad you are here :) I develop CryptoMiniSat, a premier SAT solver. Along with MiniSat, these two are the only ones on GitHub or indeed on any open development environment. I have about 3-4 years of experience with using GitHub. So, here is some advice, please don't take it wrongly :)
I think your git dir layout is wrong... You should not put binaries into GIT. Instead, on GitHub you can make "releases". Just add a git tag, push it to github, and then create a release from it. You can attach binaries to releases. This makes a lot more sense, since obviously you will not be updating your binaries with all the changes you make to the sourcecode. Also, keeping large binary files in git that are supposed to change every so often is not a good idea to do. Actually, it's a pretty bad idea. So, I suggest to:
To be honest, adding the binaries is such a bad idea that I personally would delete the repo and re-create it with the same name, but without the binaries. Otherwise whoever wants to clone your repo will need to keep the binaries in the history even if you delete them (history is forever). Cloning a repo is supposed to be cheap so people can hack on it. Putting lots of binaries in makes it very hard to clone and play.
I know the above sounds like criticism, but it's constructive and in the long run, it will pay out. It takes time to get used to the git/github way of doing things. It's great though :)
Good luck!
Mate
Hi,
thanks for sharing chuffed—I'm thrilled it's available on github!
Is there a chance we'll get a disjunctive constraint with variable processing times (i.e. a "proper" MiniZinc-style disjunctive
)?
Seb
Hi,
for my tests on Linux (Ubuntu 16.04 x64), I´m using the same example as in #10. I compiled the binaries myself, as described in the README.
When running ./par_build/fzn_chuffed test/oocsp_racks_030_e6_cc.fz
, I apparently get a valid solution:
% No search annotation given. Defaulting to VSIDS!
Configuration_configtype = array1d(1..30, [100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
Element_configuration = array1d(1..30, [0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
Frame_rack = array1d(1..30, [0, 0, 0, 0, 0, 0, 0, 28, 29, 29, 29, 28, 29, 28, 28, 28, 28, 28, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
Module_element = array1d(1..30, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 4, 5, 7, 2, 3, 0, 0, 0, 0, 0]);
Module_frame = array1d(1..30, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 16, 19, 19, 18, 18, 0, 0, 0]);
Rack_configuration = array1d(1..30, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0]);
nrofobjects = array1d(1..17, [1, 6, 6, 0, 0, 0, 12, 8, 6, 0, 0, 0, 2, 2, 1, 1, 1]);
start = array1d(1..17, [1, 2, 2, 8, 8, 8, 8, 20, 20, 26, 26, 26, 26, 28, 28, 29, 30]);
When using mpirun -np 8 ./par_build/fzn_chuffed -parallel=true -f test/oocsp_racks_030_e6_cc.fzn
(as described in the README), however, I get some errors:
% No search annotation given. Defaulting to VSIDS!
% No search annotation given. Defaulting to VSIDS!
% No search annotation given. Defaulting to VSIDS!
% No search annotation given. Defaulting to VSIDS!
% No search annotation given. Defaulting to VSIDS!
% No search annotation given. Defaulting to VSIDS!
% No search annotation given. Defaulting to VSIDS!
% No search annotation given. Defaulting to VSIDS!
[ubuntu-vm:00771] *** Process received signal ***
[ubuntu-vm:00771] Signal: Segmentation fault (11)
[ubuntu-vm:00771] Signal code: Address not mapped (1)
[ubuntu-vm:00771] Failing at address: 0xc
[ubuntu-vm:00777] *** Process received signal ***
[ubuntu-vm:00775] *** Process received signal ***
[ubuntu-vm:00775] Signal: Segmentation fault (11)
[ubuntu-vm:00775] Signal code: Address not mapped (1)
[ubuntu-vm:00775] Failing at address: 0xc
[ubuntu-vm:00770] *** Process received signal ***
[ubuntu-vm:00770] Signal: Segmentation fault (11)
[ubuntu-vm:00770] Signal code: Address not mapped (1)
[ubuntu-vm:00770] Failing at address: 0xc
[ubuntu-vm:00773] *** Process received signal ***
[ubuntu-vm:00777] Signal: Segmentation fault (11)
[ubuntu-vm:00777] Signal code: Address not mapped (1)
[ubuntu-vm:00777] Failing at address: 0xc
[ubuntu-vm:00777] [ubuntu-vm:00770] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7f71fa4163d0]
[ubuntu-vm:00770] [ 1] [ubuntu-vm:00771] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7fb759b193d0]
[ubuntu-vm:00771] [ 1] [ubuntu-vm:00775] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7f890666b3d0]
[ubuntu-vm:00775] [ 1] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7f19b254a3d0]
[ubuntu-vm:00777] [ 1] [ubuntu-vm:00773] Signal: Segmentation fault (11)
[ubuntu-vm:00773] Signal code: Address not mapped (1)
[ubuntu-vm:00773] Failing at address: 0xc
[ubuntu-vm:00773] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7fd8364a23d0]
[ubuntu-vm:00773] [ 1] [ubuntu-vm:00774] *** Process received signal ***
[ubuntu-vm:00772] *** Process received signal ***
[ubuntu-vm:00772] Signal: Segmentation fault (11)
[ubuntu-vm:00772] Signal code: Address not mapped (1)
[ubuntu-vm:00772] Failing at address: 0xc
[ubuntu-vm:00772] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7f8b86ce03d0]
[ubuntu-vm:00772] [ 1] ./par_build/fzn_chuffed(_ZNK4TintcviEv+0xc)[0x4b1378]
[ubuntu-vm:00770] [ 2] ./par_build/fzn_chuffed(_ZNK6IntVar6getMinEv+0x1c)[0x4ca2f6]
[ubuntu-vm:00770] [ 3] ./par_build/fzn_chuffed(_ZN5Slave12exportBoundsEv+0x2b)[0x54480f]
[ubuntu-vm:00770] [ 4] ./par_build/fzn_chuffed(_ZNK4TintcviEv+0xc)[0x4b1378]
[ubuntu-vm:00775] [ 2] ./par_build/fzn_chuffed(_ZNK6IntVar6getMinEv+0x1c)[0x4ca2f6]
[ubuntu-vm:00775] [ 3] ./par_build/fzn_chuffed(_ZN5Slave12exportBoundsEv+0x2b)[0x54480f]
[ubuntu-vm:00775] [ 4] ./par_build/fzn_chuffed(_ZNK4TintcviEv+0xc)[0x4b1378]
[ubuntu-vm:00777] [ 2] ./par_build/fzn_chuffed(_ZNK6IntVar6getMinEv+0x1c)[0x4ca2f6]
[ubuntu-vm:00777] [ 3] ./par_build/fzn_chuffed(_ZN5Slave12exportBoundsEv+0x2b)[0x54480f]
[ubuntu-vm:00777] [ 4] ./par_build/fzn_chuffed(_ZNK4TintcviEv+0xc)[0x4b1378]
[ubuntu-vm:00771] [ 2] ./par_build/fzn_chuffed(_ZNK6IntVar6getMinEv+0x1c)[0x4ca2f6]
[ubuntu-vm:00771] [ 3] ./par_build/fzn_chuffed(_ZNK4TintcviEv+0xc)[0x4b1378]
[ubuntu-vm:00773] [ 2] ./par_build/fzn_chuffed(_ZNK6IntVar6getMinEv+0x1c)[0x4ca2f6]
[ubuntu-vm:00773] [ 3] ./par_build/fzn_chuffed(_ZN5Slave12exportBoundsEv+0x2b)[0x54480f]
[ubuntu-vm:00773] [ 4] ./par_build/fzn_chuffed(_ZN5Slave12exportBoundsEv+0x2b)[0x54480f]
[ubuntu-vm:00771] [ 4] ./par_build/fzn_chuffed(_ZN5Slave10sendReportEv+0x5c)[0x544a0a]
[ubuntu-vm:00771] [ 5] ./par_build/fzn_chuffed(_ZN5Slave5solveEv+0xea)[0x543d50]
[ubuntu-vm:00771] [ 6] ./par_build/fzn_chuffed(_ZN6Engine5solveEP7Problem+0x12c)[0x52e69c]
[ubuntu-vm:00771] [ 7] ./par_build/fzn_chuffed(main+0xb2)[0x48b144]
[ubuntu-vm:00771] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fb75975f830]
[ubuntu-vm:00771] [ 9] ./par_build/fzn_chuffed(_start+0x29)[0x48ae69]
[ubuntu-vm:00771] *** End of error message ***
./par_build/fzn_chuffed(_ZN5Slave10sendReportEv+0x5c)[0x544a0a]
[ubuntu-vm:00773] [ 5] ./par_build/fzn_chuffed(_ZN5Slave5solveEv+0xea)[0x543d50]
[ubuntu-vm:00773] [ 6] ./par_build/fzn_chuffed(_ZN6Engine5solveEP7Problem+0x12c)[0x52e69c]
[ubuntu-vm:00773] [ 7] ./par_build/fzn_chuffed(main+0xb2)[0x48b144]
[ubuntu-vm:00773] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fd8360e8830]
[ubuntu-vm:00773] [ 9] ./par_build/fzn_chuffed(_start+0x29)[0x48ae69]
[ubuntu-vm:00773] *** End of error message ***
./par_build/fzn_chuffed(_ZN5Slave10sendReportEv+0x5c)[0x544a0a]
[ubuntu-vm:00770] [ 5] ./par_build/fzn_chuffed(_ZN5Slave5solveEv+0xea)[0x543d50]
[ubuntu-vm:00770] [ 6] ./par_build/fzn_chuffed(_ZN6Engine5solveEP7Problem+0x12c)[0x52e69c]
[ubuntu-vm:00770] [ 7] ./par_build/fzn_chuffed(main+0xb2)[0x48b144]
[ubuntu-vm:00770] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f71fa05c830]
[ubuntu-vm:00770] [ 9] ./par_build/fzn_chuffed(_start+0x29)[0x48ae69]
[ubuntu-vm:00770] *** End of error message ***
./par_build/fzn_chuffed(_ZN5Slave10sendReportEv+0x5c)[0x544a0a]
[ubuntu-vm:00775] [ 5] ./par_build/fzn_chuffed(_ZN5Slave5solveEv+0xea)[0x543d50]
[ubuntu-vm:00775] [ 6] ./par_build/fzn_chuffed(_ZN6Engine5solveEP7Problem+0x12c)[0x52e69c]
[ubuntu-vm:00775] [ 7] ./par_build/fzn_chuffed(main+0xb2)[0x48b144]
[ubuntu-vm:00775] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f89062b1830]
[ubuntu-vm:00775] [ 9] ./par_build/fzn_chuffed(_start+0x29)[0x48ae69]
[ubuntu-vm:00775] *** End of error message ***
./par_build/fzn_chuffed(_ZN5Slave10sendReportEv+0x5c)[0x544a0a]
[ubuntu-vm:00777] [ 5] ./par_build/fzn_chuffed(_ZN5Slave5solveEv+0xea)[0x543d50]
[ubuntu-vm:00777] [ 6] ./par_build/fzn_chuffed(_ZN6Engine5solveEP7Problem+0x12c)[0x52e69c]
[ubuntu-vm:00777] [ 7] ./par_build/fzn_chuffed(main+0xb2)[0x48b144]
[ubuntu-vm:00777] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f19b2190830]
[ubuntu-vm:00777] [ 9] ./par_build/fzn_chuffed(_start+0x29)[0x48ae69]
[ubuntu-vm:00777] *** End of error message ***
./par_build/fzn_chuffed(_ZNK4TintcviEv+0xc)[0x4b1378]
[ubuntu-vm:00772] [ 2] ./par_build/fzn_chuffed(_ZNK6IntVar6getMinEv+0x1c)[0x4ca2f6]
[ubuntu-vm:00772] [ 3] ./par_build/fzn_chuffed(_ZN5Slave12exportBoundsEv+0x2b)[0x54480f]
[ubuntu-vm:00772] [ 4] ./par_build/fzn_chuffed(_ZN5Slave10sendReportEv+0x5c)[0x544a0a]
[ubuntu-vm:00772] [ 5] ./par_build/fzn_chuffed(_ZN5Slave5solveEv+0xea)[0x543d50]
[ubuntu-vm:00772] [ 6] ./par_build/fzn_chuffed(_ZN6Engine5solveEP7Problem+0x12c)[0x52e69c]
[ubuntu-vm:00772] [ 7] ./par_build/fzn_chuffed(main+0xb2)[0x48b144]
[ubuntu-vm:00772] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f8b86926830]
[ubuntu-vm:00772] [ 9] ./par_build/fzn_chuffed(_start+0x29)[0x48ae69]
[ubuntu-vm:00772] *** End of error message ***
[ubuntu-vm:00774] Signal: Segmentation fault (11)
[ubuntu-vm:00774] Signal code: Address not mapped (1)
[ubuntu-vm:00774] Failing at address: 0xc
[ubuntu-vm:00774] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7fdc55c723d0]
[ubuntu-vm:00774] [ 1] ./par_build/fzn_chuffed(_ZNK4TintcviEv+0xc)[0x4b1378]
[ubuntu-vm:00774] [ 2] ./par_build/fzn_chuffed(_ZNK6IntVar6getMinEv+0x1c)[0x4ca2f6]
[ubuntu-vm:00774] [ 3] ./par_build/fzn_chuffed(_ZN5Slave12exportBoundsEv+0x2b)[0x54480f]
[ubuntu-vm:00774] [ 4] ./par_build/fzn_chuffed(_ZN5Slave10sendReportEv+0x5c)[0x544a0a]
[ubuntu-vm:00774] [ 5] ./par_build/fzn_chuffed(_ZN5Slave5solveEv+0xea)[0x543d50]
[ubuntu-vm:00774] [ 6] ./par_build/fzn_chuffed(_ZN6Engine5solveEP7Problem+0x12c)[0x52e69c]
[ubuntu-vm:00774] [ 7] ./par_build/fzn_chuffed(main+0xb2)[0x48b144]
[ubuntu-vm:00774] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fdc558b8830]
[ubuntu-vm:00774] [ 9] ./par_build/fzn_chuffed(_start+0x29)[0x48ae69]
[ubuntu-vm:00774] *** End of error message ***mpirun noticed that process rank 2 with PID 771 on node ubuntu-vm exited on signal 11 (Segmentation fault).
Best regards,
Richard
Hi there, I'd like to compile fzn_chuffed as a 32bit Binary on a 64bit Linux (Ubuntu 14.04). When I call this..._
--snip--
cd chuffed-master
mkdir build
cd build
CMAKE_LIBRARY_PATH=/home/nath/apps/chuffed/lib
cmake
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/nath/apps/chuffed/lib
-DCMAKE_INSTALL_PREFIX=/home/nath/apps/chuffed
-DCMAKE_BUILD_TYPE=RELEASE
-DBUILD_SHARED_LIBS=1
-DCMAKE_C_FLAGS=-m32
-DCMAKE_CXX_FLAGS=-m32
..
make
--snap--
... if fails while linking with the following error:
--snip--
Linking CXX executable fzn_chuffed
/home/nath/apps/chuffed/lib/libchuffed_fzn.so: Nicht definierter Verweis auf subcircuit(vec<IntVar*>&, int)' /home/nath/apps/chuffed/lib/libchuffed.so: Nicht definierter Verweis auf
OpCache::insert(char, unsigned int, unsigned int, unsigned int)'
/home/nath/apps/chuffed/lib/libchuffed.so: Nicht definierter Verweis auf OpCache::~OpCache()' /home/nath/apps/chuffed/lib/libchuffed.so: Nicht definierter Verweis auf
OpCache::check(char, unsigned int, unsigned int)'
/home/nath/apps/chuffed/lib/libchuffed.so: Nicht definierter Verweis auf EVLayerGraph::~EVLayerGraph()' /home/nath/apps/chuffed/lib/libchuffed.so: Nicht definierter Verweis auf
wdfa_to_layergraph(EVLayerGraph&, int, int, WDFATrans*, int, vec&)'
/home/nath/apps/chuffed/lib/libchuffed.so: Nicht definierter Verweis auf evgraph_to_wmdd(vec<IntVar*>, IntVar*, EVLayerGraph&, int, MDDOpts const&)' /home/nath/apps/chuffed/lib/libchuffed_fzn.so: Nicht definierter Verweis auf
cumulative_cal(vec<IntVar*>&, vec<IntVar*>&, vec<IntVar*>&, IntVar*, vec<vec >&, vec&, int, int)'
/home/nath/apps/chuffed/lib/libchuffed.so: Nicht definierter Verweis auf OpCache::OpCache(unsigned int)' /home/nath/apps/chuffed/lib/libchuffed.so: Nicht definierter Verweis auf
EVLayerGraph::EVLayerGraph()'
collect2: error: ld returned 1 exit status
make[2]: *** [fzn_chuffed] Fehler 1
make[1]: *** [CMakeFiles/fzn_chuffed.dir/all] Fehler 2
make: *** [all] Fehler 2
--snap--
(Sorry, geman). "export LDFLAGS=-m32" beforehand doesn't help. What do I do wrong?
Cheers
Alexander
--snap--
Hi!
First, thanks for making the code available for this great solver.
I can compile your software on Linux with GNU g++ 4.8.1 but I have problems to compile it under Mac OS 10.10 with the clang compiler. Clang follows the C++ standard very strictly and generates the following error.
In file included from /Users/kris/research/chuffed-master/trunk/chuffed/vars/int-var.c:3:
In file included from /Users/kris/research/chuffed-master/trunk/./chuffed/mip/mip.h:6:
/Users/kris/research/chuffed-master/trunk/./chuffed/core/propagator.h:114:15: error: use of
undeclared identifier 'Clause_new'
Clause *c = Clause_new(ps);
^
1 error generated.
It seems to be connected tot he problem of namespace specified in C++ standard in chapter "7.3.1.2 Namespace member definitions". You define a friend class Clause_new within class Clause that is not visible outside the class according to the standard. I did not tried but the code might not be compiled in newer versions (>= 5) of gnu compiler either.
Do you plan to make necessary changes?
Best,
/Kris
Hi,
since I´m not able to compile chuffed on Windows (see #9), I´m trying to use the precompiled binary provided in this repository.
However, on the OOCSP instance oocsp_racks_030_e6_cc of this year´s MiniZinc Challenge, I get the following output:
./core/propagator.h:66: virtual Clause* Propagator::explain(Lit, int): Assertion failed.
0 [sig] fzn_chuffed 8740 open_stackdumpfile: Dumping stack trace to fzn_chuffed.exe.stackdump
The stackdump is attached to this issue (unfortunately it is not very meaningful).
Hope you can help.
Thanks,
Richard
Hi,
I´m trying to compile chuffed on Windows 7. I´m using MinGW and I´m following the instructions in README.
The console input and output are as follows:
$ mkdir par_build
$ cd par_build
$ cmake -DCMAKE_CXX_COMPILER=mpicxx ../parallel
-- Building for: Visual Studio 12 2013
-- The CXX compiler identification is MSVC 18.0.31101.0
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi
o 12.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi
o 12.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:159 (target_include_directories):
target_include_directories called with invalid arguments-- Configuring incomplete, errors occurred!
See also "D:/other_projects/chuffed/par_build/CMakeFiles/CMakeOutput.log".
The file CMakeOutput.log (renamed to CMakeOutput.txt) is attached to this issue.
Hope you can help me.
Thanks,
Richard
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.