summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers/fmf/model_builder.h
blob: 94eab1fd6a6c0ebac70c36cd3c38ca23adecb1e9 (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
/*********************                                                        */
/*! \file model_builder.h
 ** \verbatim
 ** Top contributors (to current version):
 **   Andrew Reynolds, Mathias Preiner
 ** 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 Model Builder class
 **/

#include "cvc4_private.h"

#ifndef CVC5__THEORY__QUANTIFIERS__MODEL_BUILDER_H
#define CVC5__THEORY__QUANTIFIERS__MODEL_BUILDER_H

#include "expr/node.h"
#include "theory/quantifiers/inst_match.h"
#include "theory/theory_model_builder.h"

namespace cvc5 {
namespace theory {
namespace quantifiers {

class FirstOrderModel;
class QuantifiersState;
class QuantifiersRegistry;
class QuantifiersInferenceManager;

class QModelBuilder : public TheoryEngineModelBuilder
{
 protected:
  // must call preProcessBuildModelStd
  bool preProcessBuildModel(TheoryModel* m) override;
  bool preProcessBuildModelStd(TheoryModel* m);
  /** number of lemmas generated while building model */
  unsigned d_addedLemmas;
  unsigned d_triedLemmas;

 public:
  QModelBuilder(QuantifiersState& qs,
                QuantifiersRegistry& qr,
                QuantifiersInferenceManager& qim);

  //do exhaustive instantiation  
  // 0 :  failed, but resorting to true exhaustive instantiation may work
  // >0 : success
  // <0 : failed
  virtual int doExhaustiveInstantiation( FirstOrderModel * fm, Node f, int effort ) { return false; }
  //whether to construct model
  virtual bool optUseModel();
  /** exist instantiation ? */
  virtual bool existsInstantiation( Node f, InstMatch& m, bool modEq = true, bool modInst = false ) { return false; }
  //debug model
  void debugModel(TheoryModel* m) override;
  //statistics 
  unsigned getNumAddedLemmas() { return d_addedLemmas; }
  unsigned getNumTriedLemmas() { return d_triedLemmas; }

 protected:
  /** Pointer to quantifiers engine */
  QuantifiersEngine* d_qe;
  /** The quantifiers state object */
  QuantifiersState& d_qstate;
  /** Reference to the quantifiers registry */
  QuantifiersRegistry& d_qreg;
  /** The quantifiers inference manager */
  quantifiers::QuantifiersInferenceManager& d_qim;
};

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

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