GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/preprocessing/learned_literal_manager.h Lines: 1 1 100.0 %
Date: 2021-11-05 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
 * Learned literal manager
14
 */
15
16
#include "cvc5_private.h"
17
18
#ifndef CVC5__PREPROCESSING__LEARNED_LITERAL_MANAGER_H
19
#define CVC5__PREPROCESSING__LEARNED_LITERAL_MANAGER_H
20
21
#include "context/cdhashset.h"
22
#include "expr/node.h"
23
#include "smt/env_obj.h"
24
25
namespace cvc5 {
26
namespace preprocessing {
27
28
/**
29
 * This class maintains the list of learned literals that have been inferred
30
 * during preprocessing but we have not fully processed e.g. via substitutions.
31
 *
32
 * In particular, notice that if an equality (= x t) is learned at top level,
33
 * we may add x -> t to top level substitutions if t does not contain x; we can
34
 * henceforth forget that (= x t) is a learned literal. On the other hand, if
35
 * a literal like (> x t) is learned at top-level, it may be useful to remember
36
 * this information. This class is concerned with the latter kind of literals.
37
 */
38
15407
class LearnedLiteralManager : protected EnvObj
39
{
40
 public:
41
  LearnedLiteralManager(Env& env);
42
  /**
43
   * Notify learned literal. This method is called when a literal is
44
   * entailed by the current set of assertions.
45
   *
46
   * It should be rewritten, and such that top level substitutions have
47
   * been applied to it.
48
   */
49
  void notifyLearnedLiteral(TNode lit);
50
  /**
51
   * Get learned literals, which returns the current set of learned literals
52
   * provided to this class. These literals are refreshed so that the current
53
   * top-level substitutions are applied to them, and then are rewritten.
54
   */
55
  std::vector<Node> getLearnedLiterals() const;
56
57
 private:
58
  /** Learned literal map */
59
  typedef context::CDHashSet<Node> NodeSet;
60
  /** Learned literals */
61
  NodeSet d_learnedLits;
62
};
63
64
}  // namespace preprocessing
65
}  // namespace cvc5
66
67
#endif /* CVC5__PREPROCESSING__LEARNED_LITERAL_MANAGER_H */