Clingo
Loading...
Searching...
No Matches
Clingo::AST::RewriteContext Class Reference

A context object for rewriting. More...

#include <ast.hh>

Public Member Functions

 RewriteContext (Library const &lib)
 Construct the context.
 
void project_mode (ProjectionMode value)
 Set the projection mode.
 
auto project_mode () -> ProjectionMode
 Get the projection mode.
 
void project_anonymous (bool value)
 Enable projection of anonymous variables in negated literals.
 
auto project_anonymous () -> bool
 Check whether projection in negative literals is enabled.
 
void add_param (std::string_view name)
 Protect a parameter from simplification.
 
void clear_params ()
 Clear previously protected parameters.
 
void add_theory (Node const &stm)
 Add a theory node that is used to rewrite theory atoms in statements.
 

Friends

auto c_cast (RewriteContext const &x) -> clingo_ast_rewrite_context_t *
 Convert the context to its underlying C object.
 

Detailed Description

A context object for rewriting.

Constructor & Destructor Documentation

◆ RewriteContext()

Clingo::AST::RewriteContext::RewriteContext ( Library const &  lib)
inlineexplicit

Construct the context.

Parameters
libthe library to store symbols

Member Function Documentation

◆ add_param()

void Clingo::AST::RewriteContext::add_param ( std::string_view  name)
inline

Protect a parameter from simplification.

Parameters from const directives and program directives should be projected before rewriting.

Parameters
namethe name of the parameter to protect

◆ add_theory()

void Clingo::AST::RewriteContext::add_theory ( Node const &  stm)
inline

Add a theory node that is used to rewrite theory atoms in statements.

Parameters
stmthe theory statement

◆ project_anonymous() [1/2]

auto Clingo::AST::RewriteContext::project_anonymous ( ) -> bool
inline

Check whether projection in negative literals is enabled.

Returns
whether projection is enabled

◆ project_anonymous() [2/2]

void Clingo::AST::RewriteContext::project_anonymous ( bool  value)
inline

Enable projection of anonymous variables in negated literals.

This exists mainly for backward compatibility with clingo 5. Program should use the projection * instead.

Parameters
valuewhether to enable

◆ project_mode() [1/2]

auto Clingo::AST::RewriteContext::project_mode ( ) -> ProjectionMode
inline

Get the projection mode.

Returns
the projection mode

◆ project_mode() [2/2]

void Clingo::AST::RewriteContext::project_mode ( ProjectionMode  value)
inline

Set the projection mode.

Parameters
valuethe projection mode

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