1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Morgan Deters, Gereon Kremer, Tim King |
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 |
|
* Header for main cvc5 driver. |
14 |
|
*/ |
15 |
|
|
16 |
|
#include <chrono> |
17 |
|
#include <exception> |
18 |
|
#include <memory> |
19 |
|
#include <string> |
20 |
|
|
21 |
|
#include "base/cvc5config.h" |
22 |
|
#include "base/exception.h" |
23 |
|
#include "options/options.h" |
24 |
|
|
25 |
|
#ifndef CVC5__MAIN__MAIN_H |
26 |
|
#define CVC5__MAIN__MAIN_H |
27 |
|
|
28 |
|
namespace cvc5 { |
29 |
|
namespace main { |
30 |
|
|
31 |
|
class CommandExecutor; |
32 |
|
|
33 |
|
/** Full argv[0] */ |
34 |
|
extern const char* progPath; |
35 |
|
|
36 |
|
/** Just the basename component of argv[0] */ |
37 |
|
extern std::string progName; |
38 |
|
|
39 |
|
/** A reference for use by the signal handlers to print statistics */ |
40 |
|
extern std::unique_ptr<cvc5::main::CommandExecutor> pExecutor; |
41 |
|
|
42 |
|
/** Manages a custom timer for the total runtime in RAII-style. */ |
43 |
|
class TotalTimer |
44 |
|
{ |
45 |
|
public: |
46 |
8740 |
TotalTimer() : d_start(std::chrono::steady_clock::now()) {} |
47 |
|
~TotalTimer(); |
48 |
|
|
49 |
|
private: |
50 |
|
std::chrono::steady_clock::time_point d_start; |
51 |
|
}; |
52 |
|
/** The time point the binary started, accessible to signal handlers */ |
53 |
|
extern std::unique_ptr<TotalTimer> totalTime; |
54 |
|
|
55 |
|
/** |
56 |
|
* If true, will not spin on segfault even when CVC5_DEBUG is on. |
57 |
|
* Useful for nightly regressions, noninteractive performance runs |
58 |
|
* etc. See util.cpp. |
59 |
|
*/ |
60 |
|
extern bool segvSpin; |
61 |
|
|
62 |
|
} // namespace main |
63 |
|
} // namespace cvc5 |
64 |
|
|
65 |
|
/** Actual cvc5 driver functions **/ |
66 |
|
int runCvc5(int argc, char* argv[], cvc5::Options&); |
67 |
|
void printUsage(const cvc5::Options&, bool full = false); |
68 |
|
|
69 |
|
#endif /* CVC5__MAIN__MAIN_H */ |