GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/quantifiers/inst_strategy_pool.h Lines: 1 1 100.0 %
Date: 2021-05-22 Branches: 0 0 0.0 %

Line Exec Source
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
 * Pool-based instantiation strategy
14
 */
15
16
#include "cvc5_private.h"
17
18
#ifndef CVC5__THEORY__QUANTIFIERS__INST_STRATEGY_POOL_H
19
#define CVC5__THEORY__QUANTIFIERS__INST_STRATEGY_POOL_H
20
21
#include "theory/quantifiers/quant_module.h"
22
23
namespace cvc5 {
24
namespace theory {
25
namespace quantifiers {
26
27
/**
28
 * Pool-based instantiation. This implements a strategy for instantiating
29
 * quantifiers based on user-provided pool annotations.
30
 *
31
 * When check is invoked, this strategy considers each
32
 * INST_POOL annotation on quantified formulas. For each annotation, it
33
 * instantiates the associated quantified formula with the Cartesian
34
 * product of terms currently in the pool, using efficient techniques for
35
 * enumerating over tuples of terms, as implemented in the term tuple
36
 * enumerator utilities (see quantifiers/term_tuple_enumerator.h).
37
 */
38
class InstStrategyPool : public QuantifiersModule
39
{
40
 public:
41
  InstStrategyPool(QuantifiersState& qs,
42
                   QuantifiersInferenceManager& qim,
43
                   QuantifiersRegistry& qr,
44
                   TermRegistry& tr);
45
12828
  ~InstStrategyPool() {}
46
  /** Presolve */
47
  void presolve() override;
48
  /** Needs check. */
49
  bool needsCheck(Theory::Effort e) override;
50
  /** Reset round. */
51
  void reset_round(Theory::Effort e) override;
52
  /** Register quantified formula q */
53
  void registerQuantifier(Node q) override;
54
  /** Check.
55
   * Adds instantiations for all currently asserted
56
   * quantified formulas via calls to process(...)
57
   */
58
  void check(Theory::Effort e, QEffort quant_e) override;
59
  /** Identify. */
60
  std::string identify() const override;
61
62
 private:
63
  /** Process quantified formula with user pool */
64
  bool process(Node q, Node p, uint64_t& addedLemmas);
65
  /** Map from quantified formulas to user pools */
66
  std::map<Node, std::vector<Node> > d_userPools;
67
};
68
69
}  // namespace quantifiers
70
}  // namespace theory
71
}  // namespace cvc5
72
73
#endif