[Subversion] / PEAK-Rules / peak / rules / predicates.py  

Diff of /PEAK-Rules/peak/rules/predicates.py

Parent Directory | Revision Log

version 2647, Thu Aug 5 20:27:24 2010 UTC version 2648, Tue Aug 10 21:39:05 2010 UTC
Line 11 
Line 11 
   
 __all__ = [  __all__ = [
     'IsInstance', 'IsSubclass', 'Truth', 'Identity', 'Comparison',      'IsInstance', 'IsSubclass', 'Truth', 'Identity', 'Comparison',
     'IndexedEngine', 'predicate_node_for', 'meta_function'      'IndexedEngine', 'predicate_node_for', 'meta_function', 'expressionSignature',
 ]  ]
   
 abstract()  abstract()
Line 343 
Line 343 
             requires = []              requires = []
             exprs = self.all_exprs              exprs = self.all_exprs
             for _t, expr, criterion in tests_for(signature, self):              for _t, expr, criterion in tests_for(signature, self):
                   Ordering(self, expr).requires(requires)
                   requires.append(expr)
                   index_type = bitmap_index_type(self, expr)
                   if index_type is not None:
                 if expr not in exprs:                  if expr not in exprs:
                     exprs[expr] = 1                      exprs[expr] = 1
                     if always_testable(expr):                      if always_testable(expr):
                         Ordering(self, expr).requires([])                          Ordering(self, expr).requires([])
                 Ordering(self, expr).requires(requires)                      index_type(self, expr).add_case(case_id, criterion)
                 requires.append(expr)  
                 BitmapIndex(self, expr).add_case(case_id, criterion)  
         return super(IndexedEngine, self)._add_method(signature, rule)          return super(IndexedEngine, self)._add_method(signature, rule)
   
     def _generate_code(self):      def _generate_code(self):
Line 365 
Line 367 
         # Replace the entire engine with a new one          # Replace the entire engine with a new one
         Dispatching(self.function).create_engine(self.__class__)          Dispatching(self.function).create_engine(self.__class__)
   
   
   
     synchronized()      synchronized()
     def seed_bits(self, expr, cases):      def seed_bits(self, expr, cases):
         return BitmapIndex(self, expr).seed_bits(cases)          return BitmapIndex(self, expr).seed_bits(cases)
Line 449 
Line 449 
   
   
   
   when(bitmap_index_type,  (IndexedEngine, type(None)))(lambda en,ex:None)
   
 when(bitmap_index_type,  (IndexedEngine, IsInstance))(lambda en,ex:TypeIndex)  when(bitmap_index_type,  (IndexedEngine, IsInstance))(lambda en,ex:TypeIndex)
 when(bitmap_index_type,  (IndexedEngine, IsSubclass))(lambda en,ex:TypeIndex)  when(bitmap_index_type,  (IndexedEngine, IsSubclass))(lambda en,ex:TypeIndex)
   
Line 488 
Line 490 
   
   
   
   
   
 when(tests_for, (istype(tuple), Engine))  when(tests_for, (istype(tuple), Engine))
 def tests_for_tuple(ob, engine):  def tests_for_tuple(ob, engine):
     for cls, arg in zip(ob, engine.argnames):      for cls, arg in zip(ob, engine.argnames):


Generate output suitable for use with a patch program
Legend:
Removed from v.2647  
changed lines
  Added in v.2648

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help