# Path: stripstream/pddl/logic/predicates.py
# class Predicate(Head):
#     pass
#     """
#   Predicate P which extends :class:`.NamedHead`.
#   """
# 
# Path: stripstream/pddl/objects.py
# class Type(object):
# 
#     def __init__(self, name, parent=None):
#         """
#         PDDL type.
# 
#         :param name: the string name of the type
#         :param parent: the parent :class:`.Type`
#         """
#         self.name = name.lower()
#         self.parent = parent
#         self._hash = None
# 
#     def __eq__(self, other):
#         return type(self) == type(other) and self.name == other.name
# 
#     def __ne__(self, other):
#         return not(self == other)
# 
#     def __hash__(self):
#         if self._hash is None:
#             self._hash = hash((self.__class__, self.name))
#         return self._hash
# 
#     def __repr__(self):
#         return self.name
# 
#     def pddl(self):
#         return self.name
# 
# class Constant(Object):
#     pass
#     """
#   PDDL constant which extends :class:`.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):]


from itertools import product
from stripstream.pddl.logic.predicates import Predicate
from stripstream.pddl.objects import Type, Constant, Parameter as SSParameter
            name = self.prefix % VariableType.num
            VariableType.num += 1
        self.value_to_const = {}
        self.const_to_value = {}
        self.domain = domain
        super(VariableType, self).__init__(name, parent=None)

    def __call__(self, value):
        if value not in self.value_to_const:
            if self.domain is not None and value not in self.domain:
                raise ValueError('%s not in the domain of %s' % (value, self))
            name = '%s_%s' % (self.name, len(self.value_to_const))
            const = Constant(name, self)
            self.value_to_const[value] = const
            self.const_to_value[const] = value
        return self.value_to_const[value]

    def get_value(self, const):
        return self.const_to_value[const]

    def param(self, name):
        return FreeParameter(name, self)

VarType = VariableType


def get_value(const):
    return const.type.get_value(const)



# Path: stripstream/pddl/logic/predicates.py
# class Predicate(Head):
#     pass
#     """
#   Predicate P which extends :class:`.NamedHead`.
#   """
# 
# Path: stripstream/pddl/objects.py
# class Type(object):
# 
#     def __init__(self, name, parent=None):
#         """
#         PDDL type.
# 
#         :param name: the string name of the type
#         :param parent: the parent :class:`.Type`
#         """
#         self.name = name.lower()
#         self.parent = parent
#         self._hash = None
# 
#     def __eq__(self, other):
#         return type(self) == type(other) and self.name == other.name
# 
#     def __ne__(self, other):
#         return not(self == other)
# 
#     def __hash__(self):
#         if self._hash is None:
#             self._hash = hash((self.__class__, self.name))
#         return self._hash
# 
#     def __repr__(self):
#         return self.name
# 
#     def pddl(self):
#         return self.name
# 
# class Constant(Object):
#     pass
#     """
#   PDDL constant which extends :class:`.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):]


# Path: stripstream/fts/variable.py
from itertools import product
from stripstream.pddl.logic.predicates import Predicate
from stripstream.pddl.objects import Type, Constant, Parameter as SSParameter

            name = self.prefix % VariableType.num
            VariableType.num += 1
        self.value_to_const = {}
        self.const_to_value = {}
        self.domain = domain
        super(VariableType, self).__init__(name, parent=None)

    def __call__(self, value):
        if value not in self.value_to_const:
            if self.domain is not None and value not in self.domain:
                raise ValueError('%s not in the domain of %s' % (value, self))
            name = '%s_%s' % (self.name, len(self.value_to_const))
            const = Constant(name, self)
            self.value_to_const[value] = const
            self.const_to_value[const] = value
        return self.value_to_const[value]

    def get_value(self, const):
        return self.const_to_value[const]

    def param(self, name):
        return FreeParameter(name, self)

VarType = VariableType


def get_value(const):
    return const.type.get_value(const)



class FreeParameter(SSParameter):