[gecode-users] Problems with some REG and some suggestions
TeXitoi
texitoi+news at texitoi.eu
Mon Sep 26 20:32:09 CEST 2011
Hi,
First, Thanks for you're very good CP library: I enjoy using it.
I have see 1 "bug" and have identified some missing features.
First, I have poblems when I try to generate REG of the form
REG r = *a + a(1000,1000);
It takes a lot of RAM. Here is a main function that show the problem:
#include <gecode/int.hh>
#include <gecode/search.hh>
#include <gecode/minimodel.hh>
using namespace Gecode;
using namespace std;
int main(void)
{
REG any_l = REG(0) | REG(1);
cout << "Generating '.{1000}'..." << flush;
REG bigReg_l = any_l(1000,1000);
cout << " done." << endl;
cout << "Generating DFA(.{1000})..." << flush;
DFA dfa_l(bigReg_l);//OK
cout << " done." << endl;
cout << "Generating '.{1000}.{1000}'..." << flush;
REG veryBigReg_l = bigReg_l + bigReg_l;
cout << " done." << endl;
cout << "Generating DFA(.{1000}.{1000})..." << flush;
dfa_l = DFA(veryBigReg_l);//OK
cout << " done." << endl;
cout << "Generating '.{1000}.*'..." << flush;
veryBigReg_l = bigReg_l + *any_l;
cout << " done." << endl;
cout << "Generating DFA(.{1000}.*)..." << flush;
dfa_l = DFA(veryBigReg_l);//OK
cout << " done." << endl;
cout << "Generating '.*.{1000}'..." << flush;
veryBigReg_l = *any_l + bigReg_l;
cout << " done." << endl;
cout << "Generating DFA(.*.{1000})..." << flush;
dfa_l = DFA(veryBigReg_l);//takes lots of RAM...
cout << " done." << endl;
}
Then, it could be great to have different IntConLevel for the sequence
constraint. In my model, the filtering does not help and takes time, so
I post a count constraint for each interval. It can be useful to have
that with IntConLevel = ICL_VAL. And with IntConLevel = ICL_DOM, the
extensional version (which is exponential).
Finally, DFA operations can be very useful : union, intersection,
concatenation, star and opposite. I already coded intersection and
opposite for my needs (I can show them if you want, but the
implementation is quite naive).
Again, thanks a lot for Gecode!
--
Guillaume Pinot http://www.texitoi.eu
« Il semble que la perfection soit atteinte non quand il n'y a plus
rien à ajouter, mais quand il n'y a plus rien à retrancher. »
-- Antoine de Saint-Exupéry, Terre des hommes
() ASCII ribbon campaign -- Against HTML e-mail
/\ http://www.asciiribbon.org -- Against proprietary attachments
More information about the users
mailing list