Clingo
Loading...
Searching...
No Matches
CppClingo::Control::BackendHandle Class Referenceabstract

Object to provide access to the backend. More...

#include <solver.hh>

Public Member Functions

auto program () -> Clasp::Asp::LogicProgram &
 Get the logic program.
 
auto theory () -> Output::TheoryData &
 Get the theory.
 
auto store () -> SymbolStore &
 The symbol store.
 
auto add_atom (Symbol atom) -> prg_lit_t
 Add a literal for the given symbol.
 
void close ()
 Close the handle.
 
virtual ~BackendHandle ()=default
 Destroy the handle.
 

Detailed Description

Object to provide access to the backend.

This backend is intended to be used in the C API to extend the ground program representation.

Logically, adding a block of rules via the backend can be seen like a call to ground. In fact, ground is called with an empty part list when the handle is destroyed to run the required finalization logic (grounding currently does not involve dedicated initialization).

Note that symbols added via the backend are not added to the domains of the grounder. This has to be done using add_atom().

Member Function Documentation

◆ add_atom()

auto CppClingo::Control::BackendHandle::add_atom ( Symbol  atom) -> prg_lit_t
inline

Add a literal for the given symbol.

Returns literals of existing symbolic atoms are introduces a new one.

Parameters
atomthe symbol
Returns
the literal of the symbolic atom

◆ close()

void CppClingo::Control::BackendHandle::close ( )
inline

Close the handle.

This functions must be called before continuing to use the associated solver.

◆ program()

auto CppClingo::Control::BackendHandle::program ( ) -> Clasp::Asp::LogicProgram &
inline

Get the logic program.

Returns
the program

◆ store()

auto CppClingo::Control::BackendHandle::store ( ) -> SymbolStore &
inline

The symbol store.

Returns
the symbol store

◆ theory()

auto CppClingo::Control::BackendHandle::theory ( ) -> Output::TheoryData &
inline

Get the theory.

Returns
the theory

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