cvc5.git
5 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

5 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).

5 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)

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

5 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)

5 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.

5 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.

5 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)

5 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

5 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)

5 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)

5 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)

5 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)

5 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)

5 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.

5 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.

5 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.

5 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.

5 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)

5 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)

5 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)

5 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)

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

5 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)

5 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)

5 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)

5 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)

5 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)

5 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)

5 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)

5 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.

5 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)

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

5 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)

5 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)

5 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

5 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

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

5 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).

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

5 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.

5 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).

5 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.

5 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>
5 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)

5 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)

5 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.

5 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.

5 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.

5 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`.

5 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.

5 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.

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

5 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)

5 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)

5 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)

5 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)

5 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.

5 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)

5 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.

5 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

5 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)

5 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.

5 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)

5 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)

5 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)

5 years agoAvoid printing success for `--force-logic` (#3363)
Andres Noetzli [Wed, 9 Oct 2019 06:24:42 +0000 (23:24 -0700)]
Avoid printing success for `--force-logic` (#3363)

CVC4 was printing success when `--force-logic` was used because
internally, `--force-logic` generates a `SetBenchmarkLogicCommand`. This
caused issues with the SMT-COMP trace executor. This commit fixes the
behavior by muting the command if it was not issued by the user.

The issue was likely introduced with #3062.

5 years agocmake: Fix include of CVC4JavaTargets.cmake. (#3373)
Mathias Preiner [Wed, 9 Oct 2019 00:55:05 +0000 (17:55 -0700)]
cmake: Fix include of CVC4JavaTargets.cmake. (#3373)

Only include Java targets if Java bindings are enabled.

5 years agoNew C++ API: Term: Add missing checks for null. (#3364)
Aina Niemetz [Wed, 9 Oct 2019 00:24:49 +0000 (17:24 -0700)]
New C++ API: Term: Add missing checks for null. (#3364)

Co-Authored-By: Andres Noetzli <andres.noetzli@gmail.com>
5 years agoLimit cases of sygus inference based on type (#3370)
Andrew Reynolds [Tue, 8 Oct 2019 23:06:16 +0000 (18:06 -0500)]
Limit cases of sygus inference based on type (#3370)

This makes `--sygus-inference` a no-op for inputs where there is a free function whose sort cannot be handled in a sygus grammar.

It also fixes an issue where skolem variables were not being treated as functions-to-synthesize.

Fixes #3250 and fixes #3356.

5 years agoFix method for getting arithmetic function definition body (#3371)
Andrew Reynolds [Tue, 8 Oct 2019 20:32:38 +0000 (15:32 -0500)]
Fix method for getting arithmetic function definition body (#3371)

5 years agoprefer prefix ++ operator for iterators
Piotr Trojanek [Thu, 22 Aug 2019 21:22:51 +0000 (23:22 +0200)]
prefer prefix ++ operator for iterators

Detected with cppcheck static analyser, which said: (performance) Prefer
prefix ++/-- operators for non-primitive types. Reformat with clang-format
as needed.

Signed-off-by: Piotr Trojanek <piotr.trojanek@gmail.com>
5 years agopass parameters by reference where it affects performance
Piotr Trojanek [Thu, 22 Aug 2019 21:12:20 +0000 (23:12 +0200)]
pass parameters by reference where it affects performance

Detected with cppcheck static analyser, which said: (performance) Function
parameter should be passed by reference. Reformat with clang-format as
needed.

Signed-off-by: Piotr Trojanek <piotr.trojanek@gmail.com>
5 years ago[CVC Parser] Add support for regular expressions (#3346)
Andres Noetzli [Tue, 8 Oct 2019 17:00:48 +0000 (10:00 -0700)]
[CVC Parser] Add support for regular expressions (#3346)

5 years agoDisallow --proof and --incremental (#3332)
Andres Noetzli [Tue, 8 Oct 2019 16:05:50 +0000 (09:05 -0700)]
Disallow --proof and --incremental (#3332)

5 years agoMake ackermannization generally applicable rather than just BV (#3315)
Ying Sheng [Tue, 8 Oct 2019 15:18:21 +0000 (08:18 -0700)]
Make ackermannization generally applicable rather than just BV (#3315)

The ackermannization process is currently already support general theories rather than specifically for BV. In this pull request, an option has been added to turn on ackermannization independently.

5 years agoBuild system: Add build type for incremental competition builds. (#3365)
Aina Niemetz [Tue, 8 Oct 2019 06:27:44 +0000 (23:27 -0700)]
Build system: Add build type for incremental competition builds. (#3365)

Previously, competition builds for incremental tracks required to
manually pass in -DCVC4_SMTCOMP_APPLICATION_TRACK as compiler flag. This
introduces an additional build type for incremental competition builds
to simplify configuration for such builds.

5 years agoNew C++ API: Add Term::getId(). (#3360)
Aina Niemetz [Tue, 8 Oct 2019 01:37:48 +0000 (18:37 -0700)]
New C++ API: Add Term::getId(). (#3360)

+ use explicit types in NodeValue
+ add unit test for Term::isParameterized()

Co-Authored-By: makaimann <makaim@stanford.edu>
5 years ago[SMT2 Parser] Move code of `rewriterulesCommand` (#3334)
Andres Noetzli [Tue, 8 Oct 2019 01:16:40 +0000 (18:16 -0700)]
[SMT2 Parser] Move code of `rewriterulesCommand` (#3334)

This commit moves the code in `rewriterulesCommand` in the SMT2 parser
to the `Smt2` class. Additionally, it creates a `boundVarList` rule to
reduce code duplication.

5 years agoFix typo in regression (#3359)
Andrew Reynolds [Sun, 6 Oct 2019 15:34:24 +0000 (10:34 -0500)]
Fix typo in regression (#3359)

5 years agoFix str to int reduction (#3358)
Andrew Reynolds [Sun, 6 Oct 2019 07:33:25 +0000 (02:33 -0500)]
Fix str to int reduction (#3358)

This fixes a corner case of the str-to-int reduction for the case where the argument is the empty string.

This fixes #3357.

5 years agoAvoid duplicate lemmas in datatypes (#3310)
Andrew Reynolds [Fri, 4 Oct 2019 07:12:02 +0000 (02:12 -0500)]
Avoid duplicate lemmas in datatypes (#3310)

We previously were sending e.g. dt.size >= 0 lemmas when size terms are pre-registered, which can happen multiple times in a user context. This ensures we cache whether a lemma is sent in a user-context dependent way in the datatypes solver. This ensures we don't send the same lemma twice for dt.size >= 0 lemmas.

5 years agoDisable proofs for unsupported logics (#3327)
yoni206 [Thu, 3 Oct 2019 22:23:58 +0000 (15:23 -0700)]
Disable proofs for unsupported logics (#3327)

This commit makes CVC4 complain if the user asked for proofs for an unsupported logic (in this contest, ALL is considered unsupported).
Changes in the regression script are introduced as well, in order to only request proofs for regressions in supported logics.

5 years agoTravis: Reenable building and running of examples. (#3351)
Aina Niemetz [Thu, 3 Oct 2019 19:41:40 +0000 (12:41 -0700)]
Travis: Reenable building and running of examples. (#3351)

5 years agoAdd missing type definitions to CDHashMap iterator (#3330)
Andres Noetzli [Thu, 3 Oct 2019 18:24:15 +0000 (11:24 -0700)]
Add missing type definitions to CDHashMap iterator (#3330)

Our `CDMapBlack` test failed to compile with newer versions of libstdc++
because they require the `value_type` to be defined for the iterator
(accessed via `std::iterator_traits`). Due to the implementation of
`std::iterator_traits`, we also need to define `iterator_category`,
`difference_type`, `pointer`, and `reference`.

5 years ago[SMT2 Parser] Move code of `sygusCommand` (#3335)
Andres Noetzli [Thu, 3 Oct 2019 17:19:12 +0000 (10:19 -0700)]
[SMT2 Parser] Move code of `sygusCommand` (#3335)

This commit moves the code in `sygusCommand` in the SMT2 parser to the
`Smt2` class. The original code was pushing and popping the current
scope inline. This commit adds a class `SynthFunFactory` that takes care
of that upon creation and destruction.

5 years agoFix compiler warning. (#3348)
Aina Niemetz [Thu, 3 Oct 2019 04:39:14 +0000 (21:39 -0700)]
Fix compiler warning. (#3348)

5 years ago[SMT-COMP] Remove --unconstrained-simp for incremental QF_LIA (#3333)
Andres Noetzli [Wed, 2 Oct 2019 22:59:26 +0000 (15:59 -0700)]
[SMT-COMP] Remove --unconstrained-simp for incremental QF_LIA (#3333)

Fixes #3058. Commit a7c4cd3ecacb1e484a076edde0274c282bb43ffb changed
CVC4's behavior to emit an error when `--unconstrained-simp` is used
with `--incremental`. Before, we were silently disabling it. For some
reason, we had that option enabled for the incremental QF_LIA track of
SMT-COMP, so CVC4 failed on those benchmarks. This commit changes the
corresponding competition script to not use the option.

5 years agoTrivial solve method for single invocation sygus (#3328)
Andrew Reynolds [Tue, 1 Oct 2019 06:56:57 +0000 (01:56 -0500)]
Trivial solve method for single invocation sygus (#3328)

This short circuits CEGQI when the conjecture is solvable by simple equality reasoning. It adds two examples where we previously would have fallen back on enumeration due to not having an instantiation technique for strings, despite the conjectures being trivially solvable.

5 years agoAdd rewrite for splitting equalities (#2957)
Andres Noetzli [Mon, 30 Sep 2019 03:31:18 +0000 (20:31 -0700)]
Add rewrite for splitting equalities (#2957)

5 years agoAdd help for sygus 2.0 (#3318)
Andrew Reynolds [Mon, 30 Sep 2019 02:32:30 +0000 (21:32 -0500)]
Add help for sygus 2.0 (#3318)

5 years agoAvoid cases of empty sygus grammars (#3301)
Andrew Reynolds [Mon, 30 Sep 2019 01:52:26 +0000 (20:52 -0500)]
Avoid cases of empty sygus grammars (#3301)

5 years agoFail single invocation techniques when utility inference fails. (#3322)
Andrew Reynolds [Sun, 29 Sep 2019 22:54:13 +0000 (17:54 -0500)]
Fail single invocation techniques when utility inference fails. (#3322)

5 years agoIntroduce template classes for simple type rules (#2835)
Andres Noetzli [Sun, 29 Sep 2019 03:18:22 +0000 (20:18 -0700)]
Introduce template classes for simple type rules (#2835)

This commit introduces two template classes `SimpleTypeRule` and
`SimpleTypeRuleVar` to help define simple type rules without writing
lots of redundant code. The main advantages of this approach are:

- Less code
- More consistent error reporting
- Easier to extend type checking with other functionality (e.g. getting
the type of a symbol)

5 years agoSupport smt2 language "match" term (#3258)
Andrew Reynolds [Sat, 28 Sep 2019 02:01:54 +0000 (21:01 -0500)]
Support smt2 language "match" term  (#3258)

5 years agoFix case of disjunctive conclusion in strings (#3254)
Andrew Reynolds [Fri, 27 Sep 2019 20:01:42 +0000 (15:01 -0500)]
Fix case of disjunctive conclusion in strings (#3254)

5 years agoMake substitution index context-independent (#2474)
Andres Noetzli [Fri, 27 Sep 2019 17:57:58 +0000 (10:57 -0700)]
Make substitution index context-independent (#2474)

When we do solving in incremental mode, we store substitutions at a
special index in our list of assertions. Previously, we used a
context-dependent variable for that. However, this is not needed since
the list of assertions just consists of the assertions currently being
processed, which are independent of the assertions seen so far. This
commit changes the index to be an ordinary integer and moves it to the
AssertionPipeline. Additionally, it abstracts access to the index in
preparation for splitting AssertionPipeline into three vectors (see
issue #2473).

5 years agoCVC print support for recoverable failure (#3323)
Andrew Reynolds [Fri, 27 Sep 2019 02:53:45 +0000 (21:53 -0500)]
CVC print support for recoverable failure (#3323)

5 years ago Fix off by one error in strings flat form explanation (#3273)
Andrew Reynolds [Wed, 25 Sep 2019 23:26:41 +0000 (18:26 -0500)]
 Fix off by one error in strings flat form explanation (#3273)

Fixes #3272.

This was caused by not explaining the last equal component in a flat form inference.  For example, if `x=y`, we may infer `z=""` from `u++x++z=u++y` since the 1st and 2nd components of these strings are equal. However, we would not add the explanation of `x=y` due to an off-by-one error.

Notice that this code is very rarely used (the code for F_EndpointEmp is not covered by our regressions). This is since length elaboration should catch conflicting cases like above, where `len(u++x++z)!=len(u++y)` if `x=y` and `z!=""` and thus `u++x++z != u++y`.  #3272 happened to catch a rare case where it is applied. This is likely due to theory combination not propagating an equality prior to running a full effort call to strings check, which is unexpected but not impossible.

5 years agoAdd isParameterized function to Expr (#3303)
Andrew Reynolds [Wed, 25 Sep 2019 17:09:42 +0000 (12:09 -0500)]
Add isParameterized function to Expr (#3303)