Method: MiniSat::Solver#<<

Defined in:
ext/minisat/minisat.c

#<<(var_or_lit_or_ary) ⇒ Object

Almost same as Solver#add_caluse. This method receives Array of Variable or Literal.

solver << a          # equivalent to solver.add_clause(a)
solver << [a, b, -c] # equivalent to solver.add_clause(a, b, -c)


272
273
274
275
276
277
278
279
280
281
282
# File 'ext/minisat/minisat.c', line 272

static VALUE solver_add_clause_2(VALUE rslv, VALUE rcls)
{
    if(TYPE(rcls) == T_DATA
       && RDATA(rcls)->dfree == (RUBY_DATA_FUNC)value_free) {
      return solver_add_clause(1, &rcls, rslv);
    }
    else {
      rcls = rb_convert_type(rcls, T_ARRAY, "Array", "to_ary");
      return solver_add_clause(RARRAY_LEN(rcls), RARRAY_PTR(rcls), rslv);
    }
}