class documentation

Base class for boolean terms.

Method extract_equalities Find all equalities that appear in this term.
Method extract_pivots Find values for every variable that appears in this term.
Method simplify Simplify this term, given a list of possible values for each variable.
Class Variable __slots__ Undocumented
def extract_equalities(self): (source)

Find all equalities that appear in this term. Returns: A sequence of tuples of a string (variable name) and a string (value or variable name).

def extract_pivots(self, assignments): (source)

Find values for every variable that appears in this term. This finds all variables that appear in this term and limits them to the values they appear together with. For example, consider the equation t = v1 | (t = v2 & (t = v2 | t = v3)) Here, t can be limited to [v1, v2]. (v3 is impossible.) Args: assignments: The current "upper bound", i.e. all values that are still possible for variables. Used for extracting pivots out of Eq(var, var). Returns: A dictionary mapping strings (variable names) to sets of strings (value or variable names).

def simplify(self, assignments): (source)

Simplify this term, given a list of possible values for each variable. Args: assignments: A list of possible values for each variable. A dictionary mapping strings (variable name) to sets of strings (value names). Returns: A new BooleanTerm, potentially simplified.