cvc5.git
2 years agoCheck the synthesized funs of `check-synth-next`. (#7915)
Abdalrhman Mohamed [Tue, 11 Jan 2022 06:36:20 +0000 (00:36 -0600)]
Check the synthesized funs of `check-synth-next`. (#7915)

This PR ensures that the functions synthesized by cvc5 with check-synth-next command(s) are different from the preceding ones.

2 years agoAdd new idiomatic examples (#7912)
Alex Ozdemir [Tue, 11 Jan 2022 00:49:02 +0000 (16:49 -0800)]
Add new idiomatic examples (#7912)

2 years ago[Win64] Link LibPoly statically for static builds (#7891)
Andres Noetzli [Tue, 11 Jan 2022 00:15:03 +0000 (16:15 -0800)]
[Win64] Link LibPoly statically for static builds (#7891)

Fixes #7861. LibPoly was not getting linked statically for Windows
builds, even when building a static version of cvc5. This commit fixes
the issue.

2 years agoFix internal type error when printing lambdas with more than one variable in LFSC...
Andrew Reynolds [Mon, 10 Jan 2022 22:53:40 +0000 (16:53 -0600)]
Fix internal type error when printing lambdas with more than one variable in LFSC (#7909)

2 years agoCheck arity in Sort::instantiate (#7897)
Andrew Reynolds [Mon, 10 Jan 2022 22:19:00 +0000 (16:19 -0600)]
Check arity in Sort::instantiate (#7897)

Fixes cvc5/cvc5-projects#386.

2 years agoAdd new methods for RealAlgebraicNumber (#7907)
Gereon Kremer [Mon, 10 Jan 2022 21:29:45 +0000 (13:29 -0800)]
Add new methods for RealAlgebraicNumber (#7907)

This PR adds some new methods for the RealAlgebraicNumber class: division, computing the (multiplicative) inverse and a specialization of std::hash.

2 years agoUpdate to latest libpoly version (#7906)
Gereon Kremer [Mon, 10 Jan 2022 20:14:59 +0000 (12:14 -0800)]
Update to latest libpoly version (#7906)

This PR updates to the latest libpoly version. It contains a bugfix and adds division and inverse operations for algebraic numbers.

2 years agoapi: Remove Sort::isComparableTo(). (#7903)
Aina Niemetz [Mon, 10 Jan 2022 19:27:04 +0000 (11:27 -0800)]
api: Remove Sort::isComparableTo(). (#7903)

Since we do not support arithmetic subtyping on the API level anymore,
this function is obsolete. Consequently, this now requires that
replacement terms as arguments to Term::substitute() are of the same
sort as the replaced terms.

2 years agoAvoid gcc/10.1.0 bug by moving some configuration into a namespace
Matthew Sotoudeh [Mon, 10 Jan 2022 18:29:10 +0000 (10:29 -0800)]
Avoid gcc/10.1.0 bug by moving some configuration into a namespace

Eventually there is intention to move all of cvc5::Configuration into
cvc5::configuration, this is a first step that also has the nice side-effect of
letting it build under an otherwise-buggy version of gcc/10.1.0 that was
causing issues.

Signed-off-by: Matthew Sotoudeh <sotoudeh@stanford.edu>
2 years agoStart post-release for 0.0.5
Mathias Preiner [Sat, 8 Jan 2022 00:00:41 +0000 (16:00 -0800)]
Start post-release for 0.0.5

2 years agoBump version to 0.0.5
Mathias Preiner [Sat, 8 Jan 2022 00:00:41 +0000 (16:00 -0800)]
Bump version to 0.0.5

2 years agoImprove docs extension for examples (#7900)
Gereon Kremer [Fri, 7 Jan 2022 22:25:38 +0000 (14:25 -0800)]
Improve docs extension for examples (#7900)

We recently added automatic download links for examples in our documentation, however they assumed everything to live inside the main cvc5 repo while, e.g., the examples for the z3py compat API do not. While #7896 provided a very simple fix, it mixes different concerns (rendering of tabs vs. locating the input files, though they should coincide right now).
This PR takes a more fundamental approach by extending the current pattern mechanism to allow for explicit url specification.

Closes #7896.

2 years agoPython Idomatic API: Document solver, results, utilities, and fns (#7882)
Alex Ozdemir [Fri, 7 Jan 2022 20:42:28 +0000 (12:42 -0800)]
Python Idomatic API: Document solver, results, utilities, and fns (#7882)

I put fns into "Core & Booleans".

2 years agoRemove CDDenseSet data structure (#7890)
Matthew Sotoudeh [Fri, 7 Jan 2022 20:12:18 +0000 (12:12 -0800)]
Remove CDDenseSet data structure (#7890)

It was not used anywhere, and does not appear to build under, at least,
GCC/9.1.0.

Signed-off-by: Matthew Sotoudeh <sotoudeh@stanford.edu>
2 years agoFix eager string preprocessing in incremental mode (#7895)
Andrew Reynolds [Fri, 7 Jan 2022 19:30:36 +0000 (13:30 -0600)]
Fix eager string preprocessing in incremental mode (#7895)

Fixes #5780.

Issue was caused by reintroducing skolems during preprocessing that were already solved for.

2 years agoSome minor improvements to the theory references (#7881)
Gereon Kremer [Fri, 7 Jan 2022 17:49:22 +0000 (09:49 -0800)]
Some minor improvements to the theory references (#7881)

2 years agoAdd regressions for array sequence solver (#7874)
Andrew Reynolds [Fri, 7 Jan 2022 16:32:34 +0000 (10:32 -0600)]
Add regressions for array sequence solver (#7874)

This closes the seqArray branch.

2 years agoDocument quantifiers in idiomatic python API (#7880)
Alex Ozdemir [Fri, 7 Jan 2022 04:37:08 +0000 (20:37 -0800)]
Document quantifiers in idiomatic python API (#7880)

2 years ago[Regressions] Add directive for disabling testers (#7892)
Andres Noetzli [Fri, 7 Jan 2022 04:13:56 +0000 (20:13 -0800)]
[Regressions] Add directive for disabling testers (#7892)

This commit adds a directive for regressions (`DISABLE-TESTER`) that
allows disabling a given tester for a regression. Currently, we disable
testers based on properties such as command line arguments, which can be
error prone.

2 years agoMake alpha equivalence user context dependent (#7889)
Andrew Reynolds [Thu, 6 Jan 2022 23:42:14 +0000 (17:42 -0600)]
Make alpha equivalence user context dependent (#7889)

Fixes #5373

Issues were occurring due to using quantified formulas in alpha equivalence that were stale.

This also removes spurious warnings from quantifier elimination (dropping the "strict" requirement, which unnecessarily warns if we are in a non-arithmetic logic).

2 years agoDisallow separation logic in incremental mode (#7888)
Andrew Reynolds [Thu, 6 Jan 2022 23:26:10 +0000 (17:26 -0600)]
Disallow separation logic in incremental mode (#7888)

Fixes #5541. Fixes #5607.

2 years agoImprove theory combination in the presence of real algebraic numbers (#7883)
Gereon Kremer [Thu, 6 Jan 2022 21:09:10 +0000 (13:09 -0800)]
Improve theory combination in the presence of real algebraic numbers (#7883)

This PR changes how we handle real algebraic numbers in theory combination and model construction.
The goal is to improve getEqualityStatus() and produce proper models more often.
We now use a RAN-aware evaluator for getEqualityStatus() and change the way how the nonlinear extension finalizes its model.

2 years agoFix non-idempotent rewrite in arrays (#7887)
Andrew Reynolds [Thu, 6 Jan 2022 20:25:19 +0000 (14:25 -0600)]
Fix non-idempotent rewrite in arrays (#7887)

Fixes #6807.

2 years agoMinor cleaning of non-clausal simplification (#7886)
Andrew Reynolds [Thu, 6 Jan 2022 20:05:04 +0000 (14:05 -0600)]
Minor cleaning of non-clausal simplification (#7886)

2 years agocppapi: Remove Datatype::hasNestedRecursion(). (#7878)
Aina Niemetz [Wed, 5 Jan 2022 21:20:05 +0000 (13:20 -0800)]
cppapi: Remove Datatype::hasNestedRecursion(). (#7878)

Datatypes with nested recursion are a highly experimental feature and we
currentle don't even have a decision procedure for them.

2 years agoPy idiomatic API: Doc sets, datatypes, FP (#7877)
Alex Ozdemir [Wed, 5 Jan 2022 20:47:09 +0000 (12:47 -0800)]
Py idiomatic API: Doc sets, datatypes, FP (#7877)

2 years agoapi: Add missing guard for Datatype::isFinite(). (#7879)
Aina Niemetz [Wed, 5 Jan 2022 20:23:17 +0000 (12:23 -0800)]
api: Add missing guard for Datatype::isFinite(). (#7879)

2 years agoProperly parse arithmetic values (#7876)
Andrew Reynolds [Wed, 5 Jan 2022 18:58:10 +0000 (12:58 -0600)]
Properly parse arithmetic values (#7876)

This makes our parser correct for arithmetic values e.g. (- n) is parsed as a value not UMINUS when n is a numeral, as indicated in SMT-LIB. Similarly for (/ m n) and (/ (- m) n) we parse as values and not DIVISION.

This subsumes a patch for constructing array constants where this led to issues.

2 years agoTrack input list for atoms in difficulty manager (#7851)
Andrew Reynolds [Wed, 5 Jan 2022 18:01:25 +0000 (12:01 -0600)]
Track input list for atoms in difficulty manager (#7851)

This makes our support for get-difficulty faster by tracking the set of input formulas that atoms occur in, which is highly important for benchmarks with many assertions and where many lemmas are added at standard effort.

This is work towards making get-difficulty scale on a large benchmark from Certora.

2 years agoDon't use python's collections.Set (#7875)
Alex Ozdemir [Wed, 5 Jan 2022 17:19:03 +0000 (09:19 -0800)]
Don't use python's collections.Set (#7875)

We used to use collections.Set.

Apparently this was an alias for collections.abc.Set. I can't find it
documented anywhere though, going as far back as Python 3.5. Perhaps it
was an undocumented left-over from when the collections.abc module was
split out from collections in Python 3.3?

At any rate, the alias appears broken in Python version 3.10.1.

Now we just use the builtin set type, which is what we wanted anyway,
I think.

2 years agoProperly set __file__ in python bindings (#7867)
yoni206 [Wed, 5 Jan 2022 16:26:00 +0000 (18:26 +0200)]
Properly set __file__ in python bindings (#7867)

When running make docs after changing the documentation in cvc5.pxi, the html files are not updated. This PR fixes this issue.

Co-authored-by: Gereon Kremer gereon.kremer@cs.rwth-aachen.de
2 years agoFix proofs for datatype purify (#7841)
Andrew Reynolds [Tue, 4 Jan 2022 21:50:17 +0000 (15:50 -0600)]
Fix proofs for datatype purify (#7841)

Previously we were failing to produce proofs for purification lemmas (= t witness_form(t)) from datatypes.

2 years agoChange default granularity of proofs to macro (#7855)
Andrew Reynolds [Tue, 4 Jan 2022 21:22:20 +0000 (15:22 -0600)]
Change default granularity of proofs to macro (#7855)

Also changes the name "off" to "macro" to be more consistent.

2 years agoReorder NodeManager class according to code guidelines. (#7873)
Aina Niemetz [Tue, 4 Jan 2022 20:15:53 +0000 (12:15 -0800)]
Reorder NodeManager class according to code guidelines. (#7873)

This only moves code, and removes some redundant inline keywords.

2 years agoAdd utility expr::isBooleanConnective (#7869)
Andrew Reynolds [Tue, 4 Jan 2022 19:38:51 +0000 (13:38 -0600)]
Add utility expr::isBooleanConnective (#7869)

2 years agoRemove spurious call to applySubs (#7871)
Andrew Reynolds [Tue, 4 Jan 2022 19:04:53 +0000 (13:04 -0600)]
Remove spurious call to applySubs (#7871)

This call is preceded by another call to `apply-subs` at the beginning of preprocessing.

This is motivated by very large input benchmarks from Cetora where this preprocessing pass can take up to 5 seconds.

2 years agoRemove unused shutdown infrastructure (#7872)
Andrew Reynolds [Tue, 4 Jan 2022 18:07:42 +0000 (12:07 -0600)]
Remove unused shutdown infrastructure (#7872)

2 years agoFix int blaster (#7856)
Andrew Reynolds [Tue, 4 Jan 2022 17:35:49 +0000 (11:35 -0600)]
Fix int blaster (#7856)

2 years agoAdd bag.member operator to theory of bags (#7857)
mudathirmahgoub [Tue, 4 Jan 2022 16:49:00 +0000 (10:49 -0600)]
Add bag.member operator to theory of bags (#7857)

This PR adds the predicate bag.member to be analogous to predicate set.member.
The PR is motivated by converting regressions for sets to bags, which avoids defining a predicate for each set type

(define-fun bag.member ((e E) (B (Bag E))) Bool (>= (bag.count e B) 1))

2 years ago[proofs] [sat] Add manager for optimized clauses and their proofs (#7824)
Haniel Barbosa [Tue, 4 Jan 2022 16:16:39 +0000 (13:16 -0300)]
[proofs] [sat] Add manager for optimized clauses and their proofs (#7824)

This utility is going to be used by both the proof cnf stream and the sat proof manager to re-add to their respective internal proofs the proof nodes that were stored for clauses saved within the SAT solver at an assertion level below the current user level.

The utility is a context notify object, which means that it can be called when the tracked context pops.

2 years agoRefactor bag solver (#7770)
mudathirmahgoub [Tue, 4 Jan 2022 15:39:33 +0000 (09:39 -0600)]
Refactor bag solver (#7770)

2 years agoAdding interpolation and abduction to the python API (#7868)
yoni206 [Tue, 4 Jan 2022 15:18:41 +0000 (17:18 +0200)]
Adding interpolation and abduction to the python API (#7868)

This PR adds getAbduct, getAbductNext, getInterpol, and getInterpolNext to the python API.
Tests and documentation are added as well.

2 years agoapi: Add unit test for null case of Sort::toString(). (#7865)
Aina Niemetz [Tue, 4 Jan 2022 01:37:47 +0000 (17:37 -0800)]
api: Add unit test for null case of Sort::toString(). (#7865)

2 years agoapi: Remove redundant check in Term::toString(). (#7866)
Aina Niemetz [Tue, 4 Jan 2022 01:00:06 +0000 (17:00 -0800)]
api: Remove redundant check in Term::toString(). (#7866)

2 years agoUpdate quantifiers compute elim symbols to be iterative dag traversal (#7822)
Andrew Reynolds [Mon, 3 Jan 2022 23:56:18 +0000 (17:56 -0600)]
Update quantifiers compute elim symbols to be iterative dag traversal (#7822)

Fixes cvc5/cvc5-projects#389.

2 years ago[BV] Remove non-existent `friend` class (#7864)
Andres Noetzli [Mon, 3 Jan 2022 21:59:47 +0000 (13:59 -0800)]
[BV] Remove non-existent `friend` class (#7864)

2 years agoAdd download link for examples in documentation (#7836)
Gereon Kremer [Mon, 3 Jan 2022 21:25:00 +0000 (13:25 -0800)]
Add download link for examples in documentation (#7836)

This PR adds a download link to all examples in the documentation
(that are included via the examples extension). I think we should do
this, as we have text like "download the example here" at several
places already...

2 years agoapi: Remove redundant check in Sort::toString(). (#7863)
Aina Niemetz [Mon, 3 Jan 2022 21:08:53 +0000 (13:08 -0800)]
api: Remove redundant check in Sort::toString(). (#7863)

2 years agoRemove static options from sat solver. (#7790)
Gereon Kremer [Mon, 3 Jan 2022 18:29:52 +0000 (10:29 -0800)]
Remove static options from sat solver. (#7790)

This PR removes options::foo() from minisat.

2 years agoExecute `(reset)` command in parse-only mode (#7862)
Andres Noetzli [Mon, 3 Jan 2022 17:35:13 +0000 (09:35 -0800)]
Execute `(reset)` command in parse-only mode (#7862)

This commit fixes an issue where `--parse-only` would not execute
`(reset)` commands, leading to issues with symbols being defined
multiple times.

2 years ago[Regressions] Support more complex scrubbers (#7819)
Andres Noetzli [Thu, 23 Dec 2021 22:33:57 +0000 (14:33 -0800)]
[Regressions] Support more complex scrubbers (#7819)

Currently, we only support single commands in our `SCRUBBER` directives
for regression tests. This commit adds support for executing more
complex commands, including pipes. It also updates the regression script
to use the more modern, higher-level `subprocess.run()` instead of
`subprocess.Popen()`.

2 years agoRemove most uses of mkRationalNode (#7854)
Andrew Reynolds [Wed, 22 Dec 2021 17:17:52 +0000 (11:17 -0600)]
Remove most uses of mkRationalNode (#7854)

Towards eliminating arithmetic subtyping.

2 years agoAdd support for incremental + interpolants (#7853)
Andrew Reynolds [Wed, 22 Dec 2021 16:56:51 +0000 (10:56 -0600)]
Add support for incremental + interpolants (#7853)

Adds support for incrementality + get-interpol, including the get-interpol-next command.

2 years agoSupport get-abduct-next (#7850)
Andrew Reynolds [Tue, 21 Dec 2021 18:21:40 +0000 (12:21 -0600)]
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.

2 years agoEliminate remaining calls to callExtendedRewrite (#7839)
Andrew Reynolds [Tue, 21 Dec 2021 17:03:24 +0000 (11:03 -0600)]
Eliminate remaining calls to callExtendedRewrite (#7839)

2 years agoRewrite (pow2 x) to (pow 2 x) when x is a constant (#7849)
yoni206 [Tue, 21 Dec 2021 14:49:35 +0000 (16:49 +0200)]
Rewrite (pow2 x) to (pow 2 x) when x is a constant (#7849)

Fixes https://github.com/cvc5/cvc5-projects/issues/371.
Fixes https://github.com/cvc5/cvc5-projects/issues/339.
Fixes https://github.com/cvc5/cvc5-projects/issues/333.

Variants of the tests in the above issues are added to this PR. In them, we expect to get an exception because the constant is too big.

2 years agoDisable unit tests without poly (#7844)
Gereon Kremer [Tue, 21 Dec 2021 00:49:12 +0000 (16:49 -0800)]
Disable unit tests without poly (#7844)

This PR disables the new unit tests from #7829 when poly is not available.

2 years agoConnect sequences array solver to strategy in theory of strings (#7847)
Andrew Reynolds [Tue, 21 Dec 2021 00:30:43 +0000 (18:30 -0600)]
Connect sequences array solver to strategy in theory of strings (#7847)

Also corrects an issue with model construction, where SEQ_NTH should be assignable in addition to SEQ_NTH_TOTAL.

seqArray branch (which has regressions) can be merged to master after this PR.

2 years agoEliminating some uses of const rational in arithmetic (#7846)
Andrew Reynolds [Mon, 20 Dec 2021 19:10:30 +0000 (13:10 -0600)]
Eliminating some uses of const rational in arithmetic (#7846)

Note that there are several nested dependencies in arithmetic for constructing constants Constant::mkConstant ---> mkRationalNode ---> mkConst(CONST_RATIONAL, r)

This starts to disambiguate these calls.

2 years agoUpdates to LFSC signatures (#7840)
Andrew Reynolds [Mon, 20 Dec 2021 15:49:58 +0000 (09:49 -0600)]
Updates to LFSC signatures (#7840)

Includes the addition of print 2 rules from Amazon benchmarks, and updates to the names of functions.

2 years agoAllow SyGuS subsolver to be reused in incremental mode (#7785)
Andrew Reynolds [Mon, 20 Dec 2021 15:23:16 +0000 (09:23 -0600)]
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.

2 years ago[Sequences/Array Solver] Minor refactoring (#7843)
Andres Noetzli [Mon, 20 Dec 2021 14:41:06 +0000 (06:41 -0800)]
[Sequences/Array Solver] Minor refactoring (#7843)

This commit performs a minor refactoring of our array core solver. It
adds more comments and avoids sending the
STRINGS_ARRAY_NTH_TERM_FROM_UPDATE lemma more than once in a given
user context.

2 years ago[proofs] Fix helper LFSC script (#7845)
Haniel Barbosa [Mon, 20 Dec 2021 14:03:29 +0000 (11:03 -0300)]
[proofs] Fix helper LFSC script (#7845)

2 years agoapi: java: Support default arity for Solver::mkUnresolvedSort(). (#7842)
Aina Niemetz [Fri, 17 Dec 2021 23:50:59 +0000 (15:50 -0800)]
api: java: Support default arity for Solver::mkUnresolvedSort(). (#7842)

2 years ago[Strings] Minor fixes/improvements (#7837)
Andres Noetzli [Fri, 17 Dec 2021 23:19:46 +0000 (15:19 -0800)]
[Strings] Minor fixes/improvements (#7837)

This is a quick follow-up for PR #7815. My comments didn't make it in
before the PR was merged, so this commit fixes some of the minor issues
I found.

2 years agoArray-inspired Sequence Solver - Fixing several issues in the ArrayCoreSolver class...
Ying Sheng [Fri, 17 Dec 2021 22:28:12 +0000 (14:28 -0800)]
Array-inspired Sequence Solver - Fixing several issues in the ArrayCoreSolver class and options (#7820)

This commit fixes several issues in the ArrayCoreSolver class and the options:
1. Add range checking for an update rule.
2. Assign different inference ids to different rules.
3. small syntax optimizations.

2 years agoSimplify contrib/get-lfsc-checker and use cvc5 repo for LFSC signatures (#7835)
Andrew Reynolds [Fri, 17 Dec 2021 22:07:04 +0000 (16:07 -0600)]
Simplify contrib/get-lfsc-checker and use cvc5 repo for LFSC signatures (#7835)

2 years agoFix rewrite for `str.update(str.rev(s), n, t))` (#7838)
Andres Noetzli [Fri, 17 Dec 2021 21:46:14 +0000 (13:46 -0800)]
Fix rewrite for `str.update(str.rev(s), n, t))` (#7838)

Fixes https://github.com/cvc5/cvc5-projects/issues/390. This commit
fixes two issues with the rewrite: (1) the rewrite should only apply if
the update is of size 1 and (2) the `str.rev(...)` should be removed
inside the `str.update(...)`.

2 years agoMinor refactoring of API for eliminating arithmetic subtypes (#7833)
Andrew Reynolds [Fri, 17 Dec 2021 21:09:03 +0000 (15:09 -0600)]
Minor refactoring of API for eliminating arithmetic subtypes (#7833)

2 years agoFix tracker in SubstitutionMap (#7829)
Gereon Kremer [Fri, 17 Dec 2021 20:48:38 +0000 (12:48 -0800)]
Fix tracker in SubstitutionMap (#7829)

This PR fixes a subtle issue in #7787 where the rhs (instead of the lhs) of the applied substitution was inserted into the tracker.
Fixes cvc5/cvc5-projects#388

2 years agoRemove Rewriter::rewrite from bags type enumerator (#7827)
mudathirmahgoub [Fri, 17 Dec 2021 20:23:02 +0000 (14:23 -0600)]
Remove Rewriter::rewrite from bags type enumerator (#7827)

2 years agoRefactoring initialization of proofs (#7834)
Andrew Reynolds [Fri, 17 Dec 2021 19:43:36 +0000 (13:43 -0600)]
Refactoring initialization of proofs (#7834)

Eliminates one of the remaining calls to Rewriter::callExtendedRewrite, as well as making the initialization much clearer through use of Env.

2 years agoAdd relations.cpp, relations.py examples (#7801)
mudathirmahgoub [Fri, 17 Dec 2021 19:23:16 +0000 (13:23 -0600)]
Add relations.cpp, relations.py examples (#7801)

2 years agoMore documentation for idiomatic python API (#7798)
Alex Ozdemir [Fri, 17 Dec 2021 18:42:48 +0000 (10:42 -0800)]
More documentation for idiomatic python API (#7798)

Arithmetic, bit-vectors, arrays.

2 years agoGet getRealOrIntegerValueSign to the API (#7832)
Andrew Reynolds [Fri, 17 Dec 2021 18:22:13 +0000 (12:22 -0600)]
Get getRealOrIntegerValueSign to the API (#7832)

2 years agoImplement model construction for the array extension of sequences (#7815)
Andrew Reynolds [Fri, 17 Dec 2021 14:27:26 +0000 (08:27 -0600)]
Implement model construction for the array extension of sequences (#7815)

The array solver is still not usable, the only remaining changes from seqArray are to connect the array solver to the strings theory solver via the strategy + the regressions.

2 years agoapi: Rename DatatypeSelector::getRangeSort() to getCodomainSort(). (#7831)
Aina Niemetz [Fri, 17 Dec 2021 05:20:49 +0000 (21:20 -0800)]
api: Rename DatatypeSelector::getRangeSort() to getCodomainSort(). (#7831)

2 years agoapi: Add Solver::mkUnresolvedSort(). (#7817)
Aina Niemetz [Fri, 17 Dec 2021 04:24:23 +0000 (20:24 -0800)]
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.

2 years agoEliminate more uses of CONST_RATIONAL (#7816)
Andrew Reynolds [Fri, 17 Dec 2021 03:47:43 +0000 (21:47 -0600)]
Eliminate more uses of CONST_RATIONAL (#7816)

2 years agoDisable unsat cores for quaternion_ds1_symm_0428.fof.smt2. (#7830)
Mathias Preiner [Fri, 17 Dec 2021 03:30:39 +0000 (19:30 -0800)]
Disable unsat cores for quaternion_ds1_symm_0428.fof.smt2. (#7830)

Avoids timeout for nightly ASAN builds.

2 years agoEliminate most static calls to rewrite in quantifiers (#7823)
Andrew Reynolds [Thu, 16 Dec 2021 22:16:03 +0000 (16:16 -0600)]
Eliminate most static calls to rewrite in quantifiers (#7823)

2 years agoFix get-model when sort constructors are present (#7828)
Andrew Reynolds [Thu, 16 Dec 2021 21:07:55 +0000 (15:07 -0600)]
Fix get-model when sort constructors are present (#7828)

Fixes a spurious error on kind benchmarks.

Note that we don't properly handle instantiated sort constructors currently, which I believe need to be handled as declared sorts when calling getModel.

2 years ago[proofs] Simplifying and adding new utils to SAT proof manager and Proof Cnf Stream...
Haniel Barbosa [Thu, 16 Dec 2021 20:04:31 +0000 (17:04 -0300)]
[proofs] Simplifying and adding new utils to SAT proof manager and Proof Cnf Stream (#7826)

These will be necessary for upcoming changes to the SAT proof manager and Proof Cnf Stream to handle incremental proofs when optimizing the level of SAT clauses.

2 years agoapi: Add Sort::hasSymbol() and Sort::getSymbol(). (#7825)
Aina Niemetz [Thu, 16 Dec 2021 18:50:01 +0000 (10:50 -0800)]
api: Add Sort::hasSymbol() and Sort::getSymbol(). (#7825)

2 years agoMinor fix for print benchmark. (#7821)
Andrew Reynolds [Thu, 16 Dec 2021 17:50:25 +0000 (11:50 -0600)]
Minor fix for print benchmark. (#7821)

Also adds benchmark that triggered this issue.

2 years agobv-to-int: use pow2 operator (#7812)
yoni206 [Thu, 16 Dec 2021 16:49:30 +0000 (18:49 +0200)]
bv-to-int: use pow2 operator (#7812)

Currently, the int-blaster translates shifts using an ite whose size is the bit-width.
This PR adds an option to use the internal pow2 operator instead.

2 years agoint-to-bv: fail if one of the arguments has type real (#7810)
yoni206 [Thu, 16 Dec 2021 15:52:09 +0000 (17:52 +0200)]
int-to-bv: fail if one of the arguments has type real (#7810)

This PR generates a failure in int-to-bv in case a real argument is detected as a child of an arithmetic operation.
fixes cvc5/cvc5-projects#348 .

Co-authored-by: Andrew Reynolds andrew.j.reynolds@gmail.com
2 years agoAdd regression bags-of-bags-subtypes.smt2 (#7814)
mudathirmahgoub [Thu, 16 Dec 2021 15:31:47 +0000 (09:31 -0600)]
Add regression bags-of-bags-subtypes.smt2 (#7814)

2 years agoExplicitly disallow `mkConst(Rational)` (#7818)
Andres Noetzli [Thu, 16 Dec 2021 14:29:10 +0000 (06:29 -0800)]
Explicitly disallow `mkConst(Rational)` (#7818)

The Rational payload can be associated with two kinds (CONST_INTEGER
and CONST_RATIONAL), so we should never call
NodeManager::mkConst(Rational), but instead use
NodeManager::mkConstInt() and NodeManager::mkConstReal(). Currently,
calling NodeManager::mkConst(Rational) silently creates an integer
constant, which is dangerous. This commit makes it a compile-time error
instead.

2 years agoEnsure match terms are exhaustive in its type rule (#7807)
Andrew Reynolds [Wed, 15 Dec 2021 23:49:19 +0000 (17:49 -0600)]
Ensure match terms are exhaustive in its type rule (#7807)

Fixes cvc5/cvc5-projects#382.

Makes it so that we always fully type check match terms before they are rewritten, which guards potential unsoundness.

2 years agoapi: Fix smt-lib code blocks and math in C++ docs. (#7795)
Aina Niemetz [Wed, 15 Dec 2021 23:09:51 +0000 (15:09 -0800)]
api: Fix smt-lib code blocks and math in C++ docs. (#7795)

2 years agoAdd trace to see inferences in final proof (#7813)
Andrew Reynolds [Wed, 15 Dec 2021 15:15:26 +0000 (09:15 -0600)]
Add trace to see inferences in final proof (#7813)

Adds -t im-pf to see which inferences occur in the final proof. Must be used with proofs and --proof-annotate.

2 years agoEliminate static calls to rewrite in strings (#7803)
Andrew Reynolds [Tue, 14 Dec 2021 23:26:46 +0000 (17:26 -0600)]
Eliminate static calls to rewrite in strings (#7803)

2 years agoFix cvc5-projects issue 358 (#7804)
mudathirmahgoub [Tue, 14 Dec 2021 23:09:25 +0000 (17:09 -0600)]
Fix cvc5-projects issue 358 (#7804)

This PR fixes issue cvc5/cvc5-projects#358 which is caused by unregistered terms in the equality engine of bags

2 years agoAdd a random Sygus enumerator. (#7782)
Abdalrhman Mohamed [Tue, 14 Dec 2021 22:03:36 +0000 (16:03 -0600)]
Add a random Sygus enumerator. (#7782)

This PR adds a Sygus enumerator that generates random terms from a grammar. The size of the terms generated by the enumerator approximates a geometric distribution and can be configured with an option.

2 years agoMake some undocumented options regular/expert (#7805)
Gereon Kremer [Tue, 14 Dec 2021 21:14:48 +0000 (13:14 -0800)]
Make some undocumented options regular/expert (#7805)

We have some options that are currently "undocumented" for no good reason.
This PR makes them regular or expert options.

2 years agoFix issues with tracing builds (#7809)
Gereon Kremer [Tue, 14 Dec 2021 20:40:06 +0000 (12:40 -0800)]
Fix issues with tracing builds (#7809)

This PR fixes two issues that were revealed when analyzing decreased performance on trace-enabled builds.
hasIntegerModel() turns out to be a rather expensive method and should thus not be called in a Trace output.
Furthermore, the implementation of Rational::isIntegral() was generally bad because it used getDenominator() (which returns a copy of the denominator as an Integer) instead of directly checking the underlying denominator with equality for zero.

2 years agoAdd switches to toggle eager and inclusion solvers (#7784)
Andres Noetzli [Tue, 14 Dec 2021 20:02:37 +0000 (12:02 -0800)]
Add switches to toggle eager and inclusion solvers (#7784)

2 years agoConnecting the core array solver in strings (#7800)
Andrew Reynolds [Tue, 14 Dec 2021 19:35:09 +0000 (13:35 -0600)]
Connecting the core array solver in strings (#7800)

This PR takes most of the remaining changes from the seqArray branch apart from the extension to model construction.

Notably it connects the core array solver to the array solver in strings.

2 years agoMinor fix for sygus unsat query generator (#7811)
Andrew Reynolds [Tue, 14 Dec 2021 19:10:05 +0000 (13:10 -0600)]
Minor fix for sygus unsat query generator (#7811)