Пример #1
0
 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
Пример #2
0
 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