GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/expr/proof_node_to_sexpr.h Lines: 1 1 100.0 %
Date: 2021-03-23 Branches: 0 0 0.0 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file proof_node_to_sexpr.h
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Andrew Reynolds, Haniel Barbosa, Gereon Kremer
6
 ** This file is part of the CVC4 project.
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.\endverbatim
11
 **
12
 ** \brief Conversion from ProofNode to s-expressions
13
 **/
14
15
#include "cvc4_private.h"
16
17
#ifndef CVC4__EXPR__PROOF_NODE_TO_SEXPR_H
18
#define CVC4__EXPR__PROOF_NODE_TO_SEXPR_H
19
20
#include <map>
21
22
#include "expr/node.h"
23
#include "expr/proof_rule.h"
24
25
namespace CVC4 {
26
27
class ProofNode;
28
29
/** A class to convert ProofNode objects to s-expressions */
30
class ProofNodeToSExpr
31
{
32
 public:
33
  ProofNodeToSExpr();
34
31366
  ~ProofNodeToSExpr() {}
35
  /** Convert the given proof node to an s-expression
36
   *
37
   * This is useful for operations where it is useful to view a ProofNode as
38
   * a Node. Printing is one such example, where a ProofNode can be printed
39
   * as a dag after this conversion.
40
   *
41
   * The s-expression for a ProofNode has the form:
42
   *   (SEXPR (VAR "<d_rule>") S1 ... Sn (VAR ":args") (SEXPR <d_args>))
43
   * where S1, ..., Sn are the s-expressions for its <d_children>.
44
   */
45
  Node convertToSExpr(const ProofNode* pn);
46
47
 private:
48
  /** map proof rules to a variable */
49
  std::map<PfRule, Node> d_pfrMap;
50
  /** Dummy ":args" marker */
51
  Node d_argsMarker;
52
  /** Dummy ":conclusion" marker */
53
  Node d_conclusionMarker;
54
  /** map proof nodes to their s-expression */
55
  std::map<const ProofNode*, Node> d_pnMap;
56
  /**
57
   * map nodes to a bound variable, used for nodes that have special AST status
58
   * like builtin operators
59
   */
60
  std::map<Node, Node> d_nodeMap;
61
  /** get or make pf rule variable */
62
  Node getOrMkPfRuleVariable(PfRule r);
63
  /** get or make node variable */
64
  Node getOrMkNodeVariable(Node n);
65
};
66
67
}  // namespace CVC4
68
69
#endif /* CVC4__EXPR__PROOF_RULE_H */