1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Gereon Kremer, 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 |
|
* Check for factoring lemma. |
14 |
|
*/ |
15 |
|
|
16 |
|
#ifndef CVC5__THEORY__ARITH__NL__EXT__FACTORING_CHECK_H |
17 |
|
#define CVC5__THEORY__ARITH__NL__EXT__FACTORING_CHECK_H |
18 |
|
|
19 |
|
#include <vector> |
20 |
|
|
21 |
|
#include "expr/node.h" |
22 |
|
|
23 |
|
namespace cvc5 { |
24 |
|
|
25 |
|
class CDProof; |
26 |
|
|
27 |
|
namespace theory { |
28 |
|
namespace arith { |
29 |
|
namespace nl { |
30 |
|
|
31 |
|
struct ExtState; |
32 |
|
|
33 |
5206 |
class FactoringCheck |
34 |
|
{ |
35 |
|
public: |
36 |
|
FactoringCheck(ExtState* data); |
37 |
|
|
38 |
|
/** check factoring |
39 |
|
* |
40 |
|
* Returns a set of valid theory lemmas, based on a |
41 |
|
* lemma schema that states a relationship between monomials |
42 |
|
* with common factors that occur in the same constraint. |
43 |
|
* |
44 |
|
* Examples: |
45 |
|
* |
46 |
|
* x*z+y*z > t => ( k = x + y ^ k*z > t ) |
47 |
|
* ...where k is fresh and x*z + y*z > t is a |
48 |
|
* constraint that occurs in the current context. |
49 |
|
*/ |
50 |
|
void check(const std::vector<Node>& asserts, |
51 |
|
const std::vector<Node>& false_asserts); |
52 |
|
|
53 |
|
private: |
54 |
|
/** Basic data that is shared with other checks */ |
55 |
|
ExtState* d_data; |
56 |
|
|
57 |
|
/** maps nodes to their factor skolems */ |
58 |
|
std::map<Node, Node> d_factor_skolem; |
59 |
|
|
60 |
|
Node d_zero; |
61 |
|
Node d_one; |
62 |
|
|
63 |
|
/** |
64 |
|
* Introduces a new purification skolem k for n and adds k=n as lemma. |
65 |
|
* If proof is not nullptr, it proves this lemma via MACRO_SR_PRED_INTRO. |
66 |
|
*/ |
67 |
|
Node getFactorSkolem(Node n, CDProof* proof); |
68 |
|
}; |
69 |
|
|
70 |
|
} // namespace nl |
71 |
|
} // namespace arith |
72 |
|
} // namespace theory |
73 |
|
} // namespace cvc5 |
74 |
|
|
75 |
|
#endif |