Crate logical_solver

Source

Modules§

ast
logic_parser

Functions§

evaluate
Evaluates a boolean expression using a given state of variables.
parse_expression
Parses a logical expression represented as a string and returns a boxed expression.
permutate
Generates all possible combinations of boolean values for a set of variables.
solve_truth_table
The function evaluates the Boolean expression expr for each of the states in the states vector. The evaluation is performed by calling the evaluate function with the state and expression as arguments. The result of the evaluation is stored in a new vector. The solve_truth_table function returns this solution vector.