agent_logic.evaluation.truth_table

Classes

TruthTable(expression)

Generates a truth table for a given logical expression.

class agent_logic.evaluation.truth_table.TruthTable(expression)[source]

Bases: object

Generates 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.

is_satisfiable()[source]

Checks if there exists a truth assignment that makes the expression true.

Return type:

bool

Returns:

True if at least one assignment makes the expression True, otherwise False.

is_tautology()[source]

Checks if the expression is always true.

Return type:

bool

Returns:

True if the expression evaluates to True for all assignments, otherwise False.