blob: f8cb0677c314fd35ec2e2a70d7fc9ceeb9c757dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
/********************* */
/*! \file main.cpp
** \verbatim
** Original author: Morgan Deters
** Major contributors: Christopher L. Conway
** Minor contributors (to current version): Clark Barrett, Dejan Jovanovic
** This file is part of the CVC4 project.
** Copyright (c) 2009-2014 New York University and The University of Iowa
** See the file COPYING in the top-level source directory for licensing
** information.\endverbatim
**
** \brief Main driver for CVC4 executable
**
** Main driver for CVC4 executable.
**/
#include "main/main.h"
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <unistd.h>
#include "base/output.h"
#include "expr/expr_manager.h"
#include "expr/statistics.h"
#include "main/command_executor.h"
#include "main/interactive_shell.h"
#include "options/base_options.h"
#include "options/language.h"
#include "options/main_options.h"
#include "parser/parser.h"
#include "parser/parser_builder.h"
#include "parser/parser_exception.h"
#include "smt/smt_engine.h"
#include "smt_util/command.h"
#include "util/configuration.h"
#include "util/result.h"
using namespace std;
using namespace CVC4;
using namespace CVC4::main;
using namespace CVC4::language;
/**
* CVC4's main() routine is just an exception-safe wrapper around CVC4.
* Please don't construct anything here. Even if the constructor is
* inside the try { }, an exception during destruction can cause
* problems. That's why main() wraps runCvc4() in the first place.
* Put everything in runCvc4().
*/
int main(int argc, char* argv[]) {
Options opts;
try {
return runCvc4(argc, argv, opts);
} catch(OptionException& e) {
#ifdef CVC4_COMPETITION_MODE
*opts[options::out] << "unknown" << endl;
#endif
cerr << "CVC4 Error:" << endl << e << endl << endl
<< "Please use --help to get help on command-line options."
<< endl;
} catch(Exception& e) {
#ifdef CVC4_COMPETITION_MODE
*opts[options::out] << "unknown" << endl;
#endif
if(opts[options::outputLanguage] == output::LANG_SMTLIB_V2_0 ||
opts[options::outputLanguage] == output::LANG_SMTLIB_V2_5) {
*opts[options::out] << "(error \"" << e << "\")" << endl;
} else {
*opts[options::err] << "CVC4 Error:" << endl << e << endl;
}
if(opts[options::statistics] && pExecutor != NULL) {
pTotalTime->stop();
pExecutor->flushStatistics(*opts[options::err]);
}
}
exit(1);
}
|