27 Commits

Author SHA1 Message Date
Aina Niemetz
0647c4c107 Update copyright headers. (#11561)
Co-authored-by: Daniel Larraz <daniel-larraz@users.noreply.github.com>
2025-01-23 17:54:20 +00:00
Aina Niemetz
fdf9ce7138 Update copyright headers. (#10459) 2024-03-12 09:35:09 -07:00
Aina Niemetz
58d7c6d556 c++ api: Expose TermManager to the API. (#10426)
This introduces a TermManager object, which will, in the future, be the
sole object responsible for handling/managing terms and sorts. For now,
all corresponding functions in `cvc5::Solver` are marked as deprecated,
as is constructor `cvc5::Solver::Solver()`, since in the future a solver
instance must be constructed from a term manager instance. Currently, we
maintain a static thread_local term manager instance to not break the
API and continue providing constructor `cvc5::Solver::Solver()`.

Note that this already converts all C++ unit tests to use the
TermManager except for a single test `getStatistics()` in
`test/unit/api/cpp/solver_black.cpp`. Statistics handling is currently
still maintained on the solver level. The statistics we maintain,
however, concern terms only and will eventually be refactored to be
tracked in the NodeManager.

Further note that the Java and Python APIs will be refactored in
separate PRs.
2024-03-08 19:39:13 +00:00
Andrew Reynolds
3bd7eff5d8 Readd support for sygus + interactive (#10122)
Addresses #10111.
2023-11-28 18:22:30 +00:00
Andrew Reynolds
076b556b75 Merge parser API includes to cvc5_parser.h (#9967) 2023-08-29 19:31:05 -05:00
Andrew Reynolds
9193bc044f Make symbol manager's interface private (#9946)
This is another step towards the parser API.

It hides the symbol manager's interface entirely. The old implementation is now contained via a new class SymManager.

The last step will be to move this (+ command.h, input_parser.h) from parser/api/cpp/ to include/cvc5/.
2023-08-14 17:39:06 +00:00
Andrew Reynolds
20c26e2703 Remove ANTLR code from parser (#9829)
Also removes native support for TPTP as a result.
2023-07-10 10:34:40 -05:00
Aina Niemetz
0a8baa0f0a Update copyright headers. (#9736) 2023-05-09 18:06:18 +00:00
Mathias Preiner
56e14c4639 Move public headers into top-level include directory. (#9555)
This PR moves the public API headers into a top-level include directory. This makes it easier to find the public API of cvc5 and makes the install headers script obsolete.

Fixes #9553
Fixes #9556
2023-03-07 23:39:29 +00:00
Andrew Reynolds
eabeb34e89 Bind declarations and definitions only when commands are invoked (#9355)
This corrects issues in our parser related to when symbols should be added to our symbol table.

In particular, symbols should be bound only when commands are executed and not as they are parsed. Binding during parsing leads to errors in interactive mode where those symbols are bound more than once, say if a command is partially parsed and then re-parsed based on our line buffering. This required further modifications to the interactive shell to execute commands immediately as they are parsed, since executing them may impact parsing (say if a declare-fun was on the same line as the subsequent command).

This adds new methods for accessing the binding methods of the underlying symbol table of symbol manager.

There are further issues of this form to correct, e.g. for define-fun-rec, which will be addressed in a separate PR.
2023-01-05 21:12:37 +00:00
Andres Noetzli
66d374cd5c Move Command infrastructure to parser (#8893)
This commit moves the `Command` infrastructure to the parser (to
`src/parser/api/cpp`) and moves it to the `cvc5::parser` namespace. The
`Command`-related files are compiled with `-D__BUILDING_CVC5LIB`,
because they need access to the internal printers. The commit refactors
the internal code to not depend on `Command` anymore. To do this, the
commit refactors printing derived classes of `CommandStatus` to follow a
similar structure to printing commands (so that we can also print
command statuses internally without creating instances of
`Commandstatus`). This is a step towards a parser API.
2022-09-16 18:57:55 -07:00
Andres Noetzli
55d024acca Move SymbolManager and SymbolTable to parser (#8910)
This moves `SymbolManager` and `SymbolTable` to the parser. To do so, it
modifies headers in the `context` package to be public to the parser
(changes `cvc5_private.h` to `cvc5parser_public.h`), because they are
shared between the parser and the main library.
2022-06-27 22:28:27 +00:00
Andres Noetzli
b5dec96e8e Remove CommandSequence command (#8904)
The CommandSequence command was not widely used and was essentially
just replicating the functionality of a vector of commands. This is work
towards a streamlined parser API.
2022-06-23 20:51:05 +00:00
Mathias Preiner
d01e59c13b Update copyright headers for release 1.0 (#8539) 2022-04-05 20:38:57 +00:00
Mathias Preiner
bbcd471ed4 Introduce internal namespace and remove api namespace. (#8443)
The public cvc5 API now lives in the cvc5 namespace. All internal parts were moved into the (new) internal namespace.
The final hierarchy will be as follows:

cvc5
  ~~ public API
  ::context
  ::internal
  ::parser
  ::main

After this PR it will be:

cvc5
  ~~ public API
  ::internal
      ::context
      ::main
  ::parser
2022-03-29 23:23:01 +00:00
Andres Noetzli
cf79199f0d [Unit Tests] Fix shell test for Editline (#7117)
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-02 20:05:59 +00:00
Gereon Kremer
cc9155e74a Refactor managed streams (#6934)
This PR introduces a new ManagedStream class that replaces the previous ManagedOstream. It allows to directly store the (wrapped) stream objects in the options. Handling the stream options is moved from the options manager to option predicates and the different options for input and output streams are combined into a single one.
Some associated utilities (open_ostream.h and update_ostream.h) are now obsolete and thus removed.
2021-08-04 18:35:41 +00:00
Gereon Kremer
25e124deb3 Only use libedit on tty inputs (#6946)
This PR improves the check when we use libedit: only when the input is an interactive terminal.
This is motivated by a change to the unit test for the interactive mode that now properly redirects standard input (and output).
2021-07-28 21:41:22 +00:00
Gereon Kremer
0133367f9e Remove Options::set() method (#6556)
This PR gets rid of the Options::set() method, replacing it by direct access to the options data.
This method was only used internally and did nothing except for resolving the options data from the option tag type via template specializations (via ref()), which is no longer necessary.
2021-05-29 07:09:34 +00:00
Aina Niemetz
77bca094a1 Rename occurrences of CVC4 to CVC5. (#6351)
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-15 20:04:55 +00:00
Aina Niemetz
7ec3005875 Refactor and update copyright headers. (#6316) 2021-04-12 19:31:43 +00:00
Aina Niemetz
d2e454e0df New C++ Api: Rename and move headers. (#6292) 2021-04-05 19:31:28 -07:00
Aina Niemetz
05a53a2ac4 Rename namespace CVC5 to cvc5. (#6258) 2021-04-01 16:56:14 +00:00
Aina Niemetz
a1466978fb Rename namespace CVC4 to CVC5. (#6249) 2021-03-31 22:23:17 +00:00
Aina Niemetz
dc679ed380 Delete Expr layer. (#6117) 2021-03-11 19:05:58 +00:00