GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/quantifiers/fmf/model_builder.h Lines: 4 5 80.0 %
Date: 2021-05-22 Branches: 0 0 0.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Andrew Reynolds, Mathias Preiner, Gereon Kremer
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
 * Model Builder class.
14
 */
15
16
#include "cvc5_private.h"
17
18
#ifndef CVC5__THEORY__QUANTIFIERS__MODEL_BUILDER_H
19
#define CVC5__THEORY__QUANTIFIERS__MODEL_BUILDER_H
20
21
#include "expr/node.h"
22
#include "theory/quantifiers/inst_match.h"
23
#include "theory/theory_model_builder.h"
24
25
namespace cvc5 {
26
namespace theory {
27
namespace quantifiers {
28
29
class FirstOrderModel;
30
class QuantifiersState;
31
class QuantifiersRegistry;
32
class QuantifiersInferenceManager;
33
class TermRegistry;
34
35
17579
class QModelBuilder : public TheoryEngineModelBuilder
36
{
37
 protected:
38
  // must call preProcessBuildModelStd
39
  bool preProcessBuildModel(TheoryModel* m) override;
40
  bool preProcessBuildModelStd(TheoryModel* m);
41
  /** number of lemmas generated while building model */
42
  unsigned d_addedLemmas;
43
  unsigned d_triedLemmas;
44
45
 public:
46
  QModelBuilder(QuantifiersState& qs,
47
                QuantifiersInferenceManager& qim,
48
                QuantifiersRegistry& qr,
49
                TermRegistry& tr);
50
  /** finish init, which sets the model object */
51
  virtual void finishInit();
52
  //do exhaustive instantiation
53
  // 0 :  failed, but resorting to true exhaustive instantiation may work
54
  // >0 : success
55
  // <0 : failed
56
174
  virtual int doExhaustiveInstantiation( FirstOrderModel * fm, Node f, int effort ) { return false; }
57
  //whether to construct model
58
  virtual bool optUseModel();
59
  /** exist instantiation ? */
60
  virtual bool existsInstantiation( Node f, InstMatch& m, bool modEq = true, bool modInst = false ) { return false; }
61
  //debug model
62
  void debugModel(TheoryModel* m) override;
63
  //statistics
64
24128
  unsigned getNumAddedLemmas() { return d_addedLemmas; }
65
24128
  unsigned getNumTriedLemmas() { return d_triedLemmas; }
66
  /** get the model we are using */
67
  FirstOrderModel* getModel();
68
69
 protected:
70
  /** The quantifiers state object */
71
  QuantifiersState& d_qstate;
72
  /** The quantifiers inference manager */
73
  QuantifiersInferenceManager& d_qim;
74
  /** Reference to the quantifiers registry */
75
  QuantifiersRegistry& d_qreg;
76
  /** Term registry */
77
  TermRegistry& d_treg;
78
  /** Pointer to the model object we are using */
79
  FirstOrderModel* d_model;
80
  /** The model object we have allocated */
81
  std::unique_ptr<FirstOrderModel> d_modelAloc;
82
};
83
84
}  // namespace quantifiers
85
}  // namespace theory
86
}  // namespace cvc5
87
88
#endif /* CVC5__THEORY__QUANTIFIERS__MODEL_BUILDER_H */