Connect++ 0.6.0
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
Matrix Class Reference

Representation of the Matrix within a proof. More...

#include <Matrix.hpp>

Collaboration diagram for Matrix:

Public Member Functions

 Matrix ()
 Use this constructor if you really want an empty Matrix.
 
 Matrix (size_t)
 Use this constructor when you know how many predicates there are.
 
 Matrix (const Matrix &)=delete
 You're never going to need to copy a Matrix.
 
 Matrix (const Matrix &&)=delete
 
Matrixoperator= (const Matrix &)=delete
 
Matrixoperator= (const Matrix &&)=delete
 
ClauseNum get_num_clauses () const
 Straightforward get method.
 
size_t get_index_entry_size (size_t _i) const
 The ExtensionEnumerator needs to know this.
 
MatrixPairType get_index_entry (size_t _i, size_t _j) const
 The ExtensionEnumerator needs to know this.
 
const Clauseoperator[] (size_t i) const
 Straightforward get method.
 
const Literalinspect_literal (size_t i, size_t j)
 Straightforward get method.
 
const Literalinspect_index_literal (size_t i, size_t j)
 Straightforward get method.
 
bool is_positive (size_t i) const
 Is a particular Clause positive?
 
bool is_negative (size_t i) const
 Is a particular Clause negative?
 
bool is_ground (size_t i) const
 Is a particular Clause ground?
 
bool is_conjecture (size_t i) const
 Is a particular Clause a conjecture?
 
void set_num_equals (uint32_t n)
 Straightforward set method.
 
pair< bool, size_t > find_start () const
 Use a simple heuristic to find a good start clause.
 
void set_num_preds (size_t)
 Make an empty index.
 
void add_clause (Clause &, string="")
 Add a Clause to the Matrix and update the index accordingly.
 
void deterministic_reorder (size_t)
 Deterministic reorder of the clauses.
 
void random_reorder ()
 Randomly reorder the matrix.
 
void random_reorder_literals ()
 Randomly reorder the literals in each clause in the matrix.
 
void move_equals_to_start ()
 Self-explanatory.
 
vector< Clause >::const_iterator cbegin () const
 
vector< Clause >::const_iterator cend () const
 
vector< Clause >::iterator begin ()
 
vector< Clause >::iterator end ()
 
string to_string () const
 Make a string representation.
 
string make_LaTeX (bool=false) const
 Make a usable LaTeX representation.
 
void write_to_prolog_file (const path &) const
 Write to a file that can be read by Prolog.
 
void show_tptp () const
 Output in TPTP compatible format.
 
void sort_clauses_by_increasing_size ()
 Self-explanatory.
 
void get_literal_clause_pair (LitNum, size_t, Literal &, Clause &) const
 Get a literal and clause from the index.
 

Private Member Functions

void make_clauses_copy ()
 Store a copy of the clauses.
 
void rebuild_index (vector< Clause > &, vector< string > &)
 Rebuild the index after, for example, reordering.
 
template<class Comparison >
void sort_clauses (Comparison comparison)
 Template method for general sorting of clauses, which sorts roles at the same time.
 

Private Attributes

vector< Clauseclauses
 The Matrix itself is just a set of Clauses.
 
vector< bool > positive_clauses
 Keep track of which clauses are positive.
 
vector< bool > negative_clauses
 Keep track of which clauses are negative.
 
vector< bool > ground_clauses
 We need to know this to control backtracking.
 
vector< string > clause_roles
 Keep track of which clauses are conjectures etc.
 
uint32_t num_equals
 You need to know how many equality axioms there are in case you want to move them around.
 
vector< Clauseclauses_copy
 It makes sense to keep a copy of the clauses if your schedule reorders multiple times.
 
vector< string > roles_copy
 It makes sense to keep a copy of the roles if your schedule reorders multiple times.
 
bool copy_saved
 Remember whether you've saved a copy.
 
vector< vector< MatrixPairType > > index
 We want to be able to quickly identify where in each clause a particular literal lives.
 
vector< vector< LiteralClausePairType > > literal_clause_index
 This corresponds closely to index, but has the actual Literal, and the Clause after the Literal's removal.
 

Static Private Attributes

static std::mt19937 d
 Randomness for random reordering.
 

Friends

ostream & operator<< (ostream &, const Matrix &)
 

Detailed Description

Representation of the Matrix within a proof.

The Matrix itself never actually changes. However we do want to be able to look things up quickly when finding possible extension steps, so we build a pair of indexes to help with that.

Definition at line 74 of file Matrix.hpp.

Constructor & Destructor Documentation

◆ Matrix() [1/3]

Matrix::Matrix ( )
inline

Use this constructor if you really want an empty Matrix.

Definition at line 194 of file Matrix.hpp.

195 : clauses()
196 , index()
201 , clause_roles()
202 , clauses_copy()
203 , roles_copy()
204 , copy_saved(false)
205 {}
vector< Clause > clauses
The Matrix itself is just a set of Clauses.
Definition Matrix.hpp:79
vector< string > clause_roles
Keep track of which clauses are conjectures etc.
Definition Matrix.hpp:101
vector< vector< MatrixPairType > > index
We want to be able to quickly identify where in each clause a particular literal lives.
Definition Matrix.hpp:128
bool copy_saved
Remember whether you've saved a copy.
Definition Matrix.hpp:120
vector< string > roles_copy
It makes sense to keep a copy of the roles if your schedule reorders multiple times.
Definition Matrix.hpp:116
vector< Clause > clauses_copy
It makes sense to keep a copy of the clauses if your schedule reorders multiple times.
Definition Matrix.hpp:111
vector< vector< LiteralClausePairType > > literal_clause_index
This corresponds closely to index, but has the actual Literal, and the Clause after the Literal's rem...
Definition Matrix.hpp:133
vector< bool > negative_clauses
Keep track of which clauses are negative.
Definition Matrix.hpp:91
vector< bool > ground_clauses
We need to know this to control backtracking.
Definition Matrix.hpp:95
vector< bool > positive_clauses
Keep track of which clauses are positive.
Definition Matrix.hpp:85

◆ Matrix() [2/3]

Matrix::Matrix ( size_t num_predicates)

Use this constructor when you know how many predicates there are.

Parameters
num_predicatesNumber of predicates.

Definition at line 30 of file Matrix.cpp.

31: clauses()
32, index((num_predicates * 2), vector<MatrixPairType>())
33, literal_clause_index((num_predicates * 2), vector<LiteralClausePairType>())
38, num_equals(0)
40, roles_copy()
41, copy_saved(false)
42{}
uint32_t num_equals
You need to know how many equality axioms there are in case you want to move them around.
Definition Matrix.hpp:106

◆ Matrix() [3/3]

Matrix::Matrix ( const Matrix & )
delete

You're never going to need to copy a Matrix.

Let the compiler be your friend.

Member Function Documentation

◆ add_clause()

void Matrix::add_clause ( Clause & clause,
string role = "" )

Add a Clause to the Matrix and update the index accordingly.

Optionally add a clause role.

Parameters
clauseReference to the Clause.
roleA string denoting the role of the clause.

Definition at line 97 of file Matrix.cpp.

97 {
98 ClauseNum clause_number = clauses.size();
99 LitNum literal_number = 0;
100 for (size_t j = 0; j < clause.size(); j++) {
101 size_t i = clause[j].get_pred_as_index();
102 index[i].push_back(MatrixPairType(clause_number, literal_number));
103 Clause new_clause = clause;
104 new_clause.drop_literal(literal_number);
105 literal_clause_index[i].push_back(LiteralClausePairType(clause[j], new_clause));
106 literal_number++;
107 }
108 clauses.push_back(clause);
109 positive_clauses.push_back(clause.is_positive());
110 negative_clauses.push_back(clause.is_negative());
111 ground_clauses.push_back(clause.is_ground());
112 clause_roles.push_back(role);
113}
Representation of clauses.
Definition Clause.hpp:52
bool is_positive() const
A clause is positive if it has no negated literals.
Definition Clause.cpp:30
size_t size() const
Straightforward get method.
Definition Clause.hpp:78
bool is_negative() const
A clause is negative if it has only negated literals.
Definition Clause.cpp:42
bool is_ground() const
Is this a ground clause?
Definition Clause.cpp:87
void drop_literal(LitNum)
Get rid of the specified Literal.
Definition Clause.cpp:155

◆ begin()

vector< Clause >::iterator Matrix::begin ( )
inline

Definition at line 351 of file Matrix.hpp.

351{ return clauses.begin(); }

◆ cbegin()

vector< Clause >::const_iterator Matrix::cbegin ( ) const
inline

Definition at line 349 of file Matrix.hpp.

349{ return clauses.cbegin(); }

◆ cend()

vector< Clause >::const_iterator Matrix::cend ( ) const
inline

Definition at line 350 of file Matrix.hpp.

350{ return clauses.cend(); }

◆ deterministic_reorder()

void Matrix::deterministic_reorder ( size_t n)

Deterministic reorder of the clauses.

Call the reorder algorithm the specified number of times. This assumes you have stored a copy of the original clauses.

Parameters
nNumber of times to call the reorder algorithm

Only store a copy of the clauses the first time you do this.

Definition at line 133 of file Matrix.cpp.

133 {
137 if (!copy_saved) {
138 copy_saved = true;
140 }
141 /*
142 * Find a suitably reordered set of indices.
143 */
144 vector<uint32_t> new_order;
145 size_t s = clauses.size();
146 for (size_t i = 0; i < s; i++)
147 new_order.push_back(i);
148 new_order = deterministic_reorder_n_times<uint32_t>(new_order, n);
149 /*
150 * Do the reordering.
151 */
152 vector<Clause> cs;
153 vector<string> ss;
154 for (size_t i = 0; i < s; i++) {
155 cs.push_back(clauses_copy[new_order[i]]);
156 ss.push_back(roles_copy[new_order[i]]);
157 }
158 /*
159 * Clear and rebuild as necessary.
160 */
161 rebuild_index(cs, ss);
162}
void rebuild_index(vector< Clause > &, vector< string > &)
Rebuild the index after, for example, reordering.
Definition Matrix.cpp:115
void make_clauses_copy()
Store a copy of the clauses.
Definition Matrix.hpp:141

◆ end()

vector< Clause >::iterator Matrix::end ( )
inline

Definition at line 352 of file Matrix.hpp.

352{ return clauses.end(); }

◆ find_start()

pair< bool, size_t > Matrix::find_start ( ) const

Use a simple heuristic to find a good start clause.

Find a start clause that is positive/negative according to the –negative flag, and if possible also a conjecture clause. Also, indicate if there is no positive/negative clause, which means the problem is trivial.

Definition at line 54 of file Matrix.cpp.

54 {
55 bool found_positive = false;
56 bool found_negative = false;
57 size_t first_positive = 0;
58 size_t first_negative = 0;
59 bool found_candidate = false;
60 size_t candidate = 0;
61 size_t i = 0;
62 for (bool positive : positive_clauses) {
63 if (positive_clauses[i]) {
64 if (!found_positive) {
65 first_positive = i;
66 found_positive = true;
67 }
68 }
69 if (negative_clauses[i]) {
70 if (!found_negative) {
71 first_negative = i;
72 found_negative = true;
73 }
74 }
75 if (is_conjecture(i) && !found_candidate) {
76 if ((params::positive_representation && positive_clauses[i]) ||
77 (!params::positive_representation && negative_clauses[i])) {
78 found_candidate = true;
79 candidate = i;
80 }
81 }
82 i++;
83 }
84 if (!(found_positive && found_negative))
85 return pair<bool,size_t>(false, 0);
86 if (found_candidate)
87 return pair<bool, size_t>(true, candidate);
88 else if (params::positive_representation)
89 return pair<bool, size_t>(true, first_positive);
90 else
91 return pair<bool, size_t>(true, first_negative);
92}
bool is_conjecture(size_t i) const
Is a particular Clause a conjecture?
Definition Matrix.cpp:49

◆ get_index_entry()

MatrixPairType Matrix::get_index_entry ( size_t _i,
size_t _j ) const
inline

The ExtensionEnumerator needs to know this.

Definition at line 235 of file Matrix.hpp.

235 {
236 return (index[_i])[_j];
237 }

◆ get_index_entry_size()

size_t Matrix::get_index_entry_size ( size_t _i) const
inline

The ExtensionEnumerator needs to know this.

Definition at line 229 of file Matrix.hpp.

229 {
230 return index[_i].size();
231 }

◆ get_literal_clause_pair()

void Matrix::get_literal_clause_pair ( LitNum _l,
size_t _i,
Literal & _lit,
Clause & _clause ) const

Get a literal and clause from the index.

Parameters
_lIndex for the literal of interest.
_iIndex for where the pair is in _lit's vector.
_litResult literal.
_clauseResult clause.

Definition at line 301 of file Matrix.cpp.

301 {
302 LiteralClausePairType result = (literal_clause_index[_l])[_i];
303 _lit = result.first;
304 _clause = result.second;
305}

◆ get_num_clauses()

ClauseNum Matrix::get_num_clauses ( ) const
inline

Straightforward get method.

Definition at line 225 of file Matrix.hpp.

225{ return clauses.size(); }

◆ inspect_index_literal()

const Literal & Matrix::inspect_index_literal ( size_t i,
size_t j )
inline

Straightforward get method.

Beware - the parameters are not checked, so behave!

Parameters
iIndex in literal_clause_index;
jIndex of required entry.

Definition at line 265 of file Matrix.hpp.

265 {
266 return (literal_clause_index[i])[j].first;
267 }

◆ inspect_literal()

const Literal & Matrix::inspect_literal ( size_t i,
size_t j )
inline

Straightforward get method.

Beware - the parameters are not checked, so behave!

Parameters
iIndex of clause to get.
jIndex of literal in clause.

Definition at line 254 of file Matrix.hpp.

254 {
255 return (clauses[i])[j];
256 }

◆ is_conjecture()

bool Matrix::is_conjecture ( size_t i) const

Is a particular Clause a conjecture?

Parameters
iIndex of Clause to check.

Definition at line 49 of file Matrix.cpp.

49 {
50 return clause_roles[i] == "negated_conjecture" ||
51 clause_roles[i] == "conjecture";
52}

◆ is_ground()

bool Matrix::is_ground ( size_t i) const
inline

Is a particular Clause ground?

Parameters
iIndex of Clause to check.

Definition at line 285 of file Matrix.hpp.

285{ return ground_clauses[i]; }

◆ is_negative()

bool Matrix::is_negative ( size_t i) const
inline

Is a particular Clause negative?

Parameters
iIndex of Clause to check.

Definition at line 279 of file Matrix.hpp.

279{ return negative_clauses[i]; }

◆ is_positive()

bool Matrix::is_positive ( size_t i) const
inline

Is a particular Clause positive?

Parameters
iIndex of Clause to check.

Definition at line 273 of file Matrix.hpp.

273{ return positive_clauses[i]; }

◆ make_clauses_copy()

void Matrix::make_clauses_copy ( )
inlineprivate

Store a copy of the clauses.

Definition at line 141 of file Matrix.hpp.

141 {
142 clauses_copy.clear();
144 roles_copy.clear();
146 }

◆ make_LaTeX()

string Matrix::make_LaTeX ( bool subbed = false) const

Make a usable LaTeX representation.

Parameters
subbedImplement substitutions if true.

Definition at line 259 of file Matrix.cpp.

259 {
260 string s ("\\[\n\\begin{split}\n");
261 s += "\\textcolor{magenta}{M} = ";
262 for (const Clause& c : clauses) {
263 s += "&\\,";
264 s += c.make_LaTeX(subbed);
265 s += "\\\\";
266 }
267 s += "\n\\end{split}\n\\]\n";
268
269 return s;
270}

◆ move_equals_to_start()

void Matrix::move_equals_to_start ( )

Self-explanatory.

BUT only do this to the matrix built at the start of the process, as it assumes the equality axioms are at the end of the matrix.

Definition at line 208 of file Matrix.cpp.

208 {
209 if (num_equals == 0) {
210 cerr << "Why are you trying to move equality axioms - there aren't any?" << endl;
211 return;
212 }
214 clauses.clear();
215 positive_clauses.clear();
216 negative_clauses.clear();
217 ground_clauses.clear();
218 clause_roles.clear();
219 size_t s2 = index.size();
220 size_t s3 = literal_clause_index.size();
221 index.clear();
222 literal_clause_index.clear();
223 index = vector<vector<MatrixPairType> >(s2, vector<MatrixPairType>());
224 literal_clause_index = vector<vector<LiteralClausePairType> >(s3, vector<LiteralClausePairType>());
225 size_t n_clauses = clauses_copy.size();
226 for (size_t i = n_clauses - num_equals; i < n_clauses; i++) {
228 }
229 for (size_t i = 0; i < n_clauses - num_equals; i++) {
231 }
232 clauses_copy.clear();
233 roles_copy.clear();
234}
void add_clause(Clause &, string="")
Add a Clause to the Matrix and update the index accordingly.
Definition Matrix.cpp:97

◆ operator[]()

const Clause & Matrix::operator[] ( size_t i) const
inline

Straightforward get method.

Beware - the parameter is not checked, so behave!

Parameters
iIndex of item to get.

Definition at line 245 of file Matrix.hpp.

245{ return clauses[i]; }

◆ random_reorder()

void Matrix::random_reorder ( )

Randomly reorder the matrix.

Definition at line 164 of file Matrix.cpp.

164 {
165 vector<Clause> saved_clauses(clauses);
166 vector<string> saved_clause_roles(clause_roles);
167 /*
168 * Find a suitably reordered set of indices.
169 */
170 vector<uint32_t> new_order;
171 size_t s = clauses.size();
172 for (size_t i = 0; i < s; i++)
173 new_order.push_back(i);
174 std::shuffle(new_order.begin(), new_order.end(), d);
175 /*
176 * Do the reordering.
177 */
178 vector<Clause> cs;
179 vector<string> ss;
180 for (size_t i = 0; i < s; i++) {
181 cs.push_back(saved_clauses[new_order[i]]);
182 ss.push_back(saved_clause_roles[new_order[i]]);
183 }
184 /*
185 * Clear and rebuild as necessary.
186 */
187 rebuild_index(cs, ss);
188}
static std::mt19937 d
Randomness for random reordering.
Definition Matrix.hpp:137

◆ random_reorder_literals()

void Matrix::random_reorder_literals ( )

Randomly reorder the literals in each clause in the matrix.

Definition at line 190 of file Matrix.cpp.

190 {
191 vector<Clause> saved_clauses(clauses);
192 vector<string> saved_clause_roles(clause_roles);
193 size_t s = clauses.size();
194 /*
195 * Reorder.
196 */
197 for (size_t i = 0; i < s; i++) {
198 Clause c(saved_clauses[i]);
199 c.random_reorder();
200 saved_clauses[i] = c;
201 }
202 /*
203 * Clear and rebuild as necessary.
204 */
205 rebuild_index(saved_clauses, saved_clause_roles);
206}

◆ rebuild_index()

void Matrix::rebuild_index ( vector< Clause > & cs,
vector< string > & ss )
private

Rebuild the index after, for example, reordering.

Parameters
csVector of clauses.
ssVector of strings.

Definition at line 115 of file Matrix.cpp.

115 {
116 size_t s = clauses.size();
117 clauses.clear();
118 positive_clauses.clear();
119 negative_clauses.clear();
120 ground_clauses.clear();
121 clause_roles.clear();
122 size_t s2 = index.size();
123 size_t s3 = literal_clause_index.size();
124 index.clear();
125 literal_clause_index.clear();
126 index = vector<vector<MatrixPairType> >(s2, vector<MatrixPairType>());
127 literal_clause_index = vector<vector<LiteralClausePairType> >(s3, vector<LiteralClausePairType>());
128 for (size_t i = 0; i < s; i++) {
129 add_clause(cs[i], ss[i]);
130 }
131}

◆ set_num_equals()

void Matrix::set_num_equals ( uint32_t n)
inline

Straightforward set method.

Parameters
nNumber of equality axioms.

Definition at line 297 of file Matrix.hpp.

297{ num_equals = n; }

◆ set_num_preds()

void Matrix::set_num_preds ( size_t num_predicates)

Make an empty index.

Definition at line 44 of file Matrix.cpp.

44 {
45 index = vector<vector<MatrixPairType> >((num_predicates * 2), vector<MatrixPairType>());
46 literal_clause_index = vector<vector<LiteralClausePairType> >((num_predicates * 2), vector<LiteralClausePairType>());
47}

◆ show_tptp()

void Matrix::show_tptp ( ) const

Output in TPTP compatible format.

Definition at line 289 of file Matrix.cpp.

289 {
290 size_t matrix_i = 0;
291 for (const Clause& c : clauses) {
292 cout << "cnf(matrix-";
293 cout << std::to_string(matrix_i++);
294 cout << ", plain, ";
295 cout << c.to_tptp_string();
296 cout << ").";
297 cout << std::endl;
298 }
299}

◆ sort_clauses()

template<class Comparison >
void Matrix::sort_clauses ( Comparison comparison)
inlineprivate

Template method for general sorting of clauses, which sorts roles at the same time.

ClauseComparisons.hpp contains function objects that can be used with this to implement different orderings.

Definition at line 162 of file Matrix.hpp.

162 {
163 /*
164 * Combine the clauses with their roles.
165 */
166 vector<ClauseAndRole> cr;
167 size_t s = clauses.size();
168 for (size_t i = 0; i < s; i++) {
169 cr.push_back(ClauseAndRole(clauses[i], clause_roles[i]));
170 }
171 /*
172 * Sort them according to the relevant ordering.
173 */
174 std::sort(cr.begin(), cr.end(), comparison);
175 /*
176 * Split them again and re-build the index.
177 */
178 clauses.clear();
179 positive_clauses.clear();
180 negative_clauses.clear();
181 clause_roles.clear();
182 size_t s2 = index.size();
183 index.clear();
184 index = vector<vector<MatrixPairType> >(s2, vector<MatrixPairType>());
185 for (size_t i = 0; i < s; i++) {
186 add_clause(cr[i].first, cr[i].second);
187 }
188 }

◆ sort_clauses_by_increasing_size()

void Matrix::sort_clauses_by_increasing_size ( )
inline

Self-explanatory.

Inspired by "Machine Learning Guidance for Connection Tableaux," Farber et al. 2020 although with a different measure of size and happening at a different place.

Makes use of the sort_clauses template.

Definition at line 385 of file Matrix.hpp.

385 {
386 ClauseLengthCompare comparison;
387 sort_clauses<ClauseLengthCompare>(comparison);
388 }
Provide a function object to compare clauses by size.

◆ to_string()

string Matrix::to_string ( ) const

Make a string representation.

Definition at line 236 of file Matrix.cpp.

236 {
237 string result;
238 colour_string::ColourString cs(params::use_colours);
239 size_t i = 0;
240 for (const Clause& c : clauses) {
241 if (is_conjecture(i))
242 result += cs("*").orange();
243 else
244 result += " ";
245 if (positive_clauses[i])
246 result += cs("+").orange();
247 else if (negative_clauses[i])
248 result += cs("-").orange();
249 else
250 result += " ";
251 result += " ";
252 i++;
253 result += c.to_string();
254 result += "\n";
255 }
256 return result;
257}
Simple addition of colour to strings and ostreams.

◆ write_to_prolog_file()

void Matrix::write_to_prolog_file ( const path & path_to_file) const

Write to a file that can be read by Prolog.

This is for proof checking.

Parameters
path_to_fileReference to path object.

Definition at line 272 of file Matrix.cpp.

272 {
273 std::ofstream file(path_to_file);
274 size_t matrix_i = 0;
275 // Nasty hack needed to stop the proof checker from printing
276 // a bunch of warnings when reading the matrix.
277 file << ":- style_check(-singleton)." << std::endl;
278 for (const Clause& c : clauses) {
279 file << "matrix(";
280 file << std::to_string(matrix_i++);
281 file << ", ";
282 file << c.to_prolog_string();
283 file << ").";
284 file << std::endl;
285 }
286 file.close();
287}

Friends And Related Symbol Documentation

◆ operator<<

ostream & operator<< ( ostream & out,
const Matrix & m )
friend

Definition at line 307 of file Matrix.cpp.

307 {
308 out << "Clauses in matrix:" << endl;
309 out << "------------------" << endl;
310 size_t i = 0;
311 for (const Clause& c : m.clauses) {
312 out << setw(params::output_width) << i
313 << ": " << c;
314 if (m.ground_clauses[i++]) {
315 out << " (ground)";
316 }
317 out << endl;
318 }
319 vector<string> index_lits(m.index.size(), string(""));
320 for (Clause c : m.clauses)
321 for (size_t i = 0; i < c.size(); i++)
322 index_lits[c[i].get_pred_as_index()] = c[i].get_small_lit();
323 i = 0;
324 out << endl << "Index: (Clause, Literal):" << endl;
325 out << "-------------------------" << endl;
326 for (vector<MatrixPairType> v : m.index) {
327 out << setw(params::output_width + 20) << index_lits[i++] << ": ";
328 for (MatrixPairType p : v) {
329 out << "(" << p.first << ", " << p.second << ") ";
330 }
331 out << endl;
332 }
333 out << endl << "Index: (Literal, Clause without Literal):" << endl;
334 out << "-----------------------------------------" << endl;
335 i = 0;
336 for (vector<LiteralClausePairType> v : m.literal_clause_index) {
337 out << setw(params::output_width + 20) << index_lits[i++] << ": " << endl;;
338 for (LiteralClausePairType p : v) {
339 out << p.first.to_string() << " --- " << p.second.to_string() << endl;
340 }
341 out << endl;
342 }
343 return out;
344}

Member Data Documentation

◆ clause_roles

vector<string> Matrix::clause_roles
private

Keep track of which clauses are conjectures etc.

This allows start clause heuristics to be applied.

Definition at line 101 of file Matrix.hpp.

◆ clauses

vector<Clause> Matrix::clauses
private

The Matrix itself is just a set of Clauses.

Definition at line 79 of file Matrix.hpp.

◆ clauses_copy

vector<Clause> Matrix::clauses_copy
private

It makes sense to keep a copy of the clauses if your schedule reorders multiple times.

Definition at line 111 of file Matrix.hpp.

◆ copy_saved

bool Matrix::copy_saved
private

Remember whether you've saved a copy.

Definition at line 120 of file Matrix.hpp.

◆ d

std::mt19937 Matrix::d
staticprivate

Randomness for random reordering.

Definition at line 137 of file Matrix.hpp.

◆ ground_clauses

vector<bool> Matrix::ground_clauses
private

We need to know this to control backtracking.

Definition at line 95 of file Matrix.hpp.

◆ index

vector<vector<MatrixPairType> > Matrix::index
private

We want to be able to quickly identify where in each clause a particular literal lives.

Store clause and position as pairs in a row corresponding to the literal.

Definition at line 128 of file Matrix.hpp.

◆ literal_clause_index

vector<vector<LiteralClausePairType> > Matrix::literal_clause_index
private

This corresponds closely to index, but has the actual Literal, and the Clause after the Literal's removal.

Definition at line 133 of file Matrix.hpp.

◆ negative_clauses

vector<bool> Matrix::negative_clauses
private

Keep track of which clauses are negative.

This allows start clause heuristics to be applied.

Definition at line 91 of file Matrix.hpp.

◆ num_equals

uint32_t Matrix::num_equals
private

You need to know how many equality axioms there are in case you want to move them around.

Definition at line 106 of file Matrix.hpp.

◆ positive_clauses

vector<bool> Matrix::positive_clauses
private

Keep track of which clauses are positive.

This allows start clause heuristics to be applied.

Definition at line 85 of file Matrix.hpp.

◆ roles_copy

vector<string> Matrix::roles_copy
private

It makes sense to keep a copy of the roles if your schedule reorders multiple times.

Definition at line 116 of file Matrix.hpp.


The documentation for this class was generated from the following files: