dReal4
dreal_main.h
1 #pragma once
2 
3 #include <iostream>
4 #include <string>
5 #include <vector>
6 
7 // TODO(soonho): Fix ezoptionparser to remove those pragmas.
8 #pragma GCC diagnostic push
9 #pragma GCC diagnostic ignored "-Wold-style-cast"
10 #ifdef __clang__
11 #pragma clang diagnostic push
12 #pragma clang diagnostic ignored "-Wshadow"
13 #endif
14 #include "./ezOptionParser.hpp"
15 #ifdef __clang__
16 #pragma clang diagnostic pop
17 #endif
18 #pragma GCC diagnostic pop
19 
20 #include "dreal/solver/config.h"
21 
22 namespace dreal {
23 
24 /// dReal's main program. It parses options from command line and
25 /// process a given file (either .smt2 or .dr file).
26 class MainProgram {
27  public:
28  /// Constructs a main program using given command-line arguments.
29  MainProgram(int argc, const char* argv[]);
30  /// Executes the main program.
31  int Run();
32 
33  private:
34  void PrintUsage();
35  void AddOptions();
36  bool ValidateOptions();
37 
38  // Extracts options from `opt_` and construts `config_`.
39  void ExtractOptions();
40 
41  bool is_options_all_valid_{false};
42  ez::ezOptionParser opt_;
43  std::vector<const std::string*> args_; // List of valid option arguments.
44  Config config_;
45 };
46 } // namespace dreal
int Run()
Executes the main program.
Definition: dreal_main.cc:393
Sum type of symbolic::Expression and symbolic::Formula.
Definition: api.cc:9
MainProgram(int argc, const char *argv[])
Constructs a main program using given command-line arguments.
Definition: dreal_main.cc:36
Definition: config.h:12
dReal&#39;s main program.
Definition: dreal_main.h:26