Function clingo_sys::clingo_control_add [] [src]

pub unsafe extern "C" fn clingo_control_add(
    control: *mut clingo_control_t,
    name: *const c_char,
    parameters: *const *const c_char,
    parameters_size: usize,
    program: *const c_char
) -> bool

Extend the logic program with the given non-ground logic program in string form.

This function puts the given program into a block of form: #program name(parameters).

After extending the logic program, the corresponding program parts are typically grounded with ::clingo_control_ground.

Parameters:

  • control the target
  • name name of the program block
  • parameters string array of parameters of the program block
  • parameters_size number of parameters
  • program string representation of the program

Returns whether the call was successful; might set one of the following error codes: - ::clingo_error_bad_alloc - ::clingo_error_runtime if parsing fails