Check whether \a x is solution
| 223 | : Test("Bool::Nary::"+str(op0)+"::"+str(n),n+1,0,1), op(op0) {} |
| 224 | /// Check whether \a x is solution |
| 225 | virtual bool solution(const Assignment& x) const { |
| 226 | int n = x.size()-1; |
| 227 | int b = check(x[n-2],op,x[n-1]); |
| 228 | for (int i=0; i<n-2; i++) |
| 229 | b = check(x[i],op,b); |
| 230 | return b == x[n]; |
| 231 | } |
| 232 | /// Post constraint |
| 233 | virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) { |
| 234 | using namespace Gecode; |