37 Commits

Author SHA1 Message Date
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
b3f4de3472 OptionCategory: Add missing implementations, uncovered tests. (#12011)
Enum OptionCategory was introduced in #11931, which did not include
implementations for `std::to_string(cvc5::modes::OptionCategory)` and
`cvc5_modes_option_category_to_str(Cvc5OptionCategory)`.

This adds implementations for these functions and further adds uncovered
tests for C, Python and Java (fixes coverage build in nightlies).
2025-06-25 06:59:46 +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
488d3d6e25 test: Add tests for missing API coverage. (#11048) 2024-07-13 01:36:56 +00:00
Aina Niemetz
08d3806e16 java api: Add hashing for Op, Term, Sort. (#11022) 2024-07-10 19:54:21 +00:00
Aina Niemetz
5ade599bf1 test: java api: Clean up and extend api coverage. (#11024) 2024-07-10 17:57:05 +00:00
Aina Niemetz
ec1f367d05 java api: Add support for equals/hash for datatypes. (#11023) 2024-07-10 17:56:14 +00:00
Aina Niemetz
f463df8baa java api: Add missing hash/equals and tests for (Synth)Result. (#11021) 2024-07-10 17:54:35 +00:00
Aina Niemetz
a6d07eac76 c api: Add more support/tests for uncovered functions. (#11011) 2024-07-10 01:51:41 +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
1d99fcea6c test: Add tests for uncovered API functions. (#10964) 2024-06-24 23:19:01 +00:00
Aina Niemetz
434cdead90 test: Add tests for uncovered API coverage. (#10725) 2024-05-06 08:27:49 -05:00
Abdalrhman Mohamed
9d1e1a15a4 Expose DSL Proof Rules. (#10568)
This PR implements one approach to exposing DSL Proof rules to the user: by making the DSL rule enum public.

Notes:

The safe toString method is not included in safe_print.h because it's generated by the RARE parser.
To test the hash and toString, for all enum values, a "last" enum value is needed. However, the current last enum value (DISTINCT_BINARY_ELIM) used in the test is generated by the RARE parser and may change in the future. Potential fixes include: adding LAST enum value, moving NONE to the end, or defining a LAST whose value is generated by the RARE parser.
2024-04-18 15:09:59 +00:00
Aina Niemetz
566eba8455 More tests for uncovered functions in nightlies. (#10595) 2024-04-08 12:29:18 -07: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
Andrew Reynolds
5e75e5460f Fix more issues with uncovered methods in nightlies (#10567) 2024-04-01 16:49:17 +00:00
Andrew Reynolds
7af25ed764 Fix uncovered API errors due to skolem ids (#10561)
Fixes the nightlies.
2024-03-28 16:15:21 +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
Aina Niemetz
175e7fbdb5 test: Add more missing Python/Java tests for api coverage. (#10411) 2024-02-20 20:30:31 +00:00
Aina Niemetz
a7951d15e5 test: Add missing Python and Java tests for api coverage in nightlies. (#10392) 2024-02-17 01:03:22 +00:00
mudathirmahgoub
2b09f57ab6 Fix java api coverage failure (#10210) 2023-12-07 20:00:28 +00:00
Hans-Jörg
14fc6f88bb Fix behaviour and API tests for proofs (#10137)
Add a test for '<<' for the proof format mode
Add this test to the uncovered functions for Python and Java
Return placeholder value if Proof object is empty
Add tests for this (and add them to uncovered functions)
2023-11-07 17:29:44 +00:00