Coverage for sparkle/types/status.py: 100%
17 statements
« prev ^ index » next coverage.py v7.10.7, created at 2025-09-29 10:17 +0000
« prev ^ index » next coverage.py v7.10.7, created at 2025-09-29 10:17 +0000
1"""Class for solver status."""
3from __future__ import annotations
4from enum import Enum
7class SolverStatus(str, Enum):
8 """Possible return states for solver runs."""
10 SUCCESS = "SUCCESS" # Positive status
11 SAT = "SAT" # SAT specific positive status
12 UNSAT = "UNSAT" # SAT specific positive status
14 # Negative status
15 UNKNOWN = "UNKNOWN"
16 CRASHED = "CRASHED"
17 TIMEOUT = "TIMEOUT"
18 WRONG = "WRONG"
19 ERROR = "ERROR"
20 KILLED = "KILLED"
22 def __str__(self: SolverStatus) -> str:
23 """Return the string value of the SolverStatus."""
24 return str(self.value)
26 @property
27 def positive(self: SolverStatus) -> bool:
28 """Return whether the status is positive."""
29 return self in [SolverStatus.SUCCESS, SolverStatus.SAT, SolverStatus.UNSAT]