117 Commits

Author SHA1 Message Date
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
3f30adabe9 Add tests for uncovered API methods for abstract sorts (#9430) 2023-01-20 19:17:50 +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
Alex Ozdemir
2f62d612ce fix ff coverage (#9381) 2023-01-05 15:43:49 -06: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
Andrew Reynolds
c0f7d8b015 Fixes for API coverage (#9124)
Fixes issue in API coverage build for nightlies.

Also adds a missing print function for block models mode.
2022-09-14 07:43:21 +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
Aina Niemetz
475ecd13e9 Use assertions instead of (Pretty)CheckArgument in expr and smt. (#9065)
This is in preparation for getting rid of IllegalArgumentException.
This exception was originally used for guards in the old API and is now
obsolete.
2022-08-23 09:07:29 -05: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
Aina Niemetz
ec5e78f730 api: Refactor sort and term (like) objects to not depend on Solver. (#9020)
This refactors Sort, Term, Op and datatype objects to not maintain a
reference (and depend) on Solver, but an associated NodeManager. This
allows to share node managers between solver instances.
2022-08-03 10:15:50 -05:00
Andrew Reynolds
1d62c72ff5 Add learned literal types to the API (#8990)
Also changes the name of the enum for now to have a prefix, since we are not using enum classes.

Furthermore this excludes true from being a preprocessed learned literal.
2022-08-03 01:33:56 +00:00
mudathirmahgoub
17d5e26a9a Add rel.project operator to sets (#8929) 2022-07-06 21:02:23 +00:00
mudathirmahgoub
f5a9a12b21 Add declareOracleFun to the Java API (#8815) 2022-06-06 18:58:22 +00:00
Ying Sheng
3690b354b4 Add getInterpolant with a grammar in the unit test for all language bindings (#8775)
Add getInterpolant with a grammar in the unit test for all language bindings
2022-05-17 13:40:32 +00:00
Andrew Reynolds
9fe8509ed9 Last remaining fixes for eliminating subtyping (#8772)
Also fixes a debug failure for the nightlies.

This also changes mkTuple to not rely on subtyping (this method should regardless be deleted from our API, as it is not the recommended way of constructing tuples).
2022-05-16 22:46:41 +00:00
Andrew Reynolds
a2f5753469 Preserve types in rewriter and make core type rules strict (#8740)
This is the key step for eliminating the use of subtyping.

This makes several changes:
(1) CONST_INTEGER is now used for integer constants, which is now exported in the API. The type rule for CONST_RATIONAL is changed to always return Real, even if its value is integral. This means we can distinguish real and integer versions of the integers. Note this also implies that the rewriter now fully preserves types, as rewriting TO_REAL applied to a constant integer will return a constant integral rational.
(2) The type rules for EQUAL, DISTINCT, ITE and APPLY_UF are made strict, in other words, we given a type exception for equalities between an Int and a Real. This restriction impacts the API.
(3) The arithmetic rewrite for (Real) equality casts integers to reals as needed to ensure Reals are only made equal to Reals. The net effect is that TO_REAL may appear on either side of equalities.
(4) The core arithmetic theory solver is modified in several places to be made robust to TO_REAL occurring as the top symbol of sides of equality.

Several assertions are strengthened or added to ensure that equalities and substitutions are between terms of the same type, when it is necessary to do so.

Two quantifiers regressions are modified since the solving techniques are not robust to TO_REAL. A few unit tests are fixed to use proper types.
2022-05-12 17:48:27 +00:00
Gereon Kremer
6007962d5e Add test coverage for almost everything from the Java API (#8723)
This PR adds tests for almost everything that is not yet covered by the java API tests.
2022-05-10 14:55:44 +00:00
Andrew Reynolds
9058998bfe Add unit tests for getInstantiations (#8741) 2022-05-09 10:05:28 -07:00
Gereon Kremer
3db254027b Make printStatisticsSafe public (#8721)
Solver::printStatisticsSafe() is private right now. There is no real reason for that, and as we claim that the driver is only using the regular API we should just make it public.
2022-05-04 17:21:41 +00:00
Gereon Kremer
79cf93488f Add missing tests for some corners of the API (#8688)
This PR adds a bunch of unit tests for some not yet covered corners of the API.
2022-05-02 21:08:58 +00:00