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

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