# Path: stripstream/pddl/logic/atoms.py
# class Initialize(Formula):
# 
#     def __init__(self, atom, value):
#         """
#         Formula atom (= F N) which initializes the value of an atom of :class:`.Function`.
# 
#         :param atom: an :class:`.Atom` of :class:`.Function`
#         :param value: the numeric value of ``value``
#         """
#         self.atom = atom
#         self.value = value
# 
#     def get_atoms(self): return set()
# 
#     def get_formulas(self): return []
# 
#     def get_quantified(self): return set()
# 
#     def pddl(self):
#         return '(= %s %s)' % (self.atom.pddl(), self.value)
#     __repr__ = pddl


from collections import defaultdict
from itertools import product
from stripstream.pddl.logic.atoms import Initialize
                        inter_map[inter_values].append(
                            frozenset(name_map.iteritems()))

                new_arg_values = set()
                for arg_value in arg_values:
                    name_map = dict(arg_value)
                    inter_values = frozenset(
                        (name, name_map[name]) for name in inter_names)
                    for other_value in inter_map[inter_values]:
                        new_arg_values.add(arg_value | other_value)
                arg_names |= set(literal.args)
                arg_values = new_arg_values

        remaining_names = list(set(operator.parameters) - arg_names)
        remaining_values = [type_to_objects.get(
            param.type, []) for param in remaining_names]
        remaining_combos = list(product(*remaining_values))
        for arg_value in arg_values:
            for combo in remaining_combos:
                combined = dict(list(arg_value) + zip(remaining_names, combo))
                instance = operator.instantiate(
                    [combined[param] for param in operator.parameters])
                if instance not in instances:
                    instances.add(instance)
                    yield instance


def smart_instantiate_operators(operators, universe):
    static_map = {pr: [] for pr in universe.stream_predicates}
    for atom in universe.get_initial_atoms():

# Path: stripstream/pddl/logic/atoms.py
# class Initialize(Formula):
# 
#     def __init__(self, atom, value):
#         """
#         Formula atom (= F N) which initializes the value of an atom of :class:`.Function`.
# 
#         :param atom: an :class:`.Atom` of :class:`.Function`
#         :param value: the numeric value of ``value``
#         """
#         self.atom = atom
#         self.value = value
# 
#     def get_atoms(self): return set()
# 
#     def get_formulas(self): return []
# 
#     def get_quantified(self): return set()
# 
#     def pddl(self):
#         return '(= %s %s)' % (self.atom.pddl(), self.value)
#     __repr__ = pddl


# Path: stripstream/algorithms/instantiation.py
from collections import defaultdict
from itertools import product
from stripstream.pddl.logic.atoms import Initialize

                        inter_map[inter_values].append(
                            frozenset(name_map.iteritems()))

                new_arg_values = set()
                for arg_value in arg_values:
                    name_map = dict(arg_value)
                    inter_values = frozenset(
                        (name, name_map[name]) for name in inter_names)
                    for other_value in inter_map[inter_values]:
                        new_arg_values.add(arg_value | other_value)
                arg_names |= set(literal.args)
                arg_values = new_arg_values

        remaining_names = list(set(operator.parameters) - arg_names)
        remaining_values = [type_to_objects.get(
            param.type, []) for param in remaining_names]
        remaining_combos = list(product(*remaining_values))
        for arg_value in arg_values:
            for combo in remaining_combos:
                combined = dict(list(arg_value) + zip(remaining_names, combo))
                instance = operator.instantiate(
                    [combined[param] for param in operator.parameters])
                if instance not in instances:
                    instances.add(instance)
                    yield instance


def smart_instantiate_operators(operators, universe):
    static_map = {pr: [] for pr in universe.stream_predicates}
    for atom in universe.get_initial_atoms():

        if not isinstance(atom, Initialize) and atom.predicate in static_map: