Clingo
Loading...
Searching...
No Matches
Core Functionality

Core types and functions used throughout all modules and version information. More...

Classes

class  Clingo::Library
 The main library class for managing global information and logging. More...
 
class  Clingo::StringBuilder
 A string builder for constructing strings. More...
 
class  Clingo::Position
 Class representing a position in a file. More...
 
class  Clingo::Location
 Class representing a range in a file. More...
 

Typedefs

using Clingo::ProgramId = clingo_id_t
 A program id used for various kinds of indices.
 
using Clingo::ProgramIdSpan = std::span< ProgramId const >
 A span of program ids.
 
using Clingo::ProgramAtom = clingo_atom_t
 A program atom.
 
using Clingo::ProgramAtomSpan = std::span< ProgramAtom const >
 A span of program atoms.
 
using Clingo::ProgramLiteral = clingo_literal_t
 A program literal.
 
using Clingo::ProgramLiteralSpan = std::span< ProgramLiteral const >
 A span of program literals.
 
using Clingo::ProgramLiteralVector = std::vector< ProgramLiteral >
 A vector of program literals.
 
using Clingo::SolverLiteral = clingo_literal_t
 A solver literal.
 
using Clingo::SolverLiteralSpan = std::span< SolverLiteral const >
 A span of solver literals.
 
using Clingo::SolverLiteralList = std::initializer_list< SolverLiteral const >
 A list of solver literals.
 
using Clingo::SolverLiteralVector = std::vector< SolverLiteral >
 A vector of solver literals.
 
using Clingo::Weight = clingo_weight_t
 A weight used in sum aggregates and minimize constraints.
 
using Clingo::WeightSpan = std::span< clingo_weight_t const >
 A span of weights.
 
using Clingo::WeightedLiteral = clingo_weighted_literal_t
 A weighted literal, which is a literal with an associated weight.
 
using Clingo::WeightedLiteralSpan = std::span< WeightedLiteral const >
 A span of weighted literals.
 
using Clingo::Sum = int64_t
 A sum representing the sum of weights.
 
using Clingo::SumSpan = std::span< Sum const >
 A span of sums.
 
using Clingo::StringSpan = std::span< std::string_view const >
 A span of string views.
 
using Clingo::StringList = std::initializer_list< std::string_view const >
 A list of string views.
 
using Clingo::Logger = std::function< void(MessageCode, std::string_view)>
 A callback function type for logging messages.
 

Enumerations

enum class  Clingo::MessageCode : clingo_message_t {
  MessageCode::trace = clingo_message_trace , MessageCode::debug = clingo_message_debug , MessageCode::info = clingo_message_info , MessageCode::operation_undefined = clingo_message_operation_undefined ,
  MessageCode::atom_undefined = clingo_message_atom_undefined , MessageCode::file_included = clingo_message_file_included , MessageCode::global_variable = clingo_message_global_variable , MessageCode::warn = clingo_message_warn ,
  MessageCode::error = clingo_message_error
}
 Enumeration of message codes. More...
 
enum class  Clingo::LogLevel {
  LogLevel::trace = clingo_log_level_trace , LogLevel::debug = clingo_log_level_debug , LogLevel::info = clingo_log_level_info , LogLevel::wart = clingo_log_level_warn ,
  LogLevel::error = clingo_log_level_error
}
 Enumeration of log levels. More...
 
enum class  Clingo::LibraryFlags : clingo_lib_flags_t { LibraryFlags::none = 0 , LibraryFlags::slotted = clingo_lib_flags_slotted , LibraryFlags::shared = clingo_lib_flags_shared , LibraryFlags::fast_release = clingo_lib_flags_fast_release }
 Flags to create library objects. More...
 
enum class  Clingo::ExternalType : clingo_external_type_t { ExternalType::free = clingo_external_type_free , ExternalType::true_ = clingo_external_type_true , ExternalType::false_ = clingo_external_type_false , ExternalType::release = clingo_external_type_release }
 Enumeration of control modes. More...
 
enum class  Clingo::HeuristicType : clingo_heuristic_type_t {
  HeuristicType::level = clingo_heuristic_type_level , HeuristicType::sign = clingo_heuristic_type_sign , HeuristicType::factor = clingo_heuristic_type_factor , HeuristicType::init = clingo_heuristic_type_init ,
  HeuristicType::true_ = clingo_heuristic_type_true , HeuristicType::false_ = clingo_heuristic_type_false
}
 Enumeration of heuristic types. More...
 

Functions

 Clingo::CLINGO_ENABLE_BITSET_ENUM (LibraryFlags)
 Enable bitset operations on LibraryFlags.
 
auto Clingo::version () -> std::tuple< int, int, int >
 Get the version of the Clingo library as a tuple.
 

Variables

constexpr size_t Clingo::default_message_limit = 25
 The default message limit for the logger.
 

Detailed Description

Core types and functions used throughout all modules and version information.

Typedef Documentation

◆ Logger

using Clingo::Logger = typedef std::function<void(MessageCode, std::string_view)>

A callback function type for logging messages.

The callback takes a message code and a string view as arguments.

Enumeration Type Documentation

◆ ExternalType

Enumeration of control modes.

Enumerator
free 

Allow an external to be assigned freely.

true_ 

Assign an external to true.

false_ 

Assign an external to false.

release 

No longer treat an atom as external.

◆ HeuristicType

Enumeration of heuristic types.

Enumerator
level 

Set the level of an atom.

sign 

Configure which sign to chose for an atom.

factor 

Modify VSIDS factor of an atom.

init 

Modify the initial VSIDS score of an atom.

true_ 

Set the level of an atom and choose a positive sign.

false_ 

Set the level of an atom and choose a negative sign.

◆ LibraryFlags

Flags to create library objects.

Enumerator
none 

no flags set

slotted 

use custom allocator for storing symbols

shared 

create symbols in a thread-safe manner

fast_release 

whether to enable fast release of libraries

◆ LogLevel

Enumeration of log levels.

Enumerator
trace 

the trace level (most verbose)

debug 

the debug level

info 

the info level

wart 

the warning level

error 

the error level (least verbose)

◆ MessageCode

Enumeration of message codes.

Enumerator
trace 

a trace message

debug 

a debug message

info 

an info message

operation_undefined 

undefined operation in program

atom_undefined 

undefined atom in program

file_included 

same file included multiple times

global_variable 

global variable in tuple of aggregate element

warn 

a warning message

error 

to report multiple errors; a corresponding runtime error is raised later

Function Documentation

◆ version()

auto Clingo::version ( ) -> std::tuple<int, int, int>
inline

Get the version of the Clingo library as a tuple.

Returns
a tuple containing the major, minor, and revision version numbers