GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/quantifiers/ematching/instantiation_engine.h Lines: 1 1 100.0 %
Date: 2021-09-15 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(Env& env,
38
                      QuantifiersState& qs,
39
                      QuantifiersInferenceManager& qim,
40
                      QuantifiersRegistry& qr,
41
                      TermRegistry& tr);
42
  ~InstantiationEngine();
43
  void presolve() override;
44
  bool needsCheck(Theory::Effort e) override;
45
  void reset_round(Theory::Effort e) override;
46
  void check(Theory::Effort e, QEffort quant_e) override;
47
  bool checkCompleteFor(Node q) override;
48
  void checkOwnership(Node q) override;
49
  void registerQuantifier(Node q) override;
50
  Node explain(TNode n) { return Node::null(); }
51
  /** add user pattern */
52
  void addUserPattern(Node q, Node pat);
53
  void addUserNoPattern(Node q, Node pat);
54
  /** Identify this module */
55
128847
  std::string identify() const override { return "InstEngine"; }
56
57
 private:
58
  /** is the engine incomplete for this quantifier */
59
  bool isIncomplete(Node q);
60
  /** do instantiation round */
61
  void doInstantiationRound(Theory::Effort effort);
62
  /** Return true if this module should process quantified formula q */
63
  bool shouldProcess(Node q);
64
  /** instantiation strategies */
65
  std::vector<InstStrategy*> d_instStrategies;
66
  /** user-pattern instantiation strategy */
67
  std::unique_ptr<InstStrategyUserPatterns> d_isup;
68
  /** auto gen triggers; only kept for destructor cleanup */
69
  std::unique_ptr<InstStrategyAutoGenTriggers> d_i_ag;
70
  /** current processing quantified formulas */
71
  std::vector<Node> d_quants;
72
  /** all triggers will be stored in this database */
73
  inst::TriggerDatabase d_trdb;
74
  /** for computing relevance of quantifiers */
75
  std::unique_ptr<QuantRelevance> d_quant_rel;
76
}; /* class InstantiationEngine */
77
78
}  // namespace quantifiers
79
}  // namespace theory
80
}  // namespace cvc5
81
82
#endif /* CVC5__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H */