Пример #1
0
    def walk_function(self, formula, args, **kwargs):
        """Extends the Theory with UF."""
        if len(args) == 1:
            theory_out = args[0].copy()
        elif len(args) > 1:
            theory_out = args[0]
            for t in args[1:]:
                theory_out = theory_out.combine(t)
        else:
            theory_out = Theory()

        theory_out.uninterpreted = True
        return theory_out
Пример #2
0
 def walk_function(self, formula, args, **kwargs):
     """Extends the Theory with UF."""
     #pylint: disable=unused-argument
     if len(args) == 1:
         theory_out = args[0].copy()
     elif len(args) > 1:
         theory_out = args[0]
         for t in args[1:]:
             theory_out = theory_out.combine(t)
     else:
         theory_out = Theory()
     theory_out.uninterpreted = True
     return theory_out
Пример #3
0
    def walk_function(self, formula, args):
        """Extends the Theory with UF."""
        if len(args) == 1:
            theory_out = args[0].copy()
        elif len(args) > 1:
            theory_out = args[0]
            for t in args[1:]:
                theory_out = theory_out.combine(t)
        else:
            theory_out = Theory()

        theory_out.uninterpreted = True
        return theory_out
Пример #4
0
 def walk_function(self, formula, args, **kwargs):
     """Extends the Theory with UF."""
     #pylint: disable=unused-argument
     if len(args) == 1:
         theory_out = args[0].copy()
     elif len(args) > 1:
         theory_out = args[0]
         for t in args[1:]:
             theory_out = theory_out.combine(t)
     else:
         theory_out = Theory()
     # Extend Theory with function return type
     rtype = formula.function_name().symbol_type().return_type
     theory_out = theory_out.combine(self._theory_from_type(rtype))
     theory_out.uninterpreted = True
     return theory_out
Пример #5
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
Пример #6
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