|
Clingo
|
Helper to pass arguments to rewrite functions. More...
#include <rewrite_context.hh>
Classes | |
| struct | pop_ |
| Helper to pop auxiliary variable assignments. More... | |
Public Types | |
| using | Guard = std::unique_ptr< RewriteContext, pop_ > |
| Helper to pop auxiliary variable assignments. | |
Public Member Functions | |
| RewriteContext (Logger &log, SymbolStore &store, RewriteOptions const &opts, TheoryAtomParser const &parser, ParamMap const ¶m_map, ConstMap const &const_map) | |
| Construct a rewrite context. | |
| RewriteContext (RewriteContext &&) noexcept=delete | |
| Delete move/copy constructor. | |
| void | init (StringSet names, char const *prefix) |
| Initialize/reset the name generator. | |
| auto | logger () const -> Logger & |
| Get the logger. | |
| auto | options () const -> RewriteOptions const & |
| Get the logger. | |
| auto | parser () const -> TheoryAtomParser const & |
| Get the parser. | |
| auto | store () const -> SymbolStore & |
| Get the symbol store. | |
| auto | gen () -> NameGen & |
| Get the name generator. | |
| auto | is_param (String name) const -> std::optional< size_t > |
| Check if the given identifier is a parameter defined by a program directive. | |
| auto | is_const (String name) const -> std::optional< Symbol > |
| Check if the given identifier is a parameter defined by a constant. | |
| auto | has_params () const -> bool |
| Check if there is at least one parameter (from a program or const statement). | |
| auto | aux () -> AuxTermVec & |
| Get the variable term map. | |
| void | pop () |
| Pop the last variable term map pushed. | |
| auto | push () -> Guard |
| Push a fresh variable term map. | |
| void | set_error () |
| Mark that there was an error during rewriting. | |
| auto | has_error () const -> bool |
| Check if there has been an error during rewriting. | |
Helper to pass arguments to rewrite functions.
|
inline |
Check if the given identifier is a parameter defined by a constant.
If it is a parameter, return its value.
|
inline |
Check if the given identifier is a parameter defined by a program directive.
If it is a parameter, return its index.
|
inline |
Mark that there was an error during rewriting.
The idea is that processing can continue despite this error to produce more than one error indicator to the user.