8 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
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
b1de316fe8 test: Add tests for BITVECTOR_BIT. (#11014) 2024-07-09 02:30:50 +00:00
Aina Niemetz
43a3c61d2c c++ api: Add hashing for grammars. (#10934)
This also adds guards for `std::hash` over API types when the functions
are called on null objects.
2024-06-21 19:40:11 +00:00
Aina Niemetz
76ca7af427 c api: Add term and op functions and term tests. (#10827)
Test op_black will follow separately.
2024-06-11 23:17:25 +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