pub unsafe extern "C" fn clingo_propagate_init_add_weight_constraint(
init: *mut clingo_propagate_init_t,
literal: clingo_literal_t,
literals: *const clingo_weighted_literal_t,
size: usize,
bound: clingo_weight_t,
type_: clingo_weight_constraint_type_t,
compare_equal: bool,
result: *mut bool
) -> bool
Expand description
! Add the given weight constraint to the solver.
!
! This function adds a constraint of form literal <=> { lit=weight | (lit, weight) in literals } >= bound
to the solver.
! Depending on the type the <=>
connective can be either a left implication, right implication, or equivalence.
!
! @attention No further calls on the init object or functions on the assignment should be called when the result of this method is false.
!
! @param[in] init the target
! @param[in] literal the literal of the constraint
! @param[in] literals the weighted literals
! @param[in] size the number of weighted literals
! @param[in] bound the bound of the constraint
! @param[in] type the type of the weight constraint
! @param[in] compare_equal if true compare equal instead of less than equal
! @param[out] result result indicating whether the problem became unsatisfiable
! @return whether the call was successful; might set one of the following error codes:
! - ::clingo_error_bad_alloc