156 Commits

Author SHA1 Message Date
Daniel Larraz
17f380674b java: Store JNI library by OS and CPU architecture (#12237)
This PR builds and stores the JNI library in a directory structured
according to the OS and CPU architecture. This allows a single JAR to
contain native JNI libraries for multiple OSes and CPU architectures
simultaneously, and prevents file collisions when multiple JARs
containing a native JNI library for the same OS but different
architectures are added to the classpath.
2025-11-17 16:17:04 +00:00
Daniel Larraz
1120e3df17 Adapt CMake files to run Java tests on Windows (#12203)
Resolves #12143
2025-11-05 21:25:56 +00:00
Daniel Larraz
478876f4d8 Add missing Java and Python API tests (#12186) 2025-10-28 11:29:03 +00:00
Daniel Larraz
1b34e4c887 java: Make CVC5ApiException a subclass of RuntimeException (#12141)
Currently, `CVC5ApiException` inherits from `Exception`, which is a
*checked exception* in Java. Checked exceptions must be declared in the
`throws` clause of any method that may throw them; failing to do so
prevents Java code using the method from catching the exception as a
`CVC5ApiException`. This PR changes `CVC5ApiException` to be a subclass
of `RuntimeException`, which is an *unchecked exception*. Unchecked
exceptions may optionally be listed in the *throws* clause, but omitting
them does not prevent code from catching them.

Fixes #12117
2025-09-22 20:36:26 +00:00
Daniel Larraz
fd7e6d0620 cmake: Update targets to build and run API tests (#12127)
This PR adds new targets, `build-cppapitests` and `cppapitests`, for
building and running the C++ API tests, and uses `build-apitests` and
`apitests` for building and running the API tests across all languages
(C++, C, Python, etc.). It also adds a new target, `pyapitests`, for
running the Python API tests, and fixes the `capitests` target to run
the correct set of C API tests. In addition, it moves all issue-related
Python API tests to their own directory, as is already done for the C++
and C API tests.
2025-09-22 15:33:06 +00:00
Andrew Reynolds
b056bd2446 Add stable as a build type (#12128)
This adds `stable` as a build type, which is similar to `safe` but
permits incomplete proofs in regressions and the use of regular options
with `no-support:` fields.
2025-09-18 18:36:59 +00:00
Mathias Preiner
f19f42f377 Update copyright headers, add missing header documentation. (#11990)
Adds missing header documentation for new files, remove carriage returns
from new files.
2025-06-18 19:41:07 +00:00
Andrew Reynolds
041cad8063 Guard illegal kinds in assertions (#11876)
This makes the checks for kinds more robust. In particular we now catch
assertions with illegal kinds that otherwise could be dropped. We also
check for illegal types.

This fixes proofs in CPC in safe mode on 2 regressions.

---------

Co-authored-by: Mathias Preiner <mathias.preiner@gmail.com>
2025-05-20 15:46:58 +00:00
Daniel Larraz
b43bba2e36 cmake: Ensure the Python API is built when build-tests is invoked (#11900)
It also adds a rule, named `pyapitests`, to build only the Python unit
tests, similar to the C API test rule (`capitests`).
2025-05-19 17:29:57 +00:00
Andrew Reynolds
86b5903297 Add "no_support" field in options toml, generalize safe options (#11837)
This generalizes `--safe-options` to `--safe-mode=safe`.

An additional mode `--safe-mode=stable` is added which permits regular
options that do not support an essential feature (models and proofs).

This adds a field `no_support:` to the options toml files to list (as
strings) the features that are not supported by this option. This field
is expected to be maintained only for `regular` options. That is,
`common` options are assumed to have full support for all features, and
it is inconsequential which features `expert` options are supported with
(as they are not permitted in safe modes).

Marks `solve-bv-as-int`, `bv-solver`, and `cegqi-bv` as having no proof
support. Ensures the latter three are manually set by default when
`--safe-mode=safe`. Note that proof support for all 3 of these should be
available in the near future.

Restores `nl-cov`, `symmetry-breaker`, `cegqi-midpoint` as regular
options that do not support proofs.
2025-05-15 19:26:18 +00:00
Andrew Reynolds
cd4df2daff Add CI for safe-mode builds (#11869)
This ensures that regressions pass when configuring in `safe-mode`. Note
that *all* regression testers must now take into account whether we are
in a safe-mode (safe mode itself is not a new tester).

This makes the following changes:
- `safe-mode: yes|no` is now an entry in `--show-config`
- LibPoly and Cocoa are disabled by default when configuring with
`safe-mode`. We give a warning if the user specified otherwise.
- A few regressions are updated to have the appropriate options.
- Option and logic exceptions that are "admissible" in safe mode are
updated to contain the text `"in safe mode"`.
- Various options that are used in run_regression.py are upgraded to
"common" to ensure safe-mode is compatible with the tester. Removes a
few unecessary options in run_regression.py.
- Disables a number of unit tests and examples (in the CMake) that are
not applicable in safe mode.
- Adds a CI job to test a safe-mode build.

Note that the CPC tester fails due to not guarding against some unsafe
operators in the rewriter. I will address this in a separate PR.
2025-05-09 19:42:13 +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
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
d7b3320e4b Further restrictions on theory rewriters related to safe options (#11523)
Fixes https://github.com/cvc5/cvc5-projects/issues/744.
Fixes https://github.com/cvc5/cvc5-projects/issues/745.
Fixes https://github.com/cvc5/cvc5-projects/issues/746.
Fixes https://github.com/cvc5/cvc5-projects/issues/748.

Also makes it so that the FP rewriter does not rewrite experimental FP
typed terms unless `fp-exp` is enabled.

Updates several regressions based on this.

---------

Co-authored-by: Aina Niemetz <aina.niemetz@gmail.com>
2025-01-22 23:58:45 +00:00
Andrew Reynolds
ad76979329 Disable support for experimental theories when safe-options is set (#11162)
This adds options that guard the usage of "experimental" theories or
extensions thereof when `--safe-options` is enabled.

This includes bags, finite fields, separation logic, higher-order logic,
and extensions of arithmetic (including transcendentals, iand and pow2).

The options `--sets-exp` (renamed from `--sets-ext` in this PR) and
`--fp-exp` continue to be disabled by default, thus do not need to
change.

Similar to other expert options, these theories can still be used with
`safe-options` if they are enabled prior to setting `safe-options`, e.g.
`--ho-exp --safe-options ...` allows HOL to be used. The options
configuration will only override the setting of `*-exp` options if not
set by user.

This does not impact the behavior of cvc5 when `--safe-options` is not
set.

FYI @alex-ozdemir @mudathirmahgoub @yoni206 .
2024-09-27 15:07:07 +00:00
Aina Niemetz
fe5a65e26b Reorganize issues in C++ API tests. (#11106) 2024-08-06 17:53:50 +00:00
Aina Niemetz
2e5ab8def5 c api: Add API test sep_log_api. (#11105)
Co-authored-by: Mathias Preiner <mathias.preiner@gmail.com>
2024-08-05 22:04:46 +00:00
Daniel Larraz
7ee7051df0 test: c api: Fix memory leaks in capi_issue11069 (#11116) 2024-08-02 12:29:30 +00:00
Andrew Reynolds
04190ae042 Fix for parsing incremental input (#11070)
When using the incremental input interface, the parser had the behavior
that if it was ever finished, it did not reset its "finished" flag even
if more input was added.

This makes the parser internally reallocate a lexer and parser if the
user had exhausted all their input.

Fixes #11069.

---------

Co-authored-by: Aina Niemetz <aina.niemetz@gmail.com>
Co-authored-by: Daniel Larraz <daniel-larraz@users.noreply.github.com>
2024-08-01 19:14:44 +00:00
Aina Niemetz
63b043746c c api: Add API test two_solvers. (#11104)
Co-authored-by: Daniel Larraz <daniel-larraz@users.noreply.github.com>
2024-07-31 08:17:54 +00:00
Aina Niemetz
a3f060fce4 c api: Add API test reset_assertions. (#11102)
Co-authored-by: Daniel Larraz <daniel-larraz@users.noreply.github.com>
2024-07-31 07:01:09 +00:00
Aina Niemetz
addb36365d c api: Add API test ouroborous. (#11101) 2024-07-31 05:46:15 +00:00
Aina Niemetz
26f7a35729 c api: Add API test smt2_compliance. (#11103) 2024-07-30 18:50:31 +00:00
Aina Niemetz
3777d8cfcf c api: Add api tests infrastructure and boilerplate C API test. (#11095) 2024-07-26 21:42:47 +00:00