From 6a9f767abff6e6c81810cf134253399899a97424 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Wed, 8 Oct 2014 20:18:07 -0400 Subject: [PATCH] Add unsat cores support to CVC native language. --- src/parser/cvc/Cvc.g | 4 ++++ src/printer/cvc/cvc_printer.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/parser/cvc/Cvc.g b/src/parser/cvc/Cvc.g index 151e2ecb6..85939dd22 100644 --- a/src/parser/cvc/Cvc.g +++ b/src/parser/cvc/Cvc.g @@ -65,6 +65,7 @@ tokens { EXIT_TOK = 'EXIT'; INCLUDE_TOK = 'INCLUDE'; DUMP_PROOF_TOK = 'DUMP_PROOF'; + DUMP_UNSAT_CORE_TOK = 'DUMP_UNSAT_CORE'; DUMP_ASSUMPTIONS_TOK = 'DUMP_ASSUMPTIONS'; DUMP_SIG_TOK = 'DUMP_SIG'; DUMP_TCC_TOK = 'DUMP_TCC'; @@ -795,6 +796,9 @@ mainCommand[CVC4::Command*& cmd] | DUMP_PROOF_TOK { cmd = new GetProofCommand(); } + | DUMP_UNSAT_CORE_TOK + { cmd = new GetUnsatCoreCommand(); } + | ( DUMP_ASSUMPTIONS_TOK | DUMP_SIG_TOK | DUMP_TCC_TOK diff --git a/src/printer/cvc/cvc_printer.cpp b/src/printer/cvc/cvc_printer.cpp index 2b5cc39c8..48f1aadec 100644 --- a/src/printer/cvc/cvc_printer.cpp +++ b/src/printer/cvc/cvc_printer.cpp @@ -874,6 +874,7 @@ void CvcPrinter::toStream(std::ostream& out, const Command* c, tryToStream(out, c, d_cvc3Mode) || tryToStream(out, c, d_cvc3Mode) || tryToStream(out, c, d_cvc3Mode) || + tryToStream(out, c, d_cvc3Mode) || tryToStream(out, c, d_cvc3Mode) || tryToStream(out, c, d_cvc3Mode) || tryToStream(out, c, d_cvc3Mode) || @@ -1149,6 +1150,10 @@ static void toStream(std::ostream& out, const GetProofCommand* c, bool cvc3Mode) out << "DUMP_PROOF;"; } +static void toStream(std::ostream& out, const GetUnsatCoreCommand* c, bool cvc3Mode) throw() { + out << "DUMP_UNSAT_CORE;"; +} + static void toStream(std::ostream& out, const SetBenchmarkStatusCommand* c, bool cvc3Mode) throw() { out << "% (set-info :status " << c->getStatus() << ")"; } -- 2.30.2