GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/quantifiers/ematching/instantiation_engine.h Lines: 1 1 100.0 %
Date: 2021-08-06 Branches: 1 2 50.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Andrew Reynolds, Mathias Preiner, Morgan Deters
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
 * Instantiation Engine classes.
14
 */
15
16
#include "cvc5_private.h"
17
18
#ifndef CVC5__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H
19
#define CVC5__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H
20
21
#include <vector>
22
23
#include "theory/quantifiers/ematching/inst_strategy.h"
24
#include "theory/quantifiers/ematching/trigger_database.h"
25
#include "theory/quantifiers/quant_module.h"
26
#include "theory/quantifiers/quant_relevance.h"
27
28
namespace cvc5 {
29
namespace theory {
30
namespace quantifiers {
31
32
class InstStrategyUserPatterns;
33
class InstStrategyAutoGenTriggers;
34
35
class InstantiationEngine : public QuantifiersModule {
36
 public:
37
  InstantiationEngine(QuantifiersState& qs,
38
                      QuantifiersInferenceManager& qim,
39
                      QuantifiersRegistry& qr,
40
                      TermRegistry& tr);
41
  ~InstantiationEngine();
42
  void presolve() override;
43
  bool needsCheck(Theory::Effort e) override;
44
  void reset_round(Theory::Effort e) override;
45
  void check(Theory::Effort e, QEffort quant_e) override;
46
  bool checkCompleteFor(Node q) override;
47
  void checkOwnership(Node q) override;
48
  void registerQuantifier(Node q) override;
49
  Node explain(TNode n) { return Node::null(); }
50
  /** add user pattern */
51
  void addUserPattern(Node q, Node pat);
52
  void addUserNoPattern(Node q, Node pat);
53
  /** Identify this module */
54
131091
  std::string identify() const override { return "InstEngine"; }
55
56
 private:
57
  /** is the engine incomplete for this quantifier */
58
  bool isIncomplete(Node q);
59
  /** do instantiation round */
60
  void doInstantiationRound(Theory::Effort effort);
61
  /** Return true if this module should process quantified formula q */
62
  bool shouldProcess(Node q);
63
  /** instantiation strategies */
64
  std::vector<InstStrategy*> d_instStrategies;
65
  /** user-pattern instantiation strategy */
66
  std::unique_ptr<InstStrategyUserPatterns> d_isup;
67
  /** auto gen triggers; only kept for destructor cleanup */
68
  std::unique_ptr<InstStrategyAutoGenTriggers> d_i_ag;
69
  /** current processing quantified formulas */
70
  std::vector<Node> d_quants;
71
  /** all triggers will be stored in this database */
72
  inst::TriggerDatabase d_trdb;
73
  /** for computing relevance of quantifiers */
74
  std::unique_ptr<QuantRelevance> d_quant_rel;
75
}; /* class InstantiationEngine */
76
77
}  // namespace quantifiers
78
}  // namespace theory
79
}  // namespace cvc5
80
81
#endif /* CVC5__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H */