agent_logic.evaluation.truth_table
Classes
|
Generates a truth table for a given logical expression. |
- class agent_logic.evaluation.truth_table.TruthTable(expression)[source]
Bases:
objectGenerates a truth table for a given logical expression.
- Parameters:
expression (LogicalExpression)
- generate()[source]
Generates all possible truth values for the logical expression.
- Return type:
List[Dict[str,Union[bool,str]]]- Returns:
List of dictionaries, where each dictionary represents a row in the truth table.
- is_contradiction()[source]
Checks if the expression is always false.
- Return type:
bool- Returns:
True if the expression evaluates to False for all assignments, otherwise False.