Expression solvers
Numerical, logical, and template expressions within DIPL.
-
enum snt::dip::CustomOperatorType
Operators used to test whether a DIP symbol is defined.
Values:
-
enumerator DEFINED_OPERATOR
-
enumerator NOT_DEFINED_OPERATOR
-
enumerator DEFINED_OPERATOR
-
class LogicalAtom : public snt::exs::AtomBase<LogicalAtom, ValueNodeData>
- #include <logical_atom.h>
Public Functions
-
inline LogicalAtom(ValueNodeData b)
-
inline LogicalAtom(const LogicalAtom &a)
-
LogicalAtom &operator=(const LogicalAtom &a)
Copy the logical atom value into this object.
- Parameters:
a – Source atom whose value is copied.
-
LogicalAtom(LogicalAtom &&a) noexcept = default
-
LogicalAtom &operator=(LogicalAtom &&a) noexcept = default
-
virtual std::string to_string() override
Get a string representation of an atom
-
void comparison_equal(LogicalAtom *other) override
-
void comparison_not_equal(LogicalAtom *other) override
-
void comparison_less_equal(LogicalAtom *other) override
-
void comparison_greater_equal(LogicalAtom *other) override
-
void comparison_less(LogicalAtom *other) override
-
void comparison_greater(LogicalAtom *other) override
-
virtual void logical_not() override
Get logical negation of this value
-
void logical_and(LogicalAtom *other) override
Apply a logical AND operation.
- Parameters:
other – Other value used in the operation.
-
void logical_or(LogicalAtom *other) override
Apply a logical OR operation.
- Parameters:
other – Other value used in the operation.
-
void custom_defined()
-
void custom_not_defined()
Public Static Functions
-
static ValueNodeData from_string(const std::string &s, exs::BaseSettings *settings)
-
inline LogicalAtom(ValueNodeData b)
-
struct LogicalSettings : public snt::exs::BaseSettings
- #include <logical_atom.h>
Public Members
-
Environment *env
Environment for the references.
-
Environment *env
-
class LogicalSolver
- #include <logical_solver.h>
Solves logical expressions of DIP nodes
Public Functions
-
LogicalSolver(Environment &env, Path current = Path(""))
Logical solver constructor
- Parameters:
env – Environment class object
current – Current path in the node hierarchy
-
ValueNodeData eval(const std::string &expression)
Solve logical DIP expression
- Parameters:
expression – Logical expression string
- Returns:
Data of a value node
Public Static Attributes
-
static exs::Solver<LogicalAtom, LogicalSettings> solver
Instance of an EXS expression solver.
-
LogicalSolver(Environment &env, Path current = Path(""))
-
class NumericalAtom : public snt::exs::AtomBase<NumericalAtom, ValueNodeData>
- #include <numerical_atom.h>
Public Functions
-
inline NumericalAtom(ValueNodeData b)
-
NumericalAtom(const NumericalAtom &a)
-
NumericalAtom &operator=(const NumericalAtom &a)
Copy the numerical atom value into this object.
- Parameters:
a – Source atom whose value is copied.
-
NumericalAtom(NumericalAtom &&a) noexcept = default
-
NumericalAtom &operator=(NumericalAtom &&a) noexcept = default
-
virtual std::string to_string() override
Get a string representation of an atom
-
virtual void math_sinus() override
Get sinus of this value
-
virtual void math_cosinus() override
Get cosinus of this value
-
virtual void math_tangens() override
Get tangens value of this value
-
virtual void math_cubic_root() override
Get cubic root of this value
-
virtual void math_square_root() override
Get square root value of this value
-
virtual void math_logarithm_10() override
Get a decadic logarithm of this value
-
virtual void math_logarithm() override
Get a natural logarithm of this value
-
virtual void math_exponent() override
Get an exponential value of this value
-
void math_power(NumericalAtom *other) override
-
void math_multiply(NumericalAtom *other) override
-
void math_divide(NumericalAtom *other) override
-
void math_add(NumericalAtom *other) override
Add another value.
- Parameters:
other – Other value used in the operation.
-
void math_subtract(NumericalAtom *other) override
-
virtual void math_negate() override
Negate value of this value
Public Static Functions
-
static ValueNodeData from_string(const std::string &s, exs::BaseSettings *settings)
-
inline NumericalAtom(ValueNodeData b)
-
struct NumericalSettings : public snt::exs::BaseSettings
- #include <numerical_atom.h>
Public Members
-
Environment *env
Environment for the references.
-
Environment *env
-
class NumericalSolver
- #include <numerical_solver.h>
Solves numerical expressions of DIP nodes
Public Functions
-
NumericalSolver(Environment &env, Path current = Path(""))
Numerical solver constructor
- Parameters:
env – Environment class object
current – Current path in the node hierarchy
-
ValueNodeData eval(const std::string &expression, const std::string &units = "")
Solve numerical DIP expression
- Parameters:
expression – Numerical expression string
units – Target units of a solved value node
- Returns:
Data of a value node
Public Static Attributes
-
static exs::Solver<NumericalAtom, NumericalSettings> solver
Instance of an EXS expression solver.
-
NumericalSolver(Environment &env, Path current = Path(""))
-
class OperatorDefined : public snt::exs::OperatorGroup<1>
- #include <logical_operators.h>
DIP operator that tests for a defined symbol.
-
class OperatorNotDefined : public snt::exs::OperatorGroup<1>
- #include <logical_operators.h>
DIP operator that tests for an undefined symbol.
-
class TemplateSolver
- #include <template_solver.h>
Public Functions
-
TemplateSolver(Environment &env, Path current = Path(""))
Template solver constructor
- Parameters:
env – Environment class object
current – Current path in the node hierarchy
-
ValueNodeData eval(std::string expression)
Solve DIP string template
- Parameters:
expression – Template string
- Returns:
Data of a value node
-
TemplateSolver(Environment &env, Path current = Path(""))