cvc5.git
4 years agoFix (#3530)
Andrew Reynolds [Wed, 4 Dec 2019 22:43:02 +0000 (16:43 -0600)]
Fix (#3530)

4 years agoFixes for SyGuS PBE + templated string concatenations + datatypes (#3492)
Andrew Reynolds [Wed, 4 Dec 2019 21:52:28 +0000 (15:52 -0600)]
Fixes for SyGuS PBE + templated string concatenations + datatypes (#3492)

4 years agoFix single invocation solution construction for multiple function case (#3516)
Andrew Reynolds [Wed, 4 Dec 2019 20:34:46 +0000 (14:34 -0600)]
Fix single invocation solution construction for multiple function case (#3516)

4 years agoFix corner case in model construction of strings (#3524)
Andres Noetzli [Wed, 4 Dec 2019 00:20:13 +0000 (16:20 -0800)]
Fix corner case in model construction of strings (#3524)

This commit fixes a corner case in the model construction of strings:
For a given length, we were assuming that for each equivalence class, we
could always find an initial guess for a constant to assign to it. This
was not always true, however, because a preceding equivalence class
could use up all constants and get assigned the last remaining one, so
we wouldn't have a constant remaining for the current class. This
resulted in an assertion failure (in debug) or a crash (in production).
This commit fixes the issue by checking whether we've run out of
constants before assigning an initial constant for an equivalence class.

4 years agoImprove flexibility of lemma output in non-linear solver (#3518)
Andrew Reynolds [Tue, 3 Dec 2019 22:51:22 +0000 (16:51 -0600)]
Improve flexibility of lemma output in non-linear solver (#3518)

4 years agoFix clang-format file for brace wrapping with case labels. (#3523)
Aina Niemetz [Tue, 3 Dec 2019 18:24:20 +0000 (10:24 -0800)]
Fix clang-format file for brace wrapping with case labels. (#3523)

More recent clang version introduce an extra flag AfterCaseLabel for brace wrapping after case labels. Default is false, with the effect opening braces after case labels will be aligned on the same line as the label. Our style requires it to be set to true.

4 years agoRewrite `str.contains` used for character matching (#3519)
Andres Noetzli [Tue, 3 Dec 2019 18:05:01 +0000 (10:05 -0800)]
Rewrite `str.contains` used for character matching (#3519)

4 years agoAdd isNullHelper to avoid calling API function isNull with CVC4_API_CHECK_NOT_NULL...
makaimann [Tue, 3 Dec 2019 14:58:47 +0000 (06:58 -0800)]
Add isNullHelper to avoid calling API function isNull with CVC4_API_CHECK_NOT_NULL (#3520)

4 years agoMinor refactor: rename opterm_black to op_black (#3521)
makaimann [Tue, 3 Dec 2019 00:53:27 +0000 (16:53 -0800)]
Minor refactor: rename opterm_black to op_black (#3521)

4 years ago[SMT2 Printer] Quote symbols starting with digit (#3517)
Andres Noetzli [Mon, 2 Dec 2019 22:21:05 +0000 (14:21 -0800)]
[SMT2 Printer] Quote symbols starting with digit (#3517)

4 years agoOpTerm Refactor: Allow retrieving OpTerm used to create Term in public C++ API (...
makaimann [Mon, 2 Dec 2019 21:36:19 +0000 (13:36 -0800)]
OpTerm Refactor: Allow retrieving OpTerm used to create Term in public C++ API (#3355)

* Treat uninterpreted functions as a child in Term iteration

* Remove unnecessary const_iterator constructor

* Add parameter comments to const_iterator constructor

* Use operator[] instead of storing a vector of Expr children

* Switch pos member variable from int to uint32_t

* Add comment about how UFs are treated in iteration

* Allow OpTerm to contain a single Kind, update OpTerm construction

* Update mkTerm to use only an OpTerm (and not also a Kind)

* Remove unnecessary function checkMkOpTerm

* Update mkOpTerm comments to not use _OP Kinds

* Update examples to use new mkTerm

* First pass on fixing unit test

* Override kind for Constructor and Selector Terms

* More fixes to unit tests

* Updates to parser

* Remove old assert (for Kind, OpTerm pattern which was removed)

* Remove *_OP kinds from public API

* Add hasOpTerm and getOpTerm methods to Term

* Add test for UF iteration

* Add unit test for getOpTerm

* Move OpTerm implementation above Term implemenation to match header file

Moved in header because Term::getOpTerm() returns an OpTerm and the compiler complains
if OpTerm is not defined earlier. Simply moving the declaration is easier/cleaner than
forward declaring within the same file that it's declared.

* Fix mkTerm in datatypes-new.cpp example

* Use helper function for creating term from Kind to avoid nested API calls

* Rename: OpTerm->Op in API

* Update OpTerm->Op in examples/tests/parser

* Add case for APPLY_TESTER

* operator term -> operator

* Update src/api/cvc4cpp.h

Co-Authored-By: Aina Niemetz <aina.niemetz@gmail.com>
* Comment comment suggestion

Co-Authored-By: Aina Niemetz <aina.niemetz@gmail.com>
* Add not-null checks and implement Op from a single Kind constructor

* Undo sed mistake for OpTerm replacement

* Add 'd_' prefix to member vars

* Fix comment and remove old commented-out code

* Formatting

* Revert "Formatting"

This reverts commit d1d5fc1fb71496daeba668e97cad84c213200ba9.

* More fixes for sed mistakes

* Minor formatting

* Undo changes in CVC parser

* Add isIndexed and prefix with d_

* Create helper function for isIndexed to avoid calling API functions in other API functions

4 years ago Update ownership policy for dynamic quantifiers splitting (#3493)
Andrew Reynolds [Mon, 2 Dec 2019 19:02:01 +0000 (13:02 -0600)]
 Update ownership policy for dynamic quantifiers splitting (#3493)

4 years agoFix case of higher-order + sygus inference (#3509)
Andrew Reynolds [Mon, 2 Dec 2019 17:15:16 +0000 (11:15 -0600)]
Fix case of higher-order + sygus inference (#3509)

4 years agoEnsure quantifiers options are set with --no-strings-lazy-pp (#3515)
Andrew Reynolds [Mon, 2 Dec 2019 05:34:18 +0000 (23:34 -0600)]
Ensure quantifiers options are set with --no-strings-lazy-pp (#3515)

4 years agoPrevent ref count from reaching zero in BV instantiator (#3512)
Andres Noetzli [Sun, 1 Dec 2019 22:57:25 +0000 (14:57 -0800)]
Prevent ref count from reaching zero in BV instantiator (#3512)

4 years agoimproving parsing error messages related to HOL (#3510)
Haniel Barbosa [Sat, 30 Nov 2019 02:46:55 +0000 (23:46 -0300)]
improving parsing error messages related to HOL (#3510)

4 years agoCompetition build: Skip parsing error regression (#3511)
Andres Noetzli [Sat, 30 Nov 2019 01:01:19 +0000 (17:01 -0800)]
Competition build: Skip parsing error regression (#3511)

4 years agoFix fast SyGuS enumeration for interpreted constants (#3501)
Andrew Reynolds [Sat, 30 Nov 2019 00:24:30 +0000 (18:24 -0600)]
Fix fast SyGuS enumeration for interpreted constants (#3501)

4 years agoCheck free variables in assertions when using SyGuS (#3504)
Andrew Reynolds [Fri, 29 Nov 2019 15:31:54 +0000 (09:31 -0600)]
Check free variables in assertions when using SyGuS (#3504)

4 years agoFix sygus inference for choice functions introduced at preprocess (#3500)
Andrew Reynolds [Wed, 27 Nov 2019 21:59:36 +0000 (15:59 -0600)]
Fix sygus inference for choice functions introduced at preprocess (#3500)

4 years agoEnable sygusRecFun by default and fixes SyGuS+RecFun+HO issues (#3502)
Haniel Barbosa [Wed, 27 Nov 2019 20:52:36 +0000 (17:52 -0300)]
Enable sygusRecFun by default and fixes SyGuS+RecFun+HO issues (#3502)

4 years ago Fix indexof range lemma (#3499)
Andrew Reynolds [Wed, 27 Nov 2019 17:03:49 +0000 (11:03 -0600)]
 Fix indexof range lemma (#3499)

4 years agoBetter front-end type checking for SyGuS (#3496)
Andrew Reynolds [Mon, 25 Nov 2019 23:59:51 +0000 (17:59 -0600)]
Better front-end type checking for SyGuS (#3496)

4 years agoMinor refactoring of compute model value for nl (#3489)
Andrew Reynolds [Fri, 22 Nov 2019 18:09:19 +0000 (12:09 -0600)]
Minor refactoring of compute model value for nl (#3489)

* Refactor compute model value for nl

* Format

4 years agofixing stupid typo (#3488)
Haniel Barbosa [Fri, 22 Nov 2019 14:50:12 +0000 (11:50 -0300)]
fixing stupid typo (#3488)

4 years agohard limit for rec-fun eval (#3485)
Haniel Barbosa [Thu, 21 Nov 2019 18:17:16 +0000 (15:17 -0300)]
hard limit for rec-fun eval (#3485)

4 years agoEvaluation unfolding for symbolic SyGuS constructors (#3483)
Andrew Reynolds [Thu, 21 Nov 2019 15:54:12 +0000 (09:54 -0600)]
Evaluation unfolding for symbolic SyGuS constructors (#3483)

4 years agoLazy evaluation via rec-funs of ITE expressions (#3482)
Haniel Barbosa [Wed, 20 Nov 2019 19:42:58 +0000 (16:42 -0300)]
Lazy evaluation via rec-funs of ITE expressions  (#3482)

4 years agoFix reduction of `sqrt` (#3478)
Andres Noetzli [Tue, 19 Nov 2019 01:59:22 +0000 (17:59 -0800)]
Fix reduction of `sqrt` (#3478)

4 years agoAdd a few comments to ProofManager (#3477)
Alex Ozdemir [Tue, 19 Nov 2019 01:07:52 +0000 (17:07 -0800)]
Add a few comments to ProofManager (#3477)

4 years agoSignature documentation update (#3476)
Alex Ozdemir [Tue, 19 Nov 2019 00:41:07 +0000 (16:41 -0800)]
Signature documentation update (#3476)

This comment was slightly out-of-date.

4 years agoUse -Wimplicit-fallthrough (#3464)
Andres Noetzli [Mon, 18 Nov 2019 20:28:54 +0000 (12:28 -0800)]
Use -Wimplicit-fallthrough (#3464)

This commit enables compiler warnings for implicit fallthroughs in
switch statements that are not explicitly marked as such. The commit
introduces a new macro `CVC4_FALLTHROUGH` that can be used to indicate
that a fallthrough is intentional. The commit fixes existing warnings
and a bug in the arithmetic rewriter for `abs` (the bug likely couldn't
be triggered easily because we rewrite `abs` to an `ite` while expanding
definitions).

To have the new macro also available in the parser, the commit changes
`src/base/check.h` to be visible to the parser (it includes
`cvc4_private_library.h` now instead of `cvc4_private.h`).

4 years agoUse standard sygus interface for abduction and rewrite rule synthesis (#3471)
Andrew Reynolds [Mon, 18 Nov 2019 19:52:18 +0000 (13:52 -0600)]
Use standard sygus interface for abduction and rewrite rule synthesis (#3471)

4 years agoImprove interface for sygus datatype, fix utilities (#3473)
Andrew Reynolds [Mon, 18 Nov 2019 19:13:14 +0000 (13:13 -0600)]
Improve interface for sygus datatype, fix utilities (#3473)

4 years agoUpdates to the unit tests, api, and examples for datatypes (#3459)
Andrew Reynolds [Mon, 18 Nov 2019 02:19:24 +0000 (20:19 -0600)]
Updates to the unit tests, api, and examples for datatypes (#3459)

* Updates to the unit tests, api, and examples for datatypes

* Format

4 years agoAdd support for ThreadSanitizer instrumentation (#3467)
Andres Noetzli [Sun, 17 Nov 2019 06:38:34 +0000 (22:38 -0800)]
Add support for ThreadSanitizer instrumentation (#3467)

This commit adds support for compiling CVC4 with ThreadSanitizer
instrumentation. This is useful for debugging issues when CVC4 is used
in a multi-threaded context (e.g. #3292).

4 years agoUse standard interface for sygus default grammar construction (#3466)
Andrew Reynolds [Sat, 16 Nov 2019 04:52:58 +0000 (22:52 -0600)]
Use standard interface for sygus default grammar construction (#3466)

4 years agoIntroduce SyGuS datatype API (#3465)
Andrew Reynolds [Fri, 15 Nov 2019 22:11:34 +0000 (16:11 -0600)]
Introduce SyGuS datatype API (#3465)

4 years agoFix wrong kind in sygus version 1 parser (#3463)
Andrew Reynolds [Fri, 15 Nov 2019 13:59:38 +0000 (07:59 -0600)]
Fix wrong kind in sygus version 1 parser (#3463)

4 years agoUse Shebang in cxxtestgen when appropriate (#3458)
Alex Ozdemir [Thu, 14 Nov 2019 18:39:05 +0000 (10:39 -0800)]
Use Shebang in cxxtestgen when appropriate (#3458)

CxxTest's generator has one of three names, depending on the CxxTest
version:
* `cxxtestgen.py`, a python program
* `cxxtestgen`, some kind of program with a shebang
* `cxxtestgen.pl`, a perl program

We were mistakenly assuming that the `cxxtestgen` form was always a
python program.

Now, if we find that form on the system, we assume that it is has a
shebang, and is executable.

4 years agoAllow (set-logic ...) after (reset) (#3457)
Andres Noetzli [Wed, 13 Nov 2019 22:14:09 +0000 (14:14 -0800)]
Allow (set-logic ...) after (reset) (#3457)

Fixes #3353. #3062 introduced a flag that tracks whether we have seen a
`(set-logic ...)` command to improve the handling of `--force-logic`.
However, the flag was not set to `false` when `(reset)` was called. This
commit fixes the issue.

4 years agoDistinguish unknown status for model printing (#3454)
Andrew Reynolds [Wed, 13 Nov 2019 06:03:35 +0000 (00:03 -0600)]
Distinguish unknown status for model printing (#3454)

4 years agoRefactor non-linear extension for model-based refinement (#3452)
Andrew Reynolds [Wed, 13 Nov 2019 05:34:05 +0000 (23:34 -0600)]
Refactor non-linear extension for model-based refinement (#3452)

* Refactor non-linear extension for model-based refinement

* Format

* Minor

* Address

4 years agoAdd missing utilities for Node-level Datatype API (#3451)
Andrew Reynolds [Mon, 11 Nov 2019 19:02:55 +0000 (13:02 -0600)]
Add missing utilities for Node-level Datatype API (#3451)

4 years agoFix mkConst<RoundingMode>() for Python bindings (#3447)
Andres Noetzli [Mon, 11 Nov 2019 18:07:29 +0000 (10:07 -0800)]
Fix mkConst<RoundingMode>() for Python bindings (#3447)

4 years agoUpdate README according to the new website (#3438)
yoni206 [Mon, 11 Nov 2019 17:07:14 +0000 (09:07 -0800)]
Update README according to the new website (#3438)

4 years agoEliminate remaining references to type/expr in datatype type rules. (#3450)
Andrew Reynolds [Mon, 11 Nov 2019 16:09:00 +0000 (10:09 -0600)]
Eliminate remaining references to type/expr in datatype type rules. (#3450)

4 years agoFix bugs related to sygus higher-order + recursive functions (#3448)
Andrew Reynolds [Sun, 10 Nov 2019 14:45:39 +0000 (08:45 -0600)]
Fix bugs related to sygus higher-order + recursive functions (#3448)

4 years agoFixes in relations related to datatypes not passed by reference (#3449)
Andrew Reynolds [Sat, 9 Nov 2019 22:09:11 +0000 (16:09 -0600)]
Fixes in relations related to datatypes not passed by reference (#3449)

The current code is creating/destroying datatypes unnecessarily.

4 years agocmake: Disable C++ GNU extensions. (#3446)
Mathias Preiner [Fri, 8 Nov 2019 21:41:21 +0000 (13:41 -0800)]
cmake: Disable C++ GNU extensions. (#3446)

Fixes #971.

4 years agoMove more string utility functions (#3398)
Andrew Reynolds [Wed, 6 Nov 2019 23:12:29 +0000 (17:12 -0600)]
Move more string utility functions (#3398)

This is work towards splitting a "core solver" object from TheoryStrings.

This moves global functions from TheoryStrings to InferenceManager/SolverState, making them accessible in the future by modules that have references to these objects.

It also corrects an issue where we were maintaining two `d_conflict` fields.

4 years agoMigrate more datatype methods to the Node level (#3443)
Andrew Reynolds [Wed, 6 Nov 2019 17:11:28 +0000 (11:11 -0600)]
Migrate more datatype methods to the Node level (#3443)

This adds node-level interfaces for a few missing functions that will be necessary to have a Node-level API for datatypes.

4 years ago[Regressions] Remove leading whitespace in output (#3444)
Andres Noetzli [Wed, 6 Nov 2019 16:40:22 +0000 (08:40 -0800)]
[Regressions] Remove leading whitespace in output (#3444)

4 years agoSupport for SyGuS PBE + recursive functions (#3433)
Andrew Reynolds [Wed, 6 Nov 2019 16:00:08 +0000 (10:00 -0600)]
Support for SyGuS PBE + recursive functions (#3433)

4 years agoRemove casts to subclasses of Type in API (#3420)
Andres Noetzli [Wed, 6 Nov 2019 00:26:04 +0000 (16:26 -0800)]
Remove casts to subclasses of Type in API (#3420)

4 years agoSeparate model object in non-linear extension (#3426)
Andrew Reynolds [Tue, 5 Nov 2019 23:37:37 +0000 (17:37 -0600)]
Separate model object in non-linear extension (#3426)

4 years agoRefactor type matcher utility (#3439)
Andrew Reynolds [Tue, 5 Nov 2019 20:12:43 +0000 (14:12 -0600)]
Refactor type matcher utility (#3439)

4 years ago[Regressions] Support for running w/ default args (#3436)
Andres Noetzli [Tue, 5 Nov 2019 01:04:04 +0000 (17:04 -0800)]
[Regressions] Support for running w/ default args (#3436)

4 years agoMake check synth solution robust to auxiliary assertions (#3432)
Andrew Reynolds [Mon, 4 Nov 2019 23:48:30 +0000 (17:48 -0600)]
Make check synth solution robust to auxiliary assertions (#3432)

4 years agoFix ho extensionality in collect model info (#3435)
Andrew Reynolds [Mon, 4 Nov 2019 22:22:51 +0000 (16:22 -0600)]
Fix ho extensionality in collect model info (#3435)

4 years agoAvoid non-well-founded sygus grammars (#3434)
Andrew Reynolds [Mon, 4 Nov 2019 20:24:02 +0000 (14:24 -0600)]
Avoid non-well-founded sygus grammars (#3434)

4 years agoMake getSynthSolution return a Bool (#3306)
Andrew Reynolds [Mon, 4 Nov 2019 18:23:34 +0000 (12:23 -0600)]
Make getSynthSolution return a Bool (#3306)

4 years agoEliminate deprecated utility function from sygus (#3431)
Andrew Reynolds [Mon, 4 Nov 2019 17:11:38 +0000 (11:11 -0600)]
Eliminate deprecated utility function from sygus (#3431)

4 years agoFix non-termination in datatype type enumerator (#3369)
Andrew Reynolds [Fri, 1 Nov 2019 22:06:33 +0000 (17:06 -0500)]
Fix non-termination in datatype type enumerator (#3369)

4 years agoFix and refactor TheoryStrings::checkFlatForms() (#3326)
Andres Noetzli [Fri, 1 Nov 2019 18:58:57 +0000 (11:58 -0700)]
Fix and refactor TheoryStrings::checkFlatForms() (#3326)

This commit fixes some minor (performance) issues in
`TheoryStrings::checkFlatForms()`: The `inelig` vector was initialized
with copies of the `start` element instead of all the elements before
`start` and the `else` branch of `count == asize` was looping over all
elements from `1` instead of `start + 1`. Additionally, this commit
refactors the code to be a bit more readable.

4 years agoEagerly beta reduce during sygus to builtin term conversion (#3418)
Andrew Reynolds [Fri, 1 Nov 2019 12:09:35 +0000 (07:09 -0500)]
Eagerly beta reduce during sygus to builtin term conversion (#3418)

4 years agoRename datatypes sygus solver (#3417)
Andrew Reynolds [Fri, 1 Nov 2019 04:37:16 +0000 (23:37 -0500)]
Rename datatypes sygus solver (#3417)

4 years agoFix Unimplemented() macros missed in #3366. (#3424)
Mathias Preiner [Thu, 31 Oct 2019 21:39:29 +0000 (14:39 -0700)]
Fix Unimplemented() macros missed in #3366. (#3424)

4 years agoUnify CVC4_CHECK/CVC4_DCHECK/AlwaysAssert/Assert. (#3366)
Mathias Preiner [Wed, 30 Oct 2019 22:27:10 +0000 (15:27 -0700)]
Unify CVC4_CHECK/CVC4_DCHECK/AlwaysAssert/Assert. (#3366)

4 years agoSplit some generic utilities from the non-linear extension (#3419)
Andrew Reynolds [Wed, 30 Oct 2019 00:42:50 +0000 (19:42 -0500)]
Split some generic utilities from the non-linear extension (#3419)

* Split arith util

* Cleaner

* cpp

* Format

* Minor

4 years agoFix for non-linear models (#3410)
Andrew Reynolds [Mon, 28 Oct 2019 17:50:08 +0000 (12:50 -0500)]
Fix for non-linear models (#3410)

* Towards fix for non-linear models

* Format

* Fix

* More

* Improve

* Format

* More

4 years agoFix integer division rewrite (#3415)
Andres Noetzli [Mon, 28 Oct 2019 15:59:44 +0000 (08:59 -0700)]
Fix integer division rewrite (#3415)

4 years agoFix collect model info for higher-order (#3409)
Andrew Reynolds [Sun, 27 Oct 2019 22:47:56 +0000 (17:47 -0500)]
Fix collect model info for higher-order (#3409)

This ensures we add lemmas when collect model info fails for the higher order extension of UF. This fixes #3405 (that benchmark now answers unknown).

4 years agoFix global-declarations support (#3403)
Andres Noetzli [Sun, 27 Oct 2019 18:06:40 +0000 (11:06 -0700)]
Fix global-declarations support (#3403)

4 years agoFixes for SyGuS + regular expressions (#3313)
Andrew Reynolds [Wed, 23 Oct 2019 23:15:28 +0000 (18:15 -0500)]
Fixes for SyGuS + regular expressions (#3313)

This commit fixes numerous issues involving the combination of SyGuS and regular expressions.

Combining SyGuS and regular expressions may involve constructing regular expressions that are neither variables nor builtin regular expression operators. The code was not robust for this case, either throwing spurious assertion failures or having incorrect behavior.

4 years agoRefactoring skolems for sets (#3381)
Andrew Reynolds [Wed, 23 Oct 2019 00:42:55 +0000 (19:42 -0500)]
Refactoring skolems for sets (#3381)

This refactors skolems introduced in the theory of sets. This is analogous to how skolems are treated for the theory of strings.

A key change that this commit enables is to identify "variable" sets based on those that weren't introduced by the SkolemCache (instead of via a check that their kind is `VARIABLE`, which is done currently and is error prone).

4 years agoNodeValue: Eliminate redundant NBITS macros. (#3400)
Aina Niemetz [Tue, 22 Oct 2019 21:03:09 +0000 (14:03 -0700)]
NodeValue: Eliminate redundant NBITS macros. (#3400)

Previously, the metakind header defined macros for the number of bits
reserved for fields in the NodeValue "header" (for the reference count,
the node kind, the number of children and the node id). These macros
were redundant, since the only one using them was the NodeValue itself,
which redefined them (while using them) as constants in the class.
Additionally, MAX_CHILDREN was defined (using these macros) not only
in the metakind header, but redefined in other places.

This commit defines the above values as constexpr members of the
NodeValue class and cleans up redundancy.

4 years agoCleaning-up the declaration of wrapped functions/methods, which have no definitions...
Andrew V. Jones [Sun, 20 Oct 2019 15:35:24 +0000 (16:35 +0100)]
Cleaning-up the declaration of wrapped functions/methods, which have no definitions (#3399)

Signed-off-by: Andrew V. Jones <andrewvaughanj@gmail.com>
4 years agoUpdate overflow check to handle negative numbers (#3396)
makaimann [Fri, 18 Oct 2019 18:42:15 +0000 (11:42 -0700)]
Update overflow check to handle negative numbers (#3396)

4 years ago Move datatype utility functions to own file (#3397)
Andrew Reynolds [Thu, 17 Oct 2019 21:40:18 +0000 (16:40 -0500)]
 Move datatype utility functions to own file (#3397)

4 years agoSolver state for theory of strings (#3181)
Andrew Reynolds [Wed, 16 Oct 2019 23:44:17 +0000 (18:44 -0500)]
Solver state for theory of strings (#3181)

This refactors the theory of strings to use a solver state object, which manages state information regarding assertions.

It also deletes some unused/undefined functions in theory_strings.h.

There are no major changes to the behavior of the code or its documentation in this PR.

This is work towards #1881.

4 years agoFix line numbers in templates (#3391)
Andres Noetzli [Tue, 15 Oct 2019 21:43:33 +0000 (14:43 -0700)]
Fix line numbers in templates (#3391)

This commit updates the line numbers in templates to address warnings
due to wrong line numbers.

4 years agoRemove remaining references to Boost and Autotools (#3390)
Andres Noetzli [Tue, 15 Oct 2019 20:59:41 +0000 (13:59 -0700)]
Remove remaining references to Boost and Autotools (#3390)

This commit removes references to Boost and Autotools in the copyright
information and CMakeLists.txt.

4 years agoFix OOB access (#3383)
Andres Noetzli [Tue, 15 Oct 2019 19:49:20 +0000 (12:49 -0700)]
Fix OOB access (#3383)

In theory_engine.cpp, we were calling `theoryOf()` with
`THEORY_SAT_SOLVER` as the theory id. However, `THEORY_SAT_SOLVER` is
defined as `THEORY_LAST` and thus out-of-bounds of the `d_theoryTable`
defined in theory_engine.h (which is of size `THEORY_LAST`. This commit
adds an assertion that detects the out-of-bound access and introduces a
method to turn a theory id into a string which correctly handles
`THEORY_SAT_SOLVER`.

4 years agoFix regression (#3393)
Andres Noetzli [Tue, 15 Oct 2019 13:08:48 +0000 (06:08 -0700)]
Fix regression (#3393)

PR #3388 didn't disable the regression correctly (due to using `REQUIRE`
instead of `REQUIRES`). This commit fixes the issue.

4 years agoDisable regression test for competition build (#3388)
Andres Noetzli [Mon, 14 Oct 2019 21:21:32 +0000 (14:21 -0700)]
Disable regression test for competition build (#3388)

This commit disables a regression test that was failing for the
competition build due to not emitting the expected error message.

4 years agoRemove benchmark (#3389)
Andrew Reynolds [Mon, 14 Oct 2019 20:53:55 +0000 (15:53 -0500)]
Remove benchmark (#3389)

4 years agoSupport UF in default sygus grammars (#3319)
Andrew Reynolds [Mon, 14 Oct 2019 20:01:05 +0000 (15:01 -0500)]
Support UF in default sygus grammars (#3319)

4 years agoApply sygus repair constant techniques restricted to refinement lemmas (#3386)
Andrew Reynolds [Mon, 14 Oct 2019 19:23:38 +0000 (14:23 -0500)]
Apply sygus repair constant techniques restricted to refinement lemmas (#3386)

4 years agoEnsure lemmas from sygus repair const are guarded (#3385)
Andrew Reynolds [Mon, 14 Oct 2019 18:24:27 +0000 (13:24 -0500)]
Ensure lemmas from sygus repair const are guarded (#3385)

4 years agoMinor refactor in strings rewriter (#3387)
Andrew Reynolds [Mon, 14 Oct 2019 17:03:41 +0000 (12:03 -0500)]
Minor refactor in strings rewriter (#3387)

4 years agoEliminate negative constant coefficients in div/mod (#2929)
Andrew Reynolds [Sun, 13 Oct 2019 23:22:28 +0000 (18:22 -0500)]
Eliminate negative constant coefficients in div/mod (#2929)

Fixes #1399.

4 years agoCheck that logic is set when synth-fun command is encountered (#3384)
Andrew Reynolds [Fri, 11 Oct 2019 19:00:56 +0000 (14:00 -0500)]
Check that logic is set when synth-fun command is encountered (#3384)

4 years agoAdd support for UBSan instrumentation (#3382)
Andres Noetzli [Fri, 11 Oct 2019 08:09:09 +0000 (01:09 -0700)]
Add support for UBSan instrumentation (#3382)

This commit adds support for compiling CVC4 with UBSan instrumentation.
The commit also adds a dummy version of `AigBitblaster`. Previously,
when CVC4 was built without ABC, `AigBitblaster` was not fully defined
(the class was declared but the implementation was not being compiled).
This lead to missing RTTI information when compiling with UBSan
instrumentation.

4 years agoMake order of theories explicit in the source code. (#3379)
Aina Niemetz [Fri, 11 Oct 2019 01:52:46 +0000 (18:52 -0700)]
Make order of theories explicit in the source code. (#3379)

Fixes #2517.

This makes the order of theories explicit in the source code rather than relying on the order defined via the build system. Previously, the build system ensured the order of the theories via the KINDS_FILES variable, which is a list of kinds files that is fed to code generation scripts (mkkind, mkmetakind, mkrewriter, mktheorytraits). The generated code critical to the order of theories w.r.t. soundess is the TheoryId enum, and the CVC4_FOR_EACH_THEORY macro. Ideally, we would want to get rid of the latter (ugly and error prone), which is not possible in the current configuration, and to be discussed in the future.

This PR moves the TheoryID enum and related functions to theory/theory_id.h, and the CVC4_FOR_EACH_THEORY macro to theory/theory_engine.cpp, the only place where it is used.

I ran it on whole SMT-LIB (non-incremental and incremental) and did not encounter any soundness issues. The only issue that did occur is not related to these changes, non-critical and known: #2993

4 years agoWarning instead of assertion for failing propagating instance (#3380)
Andrew Reynolds [Thu, 10 Oct 2019 19:47:03 +0000 (14:47 -0500)]
Warning instead of assertion for failing propagating instance (#3380)

4 years agotest: Add TS_UTILS_EXPECT_ABORT macro for unit tests. (#3378)
Mathias Preiner [Thu, 10 Oct 2019 06:21:18 +0000 (23:21 -0700)]
test: Add TS_UTILS_EXPECT_ABORT macro for unit tests. (#3378)

TS_UTILS_EXPECT_ABORT can be used if an expression in a unit test is
expected to abort() instead of throwing an exception. This can happen if
CVC4_CHECK or CVC4_DCHECK fail.

4 years agoNodeValue: Use 'using' instead of 'typedef'. (#3374)
Aina Niemetz [Wed, 9 Oct 2019 01:47:53 +0000 (18:47 -0700)]
NodeValue: Use 'using' instead of 'typedef'. (#3374)

4 years agoNodeValue: Use fixed width return type for getRefCount(). (#3374)
Aina Niemetz [Wed, 9 Oct 2019 01:33:08 +0000 (18:33 -0700)]
NodeValue: Use fixed width return type for getRefCount(). (#3374)

4 years agoReorder NodeValue class according to our code style guidelines. (#3374)
Aina Niemetz [Tue, 8 Oct 2019 20:51:05 +0000 (13:51 -0700)]
Reorder NodeValue class according to our code style guidelines. (#3374)