def walk_constant(self, formula, args, **kwargs): """Returns a new theory object with the type of the constant.""" #pylint: disable=unused-argument theory_out = Theory() if formula.is_real_constant(): theory_out.real_arithmetic = True theory_out.real_difference = True elif formula.is_int_constant(): theory_out.integer_arithmetic = True theory_out.integer_difference = True elif formula.is_bv_constant(): theory_out.bit_vectors = True else: assert formula.is_bool_constant() return theory_out
def walk_constant(self, formula, args, **kwargs): """Returns a new theory object with the type of the constant.""" #pylint: disable=unused-argument theory_out = Theory() if formula.is_real_constant(): theory_out.real_arithmetic = True theory_out.real_difference = True elif formula.is_int_constant(): theory_out.integer_arithmetic = True theory_out.integer_difference = True elif formula.is_bv_constant(): theory_out.bit_vectors = True elif formula.is_string_constant(): theory_out.strings = True else: assert formula.is_bool_constant() return theory_out
def _theory_from_type(self, ty): theory = Theory() if ty.is_real_type(): theory.real_arithmetic = True theory.real_difference = True elif ty.is_int_type(): theory.integer_arithmetic = True theory.integer_difference = True elif ty.is_bool_type(): pass elif ty.is_bv_type(): theory.bit_vectors = True elif ty.is_array_type(): theory.arrays = True theory = theory.combine(self._theory_from_type(ty.index_type)) theory = theory.combine(self._theory_from_type(ty.elem_type)) elif ty.is_custom_type(): theory.custom_type = True else: # ty is either a function type theory.uninterpreted = True return theory
def _theory_from_type(self, ty): theory = Theory() if ty.is_real_type(): theory.real_arithmetic = True theory.real_difference = True elif ty.is_int_type(): theory.integer_arithmetic = True theory.integer_difference = True elif ty.is_bool_type(): pass elif ty.is_bv_type(): theory.bit_vectors = True elif ty.is_array_type(): theory.arrays = True theory = theory.combine(self._theory_from_type(ty.index_type)) theory = theory.combine(self._theory_from_type(ty.elem_type)) elif ty.is_string_type(): theory.strings = True elif ty.is_custom_type(): theory.custom_type = True else: # ty is either a function type theory.uninterpreted = True return theory