forked from vprover/vampire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Forwards.hpp
448 lines (339 loc) · 9.67 KB
/
Forwards.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
/*
* File Forwards.hpp.
*
* This file is part of the source code of the software program
* Vampire.(unstable). It is protected by applicable
* copyright laws.
*
* This source code is distributed under the licence found here
* https://vprover.github.io/license.html
* and in the source directory
*
* In summary, you are allowed to use Vampire for non-commercial
* purposes but not allowed to distribute, modify, copy, create derivatives,
* or use in competitions.
* For other uses of Vampire please contact developers for a different
* licence, which we will make an effort to provide.
*/
/**
* @file Forwards.hpp
* Forward declarations of some classes
*/
#ifndef __Forwards__
#define __Forwards__
#include "Lib/VString.hpp"
typedef void (*VoidFunc)();
namespace Lib
{
template<typename C>
struct Relocator
{
static void relocate(C* oldAddr, void* newAddr)
{
new(newAddr) C( *oldAddr );
oldAddr->~C();
}
};
struct EmptyStruct {};
class Hash;
struct IdentityHash;
struct PtrIdentityHash;
template<typename T> class VirtualIterator;
typedef VirtualIterator<int> IntIterator;
typedef VirtualIterator<unsigned> UnsignedIterator;
template<typename T> class ScopedPtr;
template<typename T> class SmartPtr;
template<class T> class RCPtr;
template<typename T> class SingleParamEvent;
template<class C> class DArray;
template<class C> class Stack;
template<class C> class Vector;
template<typename T> class List;
template<typename T, class Comparator> class BinaryHeap;
template<typename T> class SharedSet;
template <typename Key, typename Val,class Hash=Lib::Hash> class Map;
template<typename T> class ArrayishObjectIterator;
template<typename T> class ArrayMap;
template<typename C> class Vector;
class ArraySet;
typedef List<int> IntList;
typedef List<VoidFunc> VoidFuncList;
typedef Stack<vstring> StringStack;
typedef Map<vstring,unsigned,Hash> SymbolMap;
template<typename T> struct FirstHashTypeInfo;
/**
* First hash for DHMap and DHMultiset classes.
*/
#define FIRST_HASH(Cl) typename FirstHashTypeInfo<Cl>::Type
//There is a bug (what else can it be?) in the VS2008 compiler that
//requires the name of the template parameter in the declaration to
//be the same as the name of the parameter used in definition, as
//long as the parameter is used in another parameter's default value.
//
//E.g. if the first parameter name here would be K instead of Key, we
//would get a compiler error, because in the Lib/DHMap.hpp file the
//definition of the class starts with
//template <typename Key, typename Val, class Hash1, class Hash2> class DHMap
// ^^^
template <typename Key, typename Val, class Hash1=FIRST_HASH(Key), class Hash2=Hash> class DHMap;
template <typename Val, class Hash1=FIRST_HASH(Val), class Hash2=Hash> class DHSet;
template <typename K,typename V, class Hash1=FIRST_HASH(K), class Hash2=Hash> class MapToLIFO;
template <typename Val,class Hash=Lib::Hash> class Set;
template <typename Value,class ValueComparator> class SkipList;
template<class Arr> class ArrayishObjectIterator;
template<typename T> class PointerIterator;
class BacktrackData;
class Timer;
namespace Sys
{
class Semaphore;
class SyncPipe;
}
};
namespace Kernel
{
using namespace Lib;
class IntegerConstantType;
struct RationalConstantType;
class RealConstantType;
/** Index of a variable */
typedef unsigned Var;
struct BoundId
{
Var var;
bool left;
/** Create uninitialized BoundId */
BoundId() {}
BoundId(Var var, bool left) : var(var), left(left) {}
BoundId operator-() const { return BoundId(var, !left); }
};
class CoeffNumber;
class BoundNumber;
class Constraint;
class Assignment;
class V2CIndex;
class Sorts;
class Signature;
class BaseType;
class FunctionType;
class PredicateType;
typedef VirtualIterator<Var> VarIterator;
typedef RCPtr<Constraint> ConstraintRCPtr;
typedef List<Constraint*> ConstraintList;
typedef List<ConstraintRCPtr> ConstraintRCList;
typedef VirtualIterator<Constraint*> ConstraintIterator;
typedef Stack<Constraint*> ConstraintStack;
typedef Stack<ConstraintRCPtr> ConstraintRCStack;
class TermList;
typedef VirtualIterator<TermList> TermIterator;
typedef Stack<TermList> TermStack;
class Term;
class Literal;
typedef List<Literal*> LiteralList;
typedef Stack<Literal*> LiteralStack;
typedef VirtualIterator<Literal*> LiteralIterator;
class Inference;
class Unit;
typedef List<Unit*> UnitList;
typedef Stack<Unit*> UnitStack;
typedef VirtualIterator<Unit*> UnitIterator;
class FormulaUnit;
class Formula;
typedef List<Formula*> FormulaList;
typedef VirtualIterator<Formula*> FormulaIterator;
typedef Stack<Formula*> FormulaStack;
class Clause;
/** Defined as VirtualIterator<Clause*> */
typedef VirtualIterator<Clause*> ClauseIterator;
typedef SingleParamEvent<Clause*> ClauseEvent;
typedef List<Clause*> ClauseList;
typedef Stack<Clause*> ClauseStack;
typedef VirtualIterator<Literal*> LiteralIterator;
class Problem;
class FlatTerm;
class Renaming;
class Substitution;
class RobSubstitution;
typedef VirtualIterator<RobSubstitution*> SubstIterator;
typedef Lib::SmartPtr<RobSubstitution> RobSubstitutionSP;
class EGSubstitution;
typedef VirtualIterator<EGSubstitution*> RSubstIterator;
typedef Lib::SmartPtr<EGSubstitution> EGSubstitutionSP;
class Matcher;
typedef VirtualIterator<Matcher*> MatchIterator;
class TermTransformer;
class TermTransformerTransformTransformed;
class FormulaTransformer;
class FormulaUnitTransformer;
class LiteralSelector;
typedef Lib::SmartPtr<LiteralSelector> LiteralSelectorSP;
class Ordering;
typedef Lib::SmartPtr<Ordering> OrderingSP;
class Grounder;
class GlobalSubsumptionGrounder;
class IGGrounder;
typedef Lib::ScopedPtr<Grounder> GrounderSCP;
class BDD;
class BDDNode;
typedef unsigned SplitLevel;
typedef const SharedSet<SplitLevel> SplitSet;
typedef const SharedSet<unsigned> VarSet;
/**
* Color of a term
*
* To be used for symbol elimination or interpolant extraction.
*/
enum Color {
COLOR_TRANSPARENT = 0u,
COLOR_LEFT = 1u,
COLOR_RIGHT = 2u,
/**
* This color can never occur
*
* It can be used as an initial value to mark that the color is
* yet to be determined. */
COLOR_INVALID = 3u
};
class MainLoop;
typedef Lib::SmartPtr<MainLoop> MainLoopSP;
namespace Algebra
{
class ArithmeticKB;
};
};
namespace Indexing
{
class Index;
class IndexManager;
class LiteralIndex;
class LiteralIndexingStructure;
class TermIndex;
class TermIndexingStructure;
class ClauseSubsumptionIndex;
class FormulaIndex;
class TermSharing;
class ResultSubstitution;
typedef Lib::SmartPtr<ResultSubstitution> ResultSubstitutionSP;
struct SLQueryResult;
struct TermQueryResult;
class GeneratingLiteralIndex;
class SimplifyingLiteralIndex;
class UnitClauseLiteralIndex;
class FwSubsSimplifyingLiteralIndex;
class SubstitutionTree;
class LiteralSubstitutionTree;
class CodeTree;
class TermCodeTree;
class ClauseCodeTree;
class CodeTreeTIS;
class CodeTreeLIS;
class CodeTreeSubsumptionIndex;
class ArithmeticIndex;
class ConstraintDatabase;
};
namespace Saturation
{
class SaturationAlgorithm;
typedef Lib::SmartPtr<SaturationAlgorithm> SaturationAlgorithmSP;
class ClauseContainer;
class UnprocessedClauseContainer;
class PassiveClauseContainer;
typedef Lib::SmartPtr<PassiveClauseContainer> PassiveClauseContainerSP;
class ActiveClauseContainer;
class Limits;
class Splitter;
class ConsequenceFinder;
class LabelFinder;
class SymElOutput;
}
namespace Inferences
{
class InferenceEngine;
class GeneratingInferenceEngine;
typedef Lib::SmartPtr<GeneratingInferenceEngine> GeneratingInferenceEngineSP;
class ImmediateSimplificationEngine;
typedef Lib::SmartPtr<ImmediateSimplificationEngine> ImmediateSimplificationEngineSP;
class ForwardSimplificationEngine;
typedef Lib::SmartPtr<ForwardSimplificationEngine> ForwardSimplificationEngineSP;
class BackwardSimplificationEngine;
typedef Lib::SmartPtr<BackwardSimplificationEngine> BackwardSimplificationEngineSP;
class BDDMarkingSubsumption;
}
namespace SAT
{
using namespace Lib;
class SATClause;
class SATLiteral;
class SATInference;
class SATSolver;
typedef ScopedPtr<SATSolver> SATSolverSCP;
class TWLSolver;
class RestartStrategy;
typedef ScopedPtr<RestartStrategy> RestartStrategySCP;
class VariableSelector;
typedef ScopedPtr<VariableSelector> VariableSelectorSCP;
class RLCSelector;
class ClauseDisposer;
typedef ScopedPtr<ClauseDisposer> ClauseDisposerSCP;
typedef VirtualIterator<SATClause*> SATClauseIterator;
typedef List<SATClause*> SATClauseList;
typedef Stack<SATClause*> SATClauseStack;
typedef VirtualIterator<SATLiteral> SATLiteralIterator;
typedef Stack<SATLiteral> SATLiteralStack;
}
namespace Shell
{
class AnswerLiteralManager;
class LaTeX;
class Options;
class Property;
class Statistics;
class EPRRestoring;
class EPRInlining;
namespace LTB
{
class Storage;
class Builder;
class Selector;
}
}
namespace InstGen
{
class IGAlgorithm;
class ModelPrinter;
}
namespace DP
{
class DecisionProcedure;
class ScopedDecisionProcedure;
}
/**
* Deletion of incomplete class types causes memory leaks. Using this
* causes compile error when deleting incomplete classes.
*
* (see http://www.boost.org/doc/libs/1_36_0/libs/utility/checked_delete.html )
*/
template<class T> inline void checked_delete(T * x)
{
CALL("Forwards/checked_delete");
// intentionally complex - simplification causes regressions
typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
(void) sizeof(type_must_be_complete);
delete x;
}
namespace Solving
{
using namespace Lib;
/**
* Represents number of decision points at a given moment.
* Negative values have special meaning depending on where they occur.
*/
typedef int DecisionLevel;
class AssignmentSelector;
class VariableSelector;
class Solver;
class BoundsArray;
class BoundInfo;
typedef Stack<BoundInfo> BoundStack;
}
#endif /* __Forwards__ */