# Path: pyknow/watchers.py
# def define_watcher(name):
# def worth(what, level_name):
# def watch(*what, level=logging.DEBUG):
# def unwatch(*what):
# RULES = define_watcher('RULES')
# ACTIVATIONS = define_watcher('ACTIVATIONS')
# FACTS = define_watcher('FACTS')
# AGENDA = define_watcher('AGENDA')
# MATCH = define_watcher('MATCH')
# MATCHER = define_watcher('MATCHER')
# ENGINE = define_watcher('ENGINE')
# ALL = tuple(k for k in globals() if k.isupper() and k != 'ALL')


import abc
from pyknow import watchers
"""Abstract base classes for the RETE implementation."""



class Node(metaclass=abc.ABCMeta):
    """Node interface."""

    def __init__(self):
        """Initialize `self.children` and reset the node own memory."""
        self.children = list()
        self._reset()  # Reset it's OWN memory.

    @abc.abstractmethod
    def add_child(self, child, callback):  # pragma: no cover
        """Add a child to `self.children` if necessary."""
        pass

    def reset(self):
        """Reset itself and recursively all its children."""

# Path: pyknow/watchers.py
# def define_watcher(name):
# def worth(what, level_name):
# def watch(*what, level=logging.DEBUG):
# def unwatch(*what):
# RULES = define_watcher('RULES')
# ACTIVATIONS = define_watcher('ACTIVATIONS')
# FACTS = define_watcher('FACTS')
# AGENDA = define_watcher('AGENDA')
# MATCH = define_watcher('MATCH')
# MATCHER = define_watcher('MATCHER')
# ENGINE = define_watcher('ENGINE')
# ALL = tuple(k for k in globals() if k.isupper() and k != 'ALL')


# Path: pyknow/matchers/rete/abstract.py
import abc
from pyknow import watchers

"""Abstract base classes for the RETE implementation."""



class Node(metaclass=abc.ABCMeta):
    """Node interface."""

    def __init__(self):
        """Initialize `self.children` and reset the node own memory."""
        self.children = list()
        self._reset()  # Reset it's OWN memory.

    @abc.abstractmethod
    def add_child(self, child, callback):  # pragma: no cover
        """Add a child to `self.children` if necessary."""
        pass

    def reset(self):
        """Reset itself and recursively all its children."""

        watchers.MATCHER.debug("Node <%s> reset", self)