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 |
|
* Branch and bound for arithmetic |
14 |
|
*/ |
15 |
|
|
16 |
|
#include "cvc5_private.h" |
17 |
|
|
18 |
|
#ifndef CVC5__THEORY__ARITH__BRANCH_AND_BOUND__H |
19 |
|
#define CVC5__THEORY__ARITH__BRANCH_AND_BOUND__H |
20 |
|
|
21 |
|
#include <map> |
22 |
|
|
23 |
|
#include "expr/node.h" |
24 |
|
#include "proof/proof_node_manager.h" |
25 |
|
#include "proof/trust_node.h" |
26 |
|
#include "theory/arith/arith_state.h" |
27 |
|
#include "theory/arith/inference_manager.h" |
28 |
|
#include "theory/arith/pp_rewrite_eq.h" |
29 |
|
#include "util/rational.h" |
30 |
|
|
31 |
|
namespace cvc5 { |
32 |
|
namespace theory { |
33 |
|
namespace arith { |
34 |
|
|
35 |
|
/** |
36 |
|
* Class is responsible for constructing branch and bound lemmas. It is |
37 |
|
* agnostic to the state of solver; instead is simply given (variable, value) |
38 |
|
* pairs in branchIntegerVariable below and constructs the appropriate lemma. |
39 |
|
*/ |
40 |
|
class BranchAndBound |
41 |
|
{ |
42 |
|
public: |
43 |
|
BranchAndBound(ArithState& s, |
44 |
|
InferenceManager& im, |
45 |
|
PreprocessRewriteEq& ppre, |
46 |
|
ProofNodeManager* pnm); |
47 |
9851 |
~BranchAndBound() {} |
48 |
|
/** |
49 |
|
* Branch variable, called when integer var has given value |
50 |
|
* in the current model, returns a split to eliminate this model. |
51 |
|
*/ |
52 |
|
TrustNode branchIntegerVariable(TNode var, Rational value); |
53 |
|
|
54 |
|
private: |
55 |
|
/** Are proofs enabled? */ |
56 |
|
bool proofsEnabled() const; |
57 |
|
/** Reference to the state */ |
58 |
|
ArithState& d_astate; |
59 |
|
/** Reference to the inference manager */ |
60 |
|
InferenceManager& d_im; |
61 |
|
/** Reference to the preprocess rewriter for equality */ |
62 |
|
PreprocessRewriteEq& d_ppre; |
63 |
|
/** Proof generator. */ |
64 |
|
std::unique_ptr<EagerProofGenerator> d_pfGen; |
65 |
|
/** Proof node manager */ |
66 |
|
ProofNodeManager* d_pnm; |
67 |
|
}; |
68 |
|
|
69 |
|
} // namespace arith |
70 |
|
} // namespace theory |
71 |
|
} // namespace cvc5 |
72 |
|
|
73 |
|
#endif |