blob: acdc0010b84adfd32a0e81392977161c93db3878 (
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
72
73
|
/******************************************************************************
* Top contributors (to current version):
* Andrew Reynolds
*
* This file is part of the cvc5 project.
*
* Copyright (c) 2009-2021 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.
* ****************************************************************************
*
* Pool-based instantiation strategy
*/
#include "cvc5_private.h"
#ifndef CVC5__THEORY__QUANTIFIERS__INST_STRATEGY_POOL_H
#define CVC5__THEORY__QUANTIFIERS__INST_STRATEGY_POOL_H
#include "theory/quantifiers/quant_module.h"
namespace cvc5 {
namespace theory {
namespace quantifiers {
/**
* Pool-based instantiation. This implements a strategy for instantiating
* quantifiers based on user-provided pool annotations.
*
* When check is invoked, this strategy considers each
* INST_POOL annotation on quantified formulas. For each annotation, it
* instantiates the associated quantified formula with the Cartesian
* product of terms currently in the pool, using efficient techniques for
* enumerating over tuples of terms, as implemented in the term tuple
* enumerator utilities (see quantifiers/term_tuple_enumerator.h).
*/
class InstStrategyPool : public QuantifiersModule
{
public:
InstStrategyPool(QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
TermRegistry& tr);
~InstStrategyPool() {}
/** Presolve */
void presolve() override;
/** Needs check. */
bool needsCheck(Theory::Effort e) override;
/** Reset round. */
void reset_round(Theory::Effort e) override;
/** Register quantified formula q */
void registerQuantifier(Node q) override;
/** Check.
* Adds instantiations for all currently asserted
* quantified formulas via calls to process(...)
*/
void check(Theory::Effort e, QEffort quant_e) override;
/** Identify. */
std::string identify() const override;
private:
/** Process quantified formula with user pool */
bool process(Node q, Node p, uint64_t& addedLemmas);
/** Map from quantified formulas to user pools */
std::map<Node, std::vector<Node> > d_userPools;
};
} // namespace quantifiers
} // namespace theory
} // namespace cvc5
#endif
|