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
32namespace CVC4 {
33
34namespace options {
35 struct OptionsHolder;
36}/* CVC4::options namespace */
37
38class ExprStream;
39class NodeManager;
40class NodeManagerScope;
41class 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
61public:
62
64 static inline Options& current() {
65 return *s_current;
66 }
67
69 Options(const Options& 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 */
Class representing an option-parsing exception such as badly-typed or missing arguments,...
static Options & current()
Get the current Options in effect.
Definition options.h:64
const T::type & operator[](T) const
Get the value of the given option.
static void printUsage(const std::string msg, std::ostream &out)
Print overall command-line option usage message, prefixed by "msg"—which could be an error message ca...
static void printShortUsage(const std::string msg, std::ostream &out)
Print command-line option usage message for only the most-commonly used options.
std::vector< std::string > parseOptions(int argc, char *argv[])
Initialize the options based on the given command-line arguments.
std::string getDescription() const
Get a description of the command-line flags accepted by parseOptions.
bool wasSetByUser(T) const
Returns true iff the value of the given option was set by the user via a command-line option or SmtEn...
SExpr getOptions() const
Get the setting for all options.
Options(const Options &options)
static std::string suggestCommandLineOptions(const std::string &optionName)
Look up long command-line option names that bear some similarity to the given name.
void set(T, const typename T::type &)
Set the value of the given option.
Definition options.h:78
static std::vector< std::string > suggestSmtOptions(const std::string &optionName)
Look up SMT option names that bear some similarity to the given name.
static void printLanguageHelp(std::ostream &out)
Print help for the –lang command line option.
A simple S-expression.
Definition sexpr.h:51
Macros that should be defined everywhere during the building of the libraries and driver binary,...
#define CVC4_PUBLIC
Definition cvc4_public.h:30
Definition of input and output languages.
Definition expr.h:106
Options-related exceptions.
Simple representation of S-expressions.
#define CVC4_THREADLOCAL(__type...)
Definition tls.h:35