Module Import alias ImportFrom alias alias alias alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad Num Assign NameStore Call NameLoad Num FunctionDef arguments args NameParam defaults body Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults kwarg body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr keyword NameLoad NameLoad If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num orelse Assign AttributeStore NameLoad attr Num If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num orelse Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareGtE Call NameLoad AttributeLoad NameLoad attr Num body Assign NameStore Num For NameStore AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareGt NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq AttributeLoad NameLoad attr NameLoad body Return AttributeLoad NameLoad attr orelse Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareEq AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad FunctionDef arguments args NameParam defaults kwarg body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr keyword Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr body For NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body If UnaryOpNot CompareIn NameLoad AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call AttributeLoad NameLoad attr Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore UnaryOpUSub NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad ListLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd AttributeLoad AttributeLoad NameLoad attr attr UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr FunctionDef arguments args NameParam defaults body Return BoolOpAnd CompareNotEq NameLoad NameLoad CompareNotEq NameLoad NameLoad UnaryOpNot Call AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore ListComp NameLoad comprehension NameStore NameLoad Call NameLoad NameLoad If CompareGt Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index Num NameLoad Continue If Call AttributeLoad NameLoad attr NameLoad body Return AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If UnaryOpNot CompareIn NameLoad AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr NameLoad decorator_list decorator_list
N/A N/A collections bundled.traitlets HasTraits Instance List Long compat OrderedDict rule PackageRule RuleWatchNode N/A HasTraits N/A N/A rule N/A Instance PackageRule N/A _watch1 N/A Long -1 N/A _watch2 N/A Long -1 literals N/A N/A self N/A N/A N/A N/A N/A self rule literals N/A property watch1 N/A N/A self N/A N/A N/A N/A self _watch1 N/A property watch2 N/A N/A self N/A N/A N/A N/A self _watch2 N/A property __init__ N/A N/A self rule N/A kw N/A N/A N/A N/A N/A super RuleWatchNode self __init__ rule rule kw N/A N/A N/A len N/A self literals 0 N/A N/A N/A self _watch1 N/A N/A self literals N/A 0 N/A N/A N/A self _watch1 0 N/A N/A N/A len N/A self literals 1 N/A N/A N/A self _watch2 N/A N/A self literals N/A 1 N/A N/A N/A self _watch2 0 N/A watch2_on_highest N/A N/A self decisions N/A N/A N/A 
        Places the second watch on the rule's literal, decided at the highest level
         N/A N/A N/A len N/A rule literals 3 N/A N/A watch_level 0 N/A literal N/A self literals N/A N/A level N/A N/A decisions decision_level literal N/A N/A level watch_level N/A N/A N/A self _watch2 literal N/A watch_level level N/A other_watch N/A N/A self literal N/A N/A N/A 
        Given one watched literal, this method returns the other watched
        literal
         N/A N/A N/A self _watch1 literal N/A N/A N/A self _watch2 N/A N/A N/A self _watch1 N/A move_watch N/A N/A self from_literal to_literal N/A N/A N/A 
        Moves a watch from one literal to another
         N/A N/A N/A self _watch1 from_literal N/A N/A N/A self _watch1 to_literal N/A N/A N/A self _watch2 to_literal N/A N/A RulesWatchGraph N/A HasTraits N/A N/A 
    The RulesWatchGraph efficiently propagates decisions to other rules
     N/A watch_chains N/A Instance OrderedDict __init__ N/A N/A self N/A kw N/A N/A N/A N/A N/A super RulesWatchGraph self __init__ watch_chains N/A OrderedDict kw N/A insert N/A N/A self node N/A N/A N/A N/A N/A N/A node rule is_assertion N/A N/A literal N/A N/A node watch1 N/A node watch2 N/A N/A N/A N/A literal N/A self watch_chains N/A N/A N/A N/A self watch_chains N/A literal N/A N/A collections deque N/A N/A N/A N/A N/A self watch_chains N/A literal appendleft node N/A propagate_literal N/A N/A self decided_literal level decisions N/A N/A N/A 
        Propagates a decision on a literal to all rules watching the literal

        If a decision, e.g. +A has been made, then all rules containing -A, e.g.
        (-A|+B|+C) now need to satisfy at least one of the other literals, so
        that the rule as a whole becomes true, since with +A applied the rule
        is now (false|+B|+C) so essentially (+B|+C).

        This means that all rules watching the literal -A need to be updated to
        watch 2 other literals which can still be satisfied instead. So literals
        that conflict with previously made decisions are not an option.

        Alternatively it can occur that a unit clause results: e.g. if in the
        above example the rule was (-A|+B), then A turning true means that
        B must now be decided true as well.

        Parameters
        ----------
        decided_literal: int
            The literal which was decided (A in our example)
        level: int
            The level at which the decision took place and at which all
            resulting decisions should be made.
        decisions: DecisionsSet
            Used to check previous decisions and to register decisions
            resulting from propagation

        Returns
        -------
        Rule|null If a conflict is found the conflicting rule is returned
         N/A literal N/A decided_literal N/A chain N/A N/A N/A self watch_chains get literal N/A N/A node chain N/A N/A other_watch N/A N/A node other_watch literal N/A N/A N/A N/A node rule enabled N/A N/A N/A decisions satisfy other_watch N/A N/A rule_literals N/A N/A node rule literals _filtre N/A N/A rule_literal N/A N/A N/A N/A N/A literal rule_literal N/A other_watch rule_literal N/A N/A N/A decisions conflict rule_literal N/A N/A alternative_literals N/A rule_literal N/A rule_literal rule_literals N/A _filtre rule_literal N/A N/A N/A len alternative_literals 0 N/A N/A N/A N/A self move_watch literal N/A alternative_literals N/A 0 node N/A N/A N/A N/A decisions conflict other_watch N/A N/A N/A node rule N/A N/A N/A decisions decide other_watch level N/A node rule N/A None N/A move_watch N/A N/A self from_literal to_literal node N/A N/A N/A 
        Moves a rule node from one watch chain to another

        The rule node's watched literals are updated accordingly.

        Parameters
        ----------
        from_literal:
            A literal the node used to watch
        to_literal:
            A literal the node should watch now
        node:
            The rule node to be moved
         N/A N/A N/A to_literal N/A self watch_chains N/A N/A N/A N/A self watch_chains N/A to_literal N/A N/A collections deque N/A N/A N/A node move_watch from_literal to_literal N/A N/A N/A N/A self watch_chains pop from_literal N/A N/A N/A N/A N/A self watch_chains N/A to_literal appendleft node N/A N/A