Function clingo_sys::clingo_backend_weight_rule [] [src]

pub unsafe extern "C" fn clingo_backend_weight_rule(
    backend: *mut clingo_backend_t,
    choice: bool,
    head: *const clingo_atom_t,
    head_size: usize,
    lower_bound: clingo_weight_t,
    body: *const clingo_weighted_literal_t,
    body_size: usize
) -> bool

Add a weight rule to the program.

@attention All weights and the lower bound must be positive.

Parameters:

  • backend - the target backend
  • choice - determines if the head is a choice or a disjunction
  • head - the head atoms
  • head_size - the number of atoms in the head
  • lower_bound - the lower bound of the weight rule
  • body - the weighted body literals
  • body_size - the number of weighted literals in the body

Returns whether the call was successful; might set one of the following error codes:

  • ::clingo_error_bad_alloc