# Path: muninn/function.py
# class Prototype(object):
#     def __init__(self, name, argument_types=(), return_type=None):
#         self.name = name
#         self.argument_types = argument_types
#         self.return_type = return_type
# 
#         self._id = "%s(%s)" % (self.name, ",".join(imap(lambda type: type.name(), self.argument_types)))
#         if self.return_type is not None:
#             self._id += " " + self.return_type.name()
# 
#     @property
#     def id(self):
#         return self._id
# 
#     @property
#     def arity(self):
#         return len(self.argument_types)
# 
#     def _argument_types_equal(self, other):
#         if self.arity != other.arity:
#             return False
# 
#         for type_self, type_other in izip(self.argument_types, other.argument_types):
#             if type_self is not type_other:
#                 return False
#         return True
# 
#     def __eq__(self, other):
#         return self.name == other.name and self._argument_types_equal(other) and self.return_type is other.return_type
# 
#     def __ne__(self, other):
#         return not self == other
# 
#     def __str__(self):
#         return self.id
# 
#     def __repr__(self):
#         return "Prototype(name=%r, argument_types=%r, return_type=%r)" % (self.name, self.argument_types,
#                                                                           self.return_type)
# 
#     def __hash__(self):
#         return hash(self.id)
# 
# Path: muninn/language.py
# def parse_and_analyze(text, namespace_schemas={}, parameters={}):
#     return analyze(parse(text), namespace_schemas, parameters)
# 
# class Literal(AbstractSyntaxTreeNode):
#     def __init__(self, value):
#         self.value = value
# 
#     def __str__(self):
#         return "(%s %s)" % (type(self).__name__, self.value)
# 
# class Name(AbstractSyntaxTreeNode):
#     def __init__(self, value):
#         self.value = value
# 
#     def __str__(self):
#         return "(%s %s)" % (type(self).__name__, self.value)
# 
# Path: muninn/visitor.py
# class Visitor(object):
#     def visit(self, visitable, *args, **kwargs):
#         for type_ in inspect.getmro(type(visitable)):
#             try:
#                 visit_func = getattr(self, "visit_%s" % type_.__name__)
#             except AttributeError:
#                 pass
#             else:
#                 return visit_func(visitable, *args, **kwargs)
# 
#         try:
#             visit_func = getattr(self, "default")
#         except AttributeError:
#             pass
#         else:
#             return visit_func(visitable, *args, **kwargs)


import collections
import inspect
import re
    from collections.abc import MutableMapping
    from collections import MutableMapping
from muninn.exceptions import *
from muninn.function import Prototype
from muninn.language import parse_and_analyze, Literal, Name
from muninn.schema import *
from muninn.visitor import Visitor

    subtract_rewriter = binary_operator_rewriter("-")
    rewriter_table[Prototype("-", (Long, Long), Long)] = subtract_rewriter
    rewriter_table[Prototype("-", (Long, Integer), Long)] = subtract_rewriter
    rewriter_table[Prototype("-", (Integer, Long), Long)] = subtract_rewriter
    rewriter_table[Prototype("-", (Integer, Integer), Integer)] = subtract_rewriter
    rewriter_table[Prototype("-", (Real, Real), Real)] = subtract_rewriter
    rewriter_table[Prototype("-", (Real, Long), Real)] = subtract_rewriter
    rewriter_table[Prototype("-", (Long, Real), Real)] = subtract_rewriter
    rewriter_table[Prototype("-", (Real, Integer), Real)] = subtract_rewriter
    rewriter_table[Prototype("-", (Integer, Real), Real)] = subtract_rewriter

    multiply_rewriter = binary_operator_rewriter("*")
    rewriter_table[Prototype("*", (Long, Long), Long)] = multiply_rewriter
    rewriter_table[Prototype("*", (Long, Integer), Long)] = multiply_rewriter
    rewriter_table[Prototype("*", (Integer, Long), Long)] = multiply_rewriter
    rewriter_table[Prototype("*", (Integer, Integer), Integer)] = multiply_rewriter
    rewriter_table[Prototype("*", (Real, Real), Real)] = multiply_rewriter
    rewriter_table[Prototype("*", (Real, Long), Real)] = multiply_rewriter
    rewriter_table[Prototype("*", (Long, Real), Real)] = multiply_rewriter
    rewriter_table[Prototype("*", (Real, Integer), Real)] = multiply_rewriter
    rewriter_table[Prototype("*", (Integer, Real), Real)] = multiply_rewriter

    divide_rewriter = binary_operator_rewriter("/")
    rewriter_table[Prototype("/", (Long, Long), Long)] = divide_rewriter
    rewriter_table[Prototype("/", (Long, Integer), Long)] = divide_rewriter
    rewriter_table[Prototype("/", (Integer, Long), Long)] = divide_rewriter
    rewriter_table[Prototype("/", (Integer, Integer), Integer)] = divide_rewriter
    rewriter_table[Prototype("/", (Real, Real), Real)] = divide_rewriter
    rewriter_table[Prototype("/", (Real, Long), Real)] = divide_rewriter

# Path: muninn/function.py
# class Prototype(object):
#     def __init__(self, name, argument_types=(), return_type=None):
#         self.name = name
#         self.argument_types = argument_types
#         self.return_type = return_type
# 
#         self._id = "%s(%s)" % (self.name, ",".join(imap(lambda type: type.name(), self.argument_types)))
#         if self.return_type is not None:
#             self._id += " " + self.return_type.name()
# 
#     @property
#     def id(self):
#         return self._id
# 
#     @property
#     def arity(self):
#         return len(self.argument_types)
# 
#     def _argument_types_equal(self, other):
#         if self.arity != other.arity:
#             return False
# 
#         for type_self, type_other in izip(self.argument_types, other.argument_types):
#             if type_self is not type_other:
#                 return False
#         return True
# 
#     def __eq__(self, other):
#         return self.name == other.name and self._argument_types_equal(other) and self.return_type is other.return_type
# 
#     def __ne__(self, other):
#         return not self == other
# 
#     def __str__(self):
#         return self.id
# 
#     def __repr__(self):
#         return "Prototype(name=%r, argument_types=%r, return_type=%r)" % (self.name, self.argument_types,
#                                                                           self.return_type)
# 
#     def __hash__(self):
#         return hash(self.id)
# 
# Path: muninn/language.py
# def parse_and_analyze(text, namespace_schemas={}, parameters={}):
#     return analyze(parse(text), namespace_schemas, parameters)
# 
# class Literal(AbstractSyntaxTreeNode):
#     def __init__(self, value):
#         self.value = value
# 
#     def __str__(self):
#         return "(%s %s)" % (type(self).__name__, self.value)
# 
# class Name(AbstractSyntaxTreeNode):
#     def __init__(self, value):
#         self.value = value
# 
#     def __str__(self):
#         return "(%s %s)" % (type(self).__name__, self.value)
# 
# Path: muninn/visitor.py
# class Visitor(object):
#     def visit(self, visitable, *args, **kwargs):
#         for type_ in inspect.getmro(type(visitable)):
#             try:
#                 visit_func = getattr(self, "visit_%s" % type_.__name__)
#             except AttributeError:
#                 pass
#             else:
#                 return visit_func(visitable, *args, **kwargs)
# 
#         try:
#             visit_func = getattr(self, "default")
#         except AttributeError:
#             pass
#         else:
#             return visit_func(visitable, *args, **kwargs)


# Path: muninn/database/sql.py
import collections
import inspect
import re
    from collections.abc import MutableMapping
    from collections import MutableMapping
from muninn.exceptions import *
from muninn.function import Prototype
from muninn.language import parse_and_analyze, Literal, Name
from muninn.schema import *
from muninn.visitor import Visitor


    subtract_rewriter = binary_operator_rewriter("-")
    rewriter_table[Prototype("-", (Long, Long), Long)] = subtract_rewriter
    rewriter_table[Prototype("-", (Long, Integer), Long)] = subtract_rewriter
    rewriter_table[Prototype("-", (Integer, Long), Long)] = subtract_rewriter
    rewriter_table[Prototype("-", (Integer, Integer), Integer)] = subtract_rewriter
    rewriter_table[Prototype("-", (Real, Real), Real)] = subtract_rewriter
    rewriter_table[Prototype("-", (Real, Long), Real)] = subtract_rewriter
    rewriter_table[Prototype("-", (Long, Real), Real)] = subtract_rewriter
    rewriter_table[Prototype("-", (Real, Integer), Real)] = subtract_rewriter
    rewriter_table[Prototype("-", (Integer, Real), Real)] = subtract_rewriter

    multiply_rewriter = binary_operator_rewriter("*")
    rewriter_table[Prototype("*", (Long, Long), Long)] = multiply_rewriter
    rewriter_table[Prototype("*", (Long, Integer), Long)] = multiply_rewriter
    rewriter_table[Prototype("*", (Integer, Long), Long)] = multiply_rewriter
    rewriter_table[Prototype("*", (Integer, Integer), Integer)] = multiply_rewriter
    rewriter_table[Prototype("*", (Real, Real), Real)] = multiply_rewriter
    rewriter_table[Prototype("*", (Real, Long), Real)] = multiply_rewriter
    rewriter_table[Prototype("*", (Long, Real), Real)] = multiply_rewriter
    rewriter_table[Prototype("*", (Real, Integer), Real)] = multiply_rewriter
    rewriter_table[Prototype("*", (Integer, Real), Real)] = multiply_rewriter

    divide_rewriter = binary_operator_rewriter("/")
    rewriter_table[Prototype("/", (Long, Long), Long)] = divide_rewriter
    rewriter_table[Prototype("/", (Long, Integer), Long)] = divide_rewriter
    rewriter_table[Prototype("/", (Integer, Long), Long)] = divide_rewriter
    rewriter_table[Prototype("/", (Integer, Integer), Integer)] = divide_rewriter
    rewriter_table[Prototype("/", (Real, Real), Real)] = divide_rewriter
    rewriter_table[Prototype("/", (Real, Long), Real)] = divide_rewriter

    rewriter_table[Prototype("/", (Long, Real), Real)] = divide_rewriter