# Path: pyke/pattern.py
# class pattern(object):
#     def __ne__(self, b): return not (self == b)
# 
#     def simple_match_pattern(self, bindings, my_context, pattern_b, b_context):
#         return self.match_pattern(bindings, my_context, pattern_b, b_context)
# 
#     def lookup(self, context, allow_variable_in_ans = False):
#         return self
# 
# Path: pyke/unique.py
# class unique(object):
#     def __init__(self, name): self.name = name
# 
#     def __repr__(self): return "<unique %s>" % self.name


import sys
from pyke import pattern, unique
            var_context._unbind(var_name)
        del self.undo_list[mark:]
        for var_name in var_names_to_undo:
            self._unbind(var_name)

    def done(self):
        """ Unbinds all variables bound through 'self's 'bind' method.
            The assumption here is that 'self' is being abandoned, so we don't
            need to worry about self.bindings.
        """
        for var_name, var_context in self.undo_list:
            var_context._unbind(var_name)

    def _unbind(self, var_name):
        del self.bindings[var_name]

class bc_context(simple_context):
    def __init__(self, rule):
        super(bc_context, self).__init__()
        self.rule = rule

    def name(self): return self.rule.name

    def __repr__(self):
        return "<bc_context for %s at 0x%x>" % (self.name(), id(self))

    def create_plan(self, final = None):
        if final is None: final = {}
        return self.rule.make_plan(self, final)


# Path: pyke/pattern.py
# class pattern(object):
#     def __ne__(self, b): return not (self == b)
# 
#     def simple_match_pattern(self, bindings, my_context, pattern_b, b_context):
#         return self.match_pattern(bindings, my_context, pattern_b, b_context)
# 
#     def lookup(self, context, allow_variable_in_ans = False):
#         return self
# 
# Path: pyke/unique.py
# class unique(object):
#     def __init__(self, name): self.name = name
# 
#     def __repr__(self): return "<unique %s>" % self.name


# Path: pyke/contexts.py
import sys
from pyke import pattern, unique

            var_context._unbind(var_name)
        del self.undo_list[mark:]
        for var_name in var_names_to_undo:
            self._unbind(var_name)

    def done(self):
        """ Unbinds all variables bound through 'self's 'bind' method.
            The assumption here is that 'self' is being abandoned, so we don't
            need to worry about self.bindings.
        """
        for var_name, var_context in self.undo_list:
            var_context._unbind(var_name)

    def _unbind(self, var_name):
        del self.bindings[var_name]

class bc_context(simple_context):
    def __init__(self, rule):
        super(bc_context, self).__init__()
        self.rule = rule

    def name(self): return self.rule.name

    def __repr__(self):
        return "<bc_context for %s at 0x%x>" % (self.name(), id(self))

    def create_plan(self, final = None):
        if final is None: final = {}
        return self.rule.make_plan(self, final)


class variable(pattern.pattern):