# Path: stripstream/pddl/logic/formulas.py
# class Formula(object):
# 
#     def is_valid_condition(self):
#         return isinstance(self, Condition) and all(f.is_valid_condition() for f in self.get_formulas())
# 
#     def is_valid_effect(self):
#         return isinstance(self, Effect) and all(f.is_valid_effect() for f in self.get_formulas())
# 
#     def get_atoms(self): raise NotImplementedError()
# 
#     def get_literals(self): raise NotImplementedError()
# 
#     def get_formulas(self): raise NotImplementedError()
# 
#     def de_morgan(self, sign=True): raise NotImplementedError()
# 
#     def simplify(self): return self
# 
#     def get_objects(self):
#         return set(flatten(atom.args for atom in self.get_atoms()))
# 
#     def get_parameters(self):
#         return set(flatten(atom.get_parameters() for atom in self.get_atoms()))
# 
#     def get_quantified(self): raise NotImplementedError()
# 
#     def propositional(self, constants): raise NotImplementedError()
# 
#     def dequantify(self, constants): raise NotImplementedError()
# 
#     def instantiate(self, parameter_map): raise NotImplementedError()
# 
#     def clone(self): return self.instantiate({})
# 
#     def substitute(self, atom, subformula): raise NotImplementedError()
# 
#     def pddl(self): raise NotImplementedError()
#     __repr__ = pddl
#     """
#   Logical formula abstract class.
#   """
# 
# class Condition():
# 
#     def holds(self, atoms, constants): raise NotImplementedError()
# 
#     def positive_supporters(
#         self, atoms, constants): raise NotImplementedError()
# 
#     def negative_supporters(
#         self, atoms, constants): raise NotImplementedError()
#     """
#   Legal condition component interface.
#   """
# 
# class Effect():
# 
#     def add(self, atoms, constants): raise NotImplementedError()
# 
#     def delete(self, atoms, constants): raise NotImplementedError()
#     """
#   Legal effect component interface.
#   """
# 
# Path: stripstream/pddl/logic/predicates.py
# class Head(object):
# class Predicate(Head):
# class EasyPredicate(Predicate):
# class Function(Head):
# class EasyFunction(Function):
#     def __init__(self, name, types=tuple()):
#     def __call__(self, *args):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def pddl(self):
#     def __repr__(self):
#     def __init__(self, *types):
#     def __init__(self, *types):
# def convert_args(self, args):
# 
# Path: stripstream/pddl/objects.py
# class Object(object):
# 
#     def __init__(self, name, type):
#         """
#         PDDL object abstract class.
# 
#         :param name: the string name of the object
#         :param type: the :class:`.Type` of the object
#         """
#         self.name = name.lower()
#         self.type = type
#         self._hash = None
# 
#     def __eq__(self, other):
#         return type(self) == type(other) and self.name == other.name and self.type == other.type
# 
#     def __ne__(self, other):
#         return not(self == other)
# 
#     def __hash__(self):
#         if self._hash is None:
#             self._hash = hash((self.__class__, self.name, self.type))
#         return self._hash
# 
#     def pddl(self):
#         return self.name
# 
#     def typed_pddl(self):
#         return TYPE_PAIR % (self.name, self.type)
#     __repr__ = pddl
# 
# OBJECT = Type('object')
# 
# class Parameter(Object):
# 
#     def __init__(self, name, type):
#         """
#         PDDL parameter which extends :class:`.Object`.
# 
#         :param name: the string name of the parameter
#         :param type: the :class:`.Type` of the parameter
#         """
#         super(Parameter, self).__init__(PARAM_PREFIX + name, type)
# 
#     @property
#     def original(self):
#         return self.name[len(PARAM_PREFIX):]
# 
# class Constant(Object):
#     pass
#     """
#   PDDL constant which extends :class:`.Object`.
#   """


from stripstream.pddl.logic.formulas import Formula, Condition, Effect
from stripstream.pddl.logic.predicates import Function, TotalCost
from stripstream.pddl.objects import Object, OBJECT, Parameter, Constant
import stripstream.pddl.logic.connectives

    def get_quantified(self): return set()

    def substitute(self, atom, subformula): pass

    def propositional(self, constants): return self

    def dequantify(self, constants): return self

    def instantiate(self, parameter_map):
        return self.__class__(*[parameter_map.get(arg, arg) for arg in self.args])

    def de_morgan(self, sign=True):
        return self if sign else stripstream.pddl.logic.connectives.Not(self)

    def holds(self, atoms, constants):

        return all(self.args[0] == arg for arg in self.args)

    def positive_supporters(self, atoms, constants):
        return set() if self.holds(atoms, constants) else None

    def negative_supporters(self, atoms, constants):
        raise None if self.holds(atoms, constants) else set()

    def pddl(self):
        return '(= %s)' % ' '.join(arg.pddl() for arg in self.args)
    __repr__ = pddl



# Path: stripstream/pddl/logic/formulas.py
# class Formula(object):
# 
#     def is_valid_condition(self):
#         return isinstance(self, Condition) and all(f.is_valid_condition() for f in self.get_formulas())
# 
#     def is_valid_effect(self):
#         return isinstance(self, Effect) and all(f.is_valid_effect() for f in self.get_formulas())
# 
#     def get_atoms(self): raise NotImplementedError()
# 
#     def get_literals(self): raise NotImplementedError()
# 
#     def get_formulas(self): raise NotImplementedError()
# 
#     def de_morgan(self, sign=True): raise NotImplementedError()
# 
#     def simplify(self): return self
# 
#     def get_objects(self):
#         return set(flatten(atom.args for atom in self.get_atoms()))
# 
#     def get_parameters(self):
#         return set(flatten(atom.get_parameters() for atom in self.get_atoms()))
# 
#     def get_quantified(self): raise NotImplementedError()
# 
#     def propositional(self, constants): raise NotImplementedError()
# 
#     def dequantify(self, constants): raise NotImplementedError()
# 
#     def instantiate(self, parameter_map): raise NotImplementedError()
# 
#     def clone(self): return self.instantiate({})
# 
#     def substitute(self, atom, subformula): raise NotImplementedError()
# 
#     def pddl(self): raise NotImplementedError()
#     __repr__ = pddl
#     """
#   Logical formula abstract class.
#   """
# 
# class Condition():
# 
#     def holds(self, atoms, constants): raise NotImplementedError()
# 
#     def positive_supporters(
#         self, atoms, constants): raise NotImplementedError()
# 
#     def negative_supporters(
#         self, atoms, constants): raise NotImplementedError()
#     """
#   Legal condition component interface.
#   """
# 
# class Effect():
# 
#     def add(self, atoms, constants): raise NotImplementedError()
# 
#     def delete(self, atoms, constants): raise NotImplementedError()
#     """
#   Legal effect component interface.
#   """
# 
# Path: stripstream/pddl/logic/predicates.py
# class Head(object):
# class Predicate(Head):
# class EasyPredicate(Predicate):
# class Function(Head):
# class EasyFunction(Function):
#     def __init__(self, name, types=tuple()):
#     def __call__(self, *args):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def pddl(self):
#     def __repr__(self):
#     def __init__(self, *types):
#     def __init__(self, *types):
# def convert_args(self, args):
# 
# Path: stripstream/pddl/objects.py
# class Object(object):
# 
#     def __init__(self, name, type):
#         """
#         PDDL object abstract class.
# 
#         :param name: the string name of the object
#         :param type: the :class:`.Type` of the object
#         """
#         self.name = name.lower()
#         self.type = type
#         self._hash = None
# 
#     def __eq__(self, other):
#         return type(self) == type(other) and self.name == other.name and self.type == other.type
# 
#     def __ne__(self, other):
#         return not(self == other)
# 
#     def __hash__(self):
#         if self._hash is None:
#             self._hash = hash((self.__class__, self.name, self.type))
#         return self._hash
# 
#     def pddl(self):
#         return self.name
# 
#     def typed_pddl(self):
#         return TYPE_PAIR % (self.name, self.type)
#     __repr__ = pddl
# 
# OBJECT = Type('object')
# 
# class Parameter(Object):
# 
#     def __init__(self, name, type):
#         """
#         PDDL parameter which extends :class:`.Object`.
# 
#         :param name: the string name of the parameter
#         :param type: the :class:`.Type` of the parameter
#         """
#         super(Parameter, self).__init__(PARAM_PREFIX + name, type)
# 
#     @property
#     def original(self):
#         return self.name[len(PARAM_PREFIX):]
# 
# class Constant(Object):
#     pass
#     """
#   PDDL constant which extends :class:`.Object`.
#   """


# Path: stripstream/pddl/logic/atoms.py
from stripstream.pddl.logic.formulas import Formula, Condition, Effect
from stripstream.pddl.logic.predicates import Function, TotalCost
from stripstream.pddl.objects import Object, OBJECT, Parameter, Constant
import stripstream.pddl.logic.connectives


    def get_quantified(self): return set()

    def substitute(self, atom, subformula): pass

    def propositional(self, constants): return self

    def dequantify(self, constants): return self

    def instantiate(self, parameter_map):
        return self.__class__(*[parameter_map.get(arg, arg) for arg in self.args])

    def de_morgan(self, sign=True):
        return self if sign else stripstream.pddl.logic.connectives.Not(self)

    def holds(self, atoms, constants):

        return all(self.args[0] == arg for arg in self.args)

    def positive_supporters(self, atoms, constants):
        return set() if self.holds(atoms, constants) else None

    def negative_supporters(self, atoms, constants):
        raise None if self.holds(atoms, constants) else set()

    def pddl(self):
        return '(= %s)' % ' '.join(arg.pddl() for arg in self.args)
    __repr__ = pddl



class Increase(Formula, Effect):