195 Commits

Author SHA1 Message Date
Daniel Larraz
29ca6e63b0 python: Define explicit __init__ constructors for Cython classes (#12159)
Cython `cdef` classes without an explicit `__init__` constructor have an
implicit `__init__` that accepts any number of arguments. (Python
classes, by contrast, default to an `__init__` that takes no arguments.)
This can lead to confusing situations where arguments appear to be
accepted but are discarded. This PR fixes the issue by adding explicit
`__init__` methods to the Cython classes.

Additionally, this PR removes some unnecessary field initializations in
the Cython classes.
2025-10-02 14:41:03 +00:00
José Neto
867cdf6271 Category option info for Python and Java APIs (#12100) 2025-09-08 13:47:59 +00:00
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
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
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
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
5ebc7e2bbc python api: Reintroduce deprecated constructor for SymbolManager. (#11062)
Co-authored-by: Daniel Larraz <daniel-larraz@users.noreply.github.com>
2024-07-18 20:29:15 +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
b1de316fe8 test: Add tests for BITVECTOR_BIT. (#11014) 2024-07-09 02:30:50 +00:00
Aina Niemetz
0728e27dfa python api: Add hashing for grammars. (#10966) 2024-06-25 15:23:16 +00:00
Daniel Larraz
46b743c847 Add plugin to the Python API (#10886) 2024-06-25 14:52:35 +00:00
Aina Niemetz
1d99fcea6c test: Add tests for uncovered API functions. (#10964) 2024-06-24 23:19:01 +00:00
Aina Niemetz
00d912f521 parser: Refactor symbol manager to be associated to term manager. (#10939) 2024-06-18 23:21:47 +00:00
Amalee Wilson
176cff678d Add support for parsing skolems (#10835)
Add support for parsing and printing skolems. Updates the printer, parser, java api, c++ api, python api, and adds tests for cli parsing.
2024-06-11 15:26:24 +00:00
Abdalrhman Mohamed
2c5e476aa3 Expose API for hashing proofs. (#10391)
This PR exposes hashing and equality of proofs in the API to avoid
reconstructing the same proof step multiple times from the Lean side.

Notes:
- Proof equality in this PR is referential, not syntactical. However,
this is still useful for caching (and better than nothing).
- A default constructor, `Proof()`, is added to the Java API to mirror
the C++ and Python APIs and the `Term()` constructor in the Java API.
2024-06-06 23:18:28 +00:00
Andrew Reynolds
3f1ed7bbaf Fix issues related to error handling in the parser (#10818)
Fixes the first two issues from
https://github.com/cvc5/cvc5/issues/10813.
2024-05-28 09:00:37 -07:00
Andrew Reynolds
46c0c9419a Optionally apply substitutions in simplify (#10736)
This changes the default behavior of `simplify` not to apply top-level
substitutions.

This behavior is can be unintuitive and may e.g. introduce internal
skolems into the term the user simplifies.

The previous behavior can be enabled by passing `applySubs` to true.
2024-05-14 15:28:52 +00:00
Aina Niemetz
434cdead90 test: Add tests for uncovered API coverage. (#10725) 2024-05-06 08:27:49 -05:00