|
| 1 | +# sage_setup: distribution = sagemath-environment |
| 2 | +r""" |
| 3 | +Feature for testing the presence of SAT solvers |
| 4 | +""" |
| 5 | + |
| 6 | +from . import Executable, PythonModule |
| 7 | + |
| 8 | + |
| 9 | +class Glucose(Executable): |
| 10 | + r""" |
| 11 | + A :class:`~sage.features.Feature` describing the presence of an |
| 12 | + executable from the :ref:`Glucose SAT solver <spkg_glucose>`. |
| 13 | +
|
| 14 | + EXAMPLES:: |
| 15 | +
|
| 16 | + sage: from sage.features.sat import Glucose |
| 17 | + sage: GlucoseExecutable().is_present() # optional - glucose |
| 18 | + FeatureTestResult('glucose', True) |
| 19 | + """ |
| 20 | + def __init__(self, executable="glucose"): |
| 21 | + r""" |
| 22 | + TESTS:: |
| 23 | +
|
| 24 | + sage: from sage.features.sat import Glucose |
| 25 | + sage: isinstance(Glucose(), Glucose) |
| 26 | + True |
| 27 | + """ |
| 28 | + Executable.__init__(self, name=executable, executable=executable, |
| 29 | + spkg="glucose", type="optional") |
| 30 | + |
| 31 | + |
| 32 | +class Kissat(Executable): |
| 33 | + r""" |
| 34 | + A :class:`~sage.features.Feature` describing the presence of the |
| 35 | + :ref:`Kissat SAT solver <spkg_kissat>`. |
| 36 | +
|
| 37 | + EXAMPLES:: |
| 38 | +
|
| 39 | + sage: from sage.features.sat import Kissat |
| 40 | + sage: Kissat().is_present() # optional - kissat |
| 41 | + FeatureTestResult('kissat', True) |
| 42 | + """ |
| 43 | + def __init__(self): |
| 44 | + r""" |
| 45 | + TESTS:: |
| 46 | +
|
| 47 | + sage: from sage.features.sat import Kissat |
| 48 | + sage: isinstance(Kissat(), Kissat) |
| 49 | + True |
| 50 | + """ |
| 51 | + Executable.__init__(self, name="kissat", executable="kissat", |
| 52 | + spkg="kissat", type="optional") |
| 53 | + |
| 54 | + |
| 55 | +class Pycosat(PythonModule): |
| 56 | + r""" |
| 57 | + A :class:`~sage.features.Feature` describing the presence of :ref:`spkg_pycosat`. |
| 58 | +
|
| 59 | + EXAMPLES:: |
| 60 | +
|
| 61 | + sage: from sage.features.sat import Pycosat |
| 62 | + sage: PycosatExecutable().is_present() # optional - pycosat |
| 63 | + FeatureTestResult('pycosat', True) |
| 64 | + """ |
| 65 | + def __init__(self): |
| 66 | + r""" |
| 67 | + TESTS:: |
| 68 | +
|
| 69 | + sage: from sage.features.sat import Pycosat |
| 70 | + sage: isinstance(Pycosat(), Pycosat) |
| 71 | + True |
| 72 | + """ |
| 73 | + PythonModule.__init__(self, "pycosat", |
| 74 | + spkg="pycosat", type="optional") |
| 75 | + |
| 76 | + |
| 77 | +def all_features(): |
| 78 | + return [Glucose(), |
| 79 | + Kissat(), |
| 80 | + Pycosat()] |
0 commit comments