/* * Main authors: * Christian Schulte * * Copyright: * Christian Schulte, 2005 * * Last modified: * $Date: 2006-08-04 16:07:12 +0200 (Fri, 04 Aug 2006) $ by $Author: schulte $ * $Revision: 3518 $ * * This file is part of Gecode, the generic constraint * development environment: * http://www.gecode.org * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a * DISCLAIMER OF ALL WARRANTIES. * */ #include "test/int.hh" #include "test/log.hh" static IntSet ds_22(-2,2); class RegularA : public IntTest { public: RegularA(const char* t) : IntTest(t,4,ds_22,false,ICL_DOM) {} virtual bool solution(const Assignment& x) const { return (((x[0] == 0) || (x[0] == 2)) && ((x[1] == -1) || (x[1] == 1)) && ((x[2] == 0) || (x[2] == 1)) && ((x[3] == 0) || (x[3] == 1))); } virtual void post(Space* home, IntVarArray& x) { REG r = (REG(0) | REG(2)) + (REG(-1) | REG(1)) + (REG(7) | REG(0) | REG(1)) + (REG(0) | REG(1)); DFA d(r); regular(home, x, d); } }; class RegularB : public IntTest { public: RegularB(const char* t) : IntTest(t,4,ds_22,false,ICL_DOM) {} virtual bool solution(const Assignment& x) const { return (x[0]