Lines Matching defs:self

200 static void msat_dealloc(msat_solver *self);
202 static int msat_init(msat_solver * self, PyObject *args, PyObject *kwds);
254 msat_dealloc(msat_solver *self)
256 refcntcon_del(self->msat_clauses);
257 if (self->msat_instance != NULL)
258 solver_delete(self->msat_instance);
260 Py_TYPE(self)->tp_free((PyObject*) self);
262 self->ob_type->tp_free((PyObject*) self);
269 msat_solver *self = (msat_solver *) arg;
270 lbool ret = solver_addclause(self->msat_instance,
274 self->msat_needs_reset = 1;
281 msat_solver *self;
285 if ((self = (msat_solver *) type->tp_alloc(type, 0)) == NULL)
294 if ((self->msat_instance = solver_new()) == NULL) {
295 Py_DECREF(self);
298 self->msat_instance->verbosity = 0;
299 self->msat_needs_reset = 0;
300 self->msat_clauses = con_alloc(1000);
301 return (PyObject *) self;
305 Py_DECREF(self);
310 Py_DECREF(self);
314 Py_DECREF(self);
317 self->msat_instance = solver_new();
318 self->msat_instance->verbosity =
320 self->msat_clauses =
322 self->msat_needs_reset = 0;
323 con_iterptrs(self->msat_clauses, self, add_clauses);
324 return (PyObject *) self;
333 msat_init(msat_solver * self, PyObject *args, PyObject *kwds)
340 msat_reset(msat_solver *self, PyObject *args)
342 int v = self->msat_instance->verbosity;
343 solver_delete(self->msat_instance);
344 self->msat_instance = solver_new();
345 self->msat_needs_reset = 0;
346 self->msat_instance->verbosity = v;
351 msat_set_verbosity(msat_solver *self, PyObject *args)
358 self->msat_instance->verbosity = index;
364 msat_adjust(msat_solver *self, PyObject *args)
370 solver_setnvars(self->msat_instance, index);
377 msat_get_variables(msat_solver *self, PyObject *args)
379 if (self->msat_needs_reset)
382 return (Py_BuildValue("i", solver_nvars(self->msat_instance)));
387 msat_get_added_clauses(msat_solver *self, PyObject *args)
389 return (Py_BuildValue("i", solver_nclauses(self->msat_instance)));
430 msat_add_clause(msat_solver *self, PyObject *args)
437 if (self->msat_needs_reset)
446 con_addptr(self->msat_clauses, is);
453 ret = solver_addclause(self->msat_instance, is, &(is[n]));
458 self->msat_needs_reset = 1;
466 msat_solve(msat_solver *self, PyObject *args, PyObject *keywds)
477 if (self->msat_needs_reset)
495 ret = solver_solve(self->msat_instance, as, as_top);
503 self->msat_needs_reset = 1;
509 msat_dereference(msat_solver *self, PyObject *args)
513 if (self->msat_needs_reset)
519 if (self->msat_instance->model.ptr[literal] == l_True)