(self, formula)
Cast a formula to real type.
Cast a formula to real type.
Cast a formula to real type .
def ToReal(self, formula):
        """ Cast a formula to real type. """
        t = self.env.stc.get_type(formula)
        if t == types.REAL:
            # Ignore casting of a Real
            return formula
        elif t == types.INT:
            if formula.is_int_constant():
                return self.Real(formula.constant_value())
            return self.create_node(node_type=op.TOREAL,
                                    args=(formula,))
        else:
            raise PysmtTypeError("Argument is of type %s, but INT was "
                                 "expected!\n" % t)
def ToReal ( self , formula ) : t = self . env . stc . get_type ( formula ) if t == types . REAL : # Ignore casting of a Real return formula elif t == types . INT : if formula . is_int_constant ( ) : return self . Real ( formula . constant_value ( ) ) return self . create_node ( node_type = op . TOREAL , args = ( formula , ) ) else : raise PysmtTypeError ( "Argument is of type %s, but INT was " "expected!\n" % t )