class BooleanTerm: (source)
Known subclasses: pytype.pytd.booleq.FalseValue
, pytype.pytd.booleq.TrueValue
, pytype.pytd.booleq._And
, pytype.pytd.booleq._Eq
, pytype.pytd.booleq._Or
Base class for boolean terms.
Method | extract |
Find all equalities that appear in this term. |
Method | extract |
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 |
pytype.pytd.booleq.FalseValue
, pytype.pytd.booleq.TrueValue
, pytype.pytd.booleq._And
, pytype.pytd.booleq._Eq
, pytype.pytd.booleq._Or
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).
pytype.pytd.booleq.FalseValue
, pytype.pytd.booleq.TrueValue
, pytype.pytd.booleq._And
, pytype.pytd.booleq._Eq
, pytype.pytd.booleq._Or
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).
pytype.pytd.booleq.FalseValue
, pytype.pytd.booleq.TrueValue
, pytype.pytd.booleq._And
, pytype.pytd.booleq._Eq
, pytype.pytd.booleq._Or
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.