Example #1
0
        def rewrite_comp(self, symbol, name, comp):
            ct = self.symtab.clausetools

            # Get our parameters and our subquery's parameters and don't
            # rewrite them away, to ensure we don't mess up anyone's
            # params attribute in the symbol table.
            subqueries = Finder.run(comp)
            all_params = OrderedSet.from_union(q.params for q in subqueries)
            all_params.update(symbol.params)
            comp = ct.rewrite_with_patterns(comp, all_params)

            return comp
Example #2
0
 def rewrite_comp(self, symbol, name, comp):
     ct = self.symtab.clausetools
     
     # Get our parameters and our subquery's parameters and don't
     # rewrite them away, to ensure we don't mess up anyone's
     # params attribute in the symbol table.
     subqueries = Finder.run(comp)
     all_params = OrderedSet.from_union(
                     q.params for q in subqueries)
     all_params.update(symbol.params)
     comp = ct.rewrite_with_patterns(comp, all_params)
     
     return comp