class Command;
+namespace main {
+class CommandExecutor;
+} // namespace main
+
namespace internal {
#ifndef DOXYGEN_SKIP
class Result;
class SynthResult;
class StatisticsRegistry;
-
-namespace main {
-class CommandExecutor;
-} // namespace main
} // namespace internal
class Solver;
friend class Grammar;
friend class Op;
friend class cvc5::Command;
- friend class internal::main::CommandExecutor;
+ friend class main::CommandExecutor;
friend class Sort;
friend class Term;
#include "smt/command.h"
#include "smt/solver_engine.h"
-namespace cvc5::internal {
-namespace main {
+namespace cvc5::main {
// Function to cancel any (externally-imposed) limit on CPU time.
// This is used for competitions while a solution (proof or model)
d_solver->getDriverOptions().err() << std::flush;
}
-} // namespace main
-} // namespace cvc5::internal
+} // namespace cvc5::main
class Command;
-namespace internal {
-
namespace main {
class CommandExecutor
std::ostream& out);
} // namespace main
-} // namespace internal
} // namespace cvc5
#endif /* CVC5__MAIN__COMMAND_EXECUTOR_H */
using namespace std;
using namespace cvc5::internal;
using namespace cvc5::parser;
-using namespace cvc5::internal::main;
+using namespace cvc5::main;
-namespace cvc5::internal {
-namespace main {
+namespace cvc5::main {
/** Full argv[0] */
const char* progPath;
std::string progName;
/** A pointer to the CommandExecutor (the signal handlers need it) */
-std::unique_ptr<cvc5::internal::main::CommandExecutor> pExecutor;
+std::unique_ptr<CommandExecutor> pExecutor;
-} // namespace main
-} // namespace cvc5::internal
+} // namespace cvc5::main
int runCvc5(int argc, char* argv[], std::unique_ptr<cvc5::Solver>& solver)
{
cvc5::DriverOptions dopts = solver->getDriverOptions();
// Parse the options
- std::vector<string> filenames = main::parse(*solver, argc, argv, progName);
+ std::vector<string> filenames = parse(*solver, argc, argv, progName);
if (solver->getOptionInfo("help").boolValue())
{
- main::printUsage(progName, dopts.out());
+ printUsage(progName, dopts.out());
exit(1);
}
for (const auto& name : {"show-config",
#include "options/option_exception.h"
using namespace cvc5::internal;
+using namespace cvc5::main;
/**
* cvc5's main() routine is just an exception-safe wrapper around runCvc5.
solver->getDriverOptions().err()
<< "(error \"" << e << "\")" << std::endl;
}
- if (solver->getOptionInfo("stats").boolValue()
- && main::pExecutor != nullptr)
+ if (solver->getOptionInfo("stats").boolValue() && pExecutor != nullptr)
{
- main::pExecutor->printStatistics(solver->getDriverOptions().err());
+ pExecutor->printStatistics(solver->getDriverOptions().err());
}
}
// Make sure that the command executor is destroyed before the node manager.
- main::pExecutor.reset();
+ pExecutor.reset();
exit(1);
}
#ifndef CVC5__MAIN__MAIN_H
#define CVC5__MAIN__MAIN_H
-namespace cvc5::internal {
-namespace main {
+namespace cvc5::main {
class CommandExecutor;
extern std::string progName;
/** A reference for use by the signal handlers to print statistics */
-extern std::unique_ptr<cvc5::internal::main::CommandExecutor> pExecutor;
+extern std::unique_ptr<CommandExecutor> pExecutor;
/**
* If true, will not spin on segfault even when CVC5_DEBUG is on.
*/
extern bool segvSpin;
-} // namespace main
-} // namespace cvc5::internal
+} // namespace cvc5::main
/** Actual cvc5 driver functions **/
int runCvc5(int argc, char* argv[], std::unique_ptr<cvc5::Solver>&);
#include "api/cpp/cvc5.h"
-namespace cvc5::internal::main {
+namespace cvc5::main {
/**
* Print overall command-line option usage message to the given output stream
char* argv[],
std::string& binaryName);
-} // namespace cvc5::internal::options
+} // namespace cvc5::main
#endif
#include <iostream>
#include <limits>
-namespace cvc5::internal::main {
+namespace cvc5::main {
+
+using namespace cvc5::internal;
// clang-format off
static const std::string commonOptionsDescription =
return nonoptions;
}
-} // namespace cvc5::internal::options
+} // namespace cvc5::main
using cvc5::internal::Exception;
using namespace std;
-namespace cvc5::internal {
-namespace main {
+namespace cvc5::main {
+using namespace cvc5::internal;
/**
* If true, will not spin on segfault even when CVC5_DEBUG is on.
}
} // namespace signal_handlers
-} // namespace main
-} // namespace cvc5::internal
+} // namespace cvc5::main
#ifndef CVC5__MAIN__SIGNAL_HANDLERS_H
#define CVC5__MAIN__SIGNAL_HANDLERS_H
-namespace cvc5::internal {
-namespace main {
+namespace cvc5::main {
namespace signal_handlers {
/**
void cleanup();
} // namespace signal_handlers
-} // namespace main
-} // namespace cvc5::internal
+} // namespace cvc5::main
#endif /* CVC5__MAIN__SIGNAL_HANDLERS_H */
#include "base/exception.h"
#include "signal_handlers.h"
-namespace cvc5::internal {
-namespace main {
+namespace cvc5::main {
#if HAVE_SETITIMER
TimeLimit::~TimeLimit() {}
sigemptyset(&sact.sa_mask);
if (sigaction(SIGALRM, &sact, NULL))
{
- throw Exception(std::string("sigaction(SIGALRM) failure: ")
- + strerror(errno));
+ throw internal::Exception(std::string("sigaction(SIGALRM) failure: ")
+ + strerror(errno));
}
// Check https://linux.die.net/man/2/setitimer
// Argument 3: old timer configuration, we don't want to know
if (setitimer(ITIMER_REAL, &timerspec, nullptr))
{
- throw Exception(std::string("timer_settime() failure: ") + strerror(errno));
+ throw internal::Exception(std::string("timer_settime() failure: ")
+ + strerror(errno));
}
#else
abort_timer_flag.store(false);
return TimeLimit();
}
-} // namespace main
-} // namespace cvc5::internal
+} // namespace cvc5::main
#include <cstdint>
-namespace cvc5::internal {
-namespace main {
+namespace cvc5::main {
/**
* This class makes sure that the main thread signals back to the time
*/
TimeLimit install_time_limit(uint64_t ms);
-} // namespace main
-} // namespace cvc5::internal
+} // namespace cvc5::main
#endif /* CVC5__MAIN__TIME_LIMIT_H */