33 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
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
ca3448cf99 Add tests for uncovered functions in nightlies. (#10593) 2024-04-08 10:33:06 -07: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
0a0a339983 Python API tests: Add tests for deprecated functions for nightly coverage. (#10505) 2024-03-15 13:25:11 -07: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
Daniel Larraz
6a33a2f89d Fix python api coverage failure (#10233) 2023-12-15 16:14:26 -06: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
Andrew Reynolds
3621c2c5e5 Fixes for uncovered parser API methods (#10082)
Fixes nightly builds.
2023-10-04 00:24:08 +00:00
Hans-Jörg
0a35879fc1 Make Proof Rule enum a part of the API (#9925)
This pull requests makes the enum that lists all proof rules a part of the API.

It also renames the enum from PfRule to ProofRule. It also renames some unrelated types and function names that share the PfRule name (such as DslPfRule).
This rename unfortunately touches many files since PfRule is not an uncommon type. (second to last commit)
2023-09-27 00:58:03 +00:00
Aina Niemetz
7a4a17b193 c api: Introduce C/C++ specific handling of public enums. (#9915)
This introduces a general way to use public enums both in the C++ and
the (upcoming) C API. For the C++ case, we now use enum classes rather
than enums for public enums. This also includes definitions for
C API to_string conversions for public enums. C API definitions in
cvc5_types.h are only included from the C API, guarded via a macro
(thus, for now, not included yet when the header is included).
2023-08-22 18:17:16 +00:00
Andrew Reynolds
21da2fba14 Add synth finder utility (#9814)
Work towards supporting (find-synth :X).

This adds a unified utility SynthFinder for implementing the functionality removed in #9796.

It introduces "find synth targets" as different things that can be found using find-synth.

Further PRs will connect this utility to the API.
2023-06-19 16:47:31 +00:00
Aina Niemetz
0a8baa0f0a Update copyright headers. (#9736) 2023-05-09 18:06:18 +00:00
Andrew Reynolds
3f30adabe9 Add tests for uncovered API methods for abstract sorts (#9430) 2023-01-20 19:17:50 +00:00