17 Commits

Author SHA1 Message Date
Andrew Reynolds
6c2dc6e78f Add option to make regular expressions first class (#12049)
This adds an expert option to allow regular expressions to appear
anywhere in constraints, including in datatype fields, or as arguments
to uninterpreted functions.

This is required for reasoning about the correctness of CPC for proof
rules involving regular expressions.
2025-08-23 16:48:07 +00:00
Daniel Larraz
510315c260 Use u32string to represent Unicode strings encoded in UTF-32 (#11994)
This PR introduces the new C++ methods `Term TermManager::mkString(const
std::u32string& s)` and `std::u32string Term::getU32StringValue()` to
replace old methods `Term TermManager::mkString(const std::wstring& s)`
and `std::wstring Term::getStringValue()`.

The reason for this change is that `wchar_t` has a platform-dependent
size: on Windows, it is 16-bit (UTF-16), while on Linux and macOS, it is
32-bit (UTF-32). However, the current implementation assumes that
`wchar_t` is always 32 bits. In contrast, `char32_t` and
`std::u32string` are explicitly designed for Unicode and have consistent
32-bit size across platforms.

Similarly, this PR also introduces C functions
`cvc5_mk_string_from_char32` and `cvc5_term_get_u32string_value`
to replace old functions `cvc5_mk_string_from_wchar` and
`cvc5_term_get_string_value`.

Although `char32_t` is part of the C11 standard, the `<uchar.h>` header
(which should define `char32_t`) is missing in Apple Clang. Therefore,
we explicitly provide a definition in such cases.

---------

Co-authored-by: Aina Niemetz <aina.niemetz@gmail.com>
2025-07-08 08:12:52 +00:00
Aina Niemetz
cf8c5f3ade NodeManager as a static thread_local singleton is no more. (#11816)
Co-authored-by: Daniel Larraz <daniel-larraz@users.noreply.github.com>
2025-04-16 01:39:01 +00:00
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
fb407f4c06 c api: Add support/tests for some uncovered functions. (#10988)
This is work towards full API coverage so that the C API tests can be
plugged into the nightlies coverage tests.
2024-07-09 23:27:42 +00:00
Aina Niemetz
7cb2411d8a c api: Add support for term manager statistics. (#10986) 2024-07-09 21:02:46 +00:00
Aina Niemetz
82be2ff2fc c api: Add term creation functions and tests. (#10804) 2024-06-11 21:41:39 +00:00
Aina Niemetz
5eeb791635 Revert "c api: Add tests for op. (#10828)"
This reverts commit 6efe0fae41.

This got merged in prematurely by accident.
2024-06-11 07:32:57 -07:00
Aina Niemetz
6efe0fae41 c api: Add tests for op. (#10828)
This is based on #10827.
2024-06-11 02:48:34 +00:00
Aina Niemetz
e7218350c1 c api: Add term manager, sort creation + tests. (#10623)
Note commented out lines in the tests will be disabled when the
corresponding functions are implemented.
2024-05-17 19:17:49 +00:00
Aina Niemetz
ca3448cf99 Add tests for uncovered functions in nightlies. (#10593) 2024-04-08 10:33:06 -07:00
Aina Niemetz
354fc4147e Java API: Refactor to expose TermManager. (#10531)
This is related to the previous refactor of the C++ API in
https://github.com/cvc5/cvc5/pull/10426.
2024-04-02 16:42:06 +00:00
Aina Niemetz
b9b4e1b9da c++ API: Refactor statistics handling. (#10530)
This moves term statistics collection from Solver to TermManager.
TermManager and Solver now both provide `getStatistics()`, the former
captures API level term statistics, the latter internal solver
statistics.

This also adds iterator capabilities to the Python Statistics class.
2024-04-01 21:12:16 +00:00
Aina Niemetz
cd77bc5a28 c++ api: Add missing guards, tests for associated term manager. (#10501)
Added tests will be added for Python in a separate PR, and for Java in
the corresponding (future) PR that refactors for term manager.
2024-03-18 18:34:09 +00:00
Aina Niemetz
83f27f0dbc Add tests for uncovered API functions for nightlies. (#10496) 2024-03-12 12:37:45 -07: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