1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Andrew Reynolds, Tim King, Mathias Preiner |
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 |
|
* The pretty-printer interface for the TPTP output language. |
14 |
|
*/ |
15 |
|
|
16 |
|
#include "cvc5_private.h" |
17 |
|
|
18 |
|
#ifndef CVC5__PRINTER__TPTP_PRINTER_H |
19 |
|
#define CVC5__PRINTER__TPTP_PRINTER_H |
20 |
|
|
21 |
|
#include <iostream> |
22 |
|
|
23 |
|
#include "printer/printer.h" |
24 |
|
|
25 |
|
namespace cvc5 { |
26 |
|
namespace printer { |
27 |
|
namespace tptp { |
28 |
|
|
29 |
126 |
class TptpPrinter : public cvc5::Printer |
30 |
|
{ |
31 |
|
public: |
32 |
|
using cvc5::Printer::toStream; |
33 |
|
void toStream(std::ostream& out, |
34 |
|
TNode n, |
35 |
|
int toDepth, |
36 |
|
size_t dag) const override; |
37 |
|
void toStream(std::ostream& out, const CommandStatus* s) const override; |
38 |
|
void toStream(std::ostream& out, const smt::Model& m) const override; |
39 |
|
/** |
40 |
|
* Print unsat core to stream. |
41 |
|
* We use the expression names associated with the unsat core |
42 |
|
* (UnsatCore::getCoreNames). |
43 |
|
*/ |
44 |
|
void toStream(std::ostream& out, const UnsatCore& core) const override; |
45 |
|
|
46 |
|
private: |
47 |
|
/** |
48 |
|
* To stream model sort. This prints the appropriate output for type |
49 |
|
* tn declared via declare-sort or declare-datatype. |
50 |
|
*/ |
51 |
|
void toStreamModelSort(std::ostream& out, |
52 |
|
TypeNode tn, |
53 |
|
const std::vector<Node>& elements) const override; |
54 |
|
|
55 |
|
/** |
56 |
|
* To stream model term. This prints the appropriate output for term |
57 |
|
* n declared via declare-fun. |
58 |
|
*/ |
59 |
|
void toStreamModelTerm(std::ostream& out, |
60 |
|
const Node& n, |
61 |
|
const Node& value) const override; |
62 |
|
|
63 |
|
}; /* class TptpPrinter */ |
64 |
|
|
65 |
|
} // namespace tptp |
66 |
|
} // namespace printer |
67 |
|
} // namespace cvc5 |
68 |
|
|
69 |
|
#endif /* CVC5__PRINTER__TPTP_PRINTER_H */ |