A library that helps testing correctness of algorithms for Boolean satisfiability problem.
pip install sat-heuristic-validator
from sat_heuristic_validator.dataset import only_3_cnf_dataset
from sat_heuristic_validator.struct import And
from sat_heuristic_validator.validation import validate, ValidationMode
def your_algorithm(f: And) -> bool:
...
validate(
algorithm=your_algorithm,
dataset=only_3_cnf_dataset(n=3),
validation_mode=ValidationMode.ALL_SAMPLES,
)
ValidationMode.SAMPLE
- output single incorrect sampleValidationMode.CONFUSION_MATRIX
- print confusion metricsValidationMode.ALL_SAMPLES
- print all incorrectly labeled samples
Check out examples.