84 Commits

Author SHA1 Message Date
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
Andrew Reynolds
2e41f64d47 Simplify API for constructing tuple values (#9766)
In preparation for 1.1.
2023-06-12 17:28:05 +00:00
Aina Niemetz
0a8baa0f0a Update copyright headers. (#9736) 2023-05-09 18:06:18 +00:00
Andrew Reynolds
6fb78cd0d5 Add get-timeout-core to the API (#9670)
Adds to C++, Java and Python APIs.

Also includes a fix for the internals discovered when adding a regression.
2023-04-17 08:11:39 -05:00
Aina Niemetz
7081f806f7 parser: Fix handling of fp values. (#9668)
Parser did not recognize `(fp #bX #bY #bZ)` as FP value. This further
introduces a new API function `Solver::mkFloatingPoint(const Term&,
const Term& const Term&)` to create a floating-point value from its
IEEE-754 bit-vector components.
2023-04-14 17:30:49 +00:00
Andrew Reynolds
00e19fdbe2 Minor improvements to difficulty manager (#9510)
We now track difficulty on lemmas themselves, which can potentially used as a heuristic for measuring the usefulness of lemmas.

This also makes it so that all literals in lemmas are used for incrementing difficulty.
2023-03-08 21:36:44 +00:00
mudathirmahgoub
9a20c372b0 Expose sygus assumptions and constraints to the api (#9471) 2023-02-02 21:08:28 +00:00
Andrew Reynolds
25d781fc96 Do not use null sort as dummy for empty set and bag (#9469)
This is incompatible with forthcoming changes to the type checker where the null type node means "not well typed".
2023-01-27 20:48:08 +00:00
Andrew Reynolds
b3fbf9afcc Add infrastructure and API for abstract sorts (#9263)
Adds necessary API methods for supporting abstract sorts in the cpp, java, python APIs.

An abstract sort represents a class of sorts. It is parameterized by a kind. For example, the abstract sort parameterized by the kind BITVECTOR_SORT denotes bitvectors of unspecified bit-width.

To support the above functionality, the kinds of Sort must be exported in the API, which is done in this PR.

This is the first step towards supporting the rewrite DSL for parameterized sorts, and planned SyGuS extensions that use gradual typing.
2023-01-17 19:37:10 +00:00
mudathirmahgoub
590af04a10 Remove reference to solver from java objects (#9147) 2022-10-04 17:06:02 +00:00
Andres Noetzli
bc6968a19d Better error checking for indices of to_fp (#9142)
Fixes #9140. Instead of crashing with an assertion error during the
creation of the operator, the commit introduces error checks at the API
level to ensure that the indices are `> 1` as required by the SMT-LIB
standard.

It also fixes our error check for `mkFloatingPointSort` to ensure that
the exponent and the significand length are both greater than one as
required by the SMT-LIB standard.
2022-09-24 01:59:29 +00:00
Aina Niemetz
85f62cb40c api: Add getVersion(). (#9093)
This adds support for querying the version string of the solver via the API.
2022-08-30 12:04:04 -07:00
Aina Niemetz
6552114986 api: Move well-foundedness guard of DT from parser to API. (#9074)
Fixes cvc5/cvc5-projects#527.
2022-08-23 19:38:25 +00:00
Andrew Reynolds
16c99817ff Fix for API guarding of double use of DatatypeDecl (#9028)
The method DatatypeDecl::isResolved() was not accurate, nor was it being checked in cvc5_checks.h when constructing multiple datatypes.

Fixes cvc5/cvc5-projects#522.
2022-08-23 15:56:47 +00:00
Andrew Reynolds
9669fed459 Add Proof components to the API (#9030)
Also adds a no argument version of getLearnedLiterals to Java, for consistency.
2022-08-05 18:00:05 +00:00