Clingo
Loading...
Searching...
No Matches
Symbolic Atom Inspection

Inspection of atoms occurring in ground logic programs. More...

Classes

struct  clingo_signature
 Represents a predicate signature. More...
 

Typedefs

typedef struct clingo_signature clingo_signature_t
 Represents a predicate signature.
 
typedef struct clingo_base clingo_base_t
 Object to inspect symbolic atoms in a program—the relevant Herbrand base gringo uses to instantiate programs and the terms that occur in the heads of #show statements.
 
typedef struct clingo_atom_base clingo_atom_base_t
 Object to inspect the symbolic atoms in a program.
 
typedef struct clingo_term_base clingo_term_base_t
 Object to inspect the shown terms in a program.
 
typedef int clingo_theory_term_type_t
 Corresponding type to clingo_theory_term_type_e.
 
typedef struct clingo_theory_base clingo_theory_base_t
 Object to inspect theory atoms.
 

Enumerations

enum  clingo_theory_term_type_e {
  clingo_theory_term_type_tuple = 0 , clingo_theory_term_type_list = 1 , clingo_theory_term_type_set = 2 , clingo_theory_term_type_function = 3 ,
  clingo_theory_term_type_number = 4 , clingo_theory_term_type_symbol = 5
}
 Enumeration of theory term types. More...
 

Functions

CLINGO_VISIBILITY_DEFAULT bool clingo_base_is_fact (clingo_base_t const *atoms, clingo_literal_t literal, bool *is_fact)
 Check whether the given literal is a fact.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_base_is_external (clingo_base_t const *atoms, clingo_literal_t literal, bool *is_external)
 Check whether an literal is external.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_base_is_shown (clingo_base_t const *atoms, clingo_literal_t literal, bool *is_shown)
 Check whether an literal is shown.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_base_is_projected (clingo_base_t const *atoms, clingo_literal_t literal, bool *is_projected)
 Check whether a literal is subject to projection.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_base_is_current (clingo_base_t const *atoms, clingo_literal_t literal, bool *is_current)
 Check whether a literal has been introduced in the current step.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_base_atoms_size (clingo_base_t const *base, size_t *size)
 Get the number of atom bases in the program.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_base_atoms_at (clingo_base_t const *base, size_t index, clingo_signature_t *signature, clingo_atom_base_t const **atoms)
 Get the signature and atom base at the given index.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_base_atoms_find (clingo_base_t const *base, clingo_signature_t const *signature, clingo_atom_base_t const **atoms, bool *found)
 Find the atom base wit the given signature.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_atom_base_size (clingo_atom_base_t const *atoms, size_t *size)
 Get the size of the given atom base.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_atom_base_find (clingo_atom_base_t const *atoms, clingo_symbol_t symbol, size_t *index)
 Find the index of the atom with the given symbol in the atom base.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_atom_base_symbol (clingo_atom_base_t const *atoms, size_t index, clingo_symbol_t *symbol)
 Get the symbolic representation of an atom.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_atom_base_literal (clingo_atom_base_t const *atoms, size_t index, clingo_literal_t *literal)
 Returns the (numeric) program literal corresponding to the given symbolic atom.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_base_terms (clingo_base_t const *base, clingo_term_base_t const **terms)
 Get the term base capturing show term directives.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_base_theory (clingo_base_t const *base, clingo_theory_base_t const **theory)
 Get the theory base capturing theory terms, elements, and atoms.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_term_base_size (clingo_term_base_t const *terms, size_t *size)
 During grounding, theory atoms get consecutive numbers starting with zero.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_term_base_symbol (clingo_term_base_t const *terms, size_t index, clingo_symbol_t *term)
 Get the symbol of the show directive with the given index.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_term_base_condition (clingo_term_base_t const *terms, size_t index, size_t const **sizes, clingo_literal_t const *const **literals, size_t *size)
 Get the conditions of a show directive.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_term_base_find (clingo_term_base_t const *terms, clingo_symbol_t symbol, size_t *index)
 Get the index of the given symbol.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_control_base (clingo_control_t const *control, clingo_base_t const **base)
 Get the base associated with the control object.
 

Theory Term Inspection

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_term_type (clingo_theory_base_t const *theory, clingo_id_t term, clingo_theory_term_type_t *type)
 Get the type of the given theory term.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_term_number (clingo_theory_base_t const *theory, clingo_id_t term, int *number)
 Get the number of the given numeric theory term.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_term_name (clingo_theory_base_t const *theory, clingo_id_t term, clingo_string_t *name)
 Get the name of the given constant or function theory term.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_term_arguments (clingo_theory_base_t const *theory, clingo_id_t term, clingo_id_t const **arguments, size_t *size)
 Get the arguments of the given function theory term.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_term_to_string (clingo_theory_base_t const *theory, clingo_id_t term, clingo_string_builder_t *builder)
 Get the string representation of the given theory term.
 

Theory Element Inspection

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_element_tuple (clingo_theory_base_t const *theory, clingo_id_t element, clingo_id_t const **tuple, size_t *size)
 Get the tuple (array of theory terms) of the given theory element.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_element_condition (clingo_theory_base_t const *theory, clingo_id_t element, clingo_literal_t const **condition, size_t *size)
 Get the condition (array of aspif literals) of the given theory element.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_element_condition_id (clingo_theory_base_t const *theory, clingo_id_t element, clingo_literal_t *condition)
 Get the id of the condition of the given theory element.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_element_to_string (clingo_theory_base_t const *theory, clingo_id_t element, clingo_string_builder_t *builder)
 Get the string representation of the given theory element.
 

Theory Atom Inspection

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_size (clingo_theory_base_t const *theory, size_t *size)
 Get the total number of theory theory.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_atom_term (clingo_theory_base_t const *theory, clingo_id_t atom, clingo_id_t *term)
 Get the theory term associated with the theory atom.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_atom_elements (clingo_theory_base_t const *theory, clingo_id_t atom, clingo_id_t const **elements, size_t *size)
 Get the theory elements associated with the theory atom.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_atom_has_guard (clingo_theory_base_t const *theory, clingo_id_t atom, bool *has_guard)
 Whether the theory atom has a guard.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_atom_guard (clingo_theory_base_t const *theory, clingo_id_t atom, clingo_string_t *connective, clingo_id_t *term)
 Get the guard consisting of a theory operator and a theory term of the given theory atom.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_atom_literal (clingo_theory_base_t const *theory, clingo_id_t atom, clingo_literal_t *literal)
 Get the aspif literal associated with the given theory atom.
 
CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_atom_to_string (clingo_theory_base_t const *theory, clingo_id_t atom, clingo_string_builder_t *builder)
 Get the string representation of the given theory atom.
 

Detailed Description

Inspection of atoms occurring in ground logic programs.

For an examples, see base-atoms.c and base-theory.c.

Typedef Documentation

◆ clingo_atom_base_t

typedef struct clingo_atom_base clingo_atom_base_t

Object to inspect the symbolic atoms in a program.

Atom bases capture atoms over the same signature.

◆ clingo_base_t

typedef struct clingo_base clingo_base_t

Object to inspect symbolic atoms in a program—the relevant Herbrand base gringo uses to instantiate programs and the terms that occur in the heads of #show statements.

See also
clingo_control_base()

◆ clingo_signature_t

Represents a predicate signature.

Signatures have a name and an arity, and can be positive or negative (to represent classical negation).

Enumeration Type Documentation

◆ clingo_theory_term_type_e

Enumeration of theory term types.

Enumerator
clingo_theory_term_type_tuple 

a tuple term, e.g., (1,2,3)

clingo_theory_term_type_list 

a list term, e.g., [1,2,3]

clingo_theory_term_type_set 

a set term, e.g., {1,2,3}

clingo_theory_term_type_function 

a function term, e.g., f(1,2,3)

clingo_theory_term_type_number 

a number term, e.g., 42

clingo_theory_term_type_symbol 

a symbol term, e.g., c

Function Documentation

◆ clingo_atom_base_find()

CLINGO_VISIBILITY_DEFAULT bool clingo_atom_base_find ( clingo_atom_base_t const *  atoms,
clingo_symbol_t  symbol,
size_t *  index 
)

Find the index of the atom with the given symbol in the atom base.

If the symbol is not found, return the size of the atom base.

Parameters
atomsthe atom base
symbolthe symbol to lookup
indexthe target index
Returns
wether the call was successful

◆ clingo_atom_base_literal()

CLINGO_VISIBILITY_DEFAULT bool clingo_atom_base_literal ( clingo_atom_base_t const *  atoms,
size_t  index,
clingo_literal_t literal 
)

Returns the (numeric) program literal corresponding to the given symbolic atom.

Such a literal can be mapped to a solver literal (see the Theory Propagation module) or be used in rules in aspif format (see the Abstract Syntax Trees module).

Parameters
[in]atomsthe atom base
[in]indexthe index of the atom
[out]literalthe resulting literal
Returns
wether the call was successful

◆ clingo_atom_base_size()

CLINGO_VISIBILITY_DEFAULT bool clingo_atom_base_size ( clingo_atom_base_t const *  atoms,
size_t *  size 
)

Get the size of the given atom base.

Parameters
[in]atomsthe atom base
[out]sizethe target size
Returns
wether the call was successful

◆ clingo_atom_base_symbol()

CLINGO_VISIBILITY_DEFAULT bool clingo_atom_base_symbol ( clingo_atom_base_t const *  atoms,
size_t  index,
clingo_symbol_t symbol 
)

Get the symbolic representation of an atom.

Parameters
[in]atomsthe atom base
[in]indexthe index of the atom
[out]symbolthe resulting symbol
Returns
wether the call was successful

◆ clingo_base_atoms_at()

CLINGO_VISIBILITY_DEFAULT bool clingo_base_atoms_at ( clingo_base_t const *  base,
size_t  index,
clingo_signature_t signature,
clingo_atom_base_t const **  atoms 
)

Get the signature and atom base at the given index.

The index must be smaller than the size reported by clingo_base_atoms_size(). Either of the two target pointers can be null if the value is not important.

Parameters
[in]basethe base
[in]indexthe index of the atom base
[out]signaturethe target signature
[out]atomsthe target atom base
Returns
wether the call was successful

◆ clingo_base_atoms_find()

CLINGO_VISIBILITY_DEFAULT bool clingo_base_atoms_find ( clingo_base_t const *  base,
clingo_signature_t const *  signature,
clingo_atom_base_t const **  atoms,
bool *  found 
)

Find the atom base wit the given signature.

Parameters
[in]basethe base
[in]signaturethe signature to lookup
[out]atomsthe target atom base
[out]foundwhether a base has been found
Returns
wether the call was successful

◆ clingo_base_atoms_size()

CLINGO_VISIBILITY_DEFAULT bool clingo_base_atoms_size ( clingo_base_t const *  base,
size_t *  size 
)

Get the number of atom bases in the program.

Each atom base is associated with a signature.

Parameters
[in]basethe target
[out]sizethe number of atoms
Returns
wether the call was successful

◆ clingo_base_is_current()

CLINGO_VISIBILITY_DEFAULT bool clingo_base_is_current ( clingo_base_t const *  atoms,
clingo_literal_t  literal,
bool *  is_current 
)

Check whether a literal has been introduced in the current step.

Note that all literals introduced before the last solve call are considered from a previous step.

Parameters
[in]atomsthe target
[in]literalthe index of the literal
[out]is_currentwhether the literal was introduced in the current step
Returns
wether the call was successful

◆ clingo_base_is_external()

CLINGO_VISIBILITY_DEFAULT bool clingo_base_is_external ( clingo_base_t const *  atoms,
clingo_literal_t  literal,
bool *  is_external 
)

Check whether an literal is external.

A literal is external if it has been defined using an external directive and has not been released or defined by a rule.

Parameters
[in]atomsthe target
[in]literalthe index of the literal
[out]is_externalwhether the literal is an external
Returns
wether the call was successful

◆ clingo_base_is_fact()

CLINGO_VISIBILITY_DEFAULT bool clingo_base_is_fact ( clingo_base_t const *  atoms,
clingo_literal_t  literal,
bool *  is_fact 
)

Check whether the given literal is a fact.

Note
This does not determine if a literal is a cautious consequence. The grounding or solving component's simplifications can only detect this in some cases.
Parameters
[in]atomsthe atom base
[in]literalthe index of the literal
[out]is_factwhether the literal is a fact
Returns
wether the call was successful

◆ clingo_base_is_projected()

CLINGO_VISIBILITY_DEFAULT bool clingo_base_is_projected ( clingo_base_t const *  atoms,
clingo_literal_t  literal,
bool *  is_projected 
)

Check whether a literal is subject to projection.

An literal is subject to projection if it occurred in a project directive.

Parameters
[in]atomsthe target
[in]literalthe index of the literal
[out]is_projectedwhether the literal is subject to projection
Returns
wether the call was successful

◆ clingo_base_is_shown()

CLINGO_VISIBILITY_DEFAULT bool clingo_base_is_shown ( clingo_base_t const *  atoms,
clingo_literal_t  literal,
bool *  is_shown 
)

Check whether an literal is shown.

A literal is shown if it has been shown by a show directive.

Parameters
[in]atomsthe target
[in]literalthe index of the tom
[out]is_shownwhether the tom is shown
Returns
wether the call was successful

◆ clingo_base_terms()

CLINGO_VISIBILITY_DEFAULT bool clingo_base_terms ( clingo_base_t const *  base,
clingo_term_base_t const **  terms 
)

Get the term base capturing show term directives.

Parameters
basethe base
termsthe term base
Returns
wether the call was successful

◆ clingo_base_theory()

CLINGO_VISIBILITY_DEFAULT bool clingo_base_theory ( clingo_base_t const *  base,
clingo_theory_base_t const **  theory 
)

Get the theory base capturing theory terms, elements, and atoms.

During grounding, theory atoms get consecutive numbers starting with zero. The total number of theory atoms can be obtained using clingo_theory_base_size().

Attention
All structural information about theory atoms, elements, and terms is reset after solving. If afterward fresh theory atoms are grounded, previously used ids are reused.

For an example, see base-theory.c.

Parameters
basethe base
theorythe theory base
Returns
wether the call was successful

◆ clingo_control_base()

CLINGO_VISIBILITY_DEFAULT bool clingo_control_base ( clingo_control_t const *  control,
clingo_base_t const **  base 
)

Get the base associated with the control object.

The base can be used to query the atoms and terms occurring in a program.

The function initializes the base struct.

Parameters
[in]controlthe target
[in]basethe base to obtain
Returns
wether the call was successful

◆ clingo_term_base_condition()

CLINGO_VISIBILITY_DEFAULT bool clingo_term_base_condition ( clingo_term_base_t const *  terms,
size_t  index,
size_t const **  sizes,
clingo_literal_t const *const **  literals,
size_t *  size 
)

Get the conditions of a show directive.

Returns the conditions under which a term is shown in form of a disjunction of conjunctions.

Parameters
[in]termsthe term base
[in]indexthe index of the show diriective
[out]sizesthe sizes of the conjunctions
[out]literalsthe target literals
[out]sizethe size of the disjunction
Returns
wether the call was successful

◆ clingo_term_base_find()

CLINGO_VISIBILITY_DEFAULT bool clingo_term_base_find ( clingo_term_base_t const *  terms,
clingo_symbol_t  symbol,
size_t *  index 
)

Get the index of the given symbol.

If the symbol is not found, the index is set to the size of the base.

Parameters
[in]termsthe term base
[in]symbolthe symbol to lookup
[out]indexthe target index
Returns
wether the call was successful

◆ clingo_term_base_size()

CLINGO_VISIBILITY_DEFAULT bool clingo_term_base_size ( clingo_term_base_t const *  terms,
size_t *  size 
)

During grounding, theory atoms get consecutive numbers starting with zero.

The total number of theory atoms can be obtained using clingo_theory_base_size().

Attention
All structural information about theory atoms, elements, and terms is reset after solving. If afterward fresh theory atoms are grounded, previously used ids are reused.

For an example, see base-theory.c.

Get the number of shown terms in a program.

Parameters
[in]termsthe term base
[out]sizethe number of terms in the base
Returns
wether the call was successful

◆ clingo_term_base_symbol()

CLINGO_VISIBILITY_DEFAULT bool clingo_term_base_symbol ( clingo_term_base_t const *  terms,
size_t  index,
clingo_symbol_t term 
)

Get the symbol of the show directive with the given index.

Parameters
[in]termsthe term base
[in]indexthe index of the show directive
[out]termthe resulting term
Returns
wether the call was successful

◆ clingo_theory_base_atom_elements()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_atom_elements ( clingo_theory_base_t const *  theory,
clingo_id_t  atom,
clingo_id_t const **  elements,
size_t *  size 
)

Get the theory elements associated with the theory atom.

Parameters
[in]theorycontainer where the atom is stored
[in]atomid of the atom
[out]elementsthe resulting array of elements
[out]sizethe number of elements
Returns
wether the call was successful

◆ clingo_theory_base_atom_guard()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_atom_guard ( clingo_theory_base_t const *  theory,
clingo_id_t  atom,
clingo_string_t connective,
clingo_id_t term 
)

Get the guard consisting of a theory operator and a theory term of the given theory atom.

Parameters
[in]theorycontainer where the atom is stored
[in]atomid of the atom
[out]connectivethe resulting theory operator
[out]termthe resulting term
Returns
wether the call was successful

◆ clingo_theory_base_atom_has_guard()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_atom_has_guard ( clingo_theory_base_t const *  theory,
clingo_id_t  atom,
bool *  has_guard 
)

Whether the theory atom has a guard.

Parameters
[in]theorycontainer where the atom is stored
[in]atomid of the atom
[out]has_guardwhether the theory atom has a guard
Returns
wether the call was successful

◆ clingo_theory_base_atom_literal()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_atom_literal ( clingo_theory_base_t const *  theory,
clingo_id_t  atom,
clingo_literal_t literal 
)

Get the aspif literal associated with the given theory atom.

Parameters
[in]theorycontainer where the atom is stored
[in]atomid of the atom
[out]literalthe resulting literal
Returns
wether the call was successful

◆ clingo_theory_base_atom_term()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_atom_term ( clingo_theory_base_t const *  theory,
clingo_id_t  atom,
clingo_id_t term 
)

Get the theory term associated with the theory atom.

Parameters
[in]theorycontainer where the atom is stored
[in]atomid of the atom
[out]termthe resulting term id
Returns
wether the call was successful

◆ clingo_theory_base_atom_to_string()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_atom_to_string ( clingo_theory_base_t const *  theory,
clingo_id_t  atom,
clingo_string_builder_t builder 
)

Get the string representation of the given theory atom.

Parameters
[in]theorycontainer where the atom is stored
[in]atomid of the element
[in]builderthe builder
Returns
wether the call was successful

◆ clingo_theory_base_element_condition()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_element_condition ( clingo_theory_base_t const *  theory,
clingo_id_t  element,
clingo_literal_t const **  condition,
size_t *  size 
)

Get the condition (array of aspif literals) of the given theory element.

Parameters
[in]theorycontainer where the element is stored
[in]elementid of the element
[out]conditionthe resulting array of aspif literals
[out]sizethe number of term literals
Returns
wether the call was successful

◆ clingo_theory_base_element_condition_id()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_element_condition_id ( clingo_theory_base_t const *  theory,
clingo_id_t  element,
clingo_literal_t condition 
)

Get the id of the condition of the given theory element.

Note
This id can be mapped to a solver literal using clingo_propagate_init_solver_literal(). This id is not (necessarily) an aspif literal; to get aspif literals use clingo_theory_base_element_condition().
Parameters
[in]theorycontainer where the element is stored
[in]elementid of the element
[out]conditionthe resulting condition id
Returns
wether the call was successful

◆ clingo_theory_base_element_to_string()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_element_to_string ( clingo_theory_base_t const *  theory,
clingo_id_t  element,
clingo_string_builder_t builder 
)

Get the string representation of the given theory element.

Parameters
[in]theorycontainer where the element is stored
[in]elementid of the element
[in]builderthe builder
Returns
wether the call was successful

◆ clingo_theory_base_element_tuple()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_element_tuple ( clingo_theory_base_t const *  theory,
clingo_id_t  element,
clingo_id_t const **  tuple,
size_t *  size 
)

Get the tuple (array of theory terms) of the given theory element.

Parameters
[in]theorycontainer where the element is stored
[in]elementid of the element
[out]tuplethe resulting array of term ids
[out]sizethe number of term ids
Returns
wether the call was successful

◆ clingo_theory_base_size()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_size ( clingo_theory_base_t const *  theory,
size_t *  size 
)

Get the total number of theory theory.

Parameters
[in]theorythe target
[out]sizethe resulting number
Returns
wether the call was successful

◆ clingo_theory_base_term_arguments()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_term_arguments ( clingo_theory_base_t const *  theory,
clingo_id_t  term,
clingo_id_t const **  arguments,
size_t *  size 
)

Get the arguments of the given function theory term.

Precondition
The term must be of type clingo_theory_term_type_function.
Parameters
[in]theorycontainer where the term is stored
[in]termid of the term
[out]argumentsthe resulting arguments in form of an array of term ids
[out]sizethe number of arguments
Returns
wether the call was successful

◆ clingo_theory_base_term_name()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_term_name ( clingo_theory_base_t const *  theory,
clingo_id_t  term,
clingo_string_t name 
)

Get the name of the given constant or function theory term.

Precondition
The term must be of type clingo_theory_term_type_function or clingo_theory_term_type_symbol.
Parameters
[in]theorycontainer where the term is stored
[in]termid of the term
[out]namethe resulting name
Returns
wether the call was successful

◆ clingo_theory_base_term_number()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_term_number ( clingo_theory_base_t const *  theory,
clingo_id_t  term,
int *  number 
)

Get the number of the given numeric theory term.

Precondition
The term must be of type clingo_theory_term_type_number.
Parameters
[in]theorycontainer where the term is stored
[in]termid of the term
[out]numberthe resulting number
Returns
wether the call was successful

◆ clingo_theory_base_term_to_string()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_term_to_string ( clingo_theory_base_t const *  theory,
clingo_id_t  term,
clingo_string_builder_t builder 
)

Get the string representation of the given theory term.

Parameters
[in]theorycontainer where the term is stored
[in]termid of the term
[in]builderthe string builder
Returns
wether the call was successful
See also
clingo_theory_base_term_to_string_size()

◆ clingo_theory_base_term_type()

CLINGO_VISIBILITY_DEFAULT bool clingo_theory_base_term_type ( clingo_theory_base_t const *  theory,
clingo_id_t  term,
clingo_theory_term_type_t type 
)

Get the type of the given theory term.

Parameters
[in]theorycontainer where the term is stored
[in]termid of the term
[out]typethe resulting type
Returns
wether the call was successful