GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/quantifiers/quantifiers_state.h Lines: 1 1 100.0 %
Date: 2021-08-01 Branches: 0 0 0.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Andrew Reynolds
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
 * Utility for quantifiers state.
14
 */
15
16
#include "cvc5_private.h"
17
18
#ifndef CVC5__THEORY__QUANTIFIERS__QUANTIFIERS_STATE_H
19
#define CVC5__THEORY__QUANTIFIERS__QUANTIFIERS_STATE_H
20
21
#include "theory/quantifiers/quantifiers_statistics.h"
22
#include "theory/theory.h"
23
#include "theory/theory_state.h"
24
25
namespace cvc5 {
26
namespace theory {
27
namespace quantifiers {
28
29
/**
30
 * The quantifiers state.
31
 */
32
class QuantifiersState : public TheoryState
33
{
34
 public:
35
  QuantifiersState(context::Context* c,
36
                   context::UserContext* u,
37
                   Valuation val,
38
                   const LogicInfo& logicInfo);
39
9838
  ~QuantifiersState() {}
40
  /**
41
   * Increment the instantiation counters, called once at the beginning of when
42
   * we perform a check with quantifiers engine for the given effort.
43
   */
44
  void incrementInstRoundCounters(Theory::Effort e);
45
  /**
46
   * Get whether we need to check at effort e based on the inst-when mode. This
47
   * option determines the policy of quantifier instantiation and theory
48
   * combination, e.g. does it run before, after, or interleaved with theory
49
   * combination. This is based on the state of the counters maintained by this
50
   * class.
51
   */
52
  bool getInstWhenNeedsCheck(Theory::Effort e) const;
53
  /** Get the number of instantiation rounds performed in this SAT context */
54
  uint64_t getInstRoundDepth() const;
55
  /** Get the total number of instantiation rounds performed */
56
  uint64_t getInstRounds() const;
57
  /** debug print equality engine on trace c */
58
  void debugPrintEqualityEngine(const char* c) const;
59
  /** get the logic info */
60
  const LogicInfo& getLogicInfo() const;
61
  /** get the stats */
62
  QuantifiersStatistics& getStats();
63
64
 private:
65
  /** The number of instantiation rounds in this SAT context */
66
  context::CDO<uint64_t> d_ierCounterc;
67
  /** The number of total instantiation rounds (full effort) */
68
  uint64_t d_ierCounter;
69
  /** The number of total instantiation rounds (last call effort) */
70
  uint64_t d_ierCounterLc;
71
  /**
72
   * A counter to remember the last value of d_ierCounterLc where we a
73
   * full effort check. This is used for interleaving theory combination
74
   * and quantifier instantiation rounds.
75
   */
76
  uint64_t d_ierCounterLastLc;
77
  /**
78
   * The number of instantiation rounds we run for each call to theory
79
   * combination.
80
   */
81
  uint64_t d_instWhenPhase;
82
  /** Information about the logic we're operating within. */
83
  const LogicInfo& d_logicInfo;
84
  /** The statistics */
85
  QuantifiersStatistics d_statistics;
86
};
87
88
}  // namespace quantifiers
89
}  // namespace theory
90
}  // namespace cvc5
91
92
#endif /* CVC5__THEORY__QUANTIFIERS__QUANTIFIERS_STATE_H */