68 Commits

Author SHA1 Message Date
Andrew Reynolds
26308ebd1d Minor change to parser example, fix for bags doc (#10086)
* Minor change to parser example, fix for bags doc

* Format
2023-10-05 09:34:21 -05:00
Andrew Reynolds
74443f10ab Adding API checks, unit tests, and examples for the parser API (#10048)
This PR adds the proper checks for the parser API. It furthermore adds examples and unit tests for the parser API.

Note that InputParser::nextCommand and InputParser::nextTerm don't catch exceptions, since we want to throw ParserExceptions containing the parsing information, not API exceptions.

Also, at the moment, the InputParser can throw an exception during initialization, which is not caught either.
2023-10-02 15:51:32 +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
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
2e41f64d47 Simplify API for constructing tuple values (#9766)
In preparation for 1.1.
2023-06-12 17:28:05 +00:00
Abdalrhman Mohamed
cde90cdf97 Minor improvements to Sygus rcons procedure. (#9781)
This PR adds minor improvements to the SyGuS solver:

Changes the weight of identity rules in the grammar, giving them higher priority during enumeration.
Replaces n-ary operators with their binary version before matching in rcons.
Splits the pattern enumerator for rcons into two enumerators: pattern enumerator and term enumerator.
Adds an option to control geometric distribution parameter used to interleave the 2 enumerators.
Additionally, this PR moves the implementation of the grammar API to an internal class with the Grammar class now a wrapper for the internal class.
2023-06-06 19:24:23 +00:00
Alex Ozdemir
368f3c3ed6 ff: connect sub-theories to main solver & test (#9218)
Organizing the PR a bit:

we hook up the subtheories to TheoryFf
we expose FF-related things via the C++/Pytohn API and SMT-LIB2 interface.
we add a bunch of tests against these interfaces.
2022-12-16 16:36:41 +00:00
Aina Niemetz
9c176f263b docs: Do not use explicit line numbers in literalinclude. (#8690) 2022-05-02 20:13:00 +00:00
mudathirmahgoub
12293a35d5 Add Relation and Table types to SMTLib parser (#8605) 2022-04-13 13:54:27 -05:00
Mathias Preiner
d01e59c13b Update copyright headers for release 1.0 (#8539) 2022-04-05 20:38:57 +00:00
Andrew Reynolds
df6ce0361d Rename mkSygusGrammar to mkGrammar (#8544) 2022-04-02 19:40:41 +00:00
Andrew Reynolds
40910fb3c6 Remove variant of mkDatatypeDecl with one sort parameter (#8543)
Subsumed by the vector version.

Also marks more methods as experimetnal.
2022-04-02 19:21:46 +00:00
Aina Niemetz
5dcb750667 api: Rename get(Selector|Constructor)Term() to getTerm(). (#8537) 2022-04-02 18:57:50 +00:00
Aina Niemetz
93247764b8 api: Remove DatatypeConstructor::getSelectorTerm(). (#8535) 2022-04-02 01:53:15 +00:00
Aina Niemetz
a735215651 api: Remove Datatype::getConstructorTerm(). (#8529) 2022-04-01 21:36:07 +00:00
Andres Noetzli
01061af730 [API] Remove redundant version of mkFunctionSort (#8503)
mkFunctionSort that takes two sorts as arguments is redundant, because
the first argument is equivalent to a vector of size one passed to the
other overload of mkFunctionSort. This commit removes the method from
the C++ API but keeps the existing semantics for the Java and Python
bindings for convenience and consistency with, e.g. mkTerm.
2022-04-01 04:50:25 +00:00
Mathias Preiner
8d7787f310 api: Swap arguments of declareSygusVar. (#8499)
Make it consistent with other declare*/define* functions.
2022-04-01 01:32:44 +00:00
mudathirmahgoub
6c421a8221 Add examples/bags.cpp (#8463) 2022-03-31 15:17:22 +00:00
Abdalrhman Mohamed
f1ba9b8542 Show the code for utilities in the docs. (#8387)
This PR adds the code for printing synthesis solutions to the docs. Various other changes are made to increase the consistency between the different bindings.

Signed-off-by: Abdalrhman M Mohamed <abdalrhman-mohamed@uiowa.edu>
2022-03-30 02:11:08 +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
Mathias Preiner
cc808da53d api: Unify mkOp variants. (#8369)
Co-authored-by: Gereon Kremer <nafur42@gmail.com>
2022-03-25 23:57:10 +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
Mathias Preiner
4a58ed7daf api: Unify mkTerm variants. (#8357) 2022-03-22 00:22:41 +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