Commit Graph

35 Commits

Author SHA1 Message Date
mudathirmahgoub
69643856df Fix some documentation warnings (#8453) 2022-03-30 03:15:58 +00:00
Mathias Preiner
bbcd471ed4 Introduce internal namespace and remove api namespace. (#8443)
The public cvc5 API now lives in the cvc5 namespace. All internal parts were moved into the (new) internal namespace.
The final hierarchy will be as follows:

cvc5
  ~~ public API
  ::context
  ::internal
  ::parser
  ::main

After this PR it will be:

cvc5
  ~~ public API
  ::internal
      ::context
      ::main
  ::parser
2022-03-29 23:23:01 +00:00
Andres Noetzli
bf2d64336c Move RoundingMode to cvc5_types.h (#8427)
This moves RoundingMode to cvc5_types.h and switches to using the
auto-generated enum bindings. It also fixes the Java-bindings generator
for enums (certain parts were previously hardcoded for Kind) and
extends the unit tests for Solver::mkRoundingMode() to actually check
the value being created.
2022-03-29 01:13:46 +00:00
Mathias Preiner
8ae907ba48 Rename get-interpol to get-interpolant. (#8424) 2022-03-28 15:30:19 -07:00
yoni206
c7507cebfa Separating produce-interpols from the mode of interpolant generation (#8326)
In current master, --produce-interpols takes a mode, where "none" is the default mode, in which interpolant generation is not enabled.
This PR makes --produce-interpols a Boolean, and adds a interpols-mode option to determine the mode, similarly to unsat cores.
2022-03-26 17:10:06 +00:00
Aina Niemetz
748c884353 api: Rename *SortConstructor* to *UninterpretedSortConstructor*. (#8406) 2022-03-26 05:40:42 +00:00
Gereon Kremer
129a79d959 Add API unit tests for options (#8339)
This PR adds some unit tests that cover some remaining cases of getOptionInfo() and getDriverOptions().
It also adds some fixes to the java bindings of these methods.
2022-03-26 00:42:26 +00:00
Andrew Reynolds
bf8ec7d9f1 Update checkSynth and checkSynthNext to return SynthResult (#8382)
Also extends to non-trivial unit test of SynthResult.

Note this also changes the expected output when using --sygus-out=status from unsat/sat/unknown to feasible/infeasible/fail (the option is used mostly just for our regressions). The output mode status-or-def is now equivalent to standard and is hence deleted.
2022-03-25 20:00:14 +00:00
Andrew Reynolds
7ae28c6038 Properly guard commands in the SyGuS API (#8390)
This commit ensures we don't segfault in the SyGuS API (for non-text inputs) if the option sygus is not set to true. It also renames mkSygusVar to declareSygusVar for consistency with the sygus input format.

For SyGuS API inputs, we now use the option sygus to true instead of setting the language to sygus2.

This furthermore changes a few details in set-defaults regarding the relationship between the language, the sygus option, and when to apply default options for sygus.

It also adds a unit test for checkSynth.
2022-03-25 02:21:44 +00:00
Gereon Kremer
81eb37c149 Add API unit tests for statistics (#8341)
This PR adds some unit tests that cover getStatistics() and the api::Stat class.
2022-03-23 22:59:23 +00:00
Andrew Reynolds
2f1483e2e3 Remove unecessary methods from the API (#8260)
Removes checkEntailed from Solver.
Removes isEntailed, isNotEntailed, isEntailedUnknown from Result.
Removes isSubsortOf, isFunctionLike, getUninterpretedSortName, getSortConstructorName from Sort.

Updates examples and unit tests.
2022-03-14 18:29:30 +00:00
Andrew Reynolds
5278d7deb8 Update abduction and interpolation API to not use pass/return by reference (#8263) 2022-03-11 21:41:54 +00:00
Andrew Reynolds
8bd0cb485e Add support for get learned literals in the API (#8099)
This command will eventually take a mode; for now it assumes a default implementation. I've opened cvc5/cvc5-wishues#104 to track this.

This is a feature requested by Certora.
2022-03-04 14:37:54 +00:00
Andrew Reynolds
18cf7ab96a Always produce assertions (#8041)
There is no reason to disable --produce-assertions, this simplifies the code to assume that assertions are always available, and always warns if the user disables this option.
2022-02-08 03:55:07 +00:00
Aina Niemetz
c335e4d3fa Rename kind PLUS -> ADD. (#8036)
This renames the arithmetic internal and API kind PLUS to ADD for
consistency with our naming scheme for other operators (e.g.,
BITVECTOR_ADD, FLOATINGPOINT_ADD).
2022-02-03 04:25:14 +00:00
Aina Niemetz
5b458eceb6 api: Rename mk<Value> functions for FP for consistency. (#8033) 2022-02-02 20:59:37 +00:00
Andres Noetzli
0f5ee6bb4a Unify abstract values and uninterpreted constants (#7424)
This commit unifies abstract values and "uninterpreted constants" into a
single kind. Note that "uninterpreted constants" is a bit of a misnomer
in the context of the new API, since they do not correspond to the
equivalent of a declare-const command, but instead are values for
symbols of an uninterpreted sort (and thus special cases of abstract
values). Instead of treating "uninterpreted constants" as a separate
kind, this commit extends abstract values to hold a type (instead of
marking their type via attribute in NodeManager::mkAbstractValue())
and uses the type of the abstract values to determine whether they are a
value for a constant of uninterpreted sort or not. Unifying these
representations simplifies code and brings the terminology more in line
with the SMT-LIB standard.

This commit also updates the APIs to remove support for creating
abstract values and "uninterpreted constants". Users should never create
those. They can only be returned as a value for a term after a
satisfiability check.

Finally, the commit removes code in the parser for parsing abstract
values and updates the code for getting values involving abstract
values. Since the parser does not allow the declaration/definition of
abstract values, and determining whether a symbol is an abstract value
was broken (not all symbols starting with an @ are abstract values),
the code was effectively dead. Getting values involving "uninterpreted
constants" now no longer requires parsing the string of the values, but
instead, we can use existing API functionality.
2022-01-13 01:42:26 +00:00
Andrew Reynolds
668518797a Disallow separation logic in incremental mode (#7888)
Fixes #5541. Fixes #5607.
2022-01-06 17:26:10 -06:00
Andrew Reynolds
5c3cc154d0 Add support for incremental + interpolants (#7853)
Adds support for incrementality + get-interpol, including the get-interpol-next command.
2021-12-22 10:56:51 -06:00
Andrew Reynolds
36f93a1431 Support get-abduct-next (#7850)
Adds support for incremental abduction, adds regression for using push/pop in combination with get-abduct, and a use of get-abduct-next.

Adds this method to C++, java API.

Interpolation/abduction not yet supported in Python API, I'm waiting for @yoni206 to add this; getAbductNext will be added to Python API in followup PR.
2021-12-21 18:21:40 +00:00
Andrew Reynolds
20d040d79b Allow SyGuS subsolver to be reused in incremental mode (#7785)
This allows SyGuS subsolvers to be called multiple times to produce solutions for a given set of SyGuS constraints using a new command check-synth-next.

By default, the SyGuS subsolver will generate a new solution for each successive check-synth.

This simplifies the internal SyGuS solver in several ways for this purpose. It also ensures that solutions are cached; current master may recompute solutions in the same state more than once if asked, which is no longer the case.

This completes our support for incremental SyGuS.
2021-12-20 15:23:16 +00:00
Aina Niemetz
9999230374 api: java: Support default arity for Solver::mkUnresolvedSort(). (#7842) 2021-12-17 23:50:59 +00:00
Aina Niemetz
6c98b2f66a api: Add Solver::mkUnresolvedSort(). (#7817)
This adds a function to create unresolved sorts for mutually recursive
datatpes. This function creates an uninterpreted sort if the arity of
the unresolved sort is 0, and a sort constructor sort otherwise.
2021-12-17 04:24:23 +00:00
Gereon Kremer
5702922272 Remove void as possible option type (#7731)
This PR removes the possibility to have void options. While there are (very) few options that may legitimately be considered void (they do not actually hold a value, but merely trigger a handler or predicate), the type being void introduces a number of special cases in the options setup. Their only real benefit was to avoid having data members that would never be used.
As it turns out, though, the same can be achieved by not specifying a name, which already supported as well.
2021-12-02 21:19:15 +00:00
Gereon Kremer
4c9df988d4 make default and modes strings instead of enum values (#7656)
For mode options, getOptionInfo would hold the name of the enum values for the default value and the available modes. This PR changes this to hold the string values instead, which is what users can actually use via the API.
2021-11-17 01:45:32 +00:00