summaryrefslogtreecommitdiff
path: root/src/main/driver_unified.cpp
AgeCommit message (Collapse)Author
2021-10-07Add new versioning scheme (#7253)Gereon Kremer
This introduces a new versioning mechanism that allows for better automation.
2021-10-01Clean options handlers (#7201)Gereon Kremer
Some cleanup on the option handlers, starting with handlers for base and main options.
2021-09-30Rename files smt_engine.(cpp|h) to solver_engine.(cpp|h). (#7279)Aina Niemetz
This is in preparation for renaming SmtEngine to SolverEngine.
2021-09-22Remove CVC language support (#7219)Mathias Preiner
This commit removes the support for the CVC language and converts all *.cvc regression tests to SMT-LIBv2.
2021-09-02[Unit Tests] Fix shell test for Editline (#7117)Andres Noetzli
When using --editline, our interactive_shell_black unit test was not working because the unit test was redirecting std::cin and std::cout to std::stringstreams, which does not work with Editline. This commit refactors our InteractiveShell class to explicitly take the input and output streams as arguments, which fixes the issue because we do not use Editline for input streams that are not std::cin. Additionally, the commit updates the unit test to use SMT-LIB syntax instead of the deprecated CVC language.
2021-09-02Driver & Options cleanup (#7109)Gereon Kremer
This PR does some cleanup in the driver and the options. It removes the now obsolete public attribute that allowed using the options in the driver, and removes a bunch of includes from the driver that are no longer necessary.
2021-09-01Make driver::totalTime a TimerStat (#7089)Gereon Kremer
This makes the `driver::totalTime` statistic a `TimerStat`. This eliminates the need to obtain the overall runtime in the driver and write it to the statistics towards the end of the runtime. This not only eliminates some code in the driver, but also gets rid of the call to `getSmtEngine()` that goes around the API. One disclaimer: The statistics output changes from seconds as a double (i.e. `1.234`) to milliseconds (i.e. `1234ms`).
2021-09-01No longer use direct access to options in driver (#7094)Gereon Kremer
This PR refactors the driver to no longer directly access the Options object, but instead use Solver::getOption() or Solver::getOptionInfo().
2021-08-30Refactor filename handling (#7088)Gereon Kremer
This PR simplifies how we store the current input file name and handle setting and getting it. It is now an option, that can also be set and get via setInfo() and getInfo().
2021-08-27Add Driver options (#7078)Gereon Kremer
This PR adds a new API function Solver::getDriverOptions() which is used to communicate special options that (a) can not be properly communicated via getOption() and (b) need to be available in the driver (in a type-safe manner). As of now, this concerns the input stream and output streams. Furthermore, this PR refactors the driver to obtain them via the driver options instead of using the (deprecated) Solver::getOptions() method.
2021-08-27Handle languages as strings in driver (#7074)Gereon Kremer
This PR moves the first chunk of code in the driver to use the proper options API for the language options. It is now handled as a string.
2021-08-26Consolidate language types (#7065)Gereon Kremer
This PR combines the two enums InputLanguage and OutputLanguage into a single Language type. It makes sure that AST is not used as input language using a predicate whenever the option is set.
2021-08-23Move options parsing code to main (#7054)Gereon Kremer
This PR moves the code responsible for parsing the command line to the main folder. Note that the options themselves, and converting strings to the options proper types, calling predicates etc, stays in libcvc5. The PR also slightly refactors the options code to get rid of the assign_* functions.
2021-08-20Make driver use options from the solver (#6930)Gereon Kremer
This PR removes explicit ownership of the options object from the main function and replaces it by an api::Solver object. To achieve this, it does a number of minor changes: - api::Solver not takes a unique_ptr<Options> in its constructor - CommandExecutor only holds a reference to (a unique ptr of) the api::Solver - the main functions accesses options via the solver
2021-08-20Add CVC5ApiOptionException (#6992)Gereon Kremer
This PR adds the new CVC5ApiOptionException. While the driver does not (and can not) do anything special for the two existing api exceptions, it can (and should) properly inform the user about incorrect command line option usage. The PR also removes the UnrecognizedOptionException. It is purely internal now, and immediately catched by the API wrapper. Having a separate exception for this is no longer useful. The additional catch block in main.cpp is only temporary until option parsing has been migrated to the driver and setting the options is done properly via the API.
2021-08-19Remove `--(no-)interactive-prompt` (#7022)Andres Noetzli
This option is mostly redundant: It offers a way to access the interactive shell without any copyright information or cvc5> prompt being printed. However, --no-interactive offers the same experience (except for the features offered by libedit).
2021-07-26Move public options functions to separate file (#6671)Gereon Kremer
This PR moves the remaining special purpose functions out of the Options class. This set of functions is only used to implement API functions in the smt engine (getting and setting options by string), and by the main driver for parsing and printing usage information.
2021-07-14Clean up option usage in command executor (#6844)Gereon Kremer
This PR makes the CommandExecutor class use the options object from its SmtEngine instead of the driver one. This makes sure that options that are set via (set-option ...) are in effect for the CommandExecutor. It still stores the driver options, though, as they are used for resets. The PR also does some minor cleanups along the way (remove unused pOptions, make things const). Fixes #2376.
2021-06-23Remove `--tear-down-incremental` (#6745)Andres Noetzli
Recent experiments have shown that `--tear-down-incremental` is actually not really helping anymore and it has always been a bit of a workaround. It is also broken on current master. This commit removes the option.
2021-06-15Remove public option wrappers (#6716)Gereon Kremer
This PR gets rid of almost all remaining public option wrappers. It does so by - making base, main and parser options public such that they can directly be used from the driver and the parser - moving incremental and the resource limiting options to base - moving dumping options to main After this PR, the only option wrapper left is becoming obsolete as well after (the follow-up of) #6697.
2021-06-08Remove `binary_name` option (#6693)Gereon Kremer
The binary_name is solely used as a temporary storage to pass the data from the options parser back to the runCvc5 method where it is put in a static variable. This PR gets rid of the option and the public option getter in favor of directly storing the program name in the static variable using an additional argument to parseOptions().
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-04Add missing dereference (#6684)Gereon Kremer
2021-06-02Use proper variable name (#6670)Gereon Kremer
This PR fixes the driver which used an incorrect variable name in competition mode.
2021-06-02Move public wrapper functions out of options class (#6600)Gereon Kremer
This PR moves options wrapper functions out of the Options class. These wrapper functions are meant to be called by "external" code that should not access the options modules. This PR thereby significantly reduces the interface of the Options class.
2021-05-14Decouple parser creation from input selection (#6533)Andres Noetzli
This commit decouples the creation of a `Parser` instance from creating an `Input` and setting the `Input` on the parser. This is a first step in refactoring the parser infrastructure. A future PR will split the parser class into three classes: `Parser`, `ParserState`, and `InputParser`. The `Parser` and `InputParser` classes will be the public-facing classes. The new `Parser` class will have methods to create `InputParser`s from files, streams, and strings. `InputParser`s will have methods to get commands/exprs from a given input. The `ParserState` class will keep track of the state of the parser and will be the internal interface for the parsers. The current `Parser` class is used both publicly and internally, which is messy.
2021-05-13Always parse streams with line buffer (#6532)Andres Noetzli
When cvc5 was compiled in competition mode (but not for the application track), then it had a special behavior when reading from stdin. When it received input from stdin, it would read all of stdin and then parse the input as a string because it assumed that the full input is directly available on stdin. However, the non-application tracks of SMT-COMP do not use stdin anymore. They pass a filename to the solver. This special case is not used as a result. Usually, cvc5 parses from stdin using the line buffer, so this commit makes it so that this is always the case, which simplifies the code.
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-15Rename occurrences of CVC4 to CVC5. (#6351)Aina Niemetz
This renames everything but GitHub links and build system related macros. Switching the build system to cvc5 will be the last step in the renaming process.
2021-04-12Refactor and update copyright headers. (#6316)Aina Niemetz
2021-04-09Rename CVC4_ macros to CVC5_. (#6327)Aina Niemetz
2021-04-05New C++ Api: Rename and move headers. (#6292)Aina Niemetz
2021-04-02cmake: Do not link against main object library. (#6269)Mathias Preiner
CMake 3.10.2 (default on Ubuntu 18.04) does not allow target_link_libraries on object libraries.
2021-04-01Rename namespace CVC5 to cvc5. (#6258)Aina Niemetz
2021-03-31Rename namespace CVC4 to CVC5. (#6249)Aina Niemetz
2021-03-30Fix total time statistic (#6233)Gereon Kremer
Since one of the last changes to the total time collection in the driver, this collection fails when the solver terminates unexpectedly (either by a signal or an exception). This PR fixes this issue and does some cleanup along the way.
2021-03-22Move statistics from the driver into the SmtEngine (#6170)Gereon Kremer
This PR does some refactoring on how we handle statistics in the driver, and some minor cleanup along the way. The SmtEngine now has dedicated statistics for the data collected within the driver and provides utility functions to set them. The driver pushes the collected statistics to the SmtEngine instead of adding them itself to the statistics registry. The node manager no longer holds a statistics registry (that nobody used anymore anyway) The command executor no longer holds a pointer to the SmtEngine itself. The pointer is not necessary and seems to become stale after we call reset on the command executor (which, luckily, we don't seem to do usually) The main motivation for this change is to make the whole statistics infrastructure private to the library and not exporting it to the outside world.
2021-03-18Eliminate more uses of SExpr. (#6149)Abdalrhman Mohamed
This PR eliminates all remaining uses of SExpr outside of statistics.
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-11First refactoring of statistics classes (#6105)Gereon Kremer
This PR does a first round of refactoring on the statistics, in particular the Stat class and derived classes. It significantly shrinks the class hierarchy, modernizes some code (e.g. use std::chrono instead of clock_gettime), removes unused features (e.g. nesting of statistics) and does some general cleanup and consolidation. Subsequent PRs are planned to change the ownership model (right now every module owns the Stat object) which makes the whole register / unregister mechanism obsolete.
2021-03-09Update copyright headers to 2021. (#6081)Aina Niemetz
2021-03-05Reimplement time limit mechanism for windows (#6049)Gereon Kremer
As noted in #5034, --tlimit is not working properly on windows. It turns out that the timer mechanism provided by the windows API are not suitable for our use case. Thus, this PR implements a generic std::thread-based timer mechanism which is used whenever the POSIX timers (setitimer) are not available. It also adds some documentation on the timer options and the reasons we ended up with this. Fixes #5034.
2020-12-11Flush statistics through NodeManager in SmtEngine (#5652)Andrew Reynolds
This removes the dependency on the Expr layer from src/main. This requires moving the flushing of NodeManager statistics within SmtEngine. This is a temporary solution until we have a permanent solution for statistics.
2020-12-02Rename macro Message to CVC4Message. (#5576)Aina Niemetz
2020-11-30Eliminate uses of SExpr from the parser. (#5496)Abdalrhman Mohamed
This is a step towards migrating Commands to the API. SExpr is an internal module that's not used by the API but is used by the parser and some commands. This PR replaces SExpr with terms of kind SEXPR in the parser and strings in commands (which brings them more inline with the API).
2020-11-09Add symbol manager (#5380)Andrew Reynolds
This add the symbol manager class, which is a Term-level utility, separate of the API. This class manages things like expression and assertion names, which is intentionally done outside the solver. The symbol manager is intended to live at the same level as the Solver. When parsing input, the symbol manager will be used to model any interaction of e.g. named expressions and assertions. It also stores the symbol table of the parser. This PR adds the basic interface for the symbol manager and passes it to the parser. Later PRs will migrate the functionality for named expression out of e.g. SmtEngine and into SymbolManager. Commands will take Solver+SymbolManager instead of Solver. This will allow the parser to be fully migrated to the new API. Marking "complex" since this impacts further design of the parser and the code that lives in src/main. FYI @4tXJ7f
2020-09-22Refactor Commands to use the Public API. (#5105)Abdalrhman Mohamed
This is work towards eliminating the Expr layer. This PR does the following: Replace Expr/Type with Term/Sort in the API for commands. Remove the command export functionality which is not supported. Since many commands now call the Solver functions instead of the SmtEngine ones, their behavior may be a slightly different. For example, (get-unsat-assumptions) now only works in incremental mode. In some cases, CVC4 will not recover from non-fatal errors.
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-15Fixes memory leak when an exception goes through runCvc4(). (Fixes #4590) ↵Gereon Kremer
(#4750) As noted in #4590, CVC4 may leak memory if an exception is thrown that interrupts the command execution loop in runCvc4(). While not a major issue (the binary is terminated anyway in this case, this is also why we label it as feature), we should fix it nevertheless. This commit makes sure that the current command is properly managed by using `std::unique_ptr` to handle its deletion.
2020-07-13Implement --tlimit for windows (#4716)Gereon Kremer
The new mechanism for --tlimit only works for POSIX compatible systems (that implement setitimer). This PR implements an alternative (though roughly equivalent) approach for windows, based on SetWaitableTimer(). To make this work (without code duplication) we need to call the timeout_handler function from time_limit.cpp as the windows solution employs an asynchronous callback instead of signals. I used the opportunity to rename util.cpp to signal_handlers.cpp (as it really does not do anything else) and reformat the file. As I do not have a windows system at hand, I have not been able to actually test this apart from making sure that it compiles with the mingw setup.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback