예제 #1
0
 def applies(self, P, _is_constant, _symbols):
     try:
         get_conversion(self.castable_to,
                        P)  # XXX: will have to invert this
     except NotLeq:
         msg = 'Could not find a conversion from %s to %s.' % (
             P, self.castable_to)
         raise_desc(OpSpecDoesntMatch, msg)
예제 #2
0
 def applies(self, rtype, is_constant, symbols):
     # needs to match
     self.other.applies(rtype, is_constant, symbols)
     
     if self.symbol in symbols:
         R0 = symbols[self.symbol] 
         try:
             get_conversion(R0, rtype) # XXX: will have to invert this
         except NotLeq:
             msg = 'Could not convert %s to %s.' % (rtype, R0) 
             raise_desc(OpSpecDoesntMatch, msg)
     else:
         symbols[self.symbol] = rtype
예제 #3
0
    def applies(self, rtype, is_constant, symbols):
        # needs to match
        self.other.applies(rtype, is_constant, symbols)

        if self.symbol in symbols:
            R0 = symbols[self.symbol]
            try:
                get_conversion(R0, rtype)  # XXX: will have to invert this
            except NotLeq:
                msg = 'Could not convert %s to %s.' % (rtype, R0)
                raise_desc(OpSpecDoesntMatch, msg)
        else:
            symbols[self.symbol] = rtype
예제 #4
0
 def applies(self, P, _is_constant, _symbols):
     try:
         get_conversion(self.castable_to, P) # XXX: will have to invert this
     except NotLeq:
         msg = 'Could not find a conversion from %s to %s.' % (P, self.castable_to)
         raise_desc(OpSpecDoesntMatch, msg)
예제 #5
0
def Conversion_a():
    A = parse_poset('kg')
    B = parse_poset('g')
    return get_conversion(A, B)
예제 #6
0
파일: primitivedps.py 프로젝트: rusi/mcdp
def Conversion_a():
    A = parse_poset('kg')
    B = parse_poset('g')
    return get_conversion(A, B)