dlinear
0.0.1
Delta-complete SMT solver for linear programming
|
Used by the PredicateAbstractor to ensure that all the theory literals are in the flattened standard form. More...
#include <LinearFormulaFlattener.h>
Public Member Functions | |
LinearFormulaFlattener (const Config &config) | |
Construct a new LinearFormulaFlattener object with the given config . | |
Formula | Flatten (const Formula &formula) |
Flatten the given formula. | |
Private Member Functions | |
Formula | BuildFlatteredFormula (const Expression &lhs, const Expression &rhs, FormulaKind kind) const |
Use the updated expressions to build a new formula, also removing any mult expression from the left-hand-side. | |
Private Attributes | |
const Config & | config_ |
Configuration. | |
std::unordered_map< Formula, Formula > | flattened_formulas_ |
Cache for the flattered formulas. | |
Used by the PredicateAbstractor to ensure that all the theory literals are in the flattened standard form.
Definition at line 22 of file LinearFormulaFlattener.h.
|
inlineexplicit |
Construct a new LinearFormulaFlattener object with the given config
.
config | configuration |
Definition at line 28 of file LinearFormulaFlattener.h.
|
nodiscardprivate |
Use the updated expressions to build a new formula, also removing any mult expression from the left-hand-side.
If a formula is in the form \( a x \lessgtr b \) where \( a, b \in \mathbb{R}, a \ne 0 \) are constants and \( x \in \mathbb{R} \) is an unknown variable, this method will remove the multiplication from the left-hand-side of the formula by dividing both sides by \( a \). If a formula is in the form \( a_1x_1 + a_2x_2 + \dots a_nx_n \lessgtr c \) where \( a_i, c_i \in \mathbb{R} \) are constants and \( x_i \in \mathbb{R} \) is an unknown variable \( \forall i \in \{1, 2, \dots, n\} \), this method will ensure that the first term in the addition of the left-hand-side has a positive coefficient, by multiplying both sides by \( -1 \) if necessary.
lhs | left-hand-side expression of the new formula |
rhs | right-hand-side expression of the new formula |
kind | kind of the formula (e.g. Eq, Lt, Geq, ...) |
Definition at line 37 of file LinearFormulaFlattener.cpp.
Flatten the given formula.
A formula is considered flatten if:
formula
or flattered_formula_ , whose value may be overwritten at the next invocation of this method. formula | the formula to flatten. |
Definition at line 16 of file LinearFormulaFlattener.cpp.