LogiXpr
Loading...
Searching...
No Matches
Functions
Evaluator functions

Functions for evaluating expressions. More...

Functions

std::vector< std::unordered_map< std::string, bool > > getTruthTableInputs (std::shared_ptr< Expression > lhs, std::shared_ptr< Expression > rhs)
 Generate the truth table inputs for the given expressions.
 
bool evaluateExpression (std::shared_ptr< Expression > expression, std::unordered_map< std::string, bool > inputs)
 Evaluate the expression with the given inputs.
 
bool isEquivalent (std::shared_ptr< Expression > lhs, std::shared_ptr< Expression > rhs)
 Check if two expressions are equivalent.
 

Detailed Description

Functions for evaluating expressions.

Function Documentation

◆ evaluateExpression()

bool evaluateExpression ( std::shared_ptr< Expression expression,
std::unordered_map< std::string, bool >  inputs 
)

Evaluate the expression with the given inputs.

Parameters
expressionpointer to expression to evaluate
inputsmap of variable inputs
Returns
bool of whether the expression is true or false

Definition at line 31 of file evaluator.cpp.

◆ getTruthTableInputs()

std::vector< std::unordered_map< std::string, bool > > getTruthTableInputs ( std::shared_ptr< Expression lhs,
std::shared_ptr< Expression rhs 
)

Generate the truth table inputs for the given expressions.

Parameters
lhspointer to left hand side expression
rhspointer to right hand side expression
Returns
vector of maps of input variables

Definition at line 8 of file evaluator.cpp.

◆ isEquivalent()

bool isEquivalent ( std::shared_ptr< Expression lhs,
std::shared_ptr< Expression rhs 
)

Check if two expressions are equivalent.

Parameters
lhspointer to left hand side expression
rhspointer to right hand side expression
Returns
bool of whether the expressions are equivalent

Definition at line 60 of file evaluator.cpp.