summaryrefslogtreecommitdiff
path: root/src/printer
diff options
context:
space:
mode:
Diffstat (limited to 'src/printer')
-rw-r--r--src/printer/printer.cpp7
-rw-r--r--src/printer/printer.h3
-rw-r--r--src/printer/smt2/smt2_printer.cpp7
-rw-r--r--src/printer/smt2/smt2_printer.h3
4 files changed, 19 insertions, 1 deletions
diff --git a/src/printer/printer.cpp b/src/printer/printer.cpp
index 8f0f50daa..7a90f5a49 100644
--- a/src/printer/printer.cpp
+++ b/src/printer/printer.cpp
@@ -153,4 +153,11 @@ void Printer::toStream(std::ostream& out, const Model& m) const throw() {
}
}/* Printer::toStream(Model) */
+void Printer::toStream(std::ostream& out, const UnsatCore& core) const throw() {
+ for(UnsatCore::iterator i = core.begin(); i != core.end(); ++i) {
+ toStream(out, Node::fromExpr(*i), -1, false, -1);
+ out << std::endl;
+ }
+}/* Printer::toStream(UnsatCore) */
+
}/* CVC4 namespace */
diff --git a/src/printer/printer.h b/src/printer/printer.h
index beb2438e2..9a9ee19d1 100644
--- a/src/printer/printer.h
+++ b/src/printer/printer.h
@@ -103,6 +103,9 @@ public:
/** Write a Model out to a stream with this Printer. */
virtual void toStream(std::ostream& out, const Model& m) const throw();
+ /** Write an UnsatCore out to a stream with this Printer. */
+ virtual void toStream(std::ostream& out, const UnsatCore& core) const throw();
+
};/* class Printer */
/**
diff --git a/src/printer/smt2/smt2_printer.cpp b/src/printer/smt2/smt2_printer.cpp
index 766db729a..543079576 100644
--- a/src/printer/smt2/smt2_printer.cpp
+++ b/src/printer/smt2/smt2_printer.cpp
@@ -771,6 +771,13 @@ void Smt2Printer::toStream(std::ostream& out, const CommandStatus* s) const thro
}/* Smt2Printer::toStream(CommandStatus*) */
+void Smt2Printer::toStream(std::ostream& out, const UnsatCore& core) const throw() {
+ out << "(" << endl;
+ this->Printer::toStream(out, core);
+ out << ")" << endl;
+}
+
+
void Smt2Printer::toStream(std::ostream& out, const Model& m) const throw() {
out << "(model" << endl;
this->Printer::toStream(out, m);
diff --git a/src/printer/smt2/smt2_printer.h b/src/printer/smt2/smt2_printer.h
index e86b3cb2b..e825d3f4c 100644
--- a/src/printer/smt2/smt2_printer.h
+++ b/src/printer/smt2/smt2_printer.h
@@ -37,7 +37,6 @@ class Smt2Printer : public CVC4::Printer {
void toStream(std::ostream& out, TNode n, int toDepth, bool types) const throw();
void toStream(std::ostream& out, const Model& m, const Command* c) const throw();
- void toStream(std::ostream& out, const Model& m) const throw();
public:
Smt2Printer(Variant variant = no_variant) : d_variant(variant) { }
using CVC4::Printer::toStream;
@@ -46,6 +45,8 @@ public:
void toStream(std::ostream& out, const CommandStatus* s) const throw();
void toStream(std::ostream& out, const Result& r) const throw();
void toStream(std::ostream& out, const SExpr& sexpr) const throw();
+ void toStream(std::ostream& out, const Model& m) const throw();
+ void toStream(std::ostream& out, const UnsatCore& core) const throw();
};/* class Smt2Printer */
}/* CVC4::printer::smt2 namespace */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback