(self, token, mgr)
return res
Given a token and a FormulaManager, returns the pysmt representation of
        the token
Given a token and a FormulaManager, returns the pysmt representation of
        the token
Given a token and a FormulaManager returns the pysmt representation of the token
def atom(self, token, mgr):
        """
        Given a token and a FormulaManager, returns the pysmt representation of
        the token
        """
        res = self.cache.get(token)
        if res is None:
            if token.startswith("#"):
                # it is a BitVector
                value = None
                width = None
                if token[1] == "b":
                    # binary
                    width = len(token) - 2
                    value = int("0" + token[1:], 2)
                else:
                    if token[1] != "x":
                        raise PysmtSyntaxError("Invalid bit-vector constant "
                                               "'%s'" % token)
                    width = (len(token) - 2) * 4
                    value = int("0" + token[1:], 16)
                res = mgr.BV(value, width)
            elif token[0] == '"':
                # String constant
                val = token[1:-1]
                val = val.replace('""', '"')
                res = mgr.String(val)
            else:
                # it could be a number or a string
                try:
                    frac = Fraction(token)
                    if frac.denominator == 1:
                        # We found an integer, depending on the logic this can be
                        # an Int or a Real
                        if self.logic is None or \
                           self.logic.theory.integer_arithmetic:
                            if "." in token:
                                res = mgr.Real(frac)
                            else:
                                res = mgr.Int(frac.numerator)
                        else:
                            res = mgr.Real(frac)
                    else:
                        res = mgr.Real(frac)

                except ValueError:
                    # a string constant
                    res = token
            self.cache.bind(token, res)
        return res
def atom ( self , token , mgr ) : res = self . cache . get ( token ) if res is None : if token . startswith ( "#" ) : # it is a BitVector value = None width = None if token [ 1 ] == "b" : # binary width = len ( token ) - 2 value = int ( "0" + token [ 1 : ] , 2 ) else : if token [ 1 ] != "x" : raise PysmtSyntaxError ( "Invalid bit-vector constant " "'%s'" % token ) width = ( len ( token ) - 2 ) * 4 value = int ( "0" + token [ 1 : ] , 16 ) res = mgr . BV ( value , width ) elif token [ 0 ] == '"' : # String constant val = token [ 1 : - 1 ] val = val . replace ( '""' , '"' ) res = mgr . String ( val ) else : # it could be a number or a string try : frac = Fraction ( token ) if frac . denominator == 1 : # We found an integer, depending on the logic this can be # an Int or a Real if self . logic is None or self . logic . theory . integer_arithmetic : if "." in token : res = mgr . Real ( frac ) else : res = mgr . Int ( frac . numerator ) else : res = mgr . Real ( frac ) else : res = mgr . Real ( frac ) except ValueError : # a string constant res = token self . cache . bind ( token , res ) return res