<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def constant(self, val, ty):
 """ Creates a constant as a VexValue :param val: The value, as an integer :param ty: The type of the resulting VexValue :return: a VexValue """

        if isinstance(val, VexValue) and not isinstance(val, IRExpr):
            raise Exception('Constant cannot be made from VexValue or IRExpr')
        rdt = self.irsb_c.mkconst(val, ty)
        return VexValue(self.irsb_c, rdt)