def declare_variable(self, var): if not var.is_symbol(): raise TypeError(var) if var.symbol_name() not in self.symbol_to_decl: tp = self._type_to_msat(var.symbol_type()) decl = mathsat.msat_declare_function(self.msat_env, var.symbol_name(), tp) self.symbol_to_decl[var] = decl self.decl_to_symbol[mathsat.msat_decl_id(decl)] = var
def declare_variable(self, var): if not var.is_symbol(): raise TypeError(var) if var.symbol_name() not in self.symbol_to_decl: tp = self._type_to_msat(var.symbol_type()) decl = mathsat.msat_declare_function(self.msat_env(), var.symbol_name(), tp) if mathsat.MSAT_ERROR_DECL(decl): msat_msg = mathsat.msat_last_error_message(self.msat_env()) raise InternalSolverError(msat_msg) self.symbol_to_decl[var] = decl self.decl_to_symbol[mathsat.msat_decl_id(decl)] = var