256 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
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
José Neto
fe5d4fed98 api: Refactor OptionInfo struct to provide option category. (#11931)
Refactor options to expose an enum field `category` instead of `bool
is_XXX`.

---------

Co-authored-by: Aina Niemetz <aina.niemetz@gmail.com>
2025-06-23 16:54:00 +00:00
Daniel Larraz
8b63df8b2f Fix declarePool test in api_solver_black (#11818)
This fixes issues in C++ `deadPool` test and resolves nightly memory
leak failure.
2025-04-16 18:27:42 +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
Andrew Reynolds
ed10fc9175 Fully support standard SMT-LIB syntax for bitvector conversions (#11801)
The latest SMT-LIB release has standardized arithmetic/bitvector
conversions (https://smt-lib.org/theories-FixedSizeBitVectors.shtml).

This adds support for them.

In particular, the kind Kind::INT_TO_BITVECTOR now has recommended
syntax int_to_bv, while int2bv is supported (deprecated) in non-strict
mode for now for backwards compatibility.

The kind Kind::BITVECTOR_TO_NAT and the smt2 syntax bv2nat for now is
maintained but should be deprecated. In particular,
Kind::BITVECTOR_TO_NAT is silently converted to
Kind::BITVECTOR_UBV_TO_INT in the API.

We add Kind::BITVECTOR_UBV_TO_INT and Kind::BITVECTOR_SBV_TO_INT in the
API.
The internal kind BITVECTOR_TO_NAT is renamed BITVECTOR_UBV_TO_INT, and
add internal kind BITVECTOR_SBV_TO_INT.

Updates the proof infrastructure to use the new naming scheme.
2025-04-10 21:51:47 +00:00
Andrew Reynolds
e067b5261b Make unit tests for proofs more robust wrt rewrite rules (#11601)
The helper method `create_rewrite_proof` no longer generates rewrite
rule holes on my dev branch, since the given rewrite is handled by
ARITH_POLY_NORM now.
2025-02-10 22:35:29 +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
Andrew Reynolds
27d6f4b241 Add getNamedTerms to symbol manager API (#11233)
Co-authored-by: mudathirmahgoub <mudathirmahgoub@gmail.com>
2024-09-30 14:27:49 +00:00
Mathias Preiner
6cf3772511 prop: Connect CaDiCaL clause learner for plugins. (#11226) 2024-09-26 13:49:08 +00:00
Andrew Reynolds
ab0299d405 Correct incompleteness tracking in incremental mode (#11204)
Fixes https://github.com/cvc5/cvc5/issues/11198.
2024-09-17 16:13:04 +00:00
Hans-Jörg
e73b991dd6 Add missing support for the assertionNames field of proofToString to Python and Java API and add unit test for all bindings (#11169)
@aniemetz Sorry, this took me longer than I hoped.

---------

Co-authored-by: Haniel Barbosa <hanielbbarbosa@gmail.com>
2024-08-20 16:08:01 +00:00
Hans-Jörg
bd2d37404b Change author name from "Hans-Jörg" to "Hans-Joerg" (#11155)
The later uses only ASCII letters instead of Unicode characters. This
currently leads to a build issue with the Java headers on FreeBSD:
https://github.com/cvc5/cvc5/issues/11145
2024-08-13 09:24:21 +00:00
Aina Niemetz
09b7705909 Fixes for nightlies. (#11049) 2024-07-13 17:23:10 +00:00
Aina Niemetz
488d3d6e25 test: Add tests for missing API coverage. (#11048) 2024-07-13 01:36:56 +00:00
Aina Niemetz
c86771fcff test: cpp api: Refactor solver_black test to use common sorts. (#11032) 2024-07-10 17:56:41 +00:00
Aina Niemetz
897a49fb60 test: cpp api: Rename solver_white test. (#11031) 2024-07-10 17:56:28 +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
68dd97ef5c c api: Add support for skolem_id_(hash|to_string). (#10987) 2024-07-09 22:10:14 +00:00
Aina Niemetz
a1e0aeb78c test: cpp api: Add tests for uncovered functions. (#11019) 2024-07-09 21:24:26 +00:00
Aina Niemetz
7cb2411d8a c api: Add support for term manager statistics. (#10986) 2024-07-09 21:02:46 +00:00
Aina Niemetz
b1de316fe8 test: Add tests for BITVECTOR_BIT. (#11014) 2024-07-09 02:30:50 +00:00