98 Commits

Author SHA1 Message Date
José Neto
867cdf6271 Category option info for Python and Java APIs (#12100) 2025-09-08 13:47:59 +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
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
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
Aina Niemetz
488d3d6e25 test: Add tests for missing API coverage. (#11048) 2024-07-13 01:36:56 +00:00
Aina Niemetz
5ade599bf1 test: java api: Clean up and extend api coverage. (#11024) 2024-07-10 17:57:05 +00:00
mudathirmahgoub
31b2ef9b3d Add plugin to Java API (#10875) 2024-06-28 17:26:16 +00: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
354fc4147e Java API: Refactor to expose TermManager. (#10531)
This is related to the previous refactor of the C++ API in
https://github.com/cvc5/cvc5/pull/10426.
2024-04-02 16:42:06 +00:00
Aina Niemetz
b9b4e1b9da c++ API: Refactor statistics handling. (#10530)
This moves term statistics collection from Solver to TermManager.
TermManager and Solver now both provide `getStatistics()`, the former
captures API level term statistics, the latter internal solver
statistics.

This also adds iterator capabilities to the Python Statistics class.
2024-04-01 21:12:16 +00: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
bf218d7e2d java: Fix incorrect call dispatch for mkTerm from Op. (#10425) 2024-02-24 01:35:07 +00:00
mudathirmahgoub
71c04db7a4 Add nullable type to theory of datatypes (#10243) 2024-01-31 15:29:14 -06:00
Andrew Reynolds
bb82ecf511 Change the default proof format to ALF (#10231) 2023-12-19 23:01:25 +00:00
Andrew Reynolds
228b963e4f Add support for get-timeout-core-assuming (#10076)
This is a variant of get-timeout-core that asks to find a timeout core over a given set of assumptions, while all current assertions are implicitly included in the core.

Also adds news + an entry missed from #9585.
2023-11-02 10:53:34 -05:00
Hans-Jörg
ce64f348d3 Add API for Proofs (#9895)
This pull requests adds support to get Proofs as proper objects from the API.

To do so it adds an object Proof that encapsulates a ProofNode. Furthermore, it adds a function proofsToString to the Solver object that prints (a vector of) proofs. Finally, it modifies the getProof function of the Solver object to return proofs.

Proof rules are returned as strings.

One thing I don't quite like is that the proof component configuration must be given to both the getProof and proofsToString method and must be the same.
2023-10-12 12:05:01 -05:00
Haniel Barbosa
1a83703006 [unsat cores] Adds command to retrieve lemmas used to derive unsat (#9585)
Feature is based on the SAT proof. The lemmas that are accumulated by the ProofCnfStream during a check-sat call are filtered according to being used or not in the SAT proof and then printed as a list.
2023-09-27 20:24:17 +00:00
Andrew Reynolds
692df390a3 Change policy for setLogic in API (#9986)
The motivation of this PR is to make the InputParser more foolproof in regards to initializing the logic.

The main change is that if the user provides a solver or symbol manager with a logic that has been set, then that logic is used. This means we throw an error if the 2 are using different logics.

It also removes the InputParser::setLogic method.

This requires adding isLogicSet and getLogic to the Solver and SymbolManager API.
2023-09-18 18:16:17 +00:00
Andrew Reynolds
d43f1b624a Add fresh argument to declareSort (#9984)
This change is analogous to the one for declareFun and is required for making it easier to communicate formulas with uninterpreted sorts in a distributed setting.

Also fixes two minor parser issues:

We should revert to "assert" mode if a declaration is received, e.g. in between a check-sat and get-model.
We should catch errors for overloaded symbols even when fresh declarations are disabled.
2023-08-30 01:43:20 +00:00
Andrew Reynolds
707a16448e Add optional fresh argument to declareFun (#9956)
This allows the user to have a consistent way of constructing constants (when fresh=false), without manually tracking a symbol table.

It also adds an option fresh-declarations to control whether the parser uses fresh constants. This is true by default to preserve backwards compatibility.

It also fixes an issue with using global-declarations from CLI.
2023-08-24 17:48:26 +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
d0e7714cf6 Add find-synth to the API. (#9910)
This reenables the regressions for find-synth algorithms using the new smt2 commands.

Note that I simplified the FindSynthSolver (as you had suggested earlier).
2023-08-07 15:58:39 +00:00
Andrew Reynolds
79ae0eeaec Remove support for synth-inv and fix command execution (#9882)
This removes synth-inv and corrects several issues in the parser concerning when commands should be executed.
2023-07-14 12:43:25 -05:00
Andrew Reynolds
5fb14d6e46 Change timeout cores to apply to preprocessed assertions (#9827)
This changes (get-timeout-core) to operate on preprocessed assertions, and to do dependency tracking to input assertions analogous to unsat cores.

This is to address scalability issues for timeout cores on problems with many definitions, as requested by Certora.

As a result, (get-timeout-core) now requires unsat cores to be enabled.

This further required improving our tracking of preprocessed assertions to take incremental mode into account, which was previously wrong.
2023-06-20 10:09:57 -05:00