<ahref="drat__checker_8h.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aid="l00001"name="l00001"></a><spanclass="lineno"> 1</span><spanclass="comment">// Copyright 2010-2021 Google LLC</span></div>
<divclass="line"><aid="l00002"name="l00002"></a><spanclass="lineno"> 2</span><spanclass="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div>
<divclass="line"><aid="l00003"name="l00003"></a><spanclass="lineno"> 3</span><spanclass="comment">// you may not use this file except in compliance with the License.</span></div>
<divclass="line"><aid="l00004"name="l00004"></a><spanclass="lineno"> 4</span><spanclass="comment">// You may obtain a copy of the License at</span></div>
<divclass="line"><aid="l00008"name="l00008"></a><spanclass="lineno"> 8</span><spanclass="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
<divclass="line"><aid="l00009"name="l00009"></a><spanclass="lineno"> 9</span><spanclass="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div>
<divclass="line"><aid="l00010"name="l00010"></a><spanclass="lineno"> 10</span><spanclass="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<divclass="line"><aid="l00011"name="l00011"></a><spanclass="lineno"> 11</span><spanclass="comment">// See the License for the specific language governing permissions and</span></div>
<divclass="line"><aid="l00012"name="l00012"></a><spanclass="lineno"> 12</span><spanclass="comment">// limitations under the License.</span></div>
<divclass="line"><aid="l00037"name="l00037"></a><spanclass="lineno"> 37</span><spanclass="comment">// DRAT is a SAT proof format that allows a simple program to check that a</span></div>
<divclass="line"><aid="l00038"name="l00038"></a><spanclass="lineno"> 38</span><spanclass="comment">// problem is really UNSAT. The description of the format and a checker are</span></div>
<divclass="line"><aid="l00039"name="l00039"></a><spanclass="lineno"> 39</span><spanclass="comment">// available at http://www.cs.utexas.edu/~marijn/drat-trim/. This class checks</span></div>
<divclass="line"><aid="l00040"name="l00040"></a><spanclass="lineno"> 40</span><spanclass="comment">// that a DRAT proof is valid.</span></div>
<divclass="line"><aid="l00042"name="l00042"></a><spanclass="lineno"> 42</span><spanclass="comment">// Note that DRAT proofs are often huge (can be GB), and can take about as much</span></div>
<divclass="line"><aid="l00043"name="l00043"></a><spanclass="lineno"> 43</span><spanclass="comment">// time to check as it takes to find the proof in the first place!</span></div>
<divclass="line"><aid="l00049"name="l00049"></a><spanclass="lineno"> 49</span><spanclass="comment">// Returns the number of Boolean variables used in the problem and infered</span></div>
<divclass="line"><aid="l00053"name="l00053"></a><spanclass="lineno"> 53</span><spanclass="comment">// Adds a clause of the problem that must be checked. The problem clauses must</span></div>
<divclass="line"><aid="l00054"name="l00054"></a><spanclass="lineno"> 54</span><spanclass="comment">// be added first, before any infered clause. The given clause must not</span></div>
<divclass="line"><aid="l00055"name="l00055"></a><spanclass="lineno"> 55</span><spanclass="comment">// contain a literal and its negation. Must not be called after Check().</span></div>
<divclass="line"><aid="l00058"name="l00058"></a><spanclass="lineno"> 58</span><spanclass="comment">// Adds a clause which is infered from the problem clauses and the previously</span></div>
<divclass="line"><aid="l00059"name="l00059"></a><spanclass="lineno"> 59</span><spanclass="comment">// infered clauses (that are have not been deleted). Infered clauses must be</span></div>
<divclass="line"><aid="l00060"name="l00060"></a><spanclass="lineno"> 60</span><spanclass="comment">// added after the problem clauses. Clauses with the Reverse Asymetric</span></div>
<divclass="line"><aid="l00061"name="l00061"></a><spanclass="lineno"> 61</span><spanclass="comment">// Tautology (RAT) property for literal l must start with this literal. The</span></div>
<divclass="line"><aid="l00062"name="l00062"></a><spanclass="lineno"> 62</span><spanclass="comment">// given clause must not contain a literal and its negation. Must not be</span></div>
<divclass="line"><aid="l00063"name="l00063"></a><spanclass="lineno"> 63</span><spanclass="comment">// called after Check().</span></div>
<divclass="line"><aid="l00066"name="l00066"></a><spanclass="lineno"> 66</span><spanclass="comment">// Deletes a problem or infered clause. The order of the literals does not</span></div>
<divclass="line"><aid="l00067"name="l00067"></a><spanclass="lineno"> 67</span><spanclass="comment">// matter. In particular, it can be different from the order that was used</span></div>
<divclass="line"><aid="l00068"name="l00068"></a><spanclass="lineno"> 68</span><spanclass="comment">// when the clause was added. Must not be called after Check().</span></div>
<divclass="line"><aid="l00071"name="l00071"></a><spanclass="lineno"> 71</span><spanclass="comment">// Checks that the infered clauses form a DRAT proof that the problem clauses</span></div>
<divclass="line"><aid="l00072"name="l00072"></a><spanclass="lineno"> 72</span><spanclass="comment">// are UNSAT. For this the last added infered clause must be the empty clause</span></div>
<divclass="line"><aid="l00073"name="l00073"></a><spanclass="lineno"> 73</span><spanclass="comment">// and each infered clause must have either the Reverse Unit Propagation (RUP)</span></div>
<divclass="line"><aid="l00074"name="l00074"></a><spanclass="lineno"> 74</span><spanclass="comment">// or the Reverse Asymetric Tautology (RAT) property with respect to the</span></div>
<divclass="line"><aid="l00075"name="l00075"></a><spanclass="lineno"> 75</span><spanclass="comment">// problem clauses and the previously infered clauses which are not deleted.</span></div>
<divclass="line"><aid="l00076"name="l00076"></a><spanclass="lineno"> 76</span><spanclass="comment">// Returns VALID if the proof is valid, INVALID if it is not, and UNKNOWN if</span></div>
<divclass="line"><aid="l00077"name="l00077"></a><spanclass="lineno"> 77</span><spanclass="comment">// the check timed out.</span></div>
<divclass="line"><aid="l00078"name="l00078"></a><spanclass="lineno"> 78</span><spanclass="comment">// WARNING: no new clause must be added or deleted after this method has been</span></div>
<divclass="line"><aid="l00087"name="l00087"></a><spanclass="lineno"> 87</span><spanclass="comment">// Returns a subproblem of the original problem that is already UNSAT. The</span></div>
<divclass="line"><aid="l00088"name="l00088"></a><spanclass="lineno"> 88</span><spanclass="comment">// result is undefined if Check() was not previously called, or did not return</span></div>
<divclass="line"><aid="l00092"name="l00092"></a><spanclass="lineno"> 92</span><spanclass="comment">// Returns a DRAT proof that GetUnsatSubProblem() is UNSAT. The result is</span></div>
<divclass="line"><aid="l00093"name="l00093"></a><spanclass="lineno"> 93</span><spanclass="comment">// undefined if Check() was not previously called, or did not return true.</span></div>
<divclass="line"><aid="l00097"name="l00097"></a><spanclass="lineno"> 97</span><spanclass="comment">// A problem or infered clause. The literals are specified as a subrange of</span></div>
<divclass="line"><aid="l00098"name="l00098"></a><spanclass="lineno"> 98</span><spanclass="comment">// 'literals_' (namely the subrange from 'first_literal_index' to</span></div>
<divclass="line"><aid="l00099"name="l00099"></a><spanclass="lineno"> 99</span><spanclass="comment">// 'first_literal_index' + 'num_literals' - 1), and are sorted in increasing</span></div>
<divclass="line"><aid="l00100"name="l00100"></a><spanclass="lineno"> 100</span><spanclass="comment">// order *before Check() is called*.</span></div>
<divclass="line"><aid="l00102"name="l00102"></a><spanclass="lineno"> 102</span><spanclass="comment">// The index of the first literal of this clause in 'literals_'.</span></div>
<divclass="line"><aid="l00104"name="l00104"></a><spanclass="lineno"> 104</span><spanclass="comment">// The number of literals of this clause.</span></div>
<divclass="line"><aid="l00107"name="l00107"></a><spanclass="lineno"> 107</span><spanclass="comment">// The clause literal to use to check the RAT property, or kNoLiteralIndex</span></div>
<divclass="line"><aid="l00108"name="l00108"></a><spanclass="lineno"> 108</span><spanclass="comment">// for problem clauses and empty infered clauses.</span></div>
<divclass="line"><aid="l00111"name="l00111"></a><spanclass="lineno"> 111</span><spanclass="comment">// The *current* number of copies of this clause. This number is incremented</span></div>
<divclass="line"><aid="l00112"name="l00112"></a><spanclass="lineno"> 112</span><spanclass="comment">// each time a copy of the clause is added, and decremented each time a copy</span></div>
<divclass="line"><aid="l00113"name="l00113"></a><spanclass="lineno"> 113</span><spanclass="comment">// is deleted. When this number reaches 0, the clause is actually marked as</span></div>
<divclass="line"><aid="l00114"name="l00114"></a><spanclass="lineno"> 114</span><spanclass="comment">// deleted (see 'deleted_index'). If other copies are added after this</span></div>
<divclass="line"><aid="l00115"name="l00115"></a><spanclass="lineno"> 115</span><spanclass="comment">// number reached 0, a new clause is added (because a Clause lifetime is a</span></div>
<divclass="line"><aid="l00116"name="l00116"></a><spanclass="lineno"> 116</span><spanclass="comment">// single interval of ClauseIndex values; therefore, in order to represent a</span></div>
<divclass="line"><aid="l00117"name="l00117"></a><spanclass="lineno"> 117</span><spanclass="comment">// lifetime made of several intervals, several Clause are used).</span></div>
<divclass="line"><aid="l00120"name="l00120"></a><spanclass="lineno"> 120</span><spanclass="comment">// The index in 'clauses_' from which this clause is deleted (inclusive).</span></div>
<divclass="line"><aid="l00121"name="l00121"></a><spanclass="lineno"> 121</span><spanclass="comment">// For instance, with AddProblemClause(c0), AddProblemClause(c1),</span></div>
<divclass="line"><aid="l00122"name="l00122"></a><spanclass="lineno"> 122</span><spanclass="comment">// DeleteClause(c0), AddProblemClause(c2), ... if c0's index is 0, then its</span></div>
<divclass="line"><aid="l00123"name="l00123"></a><spanclass="lineno"> 123</span><spanclass="comment">// deleted_index is 2. Meaning that when checking a clause whose index is</span></div>
<divclass="line"><aid="l00124"name="l00124"></a><spanclass="lineno"> 124</span><spanclass="comment">// larger than or equal to 2 (e.g. c2), c0 can be ignored.</span></div>
<divclass="line"><aid="l00127"name="l00127"></a><spanclass="lineno"> 127</span><spanclass="comment">// The indices of the clauses (with at least two literals) which are deleted</span></div>
<divclass="line"><aid="l00128"name="l00128"></a><spanclass="lineno"> 128</span><spanclass="comment">// just after this clause.</span></div>
<divclass="line"><aid="l00131"name="l00131"></a><spanclass="lineno"> 131</span><spanclass="comment">// Whether this clause is actually needed to check the DRAT proof.</span></div>
<divclass="line"><aid="l00133"name="l00133"></a><spanclass="lineno"> 133</span><spanclass="comment">// Whether this clause is actually needed to check the current step (i.e. an</span></div>
<divclass="line"><aid="l00134"name="l00134"></a><spanclass="lineno"> 134</span><spanclass="comment">// infered clause) of the DRAT proof. This bool is always false, except in</span></div>
<divclass="line"><aid="l00135"name="l00135"></a><spanclass="lineno"> 135</span><spanclass="comment">// MarkAsNeededForProof() that uses it temporarily.</span></div>
<divclass="line"><aid="l00140"name="l00140"></a><spanclass="lineno"> 140</span><spanclass="comment">// Returns true if this clause is deleted before the given clause.</span></div>
<divclass="line"><aid="l00144"name="l00144"></a><spanclass="lineno"> 144</span><spanclass="comment">// A literal to assign to true during boolean constraint propagation. When a</span></div>
<divclass="line"><aid="l00145"name="l00145"></a><spanclass="lineno"> 145</span><spanclass="comment">// literal is assigned, new literals can be found that also need to be</span></div>
<divclass="line"><aid="l00146"name="l00146"></a><spanclass="lineno"> 146</span><spanclass="comment">// assigned to true (via unit clauses). In this case they are pushed on a</span></div>
<divclass="line"><aid="l00147"name="l00147"></a><spanclass="lineno"> 147</span><spanclass="comment">// stack of LiteralToAssign values, to be processed later on (the use of this</span></div>
<divclass="line"><aid="l00148"name="l00148"></a><spanclass="lineno"> 148</span><spanclass="comment">// stack avoids recursive calls to the boolean constraint propagation method</span></div>
<divclass="line"><aid="l00151"name="l00151"></a><spanclass="lineno"> 151</span><spanclass="comment">// The literal that must be assigned to true.</span></div>
<divclass="line"><aid="l00153"name="l00153"></a><spanclass="lineno"> 153</span><spanclass="comment">// The index of the clause from which this assignment was deduced. This is</span></div>
<divclass="line"><aid="l00154"name="l00154"></a><spanclass="lineno"> 154</span><spanclass="comment">// kNoClauseIndex for the clause we are currently checking (whose literals</span></div>
<divclass="line"><aid="l00155"name="l00155"></a><spanclass="lineno"> 155</span><spanclass="comment">// are all falsified to check if a conflict can be derived). Otherwise this</span></div>
<divclass="line"><aid="l00156"name="l00156"></a><spanclass="lineno"> 156</span><spanclass="comment">// is the index of a unit clause with unit literal 'literal' that was found</span></div>
<divclass="line"><aid="l00157"name="l00157"></a><spanclass="lineno"> 157</span><spanclass="comment">// during boolean constraint propagation.</span></div>
<divclass="line"><aid="l00176"name="l00176"></a><spanclass="lineno"> 176</span><spanclass="comment">// Adds a clause and returns its index.</span></div>
<divclass="line"><aid="l00179"name="l00179"></a><spanclass="lineno"> 179</span><spanclass="comment">// Removes the last clause added to 'clauses_'.</span></div>
<divclass="line"><aid="l00182"name="l00182"></a><spanclass="lineno"> 182</span><spanclass="comment">// Returns the literals of the given clause in increasing order.</span></div>
<divclass="line"><aid="l00185"name="l00185"></a><spanclass="lineno"> 185</span><spanclass="comment">// Initializes the data structures used to check the DRAT proof.</span></div>
<divclass="line"><aid="l00188"name="l00188"></a><spanclass="lineno"> 188</span><spanclass="comment">// Adds 2 watch literals for the given clause.</span></div>
<divclass="line"><aid="l00191"name="l00191"></a><spanclass="lineno"> 191</span><spanclass="comment">// Returns true if, by assigning all the literals of 'clause' to false, a</span></div>
<divclass="line"><aid="l00192"name="l00192"></a><spanclass="lineno"> 192</span><spanclass="comment">// conflict can be found with boolean constraint propagation, using the non</span></div>
<divclass="line"><aid="l00193"name="l00193"></a><spanclass="lineno"> 193</span><spanclass="comment">// deleted clauses whose index is strictly less than 'num_clauses'. If so,</span></div>
<divclass="line"><aid="l00194"name="l00194"></a><spanclass="lineno"> 194</span><spanclass="comment">// marks the clauses actually used in this process as needed to check to DRAT</span></div>
<divclass="line"><aid="l00199"name="l00199"></a><spanclass="lineno"> 199</span><spanclass="comment">// Assigns 'literal' to true in 'assignment_' (and pushes it to 'assigned_'),</span></div>
<divclass="line"><aid="l00200"name="l00200"></a><spanclass="lineno"> 200</span><spanclass="comment">// records its source clause 'source_clause_index' in 'assignment_source_',</span></div>
<divclass="line"><aid="l00201"name="l00201"></a><spanclass="lineno"> 201</span><spanclass="comment">// and uses the watched literals to find all the clauses (whose index is less</span></div>
<divclass="line"><aid="l00202"name="l00202"></a><spanclass="lineno"> 202</span><spanclass="comment">// than 'num_clauses') that become unit due to this assignment. For each unit</span></div>
<divclass="line"><aid="l00203"name="l00203"></a><spanclass="lineno"> 203</span><spanclass="comment">// clause found, pushes its unit literal on top of</span></div>
<divclass="line"><aid="l00204"name="l00204"></a><spanclass="lineno"> 204</span><spanclass="comment">// 'high_priority_literals_to_assign_' or 'low_priority_literals_to_assign_'.</span></div>
<divclass="line"><aid="l00205"name="l00205"></a><spanclass="lineno"> 205</span><spanclass="comment">// Returns kNoClauseIndex if no falsified clause is found, or the index of the</span></div>
<divclass="line"><aid="l00206"name="l00206"></a><spanclass="lineno"> 206</span><spanclass="comment">// first found falsified clause otherwise.</span></div>
<divclass="line"><aid="l00210"name="l00210"></a><spanclass="lineno"> 210</span><spanclass="comment">// Marks the given clause as needed to check the DRAT proof, as well as the</span></div>
<divclass="line"><aid="l00211"name="l00211"></a><spanclass="lineno"> 211</span><spanclass="comment">// other clauses which were used to check this clause (these are found from</span></div>
<divclass="line"><aid="l00212"name="l00212"></a><spanclass="lineno"> 212</span><spanclass="comment">// 'unit_stack_', containing the clauses that became unit in</span></div>
<divclass="line"><aid="l00213"name="l00213"></a><spanclass="lineno"> 213</span><spanclass="comment">// AssignAndPropagate, and from 'assignment_source_', containing for each</span></div>
<divclass="line"><aid="l00214"name="l00214"></a><spanclass="lineno"> 214</span><spanclass="comment">// variable the clause that caused its assignment).</span></div>
<divclass="line"><aid="l00217"name="l00217"></a><spanclass="lineno"> 217</span><spanclass="comment">// Returns the clauses whose index is in [begin,end) which are needed for the</span></div>
<divclass="line"><aid="l00218"name="l00218"></a><spanclass="lineno"> 218</span><spanclass="comment">// proof. The result is undefined if Check() was not previously called, or did</span></div>
<divclass="line"><aid="l00219"name="l00219"></a><spanclass="lineno"> 219</span><spanclass="comment">// not return true.</span></div>
<divclass="line"><aid="l00225"name="l00225"></a><spanclass="lineno"> 225</span><spanclass="comment">// The index of the first infered clause in 'clauses_', or kNoClauseIndex if</span></div>
<divclass="line"><aid="l00226"name="l00226"></a><spanclass="lineno"> 226</span><spanclass="comment">// there is no infered clause.</span></div>
<divclass="line"><aid="l00229"name="l00229"></a><spanclass="lineno"> 229</span><spanclass="comment">// The problem clauses, followed by the infered clauses.</span></div>
<divclass="line"><aid="l00232"name="l00232"></a><spanclass="lineno"> 232</span><spanclass="comment">// A content addressable set of the non-deleted clauses in clauses_. After</span></div>
<divclass="line"><aid="l00233"name="l00233"></a><spanclass="lineno"> 233</span><spanclass="comment">// adding a clause to clauses_, this set can be used to find if the same</span></div>
<divclass="line"><aid="l00234"name="l00234"></a><spanclass="lineno"> 234</span><spanclass="comment">// clause was previously added (i.e if a find using the new clause index</span></div>
<divclass="line"><aid="l00235"name="l00235"></a><spanclass="lineno"> 235</span><spanclass="comment">// returns a previous index) and not yet deleted.</span></div>
<divclass="line"><aid="l00238"name="l00238"></a><spanclass="lineno"> 238</span><spanclass="comment">// All the literals used in 'clauses_'.</span></div>
<divclass="line"><aid="l00241"name="l00241"></a><spanclass="lineno"> 241</span><spanclass="comment">// The number of Boolean variables used in the clauses.</span></div>
<divclass="line"><aid="l00245"name="l00245"></a><spanclass="lineno"> 245</span><spanclass="comment">// Data initialized in Init() and used in Check() to check the DRAT proof.</span></div>
<divclass="line"><aid="l00247"name="l00247"></a><spanclass="lineno"> 247</span><spanclass="comment">// The literals that have been assigned so far (this is used to unassign them</span></div>
<divclass="line"><aid="l00248"name="l00248"></a><spanclass="lineno"> 248</span><spanclass="comment">// after a clause has been checked, before checking the next one).</span></div>
<divclass="line"><aid="l00251"name="l00251"></a><spanclass="lineno"> 251</span><spanclass="comment">// The current assignment values of literals_.</span></div>
<divclass="line"><aid="l00254"name="l00254"></a><spanclass="lineno"> 254</span><spanclass="comment">// For each variable, the index of the unit clause that caused its assignment,</span></div>
<divclass="line"><aid="l00255"name="l00255"></a><spanclass="lineno"> 255</span><spanclass="comment">// or kNoClauseIndex if the variable is not assigned, or was assigned to</span></div>
<divclass="line"><aid="l00256"name="l00256"></a><spanclass="lineno"> 256</span><spanclass="comment">// falsify the clause that is currently being checked.</span></div>
<divclass="line"><aid="l00259"name="l00259"></a><spanclass="lineno"> 259</span><spanclass="comment">// The stack of literals that remain to be assigned to true during boolean</span></div>
<divclass="line"><aid="l00260"name="l00260"></a><spanclass="lineno"> 260</span><spanclass="comment">// constraint propagation, with high priority (unit clauses which are already</span></div>
<divclass="line"><aid="l00261"name="l00261"></a><spanclass="lineno"> 261</span><spanclass="comment">// marked as needed for the proof are given higher priority than the others</span></div>
<divclass="line"><aid="l00262"name="l00262"></a><spanclass="lineno"> 262</span><spanclass="comment">// during boolean constraint propagation. According to 'Trimming while</span></div>
<divclass="line"><aid="l00263"name="l00263"></a><spanclass="lineno"> 263</span><spanclass="comment">// Checking Clausal Proofs', this heuristics reduces the final number of</span></div>
<divclass="line"><aid="l00264"name="l00264"></a><spanclass="lineno"> 264</span><spanclass="comment">// clauses that are marked as needed for the proof, and therefore the</span></div>
<divclass="line"><aid="l00265"name="l00265"></a><spanclass="lineno"> 265</span><spanclass="comment">// verification time, in a majority of cases -- but not all).</span></div>
<divclass="line"><aid="l00268"name="l00268"></a><spanclass="lineno"> 268</span><spanclass="comment">// The stack of literals that remain to be assigned to true during boolean</span></div>
<divclass="line"><aid="l00269"name="l00269"></a><spanclass="lineno"> 269</span><spanclass="comment">// constraint propagation, with low priority (see above).</span></div>
<divclass="line"><aid="l00272"name="l00272"></a><spanclass="lineno"> 272</span><spanclass="comment">// For each literal, the list of clauses in which this literal is watched.</span></div>
<divclass="line"><aid="l00273"name="l00273"></a><spanclass="lineno"> 273</span><spanclass="comment">// Invariant 1: the literals with indices first_watched_literal_index and</span></div>
<divclass="line"><aid="l00274"name="l00274"></a><spanclass="lineno"> 274</span><spanclass="comment">// second_watched_literal_index of each clause with at least two literals are</span></div>
<divclass="line"><aid="l00276"name="l00276"></a><spanclass="lineno"> 276</span><spanclass="comment">// Invariant 2: watched literals are non-falsified if the clause is not</span></div>
<divclass="line"><aid="l00277"name="l00277"></a><spanclass="lineno"> 277</span><spanclass="comment">// satisfied (in more details: if a clause c is contained in</span></div>
<divclass="line"><aid="l00278"name="l00278"></a><spanclass="lineno"> 278</span><spanclass="comment">// 'watched_literals_[l]' for literal l, then either c is satisfied with</span></div>
<divclass="line"><aid="l00279"name="l00279"></a><spanclass="lineno"> 279</span><spanclass="comment">// 'assignment_', or l is unassigned or assigned to true).</span></div>
<divclass="line"><aid="l00282"name="l00282"></a><spanclass="lineno"> 282</span><spanclass="comment">// The list of clauses with only one literal. This is needed for boolean</span></div>
<divclass="line"><aid="l00283"name="l00283"></a><spanclass="lineno"> 283</span><spanclass="comment">// constraint propagation, in addition to watched literals, because watched</span></div>
<divclass="line"><aid="l00284"name="l00284"></a><spanclass="lineno"> 284</span><spanclass="comment">// literals can only be used with clauses having at least two literals.</span></div>
<divclass="line"><aid="l00287"name="l00287"></a><spanclass="lineno"> 287</span><spanclass="comment">// The stack of clauses that have become unit during boolean constraint</span></div>
<divclass="line"><aid="l00288"name="l00288"></a><spanclass="lineno"> 288</span><spanclass="comment">// propagation, in HasRupProperty().</span></div>
<divclass="line"><aid="l00297"name="l00297"></a><spanclass="lineno"> 297</span><spanclass="comment">// The number of infered clauses having the RAT property (but not the RUP</span></div>
<divclass="line"><aid="l00302"name="l00302"></a><spanclass="lineno"> 302</span><spanclass="comment">// Returns true if the given clause contains the given literal. This works in</span></div>
<divclass="line"><aid="l00306"name="l00306"></a><spanclass="lineno"> 306</span><spanclass="comment">// Returns true if 'complementary_literal' is the unique complementary literal</span></div>
<divclass="line"><aid="l00307"name="l00307"></a><spanclass="lineno"> 307</span><spanclass="comment">// in the two given clauses. If so the resolvent of these clauses (i.e. their</span></div>
<divclass="line"><aid="l00308"name="l00308"></a><spanclass="lineno"> 308</span><spanclass="comment">// union with 'complementary_literal' and its negation removed) is set in</span></div>
<divclass="line"><aid="l00309"name="l00309"></a><spanclass="lineno"> 309</span><spanclass="comment">// 'resolvent'. 'clause' must contain 'complementary_literal', while</span></div>
<divclass="line"><aid="l00310"name="l00310"></a><spanclass="lineno"> 310</span><spanclass="comment">// 'other_clause' must contain its negation. 'assignment' must have at least as</span></div>
<divclass="line"><aid="l00311"name="l00311"></a><spanclass="lineno"> 311</span><spanclass="comment">// many variables as each clause, and they must all be unassigned. They are</span></div>
<divclass="line"><aid="l00312"name="l00312"></a><spanclass="lineno"> 312</span><spanclass="comment">// still unassigned upon return.</span></div>
<divclass="line"><aid="l00318"name="l00318"></a><spanclass="lineno"> 318</span><spanclass="comment">// Adds to the given drat checker the problem clauses from the file at the given</span></div>
<divclass="line"><aid="l00319"name="l00319"></a><spanclass="lineno"> 319</span><spanclass="comment">// path, which must be in DIMACS format. Returns true iff the file was</span></div>
<divclass="line"><aid="l00323"name="l00323"></a><spanclass="lineno"> 323</span><spanclass="comment">// Adds to the given drat checker the infered and deleted clauses from the file</span></div>
<divclass="line"><aid="l00324"name="l00324"></a><spanclass="lineno"> 324</span><spanclass="comment">// at the given path, which must be in DRAT format. Returns true iff the file</span></div>
<divclass="line"><aid="l00325"name="l00325"></a><spanclass="lineno"> 325</span><spanclass="comment">// was successfully parsed.</span></div>
<divclass="line"><aid="l00329"name="l00329"></a><spanclass="lineno"> 329</span><spanclass="comment">// The file formats that can be used to save a list of clauses.</span></div>
<divclass="line"><aid="l00335"name="l00335"></a><spanclass="lineno"> 335</span><spanclass="comment">// Prints the given clauses in the file at the given path, using the given file</span></div>
<divclass="line"><aid="l00336"name="l00336"></a><spanclass="lineno"> 336</span><spanclass="comment">// format. Returns true iff the file was successfully written.</span></div>
<divclass="ttc"id="anamespaceoperations__research_html"><divclass="ttname"><ahref="namespaceoperations__research.html">operations_research</a></div><divclass="ttdoc">Collection of objects used to extend the Constraint Solver library.</div><divclass="ttdef"><b>Definition:</b><ahref="dense__doubly__linked__list_8h_source.html#l00021">dense_doubly_linked_list.h:21</a></div></div>