ehebrard / mistral-2.0 Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU Affero General Public License v3.0
License: GNU Affero General Public License v3.0
I'm trying to use the FlatZinc solver according to the instructions in fz/README
. I've compiled mistral-fzn
using make
, and the binary seems to work. Both -h
and --version
give the correct output, both using mistral-fzn
and mistral-fz
.
However, when I run mistral on an actual FlatZinc file, I'm not getting any results.
I'm using a simple model:
include "all_different.mzn";
array[1..4] of var 1..4: x;
constraint all_different(x);
solve maximize sum(x);
which flattens down to:
array [1..2] of int: X_INTRODUCED_5_ = [1,-1];
var 1..4: X_INTRODUCED_0_;
var 1..4: X_INTRODUCED_1_;
var 1..4: X_INTRODUCED_2_;
var 1..4: X_INTRODUCED_3_;
var 4..16: X_INTRODUCED_4_:: is_defined_var;
array [1..4] of var int: x:: output_array([1..4]) = [X_INTRODUCED_0_,X_INTRODUCED_1_,X_INTRODUCED_2_,X_INTRODUCED_3_];
constraint int_lin_ne(X_INTRODUCED_5_,[X_INTRODUCED_0_,X_INTRODUCED_1_],0);
constraint int_lin_ne(X_INTRODUCED_5_,[X_INTRODUCED_0_,X_INTRODUCED_2_],0);
constraint int_lin_ne(X_INTRODUCED_5_,[X_INTRODUCED_0_,X_INTRODUCED_3_],0);
constraint int_lin_ne(X_INTRODUCED_5_,[X_INTRODUCED_1_,X_INTRODUCED_2_],0);
constraint int_lin_ne(X_INTRODUCED_5_,[X_INTRODUCED_1_,X_INTRODUCED_3_],0);
constraint int_lin_ne(X_INTRODUCED_5_,[X_INTRODUCED_2_,X_INTRODUCED_3_],0);
constraint int_lin_eq([1,1,1,1,-1],[X_INTRODUCED_0_,X_INTRODUCED_1_,X_INTRODUCED_2_,X_INTRODUCED_3_,X_INTRODUCED_4_],0):: ctx_pos:: defines_var(X_INTRODUCED_4_);
solve maximize X_INTRODUCED_4_;
Running ./mistral-fz test.fzn
does not give any output.
Directly running ./mistral-fzn test.fzn
does give output, but does not seem to output any results:
d PARSETIME 0
c Maximize r10
c +===========================================+
c | 17 182 0 | 10 |
c +===========================================+
Did I do anything wrong? Am I missing some step in mistral's compilation?
Hi there, I have a fzn-File which uses all my memory while reading it in with Mistral (trunk, Linux 64-bit). See http://www.datafilehost.com/d/fe1e1c15 (tgz, sorry, found no better place to upload file). I think there's something going wrong because with another files about the same size but with "solve minimize ;" everything works.
Hey, and: Keep up the good work!
Cloned the repository on a 16.10 Ubuntu machine.
issuing the command
~$ make
from within Minstral-2.0 directory yields a long list of errors, which you can find attached in out.txt.
It looks like the repository is pointing at two other external repositories which are no longer existing.
g++ -Wall -std=c++11 -I./src/include -I./tools/tclap/include -O3 -D_UNIX -D_BIT32 -c src/lib/mistral_variable.cpp -o src/obj/mistral_variable.o
In file included from src/lib/mistral_solver.cpp:21:
In file included from /usr/include/c++/v1/sstream:173:
In file included from /usr/include/c++/v1/ostream:138:
In file included from /usr/include/c++/v1/ios:215:
In file included from /usr/include/c++/v1/__locale:14:
In file included from /usr/include/c++/v1/string:504:
In file included from /usr/include/c++/v1/string_view:175:
In file included from /usr/include/c++/v1/__string:57:
/usr/include/c++/v1/algorithm:2027:18: error: no viable overloaded '='
*__first = __value_;
~~~~~~~~ ^ ~~~~~~~~
/usr/include/c++/v1/algorithm:2036:18: note: in instantiation of function template specialization 'std::__1::__fill_n<Mistral::Vector<Mistral::Variable> *, long, nullptr_t>' requested here
return _VSTD::__fill_n(__first, __convert_to_integral(__n), __value_);
^
/usr/include/c++/v1/algorithm:2055:12: note: in instantiation of function template specialization 'std::__1::fill_n<Mistral::Vector<Mistral::Variable> *, long, nullptr_t>' requested here
_VSTD::fill_n(__first, __last - __first, __value_);
^
/usr/include/c++/v1/algorithm:2063:12: note: in instantiation of function template specialization 'std::__1::__fill<Mistral::Vector<Mistral::Variable> *, nullptr_t>' requested here
_VSTD::__fill(__first, __last, __value_, typename iterator_traits<_ForwardIterator>::iterator_category());
^
./src/include/mistral_search.hpp:2603:7: note: in instantiation of function template specialization 'std::__1::fill<Mistral::Vector<Mistral::Variable> *, nullptr_t>' requested here
std::fill(neighborhood, neighborhood+n, NULL);
^
./src/include/mistral_search.hpp:2575:5: note: in instantiation of member function 'Mistral::GenericNeighborDVO<SelfPlusAverage, Mistral::MinDomainOverWeight, 1,
Mistral::ConflictCountManager>::initialise' requested here
GenericNeighborDVO() : GenericDVO< Aggregator< VarComparator >, RAND, WeightManager >() { neighborhood=NULL; }
^
./src/include/mistral_search.hpp:1521:5: note: in instantiation of member function 'Mistral::GenericNeighborDVO<SelfPlusAverage, Mistral::MinDomainOverWeight, 1,
Mistral::ConflictCountManager>::GenericNeighborDVO' requested here
GenericHeuristic(Solver *s)
^
src/lib/mistral_solver.cpp:7798:20: note: in instantiation of member function 'Mistral::GenericHeuristic<Mistral::GenericNeighborDVO<SelfPlusAverage, Mistral::MinDomainOverWeight, 1,
Mistral::ConflictCountManager>, Mistral::AnyValue>::GenericHeuristic' requested here
heu = new GenericHeuristic< GenericNeighborDVO < SelfPlusAverage, MinDomainOverWeight, 1, ConflictCountManager >, AnyValue > (this);
^
./src/include/mistral_structure.hpp:685:33: note: candidate function not viable: no known conversion from 'const nullptr_t' to 'const Vector<Mistral::Variable>' for 1st argument
inline Vector< DATA_TYPE >& operator=(const Vector< DATA_TYPE >& x)
^
In file included from src/lib/mistral_solver.cpp:27:
In file included from ./src/include/mistral_sat.hpp:34:
In file included from ./src/include/mistral_search.hpp:33:
In file included from ./src/include/mistral_solver.hpp:32:
./src/include/mistral_constraint.hpp:748:19: warning: array index 2 is past the end of the array (which contains 2 elements) [-Warray-bounds]
os << ", " << scope[2];
^ ~
./src/include/mistral_constraint.hpp:760:5: note: in instantiation of member function 'Mistral::FixedArityConstraint<2>::display' requested here
BinaryConstraint() : FixedArityConstraint<2>() {}
^
./src/include/mistral_constraint.hpp:460:5: note: array 'scope' declared here
Variable scope[ARITY];
^
OS: FreeBSD 12.2
Hi,
I'd like to simplify a FZN-Model with Mistral. --print_mod prints out constraints and varnames of a simplified model in an internal notation. Translation of these constraints to Flatzinc would not be the problem to me, but varnames like b2513 and r2162 get me a headache. I'm not a C++-Coder, so I searched for a hint how to get the original varnames into this output, but in vain.
Could you give me a hint how to do that (Filename, Method)? That would be great!
Thank you
Alex
I have a FZN, it's uploaded at http://paste.ubuntu.com/10632792/. It gives me unsat when using the option -w with todays Mistral (and a version from august last year too). Without -w, I get a valid solution. Any ideas?
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.