cvc4-1.4
options.h
Go to the documentation of this file.
1 /********************* */
17 #include "cvc4_public.h"
18 
19 #ifndef __CVC4__OPTIONS__OPTIONS_H
20 #define __CVC4__OPTIONS__OPTIONS_H
21 
22 #include <iostream>
23 #include <fstream>
24 #include <string>
25 #include <vector>
26 
28 #include "util/language.h"
29 #include "util/tls.h"
30 #include "util/sexpr.h"
31 
32 namespace CVC4 {
33 
34 namespace options {
35  struct OptionsHolder;
36 }/* CVC4::options namespace */
37 
38 class ExprStream;
39 class NodeManager;
40 class NodeManagerScope;
41 class SmtEngine;
42 
45  options::OptionsHolder* d_holder;
46 
48  static CVC4_THREADLOCAL(Options*) s_current;
49 
51  template <class T>
52  void assign(T, std::string option, std::string value, SmtEngine* smt);
54  template <class T>
55  void assignBool(T, std::string option, bool value, SmtEngine* smt);
56 
57  friend class NodeManager;
58  friend class NodeManagerScope;
59  friend class SmtEngine;
60 
61 public:
62 
64  static inline Options& current() {
65  return *s_current;
66  }
67 
68  Options();
69  Options(const Options& options);
70  ~Options();
71 
77  template <class T>
78  void set(T, const typename T::type&) {
79  // Flag a compile-time error. Write-able options specialize
80  // this template to provide an implementation.
81  T::you_are_trying_to_assign_to_a_read_only_option;
82  }
83 
85  template <class T>
86  const typename T::type& operator[](T) const;
87 
94  template <class T>
95  bool wasSetByUser(T) const;
96 
101  std::string getDescription() const;
102 
108  static void printUsage(const std::string msg, std::ostream& out);
109 
116  static void printShortUsage(const std::string msg, std::ostream& out);
117 
119  static void printLanguageHelp(std::ostream& out);
120 
126  static std::string suggestCommandLineOptions(const std::string& optionName) throw();
127 
134  static std::vector<std::string> suggestSmtOptions(const std::string& optionName) throw();
135 
141  std::vector<std::string> parseOptions(int argc, char* argv[]) throw(OptionException);
142 
146  SExpr getOptions() const throw();
147 
148 };/* class Options */
149 
150 }/* CVC4 namespace */
151 
152 #include "options/base_options.h"
153 
154 #endif /* __CVC4__OPTIONS__OPTIONS_H */
Header to define CVC4_THREAD whether or not TLS is supported by the compiler/runtime platform...
Class representing an option-parsing exception such as badly-typed or missing arguments, arguments out of bounds, etc.
Definition: kind.h:57
Options-related exceptions.
Simple representation of S-expressions.
#define CVC4_PUBLIC
Definition: cvc4_public.h:30
Definition of input and output languages.
static Options & current()
Get the current Options in effect.
Definition: options.h:64
Macros that should be defined everywhere during the building of the libraries and driver binary...
struct CVC4::options::out__option_t out
void set(T, const typename T::type &)
Set the value of the given option.
Definition: options.h:78
#define CVC4_THREADLOCAL(__type...)
Definition: tls.h:30
A simple S-expression.
Definition: sexpr.h:51