This eliminates the old option "inst format mode" and makes proof output for TPTP organized as an ordinary proof output format.
}
}
-// printer/options_handlers.h
-const std::string OptionsHandler::s_instFormatHelp = "\
-Inst format modes currently supported by the --inst-format option:\n\
-\n\
-default \n\
-+ Print instantiations as a list in the output language format.\n\
-\n\
-szs\n\
-+ Print instantiations as SZS compliant proof.\n\
-";
-
-InstFormatMode OptionsHandler::stringToInstFormatMode(const std::string& option,
- const std::string& flag,
- const std::string& optarg)
-{
- if(optarg == "default") {
- return InstFormatMode::DEFAULT;
- } else if(optarg == "szs") {
- return InstFormatMode::SZS;
- } else if(optarg == "help") {
- puts(s_instFormatHelp.c_str());
- exit(1);
- } else {
- throw OptionException(std::string("unknown option for --inst-format: `") +
- optarg + "'. Try --inst-format help.");
- }
-}
-
void OptionsHandler::setProduceAssertions(const std::string& option,
const std::string& flag,
bool value)
/** Pointer to the containing Options object.*/
Options* d_options;
-
- /* Help strings */
- static const std::string s_instFormatHelp;
-
}; /* class OptionHandler */
} // namespace options
name = "table"
help = "Print functional expressions over finite domains in a table format."
-[[option]]
- name = "instFormatMode"
- category = "regular"
- long = "inst-format=MODE"
- type = "InstFormatMode"
- default = "InstFormatMode::DEFAULT"
- handler = "stringToInstFormatMode"
- includes = ["options/printer_modes.h"]
- help = "print format mode for instantiations, see --inst-format=help"
-# InstFormatMode is currently exported as public so we can't auto genenerate
-# the enum.
-# help_mode = "Inst format modes."
-#[[option.mode.DEFAULT]]
-# name = "default"
-# help = "Print instantiations as a list in the output language format."
-#[[option.mode.SZS]]
-# name = "szs"
-# help = "Print instantiations as SZS compliant proof."
-
[[option]]
name = "flattenHOChains"
category = "regular"
[[option.mode.VERIT]]
name = "verit"
help = "Output veriT proof"
+[[option.mode.TPTP]]
+ name = "tptp"
+ help = "Output TPTP proof (work in progress)"
[[option]]
name = "proofPrintConclusion"
bool GetInstantiationsCommand::isEnabled(api::Solver* solver,
const api::Result& res)
{
- return (solver->getOptions().printer.instFormatMode
- != options::InstFormatMode::SZS
- && (res.isSat()
- || (res.isSatUnknown()
- && res.getUnknownExplanation() == api::Result::INCOMPLETE)))
+ return (res.isSat()
+ || (res.isSatUnknown()
+ && res.getUnknownExplanation() == api::Result::INCOMPLETE))
|| res.isUnsat() || res.isEntailed();
}
void GetInstantiationsCommand::invoke(api::Solver* solver, SymbolManager* sm)
#include "proof/proof_node_algorithm.h"
#include "proof/proof_node_manager.h"
#include "smt/assertions.h"
+#include "smt/env.h"
#include "smt/preprocess_proof_generator.h"
#include "smt/proof_post_processor.h"
namespace cvc5 {
namespace smt {
-PfManager::PfManager(context::UserContext* u, SmtEngine* smte)
- : d_pchecker(new ProofChecker(options::proofPedantic())),
+PfManager::PfManager(Env& env, SmtEngine* smte)
+ : d_env(env),
+ d_pchecker(new ProofChecker(options::proofPedantic())),
d_pnm(new ProofNodeManager(d_pchecker.get())),
d_pppg(new PreprocessProofGenerator(
- d_pnm.get(), u, "smt::PreprocessProofGenerator")),
+ d_pnm.get(), env.getUserContext(), "smt::PreprocessProofGenerator")),
d_pfpp(new ProofPostproccess(
d_pnm.get(),
smte,
proof::DotPrinter dotPrinter;
dotPrinter.print(out, fp.get());
}
+ else if (options::proofFormatMode() == options::ProofFormatMode::TPTP)
+ {
+ out << "% SZS output start Proof for " << d_env.getFilename() << std::endl;
+ // TODO (proj #37) print in TPTP compliant format
+ out << *fp;
+ out << "% SZS output end Proof for " << d_env.getFilename() << std::endl;
+ }
else
{
out << "(proof\n";
namespace cvc5 {
+class Env;
class ProofChecker;
class ProofNode;
class ProofNodeManager;
class PfManager
{
public:
- PfManager(context::UserContext* u, SmtEngine* smte);
+ PfManager(Env& env, SmtEngine* smte);
~PfManager();
/**
* Print the proof on the given output stream.
*/
void getAssertions(Assertions& as,
std::vector<Node>& assertions);
+ /** Reference to the env of SmtEngine */
+ Env& d_env;
/** The false node */
Node d_false;
/** For the new proofs module */
// ensure bound variable uses canonical bound variables
getNodeManager()->getBoundVarManager()->enableKeepCacheValues();
// make the proof manager
- d_pfManager.reset(new PfManager(getUserContext(), this));
+ d_pfManager.reset(new PfManager(*d_env.get(), this));
PreprocessProofGenerator* pppg = d_pfManager->getPreprocessProofGenerator();
// start the unsat core manager
d_ucManager.reset(new UnsatCoreManager());
void SmtEngine::printInstantiations( std::ostream& out ) {
SmtScope smts(this);
finishInit();
- if (d_env->getOptions().printer.instFormatMode == options::InstFormatMode::SZS)
- {
- out << "% SZS output start Proof for " << d_env->getFilename() << std::endl;
- }
QuantifiersEngine* qe = getAvailableQuantifiersEngine("printInstantiations");
// First, extract and print the skolemizations
{
out << "none" << std::endl;
}
- if (d_env->getOptions().printer.instFormatMode == options::InstFormatMode::SZS)
- {
- out << "% SZS output end Proof for " << d_env->getFilename() << std::endl;
- }
}
void SmtEngine::getInstantiationTermVectors(