blob: c03f8d229c96c11e67b3089b33690e14dfab7a23 (
plain)
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
|
/********************* */
/*! \file quant_relevance.h
** \verbatim
** Top contributors (to current version):
** Andrew Reynolds, Morgan Deters, Mathias Preiner
** This file is part of the CVC4 project.
** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS
** in the top-level source directory) and their institutional affiliations.
** All rights reserved. See the file COPYING in the top-level source
** directory for licensing information.\endverbatim
**
** \brief quantifier relevance
**/
#include "cvc4_private.h"
#ifndef CVC4__THEORY__QUANT_RELEVANCE_H
#define CVC4__THEORY__QUANT_RELEVANCE_H
#include <map>
#include "theory/quantifiers/quant_util.h"
namespace CVC4 {
namespace theory {
namespace quantifiers {
/** QuantRelevance
*
* This class is used for implementing SinE-style heuristics
* (e.g. see Hoder et al. CADE 2011)
* This is enabled by the option --relevant-triggers.
*/
class QuantRelevance : public QuantifiersUtil
{
public:
/** constructor
* cr is whether relevance is computed by this class.
* if this is false, then all calls to getRelevance
* return -1.
*/
QuantRelevance() {}
~QuantRelevance() {}
/** reset */
bool reset(Theory::Effort e) override { return true; }
/** register quantifier */
void registerQuantifier(Node q) override;
/** identify */
std::string identify() const override { return "QuantRelevance"; }
/** get number of quantifiers for symbol s */
unsigned getNumQuantifiersForSymbol(Node s)
{
return d_syms_quants[s].size();
}
private:
/** map from quantifiers to symbols they contain */
std::map<Node, std::vector<Node> > d_syms;
/** map from symbols to quantifiers */
std::map<Node, std::vector<Node> > d_syms_quants;
/** relevance for quantifiers and symbols */
std::map<Node, int> d_relevance;
/** compute symbols */
void computeSymbols(Node n, std::vector<Node>& syms);
};
} /* CVC4::theory::quantifiers namespace */
} /* CVC4::theory namespace */
} /* CVC4 namespace */
#endif /* CVC4__THEORY__QUANT_RELEVANCE_H */
|