public DomainRestoreInfo reduceDomains(Variable var,Object value,CSP csp){
  DomainRestoreInfo result=new DomainRestoreInfo();
  Domain domain=csp.getDomain(var);
  if (domain.contains(value)) {
    if (domain.size() > 1) {
      Queue<Variable> queue=QueueFactory.<Variable>createLifoQueue();
      queue.add(var);
      result.storeDomainFor(var,domain);
      csp.setDomain(var,new Domain(new Object[]{value}));
      reduceDomains(queue,csp,result);
    }
  }
 else {
    result.setEmptyDomainFound(true);
  }
  return result.compactify();
}

public DomainRestoreInfo reduceDomains ( Variable var , Object value , CSP csp ) { DomainRestoreInfo result = new DomainRestoreInfo ( ) ; Domain domain = csp . getDomain ( var ) ; if ( domain . contains ( value ) ) { if ( domain . size ( ) > 1 ) { Queue < Variable > queue = QueueFactory . < Variable > createLifoQueue ( ) ; queue . add ( var ) ; result . storeDomainFor ( var , domain ) ; csp . setDomain ( var , new Domain ( new Object [ ] { value } ) ) ; reduceDomains ( queue , csp , result ) ; } } else { result . setEmptyDomainFound ( true ) ; } return result . compactify ( ) ; }
reduces the domain of the specified variable to the specified value and reestablishes arc - consistency . it is assumed that the provided csp is arc - consistent before the call .
