GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/bags/infer_info.h Lines: 2 2 100.0 %
Date: 2021-05-22 Branches: 3 6 50.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Mudathir Mohamed, Andrew Reynolds, 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
 * Inference information utility.
14
 */
15
16
#include "cvc5_private.h"
17
18
#ifndef CVC5__THEORY__BAGS__INFER_INFO_H
19
#define CVC5__THEORY__BAGS__INFER_INFO_H
20
21
#include <map>
22
#include <vector>
23
24
#include "expr/node.h"
25
#include "theory/inference_id.h"
26
#include "theory/theory_inference.h"
27
28
namespace cvc5 {
29
namespace theory {
30
31
class TheoryInferenceManager;
32
33
namespace bags {
34
35
36
/**
37
 * An inference. This is a class to track an unprocessed call to either
38
 * send a fact, lemma, or conflict that is waiting to be asserted to the
39
 * equality engine or sent on the output channel.
40
 */
41
334
class InferInfo : public TheoryInference
42
{
43
 public:
44
  InferInfo(TheoryInferenceManager* im, InferenceId id);
45
2955
  ~InferInfo() {}
46
  /** Process lemma */
47
  TrustNode processLemma(LemmaProperty& p) override;
48
  /** Pointer to the class used for processing this info */
49
  TheoryInferenceManager* d_im;
50
  /** The conclusion */
51
  Node d_conclusion;
52
  /**
53
   * The premise(s) of the inference, interpreted conjunctively. These are
54
   * literals that currently hold in the equality engine.
55
   */
56
  std::vector<Node> d_premises;
57
58
  /**
59
   * A map of nodes to their skolem variables introduced as a result of this
60
   * inference.
61
   */
62
  std::map<Node, Node> d_skolems;
63
  /**  Is this infer info trivial? True if d_conc is true. */
64
  bool isTrivial() const;
65
  /**
66
   * Does this infer info correspond to a conflict? True if d_conc is false
67
   * and it has no new premises (d_noExplain).
68
   */
69
  bool isConflict() const;
70
  /**
71
   * Does this infer info correspond to a "fact". A fact is an inference whose
72
   * conclusion should be added as an equality or predicate to the equality
73
   * engine with no new external premises (d_noExplain).
74
   */
75
  bool isFact() const;
76
};
77
78
/**
79
 * Writes an inference info to a stream.
80
 *
81
 * @param out The stream to write to
82
 * @param ii The inference info to write to the stream
83
 * @return The stream
84
 */
85
std::ostream& operator<<(std::ostream& out, const InferInfo& ii);
86
87
}  // namespace bags
88
}  // namespace theory
89
}  // namespace cvc5
90
91
#endif /* CVC5__THEORY__BAGS__INFER_INFO_H */