Clingo C API
C API for clingo providing high level functions to control grounding and solving.
Public Attributes | List of all members
clingo_script Struct Reference

Detailed Description

Custom scripting language to run functions during grounding.

Public Attributes

bool(* execute )(clingo_location_t const *location, char const *code, void *data)
 Evaluate the given source code. More...
 
bool(* call )(clingo_location_t const *location, char const *name, clingo_symbol_t const *arguments, size_t arguments_size, clingo_symbol_callback_t symbol_callback, void *symbol_callback_data, void *data)
 Call the function with the given name and arguments. More...
 
bool(* callable )(char const *name, bool *result, void *data)
 Check if the given function is callable. More...
 
bool(* main )(clingo_control_t *control, void *data)
 Run the main function. More...
 
void(* free )(void *data)
 This function is called once when the script is deleted. More...
 
char const * version
 

Member Data Documentation

◆ call

bool(* clingo_script::call) (clingo_location_t const *location, char const *name, clingo_symbol_t const *arguments, size_t arguments_size, clingo_symbol_callback_t symbol_callback, void *symbol_callback_data, void *data)

Call the function with the given name and arguments.

Parameters
[in]locationthe location in the logic program of the function call
[in]namethe name of the function
[in]argumentsthe arguments to the function
[in]arguments_sizethe number of arguments
[in]symbol_callbackcallback to return a pool of symbols
[in]symbol_callback_datauser data for the symbol callback
[in]datauser data as given when registering the script
Returns
whether the function call was successful

◆ callable

bool(* clingo_script::callable) (char const *name, bool *result, void *data)

Check if the given function is callable.

Parameters
[in]namethe name of the function
[out]resultwhether the function is callable
[in]datauser data as given when registering the script
Returns
whether the function call was successful

◆ execute

bool(* clingo_script::execute) (clingo_location_t const *location, char const *code, void *data)

Evaluate the given source code.

Parameters
[in]locationthe location in the logic program of the source code
[in]codethe code to evaluate
[in]datauser data as given when registering the script
Returns
whether the function call was successful

◆ free

void(* clingo_script::free) (void *data)

This function is called once when the script is deleted.

Parameters
[in]datauser data as given when registering the script

◆ main

bool(* clingo_script::main) (clingo_control_t *control, void *data)

Run the main function.

Parameters
[in]controlthe control object to pass to the main function
[in]datauser data as given when registering the script
Returns
whether the function call was successful

The documentation for this struct was generated from the following file: