Crates.io | drcp-format |
lib.rs | drcp-format |
version | 0.2.0 |
source | src |
created_at | 2024-10-16 15:04:24.66846 |
updated_at | 2024-11-05 10:59:09.066341 |
description | Parse and write DRCP and literal definition files. |
homepage | |
repository | https://github.com/consol-lab/pumpkin |
max_upload_size | |
id | 1411906 |
size | 46,729 |
The Deletion Reverse Constraint Propagation format describes how a constraint programming solver proves unsatisfiability or optimality. This is a Rust library which provides a reader and writer of DRCP proof files, as well as the accompanying literal mapping file.
In a DRCP proof, the smallest building block is an atomic constraint, which describes a fact about the domain of a single variable. An atomic constraint has the form [x <op> v]
, where x
is an integer variable, <op>
is one of ==, !=, <=, >=
, and v
is an integer constant. In a DRCP proof, the proof uses integer identifiers to refer to atomic constraints. A mapping of identifiers to atomic constraints is a .lits
file, and looks like this:
1 [x1 >= 1]
2 [x2 <= 2]
Each line starts with a non-zero integer which is the identifier, then a space, and then the atomic constraint.
Atomic constraints are used in the following proof steps:
An inference step encodes the propagation of an atomic constraint. The inference step has the following format:
i <step_id> <premises> [0 <propagated>] [c:<constraint tag>] [l:<filtering algorithm>]
The individual components:
<step_id>
: A non-zero integer which serves as a unique identifier for the step in the proof.<premises>
A space-separated list of atomic constraint identfiers.<propagated>
A single atomic constraint identifier.c:<constraint tag>
: Optional. A hint which constraint triggered the inference.l:<filtering algorithm>
: Optional. A hint which filtering algorithm identified the inference.If there is no <propagated>
, then the inference reads that the premises imply false.
I.e., the premises form a nogood which is enforced by a propagator.
A nogood step encodes a partial assignment which cannot be extended to a solution.
n <step_id> <atomic constraint ids> [0 <propagation hint>]
The individual components:
<step_id>
: A non-zero integer which serves as a unique identifier for the step in the proof.<atomic constraint ids>
A space-separated list of atomic constraint identfiers. These encode the nogood as a clause.0 <propagation hint>
: Optional. A hint which is a separated list of step ids, noting what order the steps can be applied to derive this nogood.A deletion step can be used to indicate a nogood will no-longer be used in the derivation of new nogoods.
d <step_id>
The conclusion finishes the proof. It is either the claim the problem is unsatisfiable:
c UNSAT
Or it is the claim of a dual bound for the objective variable:
c <objective bound>
where <objective bound>
is an atomic constraint id encoding the dual bound on the objective variable.