Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
lrat.proto
Go to the documentation of this file.
1// Copyright 2010-2025 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14// Proto used to store LRAT proofs (https://arxiv.org/abs/1612.02353) with some
15// extensions to support multi-threading (with one output file per file). This
16// proto is only used internally to store partial proofs on disk before merging
17// them. It can be changed without backward compatibility, and should not be
18// used directly by users.
19
20// LINT: LEGACY_NAMES
21syntax = "proto2";
22
23package operations_research.sat;
24
25// A clause imported from the input problem, or from another worker.
26message LratImportedClause {
27 optional int64 clause_id = 1;
28 repeated int32 literals = 2 [packed = true];
29}
30
31// An LRAT inferred clause.
32message LratInferredClause {
33 optional int64 clause_id = 1;
34 // Literals are represented with LiteralIndex values.
35 repeated int32 literals = 2 [packed = true];
36 // Clauses which become unit and possibly empty if all the `literals` are
37 // assumed to be false (verification stops at the first empty clause). This
38 // list must be in unit propagation order. See LratChecker for more details.
39 repeated int64 unit_ids = 3 [packed = true];
40
41 // If `rat_infos` is empty, the last `unit_ids` clause must become empty after
42 // unit propagation. If the last `unit_ids` clause does not become empty by
43 // unit propagation, then `rat_infos` must contain all the clauses which
44 // contain the negation of the first `literals` (called the pivot 'p') -- and
45 // no other clauses. Moreover, for each r in `rat_infos`, all the `r.unit_ids`
46 // clauses must become unit and eventually empty if all the literals of the
47 // `r.resolvant_id` clause (minus ~p), plus those in `literals`, are assumed
48 // to be false (this list must be in unit propagation order; verification
49 // stops at the first empty clause). See LratChecker for more details.
50 message RatInfo {
51 optional int64 resolvant_id = 1;
52 repeated int64 unit_ids = 2 [packed = true];
53 }
54 repeated RatInfo rat_infos = 4;
55
56 // Whether the clause must be exported, so that other workers can import it (a
57 // clause cannot be imported if it is not previously exported). This is not
58 // needed for unary and binary clauses, which are always exported.
59 optional bool exported = 5;
60}
61
62// A clause to export, so that it can be imported from any worker. This is not
63// needed for unary and binary clauses, which are always exported.
64message LratExportedClause {
65 optional int64 clause_id = 1;
66 repeated int32 literals = 2 [packed = true];
67}
68
69// A list of clauses to delete.
70message LratDeletedClauses {
71 // IDs of the imported or inferred clauses to delete. A deleted clause can no
72 // longer be used to infer clauses.
73 repeated int64 clause_ids = 1 [packed = true];
74}
75
76// An LRAT UNSAT proof is a sequence of steps, starting from imported clauses
77// and ending with the empty clause. At each step new clauses can be inferred
78// from previous ones (with an explicit proof), or imported from another proof
79// built by another thread. A proof step can also delete clauses which are no
80// longer needed, or export a clause for other workers to import. Each clause is
81// identified by a unique clause ID.
82message LratProofStep {
83 oneof step {
84 LratImportedClause imported_clause = 1;
85 LratInferredClause inferred_clause = 2;
86 LratExportedClause exported_clause = 3;
87 LratDeletedClauses deleted_clauses = 4;
88 }
89}