Exemplo n.º 1
0
int rp_rule_problem_constraint_block(rp_parser p, rp_problem problem)
{
  rp_constraint aux;
  int i;
  if (rp_rule_constraint(p,&aux))
  {
    rp_vector_insert(rp_problem_ctrs(problem),aux);

    /* creation of relation var -> number of constraints containing var */
    for (i=0; i<rp_constraint_arity(aux); ++i)
    {
      ++rp_variable_constrained(rp_problem_var(problem,rp_constraint_var(aux,i)));
    }

    /* tail of the block */
    return( rp_rule_problem_constraint_next(p,problem) );
  }
  else
  {
    return( 0 );
  }
}
Exemplo n.º 2
0
// ----------------------------------------------------
// Operator implementing the interval satisfaction test
// ----------------------------------------------------
rp_operator_test::rp_operator_test(rp_constraint c):
  rp_operator(RP_OPERATOR_TEST_PRIORITY,rp_constraint_arity(c),0),
  _c(c)
{}