summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers/ematching/instantiation_engine.h
blob: bd7388afb940a64cc82852e2b46cbdbd2f705c63 (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
74
75
76
77
78
79
80
/*********************                                                        */
/*! \file instantiation_engine.h
 ** \verbatim
 ** Top contributors (to current version):
 **   Andrew Reynolds, Mathias Preiner, Morgan Deters
 ** This file is part of the CVC4 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.\endverbatim
 **
 ** \brief Instantiation Engine classes
 **/

#include "cvc4_private.h"

#ifndef CVC4__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H
#define CVC4__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H

#include <vector>

#include "theory/quantifiers/ematching/inst_strategy.h"
#include "theory/quantifiers/ematching/trigger_database.h"
#include "theory/quantifiers/quant_module.h"
#include "theory/quantifiers/quant_relevance.h"

namespace cvc5 {
namespace theory {
namespace quantifiers {

class InstStrategyUserPatterns;
class InstStrategyAutoGenTriggers;

class InstantiationEngine : public QuantifiersModule {
 public:
  InstantiationEngine(QuantifiersState& qs,
                      QuantifiersInferenceManager& qim,
                      QuantifiersRegistry& qr,
                      TermRegistry& tr);
  ~InstantiationEngine();
  void presolve() override;
  bool needsCheck(Theory::Effort e) override;
  void reset_round(Theory::Effort e) override;
  void check(Theory::Effort e, QEffort quant_e) override;
  bool checkCompleteFor(Node q) override;
  void checkOwnership(Node q) override;
  void registerQuantifier(Node q) override;
  Node explain(TNode n) { return Node::null(); }
  /** add user pattern */
  void addUserPattern(Node q, Node pat);
  void addUserNoPattern(Node q, Node pat);
  /** Identify this module */
  std::string identify() const override { return "InstEngine"; }

 private:
  /** is the engine incomplete for this quantifier */
  bool isIncomplete(Node q);
  /** do instantiation round */
  void doInstantiationRound(Theory::Effort effort);
  /** Return true if this module should process quantified formula q */
  bool shouldProcess(Node q);
  /** instantiation strategies */
  std::vector<InstStrategy*> d_instStrategies;
  /** user-pattern instantiation strategy */
  std::unique_ptr<InstStrategyUserPatterns> d_isup;
  /** auto gen triggers; only kept for destructor cleanup */
  std::unique_ptr<InstStrategyAutoGenTriggers> d_i_ag;
  /** current processing quantified formulas */
  std::vector<Node> d_quants;
  /** all triggers will be stored in this database */
  inst::TriggerDatabase d_trdb;
  /** for computing relevance of quantifiers */
  std::unique_ptr<QuantRelevance> d_quant_rel;
}; /* class InstantiationEngine */

}  // namespace quantifiers
}  // namespace theory
}  // namespace cvc5

#endif /* CVC4__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback