|
Gymbo
|
Base class for representing logical expressions. More...
#include <sat.h>


Public Member Functions | |
| virtual | ~Expr () |
| Destructor for the Expr class. More... | |
| virtual std::string | to_string ()=0 |
| Convert the logical expression to a string representation. More... | |
| virtual bool | evaluate ()=0 |
| Evaluate the logical expression. More... | |
| virtual bool | unConst ()=0 |
| Check if the logical expression can be simplified by removing constants. More... | |
| virtual std::pair< bool, std::string > | freeVar ()=0 |
| Identify and return free variables in the logical expression. More... | |
| virtual std::shared_ptr< Expr > | guessVar (std::string var, bool val)=0 |
| Make a guess for a variable's value and return the resulting expression. More... | |
| virtual std::shared_ptr< Expr > | simplify ()=0 |
| Simplify the logical expression. More... | |
| virtual std::shared_ptr< Expr > | fixNegations ()=0 |
| Fix negations in the logical expression. More... | |
| virtual std::shared_ptr< Expr > | distribute ()=0 |
| Distribute operations in the logical expression. More... | |
| virtual std::shared_ptr< Expr > | getLeft ()=0 |
| Get the left child expression. More... | |
| virtual std::shared_ptr< Expr > | getRight ()=0 |
| Get the right child expression. More... | |
| virtual std::unordered_set< std::string > | literals ()=0 |
| Get the literals present in the logical expression. More... | |
| virtual std::unordered_map< std::string, Polarity > | literalPolarity (std::string var)=0 |
| Get the polarities of literals with respect to a specific variable. More... | |
| virtual std::pair< std::string, bool > | unitClause ()=0 |
| Get a unit clause from the logical expression. More... | |
| virtual std::vector< std::shared_ptr< Expr > > | clauses ()=0 |
| Get a vector of clauses present in the logical expression. More... | |
Public Attributes | |
| OpCode | opcode |
| std::string | name |
Base class for representing logical expressions.
|
inlinevirtual |
Destructor for the Expr class.
|
pure virtual |
Get a vector of clauses present in the logical expression.
Implemented in gymbosat::Const, gymbosat::Not, gymbosat::Or, gymbosat::And, and gymbosat::Var.
|
pure virtual |
Distribute operations in the logical expression.
Implemented in gymbosat::Const, gymbosat::Not, gymbosat::Or, gymbosat::And, and gymbosat::Var.
|
pure virtual |
Evaluate the logical expression.
Implemented in gymbosat::Const, gymbosat::Not, gymbosat::Or, gymbosat::And, and gymbosat::Var.
|
pure virtual |
Fix negations in the logical expression.
Implemented in gymbosat::Const, gymbosat::Not, gymbosat::Or, gymbosat::And, and gymbosat::Var.
|
pure virtual |
Identify and return free variables in the logical expression.
Implemented in gymbosat::Const, gymbosat::Not, gymbosat::Or, gymbosat::And, and gymbosat::Var.
|
pure virtual |
Get the left child expression.
Implemented in gymbosat::Const, gymbosat::Not, gymbosat::Or, gymbosat::And, and gymbosat::Var.
|
pure virtual |
Get the right child expression.
Implemented in gymbosat::Const, gymbosat::Not, gymbosat::Or, gymbosat::And, and gymbosat::Var.
|
pure virtual |
Make a guess for a variable's value and return the resulting expression.
| var | Variable name. |
| val | Guessed value for the variable. |
Implemented in gymbosat::Const, gymbosat::Not, gymbosat::Or, gymbosat::And, and gymbosat::Var.
|
pure virtual |
Get the polarities of literals with respect to a specific variable.
| var | Variable name. |
Implemented in gymbosat::Const, gymbosat::Not, gymbosat::Or, gymbosat::And, and gymbosat::Var.
|
pure virtual |
Get the literals present in the logical expression.
Implemented in gymbosat::Const, gymbosat::Not, gymbosat::Or, gymbosat::And, and gymbosat::Var.
|
pure virtual |
Simplify the logical expression.
Implemented in gymbosat::Const, gymbosat::Not, gymbosat::Or, gymbosat::And, and gymbosat::Var.
|
pure virtual |
Convert the logical expression to a string representation.
Implemented in gymbosat::Const, gymbosat::Not, gymbosat::Or, gymbosat::And, and gymbosat::Var.
|
pure virtual |
Check if the logical expression can be simplified by removing constants.
Implemented in gymbosat::Const, gymbosat::Not, gymbosat::Or, gymbosat::And, and gymbosat::Var.
|
pure virtual |
Get a unit clause from the logical expression.
Implemented in gymbosat::Const, gymbosat::Not, gymbosat::Or, gymbosat::And, and gymbosat::Var.
| std::string gymbosat::Expr::name |
Name associated with the expression.
| OpCode gymbosat::Expr::opcode |
Operation code for the expression.