cvc5.git
4 years agoTypes & side-conditions for linear and affine fns (#3627)
Alex Ozdemir [Tue, 21 Jan 2020 20:15:10 +0000 (12:15 -0800)]
Types & side-conditions for linear and affine fns (#3627)

This commit introduces types for linear combinations of arith variables
along with side conditions for their arithmetic.

It does the same for affine functions.

These primitives are ultimately used in our machinery for Farkas proofs.

4 years agoAxioms (and side conditions) for tightening bounds (#3613)
Alex Ozdemir [Tue, 21 Jan 2020 15:45:10 +0000 (07:45 -0800)]
Axioms (and side conditions) for tightening bounds (#3613)

* Axioms (and side conditions) for tightening bounds

* Side conditions for verifying floor/ceiling-like functions
* Axioms for their correct execution
* Axioms for bound tightening.

* Apply suggestions from code review

Co-Authored-By: yoni206 <yoni206@users.noreply.github.com>
* Address Yoni's comments by addings documentation.

Thanks Yoni!

Co-authored-by: yoni206 <yoni206@users.noreply.github.com>
4 years agoLIRA proof: Arithmetic predicates & reification thereof (#3612)
Alex Ozdemir [Sat, 18 Jan 2020 00:56:44 +0000 (16:56 -0800)]
LIRA proof: Arithmetic predicates & reification thereof (#3612)

* Merge branch 'master' into lira-pf-arith-pred

* Shorten reify_arith_pred, thanks Yoni!

Use recursion!

* typo

4 years agoLIRA sig: int, real terms, and conversions (#3610)
Alex Ozdemir [Fri, 17 Jan 2020 23:21:03 +0000 (15:21 -0800)]
LIRA sig: int, real terms, and conversions (#3610)

* LIRA sig: int, real terms, and conversions

* Address Yoni's comments.

* Better description of "reify" functions
* explicit (rather than implicit) `fail` when reifying integer division

Co-authored-by: Andrew Reynolds <andrew.j.reynolds@gmail.com>
4 years agoUse axioms when checking goal entailment for abduction algorithm (#3611)
Andrew Reynolds [Fri, 17 Jan 2020 20:24:03 +0000 (14:24 -0600)]
Use axioms when checking goal entailment for abduction algorithm (#3611)

4 years agoNew C++ API: Add nullary constructor for Result. (#3603)
Aina Niemetz [Wed, 15 Jan 2020 16:25:21 +0000 (08:25 -0800)]
New C++ API: Add nullary constructor for Result. (#3603)

4 years agoGeneralize example-based sym breaking to conjectures with constant function apps...
Andrew Reynolds [Tue, 14 Jan 2020 20:42:44 +0000 (14:42 -0600)]
Generalize example-based sym breaking to conjectures with constant function apps (#3605)

4 years agoDisable unsat cores for regression that times out (#3607)
Andres Noetzli [Tue, 14 Jan 2020 15:47:58 +0000 (07:47 -0800)]
Disable unsat cores for regression that times out (#3607)

Regression `regress2/strings/issue3203.smt2` is currently timing out
depending on the version of the libraries loaded (see #3606 for more
info). This commit temporarily disables the regression to get the
nightlies to pass again.

4 years agoSupport arbitrary unsigned integer attributes (#3591)
Andres Noetzli [Mon, 13 Jan 2020 20:26:52 +0000 (12:26 -0800)]
Support arbitrary unsigned integer attributes (#3591)

Fixes #3586. On macOS, `size_t` resolves to `unsigned long` whereas `uint64_t`
resolves to `unsigned long long`. Even though the types have the same bit-width
and signedness, they are not considered the same type. This caused issues with
`Attribute`s that store `size_t` values because we only specialized the
`getTable()` struct for `uint64_t`. This commit changes the specialization to
work for arbitrary unsigned integer types of at most 64-bit. It does that by
generalizing the specialization of `getTable()` and by implementing a
`KindValueToTableValueMapping` for unsigned integer attributes of up to 64-bit
that casts integers between the attributes bit-width and `uint64_t`.

4 years agoFix side condition check in sygus core connective (#3600)
Andrew Reynolds [Fri, 10 Jan 2020 21:31:01 +0000 (15:31 -0600)]
Fix side condition check in sygus core connective (#3600)

4 years agoFix enum names in AIG bitblaster. (#3599)
Mathias Preiner [Fri, 10 Jan 2020 20:25:54 +0000 (12:25 -0800)]
Fix enum names in AIG bitblaster. (#3599)

4 years agoFix printing of models of uninterpreted sorts (#3597)
Andres Noetzli [Fri, 10 Jan 2020 18:49:53 +0000 (10:49 -0800)]
Fix printing of models of uninterpreted sorts (#3597)

4 years agoTrack trivial cases in transition inference (#3598)
Andrew Reynolds [Fri, 10 Jan 2020 18:08:16 +0000 (12:08 -0600)]
Track trivial cases in transition inference (#3598)

4 years agoOptimize str.substr reduction (#3595)
Andres Noetzli [Fri, 10 Jan 2020 00:45:38 +0000 (16:45 -0800)]
Optimize str.substr reduction (#3595)

This commit optimizes the `str.substr` reduction by replacing the
if-then-else term for the length of the suffix `len(sk2) = ite(len(s) >=
n+m, len(s) - (n + m), 0)` with `(len(sk2) = len(s) - (n + m) v
len(sk2) = 0) ^ len(skt) <= m`. Experiments have shown that the latter
encoding is more efficient.

4 years agoFix backtracking issue in sygus fast enumerator (#3593)
Andrew Reynolds [Wed, 8 Jan 2020 21:31:26 +0000 (15:31 -0600)]
Fix backtracking issue in sygus fast enumerator (#3593)

4 years agoUniverse set cardinality for finite types with finite cardinality (#3392)
mudathirmahgoub [Wed, 8 Jan 2020 00:13:07 +0000 (18:13 -0600)]
Universe set cardinality for finite types with finite cardinality (#3392)

* rewrote set cardinality for finite-types

* small changes and format

4 years agoFix unary minus parse check (#3594)
Andrew Reynolds [Tue, 7 Jan 2020 20:22:32 +0000 (14:22 -0600)]
Fix unary minus parse check (#3594)

4 years agoUpdate any-constant and normalization policies for sygus grammars (#3583)
Andrew Reynolds [Tue, 7 Jan 2020 17:39:27 +0000 (11:39 -0600)]
Update any-constant and normalization policies for sygus grammars (#3583)

4 years agoFix finiteness check for bounded fmf (#3589)
Andrew Reynolds [Sat, 4 Jan 2020 19:24:14 +0000 (13:24 -0600)]
Fix finiteness check for bounded fmf (#3589)

Recently, finite model finding via uninterpreted sorts was decoupled from finite bound inference techniques (the BoundedIntegers module in theory/quantifiers/fmf/). This module assumed that finite model finding was enabled in one place. This fixes the issue by adding an additional check. This fixes a model unsoundness issue where bounds on an uninterpreted sort were not being enforced.

This fixes #3587.

4 years ago[proof] ITE translation fix (#3484)
Alex Ozdemir [Tue, 31 Dec 2019 04:13:48 +0000 (20:13 -0800)]
[proof] ITE translation fix (#3484)

* Bugfix: convert ifte arms to formulas for printing

We have two kinds of ITEs in our LFSC proofs:
   * ite: for sort-typed expressions
   * ifte: for formulas
Say that we have a Bool-sorted ITE. We had machinery for emitting an
`ifte` for it, but this machinery didn't actually convert the arms of
the ITE into formulas... Facepalm.

Fixed now.

* Test the lifting of ITEs from arithmetic.

This test verifies that booleans ITEs are correctly lifted to formula
ITEs in LRA proofs.

It used to fail, but now passes.

* clang-format

* Typos.

* Add test to CMake

* Set --check-proofs in test

* Address Yoni

* Expand printsAsBool documentation
* Assert ITE typing soundness

* Assert a subtype relation for ITEs, not equality

* Update src/proof/arith_proof.h

Thanks Yoni!

Co-Authored-By: yoni206 <yoni206@users.noreply.github.com>
Co-authored-by: yoni206 <yoni206@users.noreply.github.com>
4 years agoInitial support for string reverse (#3581)
Andrew Reynolds [Mon, 23 Dec 2019 23:18:19 +0000 (17:18 -0600)]
Initial support for string reverse (#3581)

Type rules, parsing and printing, basic rewriting including constant evaluation, reduction for string reverse (`str.rev`).

Also improves support in a few places for tolower/toupper.

4 years agoDefine all options modified by ENABLE_BEST using cvc4_option (#3578)
Simon Dierl [Thu, 19 Dec 2019 23:51:29 +0000 (00:51 +0100)]
Define all options modified by ENABLE_BEST using cvc4_option (#3578)

Signed-off-by: Simon Dierl <simon.dierl@cs.tu-dortmund.de>
4 years agoFix typo in smt_options.toml. (#3579)
Mathias Preiner [Thu, 19 Dec 2019 17:52:26 +0000 (09:52 -0800)]
Fix typo in smt_options.toml. (#3579)

4 years agoIncrement Taylor degree for tangent and secant plane inferences for transcendentals...
Andrew Reynolds [Wed, 18 Dec 2019 14:44:06 +0000 (08:44 -0600)]
Increment Taylor degree for tangent and secant plane inferences for transcendentals (#3577)

4 years agoAvoid calling rewriter from type checker (#3548)
Andres Noetzli [Wed, 18 Dec 2019 08:27:18 +0000 (00:27 -0800)]
Avoid calling rewriter from type checker (#3548)

Fixes #3536. The type checker for the chain operator was calling the
rewriter. However, the floating-point rewriter was expecting
`TheoryFp::expandDefinition()` to be applied before rewriting. If the
chain operator had subterms that were supposed to be removed by
`TheoryFp::expandDefinition()`, the FP rewriter was throwing an
exception. This commit fixes the issue by not calling the full rewriter
in the type checker but by just expanding the chain operator. This is a
bit less efficient than before because the rewriter does not cache the
result of expanding the chain operator anymore but assuming that there
are no long chains, the performance impact should be negligible. It also
seemed like a reasonable assumption that the rewriter can expect to run
after `expandDefinition()` because otherwise the rewriter has to expand
definitions, which may be too restrictive.

4 years agoGenerate code for options with modes. (#3561)
Mathias Preiner [Tue, 17 Dec 2019 21:43:44 +0000 (13:43 -0800)]
Generate code for options with modes. (#3561)

This commit adds support for code generation of options with modes (enums). From now on option enums can be specified in the corresponding *.toml files without the need of extra code. All option enums are now in the options namespace.

4 years agoFix spurious parse error for rational real array constants (#3554)
Andrew Reynolds [Tue, 17 Dec 2019 08:00:42 +0000 (02:00 -0600)]
Fix spurious parse error for rational real array constants (#3554)

Currently we can't parse constant arrays that store real values that are given as rationals `(/ n m)`. We throw a spurious parse error for `((as const (Array Int Real)) (/ 1 3))`, indicating that the argument of the array is not constant. This is caused by the fact that `(/ 1 3)` is parsed as a *division* term not a rational value.

This adds a special case to constant array construction so that we compute the result of a constant division instead of using the division term `(/ n m)` when constructing an array constant.

4 years agoUse the evaluator utility in the function definition evaluator (#3576)
Andrew Reynolds [Mon, 16 Dec 2019 21:02:28 +0000 (15:02 -0600)]
Use the evaluator utility in the function definition evaluator (#3576)

Improves performance on ground conjectures with recursive functions. We use the evalutator to (partially) evaluate bodies of recursive functions, instead of relying on substitution+rewriting.

4 years agoExtend model construction with assignment exclusion set (#3377)
Andrew Reynolds [Mon, 16 Dec 2019 20:30:42 +0000 (14:30 -0600)]
Extend model construction with assignment exclusion set (#3377)

This extends the core model building algorithm in CVC4 with "assignment exclusion sets".  This functionality is useful for assigning values to terms of finite type that have specific restrictions on what their value cannot be.

In detail, previously, all unassigned terms of finite type were always assigned the first term in the type enumeration.  This is done since it is assumed that theories (e.g. datatypes) always do enough work to ensure that *arbitrary* values can be assigned to terms of finite type, and *fresh* values can be assigned to terms of infinite type. However, there are compelling cases (sets+cardinality for finite element types) where one may want to impose restrictions on what values can be assigned to terms of finite types.  Thus, we now provide `setAssignmentExclusionSet` as a way of communicating these restrictions.

This commit also refactors a few parts of `TheoryEngineModelBuilder::buildModel` to be clearer, in particular by adding a few helper functions, and by caching certain information early in the function instead of recomputing it.

This is work towards #1123.

4 years agoSupport ackermannization on uninterpreted sorts in BV (#3372)
Ying Sheng [Mon, 16 Dec 2019 19:42:36 +0000 (11:42 -0800)]
Support ackermannization on uninterpreted sorts in BV (#3372)

Support ackermannization on uninterpreted sorts in BV. For uninterpreted sorts, we create a bit-vector sort to replace it. For an uninterpreted sort `S`, if the number of variables within sort `S` is `n`, the replacing bit-vector will have size (log n)+1.

4 years agoMove Datatype management to ExprManager (#3568)
Andrew Reynolds [Mon, 16 Dec 2019 17:56:39 +0000 (11:56 -0600)]
Move Datatype management to ExprManager (#3568)

This is further work towards decoupling the Expr layer from the Node layer.

This commit makes it so that ExprManager does memory management for Datatype while NodeManager maintains a list of DType.

As a reminder, the ownership policy (and level of indirection through DatatypeIndex) is necessary due to not being able to store Datatype within Node since this leads to circular dependencies in the Node AST.

4 years agoFix evaluator for non-evaluatable nodes (#3575)
Andrew Reynolds [Mon, 16 Dec 2019 17:23:54 +0000 (11:23 -0600)]
Fix evaluator for non-evaluatable nodes (#3575)

This ensures that the Evaluator always returns the result of substitution + rewriting for constant substitutions.

This requires a few further extensions to the code, namely:
(1) Applying substutitions to operators,
(2) Reconstructing all nodes that fail to evaluate by taking into account evaluation of their children.

4 years agoRevert evaluate as node. (#3574)
Andrew Reynolds [Mon, 16 Dec 2019 16:28:51 +0000 (10:28 -0600)]
Revert evaluate as node. (#3574)

4 years agoTrace tags for dumping the decision tree in org-mode format (#2871)
makaimann [Mon, 16 Dec 2019 09:58:24 +0000 (01:58 -0800)]
Trace tags for dumping the decision tree in org-mode format (#2871)

This would add tracing options to print the decision tree in [org-mode](https://orgmode.org/) format which can be viewed with emacs or [vim-orgmode](https://github.com/jceb/vim-orgmode).

In the raw format, the number of asterisks denote the decision level of a decision, and within a propagation node, the number of spaces denote the level. Most viewers render the asterisks as indented bullets.

There are some options for controlling verbosity:
`dtview` - prints the decisions (basic option)
`dtview::command` - also prints smt-lib commands as they're issued
`dtview::conflict` - also prints conflicts
`dtview::prop` - also prints propagations

Example usage:
`cvc4 -t dtview -t dtview::command -t dtview::conflict -t dtview::prop <example smt2 file> &> example-trace.org`

The resulting file when opened with an org-mode viewer has collapsible nodes, where "..." marks a node with children.

4 years agoMinor improvement to evaluator (#3570)
Andrew Reynolds [Mon, 16 Dec 2019 06:22:40 +0000 (00:22 -0600)]
Minor improvement to evaluator (#3570)

Fixes a bug where we don't return the partially evaluated version (for unevaluatable nodes). Also adds `NONLINEAR_MULT` whose semantics is identical to `MULT`.

4 years agoSimple optimizations for the core rewriter (#3569)
Andrew Reynolds [Sun, 15 Dec 2019 07:45:27 +0000 (01:45 -0600)]
Simple optimizations for the core rewriter (#3569)

In some SyGuS applications, the bottleneck is the rewriter.  This PR makes a few simple optimizations to the core rewriter, namely:
(1) Minimize the overhead of `theoryOf` calls, which take about 10-15% of the runtime in the rewriter.  This PR avoids many calls to `theoryOf` by the observation that nodes with zero children never rewrite, hence we can return the node itself immediately.  Furthermore, the `theoryOf` call can be simplified to hardcode the context under which we were using it: get the theory (based on type) where due to the above, we can assume that the node is not a variable.
The one (negligible) change in behavior due to this change is that nodes with more than one child for which `isConst` returns true (this is limited to the case of `APPLY_CONSTRUCTOR` in datatypes) lookup their theory based on the Kind, not their type, which should always be the same theory unless a theory had a way of constructing constant nodes of a type belonging to another theory.
(2) Remove deprecated infrastrastructure for a "neverIsConst" function, which was adding about a 1% of the runtime for some SyGuS benchmarks.

This makes SyGuS for some sets of benchmarks roughly 3% faster.

4 years agoEliminate Expr-level calls in TypeNode (#3562)
Andrew Reynolds [Fri, 13 Dec 2019 17:07:16 +0000 (11:07 -0600)]
Eliminate Expr-level calls in TypeNode (#3562)

4 years agoAdd support for set comprehension (#3312)
Andrew Reynolds [Fri, 13 Dec 2019 15:53:02 +0000 (09:53 -0600)]
Add support for set comprehension (#3312)

4 years agoDisable check-synth-sol in regression with recursive functions (#3560)
Andrew Reynolds [Fri, 13 Dec 2019 13:18:29 +0000 (07:18 -0600)]
Disable check-synth-sol in regression with recursive functions (#3560)

4 years ago FP converter: convert: Use std::vector as instead of std::stack. (#3563)
Aina Niemetz [Fri, 13 Dec 2019 05:05:49 +0000 (21:05 -0800)]
 FP converter: convert: Use std::vector as instead of std::stack. (#3563)

The word-blasting function `FpConverter::convert` used a `std::stack` with `deque` as an underlying data structure (default) for node traversal. Previous experiments suggested that using `std::stack<T, std::deque<T>>` performs worse than using `std::vector<T>`, and we decided, as a guideline, to always use `std::vector` for stacks: https://github.com/CVC4/CVC4/wiki/Code-Style-Guidelines#stack.

This PR refactors `FpConverter::convert` to use `std::vector`. Runs on all incremental and non-incremental FP logics in SMT-LIB showed a slight improvement over the previous (`std::stack<T, std::deque<T>>`) implementation, and an even greater (albeit still slight) improvement over using `std::stack<T, std::vector<T>>`.

4 years agoMake CEGIS sampling robust to non-vanilla CEGIS (#3559)
Andrew Reynolds [Thu, 12 Dec 2019 21:43:36 +0000 (15:43 -0600)]
Make CEGIS sampling robust to non-vanilla CEGIS (#3559)

4 years agoFix Unif+PI algorithm with symbolic unfolding (#3558)
Haniel Barbosa [Thu, 12 Dec 2019 21:19:05 +0000 (18:19 -0300)]
Fix Unif+PI algorithm with symbolic unfolding (#3558)

4 years agoUse the node-level datatypes API (#3556)
Andrew Reynolds [Thu, 12 Dec 2019 20:38:42 +0000 (14:38 -0600)]
Use the node-level datatypes API (#3556)

4 years agoFixes for regressions (#3557)
Andrew Reynolds [Thu, 12 Dec 2019 16:01:53 +0000 (10:01 -0600)]
Fixes for regressions (#3557)

4 years agoFix CEGIS refinement for recursive functions evaluation (#3555)
Andrew Reynolds [Thu, 12 Dec 2019 03:24:43 +0000 (21:24 -0600)]
Fix CEGIS refinement for recursive functions evaluation (#3555)

4 years agoActivate node-level datatype API (#3540)
Andrew Reynolds [Thu, 12 Dec 2019 00:09:16 +0000 (18:09 -0600)]
Activate node-level datatype API (#3540)

4 years agoDo not substitute beneath arithmetic terms in the non-linear solver (#3324)
Andrew Reynolds [Wed, 11 Dec 2019 17:58:53 +0000 (11:58 -0600)]
Do not substitute beneath arithmetic terms in the non-linear solver (#3324)

4 years agoSupport symbolic unfolding in UNIF+PI (#3553)
Andrew Reynolds [Wed, 11 Dec 2019 16:07:25 +0000 (10:07 -0600)]
Support symbolic unfolding in UNIF+PI (#3553)

4 years agoIncorporate rewriting on demand in the evaluator (#3549)
Andrew Reynolds [Tue, 10 Dec 2019 23:42:31 +0000 (17:42 -0600)]
Incorporate rewriting on demand in the evaluator (#3549)

4 years agoFix ufho issues (#3551)
Haniel Barbosa [Tue, 10 Dec 2019 20:17:00 +0000 (17:17 -0300)]
Fix ufho issues (#3551)

4 years agoAllow unsat cores with sygus inference (#3550)
Andrew Reynolds [Tue, 10 Dec 2019 15:07:47 +0000 (09:07 -0600)]
Allow unsat cores with sygus inference (#3550)

4 years agoDisable sygus inference when combined with incremental and proofs (#3539)
Andrew Reynolds [Mon, 9 Dec 2019 22:17:46 +0000 (16:17 -0600)]
Disable sygus inference when combined with incremental and proofs (#3539)

4 years agoFix case of uninterpreted constant instantiation in FMF (#3543)
Andrew Reynolds [Mon, 9 Dec 2019 20:32:32 +0000 (14:32 -0600)]
Fix case of uninterpreted constant instantiation in FMF (#3543)

Fixes #3537.
This benchmark triggers a potential unsoundness caused by instantiating with an uninterpreted constant (which is unsound).

4 years agoMake theory rewriters non-static (#3547)
Andres Noetzli [Mon, 9 Dec 2019 19:19:10 +0000 (11:19 -0800)]
Make theory rewriters non-static (#3547)

This commit changes theory rewriters to be non-static. This refactoring
is needed as a stepping stone to making our rewriter configurable: If we
have multiple solver objects with different rewrite configurations, we
cannot use `static` variables for the rewriter table in the BV rewriter
for example. It is also in line with our goal of getting rid of
  singletons in general. Note that the `Rewriter` class is still a
  singleton, which will be changed in a future commit.

4 years ago[Regressions] Require proof support for abduction (#3546)
Andres Noetzli [Sun, 8 Dec 2019 19:56:50 +0000 (11:56 -0800)]
[Regressions] Require proof support for abduction (#3546)

4 years agoSimplify rewrite for character matching (#3545)
Andres Noetzli [Sat, 7 Dec 2019 03:01:43 +0000 (19:01 -0800)]
Simplify rewrite for character matching (#3545)

4 years agoUse str.subtr in str.to.int/int.to.str reduction (#3544)
Andres Noetzli [Sat, 7 Dec 2019 00:06:19 +0000 (16:06 -0800)]
Use str.subtr in str.to.int/int.to.str reduction (#3544)

Previously, we were using UFs to encode substrings in the
`str.to.int`/`int.to.str` reductions. Our experiments have shown,
however, that using `str.substr` is more efficient instead.

4 years agoThrow exception instead of warning for approximate models (#3542)
Andrew Reynolds [Fri, 6 Dec 2019 20:23:21 +0000 (14:23 -0600)]
Throw exception instead of warning for approximate models (#3542)

4 years agoAdd lemma for str.to.int/int.to.str (#3541)
Andres Noetzli [Fri, 6 Dec 2019 19:33:51 +0000 (11:33 -0800)]
Add lemma for str.to.int/int.to.str (#3541)

This commit adds a lemma to our encoding of `str.to.int` and
`int.to.str` that relates the integer value in the encodings to the
value of partial results.

4 years agoOptimize the rewriter for DT_SYGUS_EVAL (#3529)
Andrew Reynolds [Fri, 6 Dec 2019 19:12:12 +0000 (13:12 -0600)]
Optimize the rewriter for DT_SYGUS_EVAL (#3529)

This makes it so that we don't construct intermediate unfoldings of applications of DT_SYGUS_EVAL, which wastes time in node construction. It makes the sygusToBuiltin utility in TermDbSygus use this implementation.

4 years agoNew algorithm for interpolation and abduction based on unsat cores (#3255)
Andrew Reynolds [Fri, 6 Dec 2019 18:03:40 +0000 (12:03 -0600)]
New algorithm for interpolation and abduction based on unsat cores (#3255)

4 years agoAdd ExprManager as argument to Datatype (#3535)
Andrew Reynolds [Fri, 6 Dec 2019 17:00:33 +0000 (11:00 -0600)]
Add ExprManager as argument to Datatype (#3535)

4 years ago[proof] Eliminate side-condition from ER signature (#3230)
Alex Ozdemir [Fri, 6 Dec 2019 15:51:54 +0000 (07:51 -0800)]
[proof] Eliminate side-condition from ER signature (#3230)

* [proof] Eliminate the side condition in er.plf

By tweaking the axioms a bit, I got rid of the lone SC in the Extended
Resolution signature.

* [proof] Changed er_proof.cpp in line with signature

The new signature requires slightly different proof printing.

* [proof] clang-format er_proof.cpp

* Fix tests

* [proof] Actually delete the SC

* Apply suggestions from code review

Co-Authored-By: yoni206 <yoni206@users.noreply.github.com>
* Add LFSC-checking unit test for ER proof

* Gate the lfsc invocation on the build system

* Properly gate the lfsc check on the build system

* gate the plf_signatures forward def on the build system

4 years agocontrib: Setup all dependencies in deps/ directory. (#3534)
Mathias Preiner [Fri, 6 Dec 2019 14:48:04 +0000 (06:48 -0800)]
contrib: Setup all dependencies in deps/ directory. (#3534)

4 years agoIntroduce the Node-level Datatypes API (#3462)
Andrew Reynolds [Fri, 6 Dec 2019 07:22:01 +0000 (01:22 -0600)]
Introduce the Node-level Datatypes API (#3462)

This adds classes corresponding to the Node-level Datatype API "DType", which is a specification for a datatype type. It does not enable the use of this layer yet. A followup PR will update the Expr-level Datatype to use the Node-level code, which is currently verified to be functional on this branch: https://github.com/ajreynol/CVC4/tree/dtype-integrate. Futher PRs will make the internal (Node-level) code forgo the use of the Expr-layer datatype, which will then enable the Expr-layer to be replaced by the Term-layer datatype.

Most of the documentation for the methods in DType/DTypeConstructor/DTypeSelector was copied from Datatype/DatatypeConstructor/DatatypeConstructorArg.

4 years agoMake nonlinear solver intercept model assignments from the linear arithmetic solver...
Andrew Reynolds [Thu, 5 Dec 2019 20:23:16 +0000 (14:23 -0600)]
Make nonlinear solver intercept model assignments from the linear arithmetic solver (#3525)

4 years agoRefactor mode options for Unif+PI (#3531)
Andrew Reynolds [Thu, 5 Dec 2019 15:19:56 +0000 (09:19 -0600)]
Refactor mode options for Unif+PI (#3531)

4 years agoBi-directional unrolling of R* regular expressions (#3532)
Andres Noetzli [Thu, 5 Dec 2019 14:39:32 +0000 (06:39 -0800)]
Bi-directional unrolling of R* regular expressions (#3532)

4 years agoAdd mkOp for a single Kind (#3522)
makaimann [Thu, 5 Dec 2019 02:59:44 +0000 (18:59 -0800)]
Add mkOp for a single Kind (#3522)

4 years agoFix the subtyping relation for functions (#3494)
Andrew Reynolds [Thu, 5 Dec 2019 01:13:08 +0000 (19:13 -0600)]
Fix the subtyping relation for functions (#3494)

4 years agoNew grammar construction modes for SyGuS (#3486)
Andrew Reynolds [Wed, 4 Dec 2019 23:18:06 +0000 (17:18 -0600)]
New grammar construction modes for SyGuS (#3486)

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)