python-sat 1.8.dev14__tar.gz → 1.8.dev16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of python-sat might be problematic. Click here for more details.
- {python_sat-1.8.dev14/python_sat.egg-info → python-sat-1.8.dev16}/PKG-INFO +1 -1
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/README.rst +10 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/pysat/__init__.py +1 -1
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/pysat/formula.py +7 -1
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/pysat/solvers.py +109 -6
- {python_sat-1.8.dev14 → python-sat-1.8.dev16/python_sat.egg-info}/PKG-INFO +1 -1
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/pysolvers.cc +151 -39
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/LICENSE.txt +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/MANIFEST.in +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/allies/__init__.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/allies/approxmc.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/allies/unigen.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/cardenc/bitwise.hh +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/cardenc/card.hh +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/cardenc/clset.hh +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/cardenc/common.hh +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/cardenc/itot.hh +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/cardenc/ladder.hh +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/cardenc/mto.hh +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/cardenc/pairwise.hh +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/cardenc/ptypes.hh +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/cardenc/pycard.cc +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/cardenc/seqcounter.hh +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/cardenc/sortcard.hh +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/cardenc/utils.hh +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/examples/__init__.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/examples/fm.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/examples/genhard.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/examples/hitman.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/examples/lbx.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/examples/lsu.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/examples/mcsls.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/examples/models.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/examples/musx.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/examples/optux.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/examples/rc2.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/examples/usage.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/pysat/_fileio.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/pysat/_utils.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/pysat/card.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/pysat/engines.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/pysat/pb.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/pysat/process.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/python_sat.egg-info/SOURCES.txt +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/python_sat.egg-info/dependency_links.txt +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/python_sat.egg-info/requires.txt +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/python_sat.egg-info/top_level.txt +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/requirements.txt +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/setup.cfg +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/setup.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/cadical103.tar.gz +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/cadical153.tar.gz +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/cadical170.tar.gz +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/cadical195.tar.gz +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/glucose30.tar.gz +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/glucose41.tar.gz +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/glucose421.tar.gz +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/lingeling.tar.gz +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/maplechrono.zip +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/maplecm.zip +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/maplesat.zip +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/mergesat3.tar.gz +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/minicard.tar.gz +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/minisat22.tar.gz +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/minisatgh.zip +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/cadical103.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/cadical153.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/cadical195.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/glucose30.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/glucose41.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/glucose421.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/gluecard30.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/gluecard41.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/lingeling.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/maplechrono.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/maplecm.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/maplesat.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/mergesat3.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/minicard.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/minisat22.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/patches/minisatgh.patch +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/solvers/prepare.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/tests/test_accum_stats.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/tests/test_atmost.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/tests/test_atmost1.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/tests/test_atmostk.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/tests/test_boolengine.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/tests/test_clausification.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/tests/test_cnf.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/tests/test_equals1.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/tests/test_formula_unique.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/tests/test_process.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/tests/test_propagate.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/tests/test_unique_model.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/tests/test_unique_mus.py +0 -0
- {python_sat-1.8.dev14 → python-sat-1.8.dev16}/tests/test_warmstart.py +0 -0
|
@@ -348,6 +348,16 @@ publication, please, acknowledge that fact by citing PySAT:
|
|
|
348
348
|
doi = {10.1007/978-3-319-94144-8_26}
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
+
@inproceedings{itk-sat24,
|
|
352
|
+
author = {Alexey Ignatiev and Zi Li Tan and Christos Karamanos},
|
|
353
|
+
title = {Towards Universally Accessible {SAT} Technology},
|
|
354
|
+
booktitle = {SAT},
|
|
355
|
+
pages = {4:1--4:11},
|
|
356
|
+
year = {2024},
|
|
357
|
+
url = {https://doi.org/10.4230/LIPIcs.SAT.2024.16},
|
|
358
|
+
doi = {10.4230/LIPICS.SAT.2024.16},
|
|
359
|
+
}
|
|
360
|
+
|
|
351
361
|
To-Do
|
|
352
362
|
-----
|
|
353
363
|
|
|
@@ -1169,7 +1169,8 @@ class Formula(object):
|
|
|
1169
1169
|
|
|
1170
1170
|
# then recursively iterate through the clauses
|
|
1171
1171
|
for cl in self._iter(outermost=True):
|
|
1172
|
-
|
|
1172
|
+
if PYSAT_TRUE.name not in cl:
|
|
1173
|
+
yield list(filter(lambda x: x != PYSAT_FALSE.name, cl))
|
|
1173
1174
|
|
|
1174
1175
|
def clausify(self):
|
|
1175
1176
|
"""
|
|
@@ -1451,6 +1452,11 @@ class Atom(Formula):
|
|
|
1451
1452
|
#==============================================================================
|
|
1452
1453
|
Formula.set_context('_global')
|
|
1453
1454
|
PYSAT_FALSE, PYSAT_TRUE = Atom(False), Atom(True)
|
|
1455
|
+
PYSAT_FALSE.name, PYSAT_TRUE.name = -0.5, 0.5 # special (floating-point) values for the constants
|
|
1456
|
+
# different from all variable names
|
|
1457
|
+
PYSAT_FALSE.clauses, PYSAT_TRUE.clauses = [[-0.5]], [[0.5]] # unit clauses for the constants
|
|
1458
|
+
# FALSE should turn into an empty clause;
|
|
1459
|
+
# while the clause for TRUE should be removed
|
|
1454
1460
|
Formula.set_context('default')
|
|
1455
1461
|
|
|
1456
1462
|
|
|
@@ -494,10 +494,13 @@ class Solver(object):
|
|
|
494
494
|
|
|
495
495
|
def configure(self, parameters):
|
|
496
496
|
"""
|
|
497
|
-
Configure :class:`Cadical153
|
|
498
|
-
some of the predefined parameters to
|
|
499
|
-
this method
|
|
500
|
-
`Cadical195` -- no other solvers
|
|
497
|
+
Configure :class:`Cadical153`, :class:`Cadical195`, and also
|
|
498
|
+
:class:`Glucose42` by setting some of the predefined parameters to
|
|
499
|
+
selected values. Note that this method is supposed to be invoked
|
|
500
|
+
only for :class:`Cadical153` and `Cadical195` -- no other solvers
|
|
501
|
+
support this for now. (Additionally, one can use it to set some of
|
|
502
|
+
the randomness related parameters in Glucose42. No other options
|
|
503
|
+
can be set for Glucose42.)
|
|
501
504
|
|
|
502
505
|
Also note that this call must follow the creation of the new
|
|
503
506
|
solver object; otherwise, an exception may be thrown.
|
|
@@ -507,11 +510,23 @@ class Solver(object):
|
|
|
507
510
|
assigned to is provided `here
|
|
508
511
|
<https://github.com/arminbiere/cadical/blob/master/src/options.hpp>`__.
|
|
509
512
|
|
|
510
|
-
|
|
513
|
+
The list of available options of :class:`Glucose42` includes:
|
|
514
|
+
|
|
515
|
+
* ``rnd-seed``: random seed (integer)
|
|
516
|
+
|
|
517
|
+
* ``rnd-freq``: frequency of random decisions (float, 0 <= value <= 1)
|
|
518
|
+
|
|
519
|
+
* ``rnd-init-act``: random initial activities (bool)
|
|
520
|
+
|
|
521
|
+
* ``rnd-pol``: random variable polarities when branching (bool)
|
|
522
|
+
|
|
523
|
+
* ``rnd-first-descent``: random decisions before the first conflic (bool)
|
|
524
|
+
|
|
525
|
+
:param parameters: parameter names mapped to integer/boolean/floating-point values
|
|
511
526
|
:type parameters: dict
|
|
512
527
|
"""
|
|
513
528
|
|
|
514
|
-
if self.solver and type(self.solver) in (Cadical153, Cadical195):
|
|
529
|
+
if self.solver and type(self.solver) in (Cadical153, Cadical195, Glucose42):
|
|
515
530
|
self.solver.configure(parameters)
|
|
516
531
|
|
|
517
532
|
def activate_atmost(self):
|
|
@@ -4358,6 +4373,94 @@ class Glucose42(object):
|
|
|
4358
4373
|
if self.glucose:
|
|
4359
4374
|
pysolvers.glucose421_setphases(self.glucose, literals)
|
|
4360
4375
|
|
|
4376
|
+
def configure(self, parameters):
|
|
4377
|
+
"""
|
|
4378
|
+
Configure randomness-related parameters of the solver. Parameters
|
|
4379
|
+
should be passed as a dictionary ``{"name": value}``. The list of
|
|
4380
|
+
available parameters includes:
|
|
4381
|
+
|
|
4382
|
+
* ``rnd-seed``: random seed (integer)
|
|
4383
|
+
|
|
4384
|
+
* ``rnd-freq``: frequency of random decisions (float, 0 <= value <= 1)
|
|
4385
|
+
|
|
4386
|
+
* ``rnd-init-act``: random initial activities (bool)
|
|
4387
|
+
|
|
4388
|
+
* ``rnd-pol``: random variable polarities when branching (bool)
|
|
4389
|
+
|
|
4390
|
+
* ``rnd-first-descent``: random decisions before the first conflic (bool)
|
|
4391
|
+
|
|
4392
|
+
:param parameters: parameter names mapped to integer/boolean/floating-point values
|
|
4393
|
+
:type parameters: dict
|
|
4394
|
+
"""
|
|
4395
|
+
|
|
4396
|
+
# we aren't checking if the solver object exists
|
|
4397
|
+
# because it is done in all the option setters
|
|
4398
|
+
if 'rnd-seed' in parameters:
|
|
4399
|
+
self.set_rnd_seed(parameters['rnd-seed'])
|
|
4400
|
+
elif 'rnd-freq' in parameters:
|
|
4401
|
+
self.set_rnd_freq(parameters['rnd-freq'])
|
|
4402
|
+
elif 'rnd-pol' in parameters:
|
|
4403
|
+
self.set_rnd_pol(parameters['rnd-pol'])
|
|
4404
|
+
elif 'rnd-init-act' in parameters:
|
|
4405
|
+
self.set_rnd_init_act(parameters['rnd-init-act'])
|
|
4406
|
+
elif 'rnd-first-descent' in parameters:
|
|
4407
|
+
self.set_rnd_first_descent(parameters['rnd-first-descent'])
|
|
4408
|
+
|
|
4409
|
+
def set_rnd_seed(self, seed):
|
|
4410
|
+
"""
|
|
4411
|
+
Sets the seed for the solver's PRNG.
|
|
4412
|
+
|
|
4413
|
+
:param seed: Random seed value to initialise the solver's PRNG.
|
|
4414
|
+
:type seed: int
|
|
4415
|
+
"""
|
|
4416
|
+
|
|
4417
|
+
if self.glucose:
|
|
4418
|
+
pysolvers.glucose421_set_rnd_seed(self.glucose, seed)
|
|
4419
|
+
|
|
4420
|
+
def set_rnd_freq(self, freq):
|
|
4421
|
+
"""
|
|
4422
|
+
Sets the frequency of random decisions.
|
|
4423
|
+
|
|
4424
|
+
:param freq: Frequency value, must be within :math:`[0, 1]`
|
|
4425
|
+
:type seed: float
|
|
4426
|
+
"""
|
|
4427
|
+
|
|
4428
|
+
if self.glucose:
|
|
4429
|
+
pysolvers.glucose421_set_rnd_freq(self.glucose, freq)
|
|
4430
|
+
|
|
4431
|
+
def set_rnd_pol(self, to_enable):
|
|
4432
|
+
"""
|
|
4433
|
+
Enables/disables random polarities, to be used when branching.
|
|
4434
|
+
|
|
4435
|
+
:param to_enable: If True, the solver will use random polarities
|
|
4436
|
+
:type to_enable: bool
|
|
4437
|
+
"""
|
|
4438
|
+
|
|
4439
|
+
if self.glucose:
|
|
4440
|
+
pysolvers.glucose421_set_rnd_pol(self.glucose, to_enable)
|
|
4441
|
+
|
|
4442
|
+
def set_rnd_init_act(self, to_enable):
|
|
4443
|
+
"""
|
|
4444
|
+
Enables/disables random values for initial variable activities.
|
|
4445
|
+
|
|
4446
|
+
:param to_enable: If True, the solver will randomly initialise variable activities
|
|
4447
|
+
:type to_enable: bool
|
|
4448
|
+
"""
|
|
4449
|
+
|
|
4450
|
+
if self.glucose:
|
|
4451
|
+
pysolvers.glucose421_set_rnd_init_act(self.glucose, to_enable)
|
|
4452
|
+
|
|
4453
|
+
def set_rnd_first_descent(self, to_enable):
|
|
4454
|
+
"""
|
|
4455
|
+
Sets the solver's behaviour during the first descent.
|
|
4456
|
+
|
|
4457
|
+
:param to_enable: If True, the solver will make random decision until the first conflict
|
|
4458
|
+
:type to_enable: bool
|
|
4459
|
+
"""
|
|
4460
|
+
|
|
4461
|
+
if self.glucose:
|
|
4462
|
+
pysolvers.glucose421_set_rnd_first_descent(self.glucose, to_enable)
|
|
4463
|
+
|
|
4361
4464
|
def get_status(self):
|
|
4362
4465
|
"""
|
|
4363
4466
|
Returns solver's status.
|
|
@@ -136,6 +136,19 @@ static char vreset_docstring[] = "Remove all the 'observed' variable flags"
|
|
|
136
136
|
"(CaDiCaL 1.9.5 only).";
|
|
137
137
|
static char isdeclit_docstring[] = "Get reason of valid observed literal "
|
|
138
138
|
"(CaDiCaL 1.9.5 only).";
|
|
139
|
+
static char set_rnd_seed_docstring[] = "Set PNRG seed "
|
|
140
|
+
"(Glucose 4.2.1 only).";
|
|
141
|
+
static char set_rnd_freq_docstring[] = "Set frequency of random decisions "
|
|
142
|
+
"(Glucose 4.2.1 only).";
|
|
143
|
+
static char set_rnd_pol_docstring[] = "Randomize polarities on branching "
|
|
144
|
+
"(Glucose 4.2.1 only).";
|
|
145
|
+
static char set_rnd_init_act_docstring[] = "Randomize initial activities "
|
|
146
|
+
"(Glucose 4.2.1 only).";
|
|
147
|
+
static char set_rnd_first_descent_docstring[] = "Randomize decisions until first conflict "
|
|
148
|
+
"(Glucose 4.2.1 only).";
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
139
152
|
|
|
140
153
|
static PyObject *SATError;
|
|
141
154
|
static jmp_buf env;
|
|
@@ -294,25 +307,30 @@ extern "C" {
|
|
|
294
307
|
static PyObject *py_glucose41_acc_stats (PyObject *, PyObject *);
|
|
295
308
|
#endif
|
|
296
309
|
#ifdef WITH_GLUCOSE421
|
|
297
|
-
static PyObject *py_glucose421_new
|
|
298
|
-
static PyObject *py_glucose421_set_start
|
|
299
|
-
static PyObject *py_glucose421_add_cl
|
|
300
|
-
static PyObject *py_glucose421_solve
|
|
301
|
-
static PyObject *py_glucose421_solve_lim
|
|
302
|
-
static PyObject *py_glucose421_propagate
|
|
303
|
-
static PyObject *py_glucose421_setphases
|
|
304
|
-
static PyObject *py_glucose421_cbudget
|
|
305
|
-
static PyObject *py_glucose421_pbudget
|
|
306
|
-
static PyObject *py_glucose421_interrupt
|
|
307
|
-
static PyObject *py_glucose421_clearint
|
|
308
|
-
static PyObject *py_glucose421_setincr
|
|
309
|
-
static PyObject *py_glucose421_tracepr
|
|
310
|
-
static PyObject *py_glucose421_core
|
|
311
|
-
static PyObject *py_glucose421_model
|
|
312
|
-
static PyObject *py_glucose421_nof_vars
|
|
313
|
-
static PyObject *py_glucose421_nof_cls
|
|
314
|
-
static PyObject *py_glucose421_del
|
|
315
|
-
static PyObject *py_glucose421_acc_stats
|
|
310
|
+
static PyObject *py_glucose421_new (PyObject *, PyObject *);
|
|
311
|
+
static PyObject *py_glucose421_set_start (PyObject *, PyObject *);
|
|
312
|
+
static PyObject *py_glucose421_add_cl (PyObject *, PyObject *);
|
|
313
|
+
static PyObject *py_glucose421_solve (PyObject *, PyObject *);
|
|
314
|
+
static PyObject *py_glucose421_solve_lim (PyObject *, PyObject *);
|
|
315
|
+
static PyObject *py_glucose421_propagate (PyObject *, PyObject *);
|
|
316
|
+
static PyObject *py_glucose421_setphases (PyObject *, PyObject *);
|
|
317
|
+
static PyObject *py_glucose421_cbudget (PyObject *, PyObject *);
|
|
318
|
+
static PyObject *py_glucose421_pbudget (PyObject *, PyObject *);
|
|
319
|
+
static PyObject *py_glucose421_interrupt (PyObject *, PyObject *);
|
|
320
|
+
static PyObject *py_glucose421_clearint (PyObject *, PyObject *);
|
|
321
|
+
static PyObject *py_glucose421_setincr (PyObject *, PyObject *);
|
|
322
|
+
static PyObject *py_glucose421_tracepr (PyObject *, PyObject *);
|
|
323
|
+
static PyObject *py_glucose421_core (PyObject *, PyObject *);
|
|
324
|
+
static PyObject *py_glucose421_model (PyObject *, PyObject *);
|
|
325
|
+
static PyObject *py_glucose421_nof_vars (PyObject *, PyObject *);
|
|
326
|
+
static PyObject *py_glucose421_nof_cls (PyObject *, PyObject *);
|
|
327
|
+
static PyObject *py_glucose421_del (PyObject *, PyObject *);
|
|
328
|
+
static PyObject *py_glucose421_acc_stats (PyObject *, PyObject *);
|
|
329
|
+
static PyObject *py_glucose421_set_rnd_seed (PyObject *, PyObject *);
|
|
330
|
+
static PyObject *py_glucose421_set_rnd_freq (PyObject *, PyObject *);
|
|
331
|
+
static PyObject *py_glucose421_set_rnd_pol (PyObject *, PyObject *);
|
|
332
|
+
static PyObject *py_glucose421_set_rnd_init_act (PyObject *, PyObject *);
|
|
333
|
+
static PyObject *py_glucose421_set_rnd_first_descent (PyObject *, PyObject *);
|
|
316
334
|
#endif
|
|
317
335
|
#ifdef WITH_LINGELING
|
|
318
336
|
static PyObject *py_lingeling_new (PyObject *, PyObject *);
|
|
@@ -618,25 +636,30 @@ static PyMethodDef module_methods[] = {
|
|
|
618
636
|
{ "glucose41_acc_stats", py_glucose41_acc_stats, METH_VARARGS, acc_stat_docstring },
|
|
619
637
|
#endif
|
|
620
638
|
#ifdef WITH_GLUCOSE421
|
|
621
|
-
{ "glucose421_new",
|
|
622
|
-
{ "glucose421_set_start",
|
|
623
|
-
{ "glucose421_add_cl",
|
|
624
|
-
{ "glucose421_solve",
|
|
625
|
-
{ "glucose421_solve_lim",
|
|
626
|
-
{ "glucose421_propagate",
|
|
627
|
-
{ "glucose421_setphases",
|
|
628
|
-
{ "glucose421_cbudget",
|
|
629
|
-
{ "glucose421_pbudget",
|
|
630
|
-
{ "glucose421_interrupt",
|
|
631
|
-
{ "glucose421_clearint",
|
|
632
|
-
{ "glucose421_setincr",
|
|
633
|
-
{ "glucose421_tracepr",
|
|
634
|
-
{ "glucose421_core",
|
|
635
|
-
{ "glucose421_model",
|
|
636
|
-
{ "glucose421_nof_vars",
|
|
637
|
-
{ "glucose421_nof_cls",
|
|
638
|
-
{ "glucose421_del",
|
|
639
|
-
{ "glucose421_acc_stats",
|
|
639
|
+
{ "glucose421_new", py_glucose421_new, METH_VARARGS, new_docstring },
|
|
640
|
+
{ "glucose421_set_start", py_glucose421_set_start, METH_VARARGS, setstart_docstring },
|
|
641
|
+
{ "glucose421_add_cl", py_glucose421_add_cl, METH_VARARGS, addcl_docstring },
|
|
642
|
+
{ "glucose421_solve", py_glucose421_solve, METH_VARARGS, solve_docstring },
|
|
643
|
+
{ "glucose421_solve_lim", py_glucose421_solve_lim, METH_VARARGS, lim_docstring },
|
|
644
|
+
{ "glucose421_propagate", py_glucose421_propagate, METH_VARARGS, prop_docstring },
|
|
645
|
+
{ "glucose421_setphases", py_glucose421_setphases, METH_VARARGS, phases_docstring },
|
|
646
|
+
{ "glucose421_cbudget", py_glucose421_cbudget, METH_VARARGS, cbudget_docstring },
|
|
647
|
+
{ "glucose421_pbudget", py_glucose421_pbudget, METH_VARARGS, pbudget_docstring },
|
|
648
|
+
{ "glucose421_interrupt", py_glucose421_interrupt, METH_VARARGS, interrupt_docstring },
|
|
649
|
+
{ "glucose421_clearint", py_glucose421_clearint, METH_VARARGS, clearint_docstring },
|
|
650
|
+
{ "glucose421_setincr", py_glucose421_setincr, METH_VARARGS, setincr_docstring },
|
|
651
|
+
{ "glucose421_tracepr", py_glucose421_tracepr, METH_VARARGS, tracepr_docstring },
|
|
652
|
+
{ "glucose421_core", py_glucose421_core, METH_VARARGS, core_docstring },
|
|
653
|
+
{ "glucose421_model", py_glucose421_model, METH_VARARGS, model_docstring },
|
|
654
|
+
{ "glucose421_nof_vars", py_glucose421_nof_vars, METH_VARARGS, nvars_docstring },
|
|
655
|
+
{ "glucose421_nof_cls", py_glucose421_nof_cls, METH_VARARGS, ncls_docstring },
|
|
656
|
+
{ "glucose421_del", py_glucose421_del, METH_VARARGS, del_docstring },
|
|
657
|
+
{ "glucose421_acc_stats", py_glucose421_acc_stats, METH_VARARGS, acc_stat_docstring },
|
|
658
|
+
{ "glucose421_set_rnd_seed", py_glucose421_set_rnd_seed, METH_VARARGS, set_rnd_seed_docstring },
|
|
659
|
+
{ "glucose421_set_rnd_freq", py_glucose421_set_rnd_freq, METH_VARARGS, set_rnd_freq_docstring },
|
|
660
|
+
{ "glucose421_set_rnd_pol", py_glucose421_set_rnd_pol, METH_VARARGS, set_rnd_pol_docstring },
|
|
661
|
+
{ "glucose421_set_rnd_init_act", py_glucose421_set_rnd_init_act, METH_VARARGS, set_rnd_init_act_docstring },
|
|
662
|
+
{ "glucose421_set_rnd_first_descent", py_glucose421_set_rnd_first_descent, METH_VARARGS, set_rnd_first_descent_docstring },
|
|
640
663
|
#endif
|
|
641
664
|
#ifdef WITH_LINGELING
|
|
642
665
|
{ "lingeling_new", py_lingeling_new, METH_VARARGS, new_docstring },
|
|
@@ -5837,7 +5860,6 @@ static PyObject *py_glucose421_new(PyObject *self, PyObject *args)
|
|
|
5837
5860
|
"Cannot create a new solver.");
|
|
5838
5861
|
return NULL;
|
|
5839
5862
|
}
|
|
5840
|
-
|
|
5841
5863
|
return void_to_pyobj((void *)s);
|
|
5842
5864
|
}
|
|
5843
5865
|
|
|
@@ -6205,6 +6227,96 @@ static PyObject *py_glucose421_setincr(PyObject *self, PyObject *args)
|
|
|
6205
6227
|
Py_RETURN_NONE;
|
|
6206
6228
|
}
|
|
6207
6229
|
|
|
6230
|
+
//
|
|
6231
|
+
//=============================================================================
|
|
6232
|
+
static PyObject *py_glucose421_set_rnd_seed(PyObject *self, PyObject *args)
|
|
6233
|
+
{
|
|
6234
|
+
PyObject *s_obj;
|
|
6235
|
+
double dbl;
|
|
6236
|
+
|
|
6237
|
+
if (!PyArg_ParseTuple(args, "Od", &s_obj, &dbl))
|
|
6238
|
+
return NULL;
|
|
6239
|
+
|
|
6240
|
+
// get pointer to solver
|
|
6241
|
+
Glucose421::Solver *s = (Glucose421::Solver *)pyobj_to_void(s_obj);
|
|
6242
|
+
|
|
6243
|
+
s->random_seed = dbl;
|
|
6244
|
+
|
|
6245
|
+
Py_RETURN_NONE;
|
|
6246
|
+
}
|
|
6247
|
+
|
|
6248
|
+
//
|
|
6249
|
+
//=============================================================================
|
|
6250
|
+
static PyObject *py_glucose421_set_rnd_freq(PyObject *self, PyObject *args)
|
|
6251
|
+
{
|
|
6252
|
+
PyObject *s_obj;
|
|
6253
|
+
double dbl;
|
|
6254
|
+
|
|
6255
|
+
if (!PyArg_ParseTuple(args, "Od", &s_obj, &dbl))
|
|
6256
|
+
return NULL;
|
|
6257
|
+
|
|
6258
|
+
// get pointer to solver
|
|
6259
|
+
Glucose421::Solver *s = (Glucose421::Solver *)pyobj_to_void(s_obj);
|
|
6260
|
+
|
|
6261
|
+
s->random_var_freq = dbl;
|
|
6262
|
+
|
|
6263
|
+
Py_RETURN_NONE;
|
|
6264
|
+
}
|
|
6265
|
+
|
|
6266
|
+
//
|
|
6267
|
+
//=============================================================================
|
|
6268
|
+
static PyObject *py_glucose421_set_rnd_pol(PyObject *self, PyObject *args)
|
|
6269
|
+
{
|
|
6270
|
+
PyObject *s_obj;
|
|
6271
|
+
int b;
|
|
6272
|
+
|
|
6273
|
+
if (!PyArg_ParseTuple(args, "Op", &s_obj, &b))
|
|
6274
|
+
return NULL;
|
|
6275
|
+
|
|
6276
|
+
// get pointer to solver
|
|
6277
|
+
Glucose421::Solver *s = (Glucose421::Solver *)pyobj_to_void(s_obj);
|
|
6278
|
+
|
|
6279
|
+
s->rnd_pol = (bool) b;
|
|
6280
|
+
|
|
6281
|
+
Py_RETURN_NONE;
|
|
6282
|
+
}
|
|
6283
|
+
|
|
6284
|
+
//
|
|
6285
|
+
//=============================================================================
|
|
6286
|
+
static PyObject *py_glucose421_set_rnd_init_act(PyObject *self, PyObject *args)
|
|
6287
|
+
{
|
|
6288
|
+
PyObject *s_obj;
|
|
6289
|
+
int b;
|
|
6290
|
+
|
|
6291
|
+
if (!PyArg_ParseTuple(args, "Op", &s_obj, &b))
|
|
6292
|
+
return NULL;
|
|
6293
|
+
|
|
6294
|
+
// get pointer to solver
|
|
6295
|
+
Glucose421::Solver *s = (Glucose421::Solver *)pyobj_to_void(s_obj);
|
|
6296
|
+
|
|
6297
|
+
s->rnd_init_act = (bool) b;
|
|
6298
|
+
|
|
6299
|
+
Py_RETURN_NONE;
|
|
6300
|
+
}
|
|
6301
|
+
|
|
6302
|
+
//
|
|
6303
|
+
//=============================================================================
|
|
6304
|
+
static PyObject *py_glucose421_set_rnd_first_descent(PyObject *self, PyObject *args)
|
|
6305
|
+
{
|
|
6306
|
+
PyObject *s_obj;
|
|
6307
|
+
int b;
|
|
6308
|
+
|
|
6309
|
+
if (!PyArg_ParseTuple(args, "Op", &s_obj, &b))
|
|
6310
|
+
return NULL;
|
|
6311
|
+
|
|
6312
|
+
// get pointer to solver
|
|
6313
|
+
Glucose421::Solver *s = (Glucose421::Solver *)pyobj_to_void(s_obj);
|
|
6314
|
+
|
|
6315
|
+
s->randomizeFirstDescent = (bool) b;
|
|
6316
|
+
|
|
6317
|
+
Py_RETURN_NONE;
|
|
6318
|
+
}
|
|
6319
|
+
|
|
6208
6320
|
//
|
|
6209
6321
|
//=============================================================================
|
|
6210
6322
|
static PyObject *py_glucose421_tracepr(PyObject *self, PyObject *args)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|