1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Andrew Reynolds |
4 |
|
* |
5 |
|
* This file is part of the cvc5 project. |
6 |
|
* |
7 |
|
* Copyright (c) 2009-2021 by the authors listed in the file AUTHORS |
8 |
|
* in the top-level source directory and their institutional affiliations. |
9 |
|
* All rights reserved. See the file COPYING in the top-level source |
10 |
|
* directory for licensing information. |
11 |
|
* **************************************************************************** |
12 |
|
* |
13 |
|
* Utility for quantifiers state. |
14 |
|
*/ |
15 |
|
|
16 |
|
#include "cvc5_private.h" |
17 |
|
|
18 |
|
#ifndef CVC5__THEORY__QUANTIFIERS__QUANTIFIERS_STATE_H |
19 |
|
#define CVC5__THEORY__QUANTIFIERS__QUANTIFIERS_STATE_H |
20 |
|
|
21 |
|
#include "theory/quantifiers/quantifiers_statistics.h" |
22 |
|
#include "theory/theory.h" |
23 |
|
#include "theory/theory_state.h" |
24 |
|
|
25 |
|
namespace cvc5 { |
26 |
|
namespace theory { |
27 |
|
namespace quantifiers { |
28 |
|
|
29 |
|
/** |
30 |
|
* The quantifiers state. |
31 |
|
*/ |
32 |
|
class QuantifiersState : public TheoryState |
33 |
|
{ |
34 |
|
public: |
35 |
|
QuantifiersState(Env& env, |
36 |
|
Valuation val, |
37 |
|
const LogicInfo& logicInfo); |
38 |
9924 |
~QuantifiersState() {} |
39 |
|
/** |
40 |
|
* Increment the instantiation counters, called once at the beginning of when |
41 |
|
* we perform a check with quantifiers engine for the given effort. |
42 |
|
*/ |
43 |
|
void incrementInstRoundCounters(Theory::Effort e); |
44 |
|
/** |
45 |
|
* Get whether we need to check at effort e based on the inst-when mode. This |
46 |
|
* option determines the policy of quantifier instantiation and theory |
47 |
|
* combination, e.g. does it run before, after, or interleaved with theory |
48 |
|
* combination. This is based on the state of the counters maintained by this |
49 |
|
* class. |
50 |
|
*/ |
51 |
|
bool getInstWhenNeedsCheck(Theory::Effort e) const; |
52 |
|
/** Get the number of instantiation rounds performed in this SAT context */ |
53 |
|
uint64_t getInstRoundDepth() const; |
54 |
|
/** Get the total number of instantiation rounds performed */ |
55 |
|
uint64_t getInstRounds() const; |
56 |
|
/** debug print equality engine on trace c */ |
57 |
|
void debugPrintEqualityEngine(const char* c) const; |
58 |
|
/** get the logic info */ |
59 |
|
const LogicInfo& getLogicInfo() const; |
60 |
|
/** get the stats */ |
61 |
|
QuantifiersStatistics& getStats(); |
62 |
|
|
63 |
|
private: |
64 |
|
/** The number of instantiation rounds in this SAT context */ |
65 |
|
context::CDO<uint64_t> d_ierCounterc; |
66 |
|
/** The number of total instantiation rounds (full effort) */ |
67 |
|
uint64_t d_ierCounter; |
68 |
|
/** The number of total instantiation rounds (last call effort) */ |
69 |
|
uint64_t d_ierCounterLc; |
70 |
|
/** |
71 |
|
* A counter to remember the last value of d_ierCounterLc where we a |
72 |
|
* full effort check. This is used for interleaving theory combination |
73 |
|
* and quantifier instantiation rounds. |
74 |
|
*/ |
75 |
|
uint64_t d_ierCounterLastLc; |
76 |
|
/** |
77 |
|
* The number of instantiation rounds we run for each call to theory |
78 |
|
* combination. |
79 |
|
*/ |
80 |
|
uint64_t d_instWhenPhase; |
81 |
|
/** Information about the logic we're operating within. */ |
82 |
|
const LogicInfo& d_logicInfo; |
83 |
|
/** The statistics */ |
84 |
|
QuantifiersStatistics d_statistics; |
85 |
|
}; |
86 |
|
|
87 |
|
} // namespace quantifiers |
88 |
|
} // namespace theory |
89 |
|
} // namespace cvc5 |
90 |
|
|
91 |
|
#endif /* CVC5__THEORY__QUANTIFIERS__QUANTIFIERS_STATE_H */ |