1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Kshitij Bansal, Andrew Reynolds, Aina Niemetz |
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 |
|
* Decision engine. |
14 |
|
*/ |
15 |
|
|
16 |
|
#include "cvc5_private.h" |
17 |
|
|
18 |
|
#ifndef CVC5__DECISION__DECISION_ENGINE_H |
19 |
|
#define CVC5__DECISION__DECISION_ENGINE_H |
20 |
|
|
21 |
|
#include "expr/node.h" |
22 |
|
#include "prop/cnf_stream.h" |
23 |
|
#include "prop/sat_solver.h" |
24 |
|
#include "prop/sat_solver_types.h" |
25 |
|
|
26 |
|
namespace cvc5 { |
27 |
|
|
28 |
|
namespace prop { |
29 |
|
class SkolemDefManager; |
30 |
|
} |
31 |
|
|
32 |
|
class DecisionEngineOld; |
33 |
|
|
34 |
|
namespace decision { |
35 |
|
|
36 |
9494 |
class DecisionEngine |
37 |
|
{ |
38 |
|
public: |
39 |
|
/** Constructor */ |
40 |
|
DecisionEngine(context::Context* sc, |
41 |
|
context::UserContext* uc, |
42 |
|
prop::SkolemDefManager* skdm, |
43 |
|
ResourceManager* rm); |
44 |
|
|
45 |
|
/** Finish initialize */ |
46 |
|
void finishInit(prop::CDCLTSatSolverInterface* ss, prop::CnfStream* cs); |
47 |
|
|
48 |
|
/** Presolve, called at the beginning of each check-sat call */ |
49 |
|
void presolve(); |
50 |
|
|
51 |
|
/** Gets the next decision based on strategies that are enabled */ |
52 |
|
prop::SatLiteral getNext(bool& stopSearch); |
53 |
|
|
54 |
|
/** Is the DecisionEngine in a state where it has solved everything? */ |
55 |
|
bool isDone(); |
56 |
|
|
57 |
|
/** |
58 |
|
* Notify this class that assertion is an (input) assertion, not corresponding |
59 |
|
* to a skolem definition. |
60 |
|
*/ |
61 |
|
void addAssertion(TNode assertion); |
62 |
|
/** |
63 |
|
* TODO: remove this interface |
64 |
|
* Notify this class that lem is the skolem definition for skolem, which is |
65 |
|
* a part of the current assertions. |
66 |
|
*/ |
67 |
|
void addSkolemDefinition(TNode lem, TNode skolem); |
68 |
|
/** |
69 |
|
* Notify this class that the literal n has been asserted, possibly |
70 |
|
* propagated by the SAT solver. |
71 |
|
*/ |
72 |
|
void notifyAsserted(TNode n); |
73 |
|
|
74 |
|
private: |
75 |
|
/** The old implementation */ |
76 |
|
std::unique_ptr<DecisionEngineOld> d_decEngineOld; |
77 |
|
/** Pointer to resource manager for associated SmtEngine */ |
78 |
|
ResourceManager* d_resourceManager; |
79 |
|
/** using old implementation? */ |
80 |
|
bool d_useOld; |
81 |
|
}; |
82 |
|
|
83 |
|
} // namespace decision |
84 |
|
} // namespace cvc5 |
85 |
|
|
86 |
|
#endif /* CVC5__DECISION__DECISION_ENGINE_H */ |