summaryrefslogtreecommitdiff
path: root/src/options/mkoptions.py
AgeCommit message (Collapse)Author
2021-07-03Add output tags -o, --output. (#6826)Mathias Preiner
Output tags are similar to debug/trace tags, but are always enabled (except for muzzled builds) to provide useful information for users. Available output tags can be queried via -o help/--output help and are specified in the base options module via enum values. Co-authored-by: Gereon Kremer <nafur42@gmail.com>
2021-06-16Properly consider aliases in option handlers (#6683)Gereon Kremer
This PR makes sure that option handlers have access to both the canonical option name and the option name that was actually used. It also updates the options README and gets rid of the base_handlers.h of which only a fraction was used.
2021-06-07Remove `Options::wasSetByUser()` (#6682)Gereon Kremer
This PR removes the next heavily specialized template function Options::wasSetByUser() in favor of direct access to the *WasSetByUser flags.
2021-06-06Support public option modules (#6691)Gereon Kremer
This PR adds the possibility to make option modules public. As shown on the example of the main driver options, this allows to get rid of the wrappers from options_public.h. We plan to make only very few option modules public (i.e. main and parser).
2021-06-04Some cleanup in `mkoptions.py` (#6667)Gereon Kremer
This PR does some general cleanup in the mkoptions.py script: removal of obsolete code and some fixes to the comments.
2021-06-02Remove `Options::operator[]` (#6649)Gereon Kremer
This PR removes the next heavily specialized template function Options::operator[] in favor of direct access to the option data.
2021-06-02Make `Options::assign()` specializations free functions (#6648)Gereon Kremer
This PR removes the next two heavily specialized template functions. Both Options::assign() and Options::assignBool() are only used within options.cpp now and there is thus no reason to keep them in the public interface. Furthermore, we can just make them properly named functions instead of template functions.
2021-05-31Remove Options::ref() (#6647)Gereon Kremer
This PR gets rid of the templated Options::ref() method (and all its specializations for every option).
2021-05-28Add non-templated method to set option defaults (#6540)Gereon Kremer
This PR replaces the templated Options::setDefault() methods by new non-templated free functions options::{module}::setDefault{option}(). These methods should be used instead of the common if (!set by user) { set option value } pattern.
2021-05-26Use references instead of getter functions (#6597)Gereon Kremer
This PR follows a suggestions of @ajreynol to use public references instead of getter functions to access the individual option modules.
2021-05-21Move option names out of struct (#6554)Gereon Kremer
This PR moves the option names out of the option struct (which will be removed) to free constexpr string constants.
2021-05-19Remove accidental print (#6568)Gereon Kremer
2021-05-19Generate command line options for sphinx docs (#6555)Gereon Kremer
This PR adds documentation about the command line options to the sphinx documentation. It is mostly a reformatted version of what --help would print.
2021-05-17Replace smt_name by aliases (#6541)Gereon Kremer
This PR replaces the confusing co-existence of long and smt_name for options by long and a list of alias.
2021-05-13Split options holder class (#6527)Gereon Kremer
This PR splits the OptionsHolder class into separate holder classes for every options module and makes them directly accessible via appropriate Options::<module>() methods. We forward declare these new holder classes and thereby retain that we only need to recompile when we change an option module that is explicitly included. All (generated) methods that previously accessed the old holder object are changed to instead use the new holder objects. This PR does the bare minimum to do this change, further PRs will eventually get rid of all template specializations that currently surround our options class.
2021-05-10Remove header for option modules (#6514)Gereon Kremer
This PR further simplifies the option declaration by removing the header attribute from module options. Instead of specifying it manually, it is now automatically generated from the filename of the toml file. The header files and the toml files use matching names already, so this PR simply removes another mechanism that is not used anyway. This PR also does a minor cleanup of the Options class in the mkoptions.py script.
2021-05-10Remove read_only from options. (#6513)Gereon Kremer
This PR removes the possibility of declaring options read_only. It's only effect is making an attempts to disallow changing the respective option from within our internal code (by not providing a setter method). However, a "read-only" option can still be set via the setOption() methods that is also used by the API, and by SMT-LIB's set-option.
2021-04-29Simplify generated code for getOption() and setOption() (#6462)Gereon Kremer
This PR simplifies the generated code for Options::getOption() and Options::setOption(). It now uses less string streams, less temporary vectors and the new options[...] syntax (instead of options::...().
2021-04-28Clean up options holder class (#6458)Gereon Kremer
This PR does some cleanup on the options class: it puts the option defaults into the member declaration and removes the explicit constructor; it puts the holder into a unique_ptr; it uses the regular struct copy operation instead of reconstructing the holder object; it moves some macros required for option defaults into the option holder header. Also, this PR removes some obsolete code related to suggestions for typos.
2021-04-26First part of options refactoring (#6428)Gereon Kremer
This PR does a first round of refactoring and gets rid of a significant portion of generated code. In particular - it removes options::optionName.wasSetByUser() (we still have Options::wasSetByUser()) - it removes options::optionName.set() (we still have Options::set()) - it removes options::optionName.getName() in favor of options::optionName.name - it removes the specializations of Options::assign() and Options::assignBool() from the headers - it eliminates runHandlerAndPredicates() and runBoolPredicates() The removed methods are only used in few places with are changed to using Options::current().X() instead. In the future, we also want to get rid of options::optionName() and use Options::operator[]() instead, and furthermore not use Options::current() but use the options from the Env object. This PR already adds Env::getOption() as a shorthand for Env::getOptions()[...] and uses it as a proof of concept within SmtEngine.
2021-04-22Remove unused stuff from options setup (#6422)Gereon Kremer
This PR removes some old stuff from our options setup that has not been used in a long time. Most prominently, this includes the man pages that were still generated, and the alias and links options, which no longer worked anyway.
2021-04-21Goodbye CVC4, hello cvc5! (#6371)Mathias Preiner
This commits changes the build system to cvc5 and removes the remaining occurrences of CVC4. It further cleans up outdated/unused scripts in contrib/.
2021-04-12Refactor resource manager (#6322)Gereon Kremer
This PR does another round of refactoring of the resource manager and related code. - it moves the Resource enum out of the ResourceManager class - it treats the resources in a generic way (storing the statistics in a vector) instead of the manual treatment we had before - weights no longer live in the options, but in the ResourceManager and are changed accordingly in the ResourceManager constructor - following the generic treatment of resources, it also removes all the resource-specific options --x-step in favor of a generic --rweight name=weight - removed several unused methods from the ResourceManager Note that we handle the Resource enum in a way that allows to easily use other enums as additional resources, for example InferenceId. The general idea is that we will at some point have sensible default weights (so that the cumulative resources somewhat simulate the solver runtime) and users (almost) never need to modify them.
2021-04-12Refactor and update copyright headers. (#6316)Aina Niemetz
2021-04-09Rename CVC4_ macros to CVC5_. (#6327)Aina Niemetz
2021-03-16cmake: Generate cvc4_export.h and set visibility to hidden. (#6139)Mathias Preiner
The build system (cmake) will automatically generate an export header cvc4_export.h, which makes sure that the correct export features are defined depending on the compiler and target platform. The macro CVC4_EXPORT replaces CVC4_PUBLIC and its usage is reduced by 2/3. Co-authored-by: Gereon Kremer <nafur42@gmail.com>
2021-03-09Update copyright headers to 2021. (#6081)Aina Niemetz
2020-12-04Change generated options to be thread_local. (#5583)Everett Maus
Signed-off-by: Everett Maus <evmaus@google.com>
2020-09-22Update copyright header script to support CMake and Python files (#5067)Mathias Preiner
This PR updates the update-copyright.pl script to also update/add copyright headers to CMake specific files. It further fixes a small typo in the header.
2020-07-08Add getName() method to options. (#4704)Mathias Preiner
getName() returns the long option name if it exists and an empty string otherwise.
2020-03-05Enable -Wshadow and fix warnings. (#3909)Mathias Preiner
Fixes all -Wshadow warnings and enables the -Wshadow compile flag globally. Co-authored-by: Clark Barrett <barrett@cs.stanford.edu> Co-authored-by: Andres Noetzli <andres.noetzli@gmail.com> Co-authored-by: Aina Niemetz <aina.niemetz@gmail.com> Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu> Co-authored-by: makaimann <makaim@stanford.edu> Co-authored-by: yoni206 <yoni206@users.noreply.github.com> Co-authored-by: Andrew Reynolds <andrew.j.reynolds@gmail.com> Co-authored-by: AleksandarZeljic <zeljic@stanford.edu> Co-authored-by: Caleb Donovick <cdonovick@users.noreply.github.com> Co-authored-by: Amalee <amaleewilson@gmail.com> Co-authored-by: Scott Kovach <dskovach@gmail.com> Co-authored-by: ntsis <nekuna@gmail.com>
2019-12-17Generate code for options with modes. (#3561)Mathias Preiner
This commit adds support for code generation of options with modes (enums). From now on option enums can be specified in the corresponding *.toml files without the need of extra code. All option enums are now in the options namespace.
2018-09-22cmake: Working build infrastructure.Mathias Preiner
TODO: cvc4autoconfig.h
2018-07-27Require argument description for non-{bool,void} options. (#2228)Mathias Preiner
Not adding the argument description for non-{bool,void} options is now an error. Further, adds missing argument descriptions.
2018-07-26Avoid explicit dependency on Python 3 (#2195)ayveejay
2018-03-21Refactor mkoptions (#1631)Mathias Preiner
This commit refactors code generation for options. It uses a new configuration format for defining options (*.toml) and a new Python script mkoptions.py to generate the source code and option documentation. The option behavior did not change for most of the options, except that for bool --enable-/--disable- long options enable/disable was removed. E.g. --enable-miplib-trick and --disable-miplib-trick got changed to --miplib-trick and --no-miplib-trick. This commit fixes also an issues with set-option/get-option via the SMT2 interface. Before long options were only accessible if the name included the =ARG part.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback