cvc5.git
5 years ago Configured for linking against drat2er (#2754)
Alex Ozdemir [Mon, 17 Dec 2018 23:01:23 +0000 (15:01 -0800)]
 Configured for linking against drat2er (#2754)

drat2er is a C/C++ project which includes support for
   * Checking DRAT proofs
   * Converting DRAT proofs to LRAT proofs
   * Converting DRAT proofs to ER proofs

It does the first 2 by using drat-trim under the hood.

I've modified our CMake configuration to allow drat2er to be linked into
CVC4, and I added a contrib script.

5 years agoNew C++ API: Add tests for term object. (#2755)
Aina Niemetz [Mon, 17 Dec 2018 22:11:37 +0000 (14:11 -0800)]
New C++ API: Add tests for term object. (#2755)

5 years agoDRAT Signature (#2757)
Alex Ozdemir [Mon, 17 Dec 2018 01:49:34 +0000 (17:49 -0800)]
DRAT Signature (#2757)

* DRAT signature

Added the DRAT signature to CVC4.

We'll need this in order to compare three BV proof pipelines:
   1. DRAT -> Resolution -> Check
   2. DRAT -> LRAT -> Check
   3. DRAT -> Check (this one!)

Tested the signature using the attached test file. i.e. running
```
lfscc sat.plf smt.plf lrat.plf drat.plf drat_test.plf
```

* Added type annotations for tests

* Respond to Yoni's review

* Apply Yoni's suggestions from code review

Documentation polish

Co-Authored-By: alex-ozdemir <aozdemir@hmc.edu>
* Whoops, missed a spot or two

5 years agoRevert "Move ss-combine rewrite to extended rewriter (#2703)" (#2759)
Andres Noetzli [Sat, 15 Dec 2018 16:40:03 +0000 (16:40 +0000)]
Revert "Move ss-combine rewrite to extended rewriter (#2703)" (#2759)

5 years ago [LRA Proof] Storage for LRA proofs (#2747)
Alex Ozdemir [Sat, 15 Dec 2018 01:44:39 +0000 (17:44 -0800)]
 [LRA Proof] Storage for LRA proofs  (#2747)

* [LRA Proof] Storage for LRA proofs

During LRA solving the `ConstraintDatabase` contains the reasoning
behind different constraints. Combinations of constraints are
periodically used to justify lemmas (conflict clauses, propegations, ...
?). `ConstraintDatabase` is SAT context-dependent.

ArithProofRecorder will be used to store concise representations of the
proof for each lemma raised by the (LR)A theory. The (LR)A theory will
write to it, and the ArithProof class will read from it to produce LFSC
proofs.

Right now, it's pretty simplistic -- it allows for only Farkas proofs.

In future PRs I'll:
   1. add logic that stores proofs therein
   2. add logic that retrieves and prints proofs
   3. enable LRA proof production, checking, and testing

* Document ArithProofRecorder use-sites

* Update src/proof/arith_proof_recorder.cpp

Co-Authored-By: alex-ozdemir <aozdemir@hmc.edu>
* Yoni's review

* clang-format

* Response to Mathias' review.

5 years agoFixed typos.
Aina Niemetz [Fri, 14 Dec 2018 23:12:27 +0000 (15:12 -0800)]
Fixed typos.

5 years agoNew C++ API: Add tests for opterm object. (#2756)
Aina Niemetz [Fri, 14 Dec 2018 18:25:15 +0000 (10:25 -0800)]
New C++ API: Add tests for opterm object. (#2756)

5 years ago Fix extended rewriter for binary associative operators. (#2751)
Andrew Reynolds [Fri, 14 Dec 2018 02:17:50 +0000 (20:17 -0600)]
 Fix extended rewriter for binary associative operators. (#2751)

This was causing assertion failures when using Sets + Sygus.

5 years agoMake single invocation and invariant pre/post condition templates independent (#2749)
Andrew Reynolds [Fri, 14 Dec 2018 00:39:26 +0000 (18:39 -0600)]
Make single invocation and invariant pre/post condition templates independent (#2749)

--cegqi-si=none previously disabled pre/post-condition templates for invariant synthesis. This PR eliminates this dependency.

There are no major code changes in this PR, unfortunately a large block of code changed indentation so I refactored it to be more up to date with the coding guidelines.

5 years agoNew C++ API: Add tests for sort functions of solver object. (#2752)
Aina Niemetz [Thu, 13 Dec 2018 21:17:22 +0000 (13:17 -0800)]
New C++ API: Add tests for sort functions of solver object. (#2752)

5 years agoRemove spurious map (#2750)
Andrew Reynolds [Thu, 13 Dec 2018 18:03:16 +0000 (12:03 -0600)]
Remove spurious map (#2750)

5 years agoFix compiler warnings. (#2748)
Aina Niemetz [Thu, 13 Dec 2018 00:37:59 +0000 (16:37 -0800)]
Fix compiler warnings. (#2748)

5 years agoAPI: Add simple empty/sigma regexp unit tests (#2746)
Andres Noetzli [Wed, 12 Dec 2018 23:19:30 +0000 (23:19 +0000)]
API: Add simple empty/sigma regexp unit tests (#2746)

5 years ago[LRA proof] More complete LRA example proofs. (#2722)
Alex Ozdemir [Wed, 12 Dec 2018 01:35:26 +0000 (17:35 -0800)]
[LRA proof] More complete LRA example proofs. (#2722)

* [LRA proof] Refine "poly" and "term Real" distinction

Short Version:

Refined the LRA signature and used the refined version to write two new
test proofs which are close to interface compatible with the LRA proofs
that CVC4 will produce.

Love Version:

LRA proofs have the following interface:
   * Given predicates between real terms
   * Prove bottom

However, even though the type of the interface does not express this,
the predicates are **linear bounds**, not arbitrary real bounds. Thus
LRA proofs have the following structure:

   1. Prove that the input predicates are equivalent to a set of linear
      bounds.
   2. Use the linear bounds to prove bottom using farkas coefficients.

Notice that the distinction between linear bounds (associated in the
signature with the string "poly") and real predicates (which relate
"term Real"s to one another) matters quite a bit. We have certain inds
of axioms for one, and other axioms for the other.

The signature used to muddy this distinction using a constructor called
"term_poly" which converted between them. I decided it was better to buy
into the distinction fully.

Now all of the axioms for step (2) use the linear bounds and axioms for
step (1) use both kinds of bounds, which makes sense because step (1) is
basically a conversion.

Also had to add an axiom or two, because some were missing.

* Update proofs/signatures/th_lra.plf

Co-Authored-By: alex-ozdemir <aozdemir@hmc.edu>
* Improved test readability, removed unused axioms

The LRA proof tests did not have appropriate documentation, and did not
specify **what** they proved. Now they each have a header comment
stating their premises and conclusion, and that conclusion is enforced
by a type annotation in the test.

The LRA signature included some unused axioms concerning `poly_term`.
Now they've been removed.

Credits to Yoni for noticing both problems.

5 years ago[LRAT] signature robust against duplicate literals (#2743)
Alex Ozdemir [Wed, 12 Dec 2018 01:19:07 +0000 (17:19 -0800)]
[LRAT] signature robust against duplicate literals (#2743)

* [LRAT] signature robust against duplicate literals

The LRAT signature previously had complex, surprising, and occasionally
incorrect behavior when given clauses with duplicate literals.

Now it does not. Now clauses have true set semantics, and clauses with
duplicate literals are treated identically to those without.

* Test with logically = but structurally != clauses.

5 years agoRemove alternate versions of mbqi (#2742)
Andrew Reynolds [Tue, 11 Dec 2018 22:38:00 +0000 (16:38 -0600)]
Remove alternate versions of mbqi (#2742)

5 years agoLRAT signature (#2731)
Alex Ozdemir [Tue, 11 Dec 2018 19:46:38 +0000 (11:46 -0800)]
LRAT signature (#2731)

* LRAT signature

Added an LRAT signature. It is almost entirely side-conditions, but it
works.

There is also a collection of tests for it. You can run them by invoking

```
lfscc smt.plf sat.plf lrat.plf lrat_test.plf
```

* Update proofs/signatures/lrat.plf per Yoni's suggestion.

Co-Authored-By: alex-ozdemir <aozdemir@hmc.edu>
* Responding to Yoni's comments.

* Removed unused varaibles

Some tests declared `var`s which were unused.
Now they don't.

5 years agoBoolToBV modes (off, ite, all) (#2530)
makaimann [Mon, 10 Dec 2018 16:37:11 +0000 (08:37 -0800)]
BoolToBV modes (off, ite, all) (#2530)

5 years agoStrings: Make EXTF_d inference more conservative (#2740)
Andres Noetzli [Fri, 7 Dec 2018 15:48:38 +0000 (07:48 -0800)]
Strings: Make EXTF_d inference more conservative (#2740)

5 years agoArith Constraint Proof Loggin (#2732)
Alex Ozdemir [Fri, 7 Dec 2018 04:00:03 +0000 (20:00 -0800)]
Arith Constraint Proof Loggin (#2732)

* Arith Constraint Proof Logging

Also a tiny documentation update.

* Debug.isOn check around iterated output

* reference iteratees

5 years agoEnable BV proofs when using an eager bitblaster (#2733)
Alex Ozdemir [Fri, 7 Dec 2018 02:56:56 +0000 (18:56 -0800)]
Enable BV proofs when using an eager bitblaster (#2733)

* Enable BV proofs when using and eager bitblaster

Specifically:
   * Removed assertions that blocked them.
   * Made sure that only bitvectors were stored in the BV const let-map
   * Prevented true/false from being bit-blasted by the eager bitblaster

Also:
   * uncommented "no-check-proofs" from relevant tests

* Option handler logic for BV proofs

BV eager proofs only work when minisat is the sat solver being used by
the BV theory.

Added logic to the --proof hanlder to  verify this or throw an option
exception.

* Bugfix for proof options handler

I forgot that proofEnabledBuild runs even if the --proof option is
negated. In my handler I now check that proofs are enabled.

* Clang-format

5 years agoFix use-after-free due to destruction order (#2739)
Andres Noetzli [Thu, 6 Dec 2018 23:23:00 +0000 (15:23 -0800)]
Fix use-after-free due to destruction order (#2739)

A test for PR #2737 was failing even though the PR only added dead code.
This PR fixes the issue by fixing two use-after-free bugs:

- `ResolutionBitVectorProof` has a `Context` and a
`std::unique_ptr<BVSatProof>` member. The `BVSatProof` depends on the
`Context` and tries to access it (indirectly) in its constructor but
because the context was declared after the proof, the context was
destroyed before the proof, leading to a use-after-free in a method
called from the proof's destructor. This commit reorders the two
members.
- `TLazyBitblaster` was destroyed before the `LFSCCnfProof` in
`BitVectorProof` because `SmtEngine`'s destructor first destroyed the
theory engine and then the proof manager. This lead to a use-after-free
because `LFSCCnfProof` was using the `d_nullContext` of
`TLazyBitblaster`, which got indirectly accessed in `LFSCCnfProof`'s
destructor. This commit moves the destruction of `ProofManager` above
the destruction of the theory engine.

The issues were likely introduced by #2599. They went undetected because
our nightlies' ASAN check does not use proofs due to known memory leaks
in the proof module of CVC4.

I have tested this PR up to regression level 2 with ASAN with leak
detection disabled.

5 years ago Take into account minimality and types for cached PBE solutions (#2738)
Andrew Reynolds [Thu, 6 Dec 2018 16:38:05 +0000 (10:38 -0600)]
 Take into account minimality and types for cached PBE solutions (#2738)

5 years agoApply extended rewriting on PBE static symmetry breaking. (#2735)
Andrew Reynolds [Tue, 4 Dec 2018 22:04:47 +0000 (16:04 -0600)]
Apply extended rewriting on PBE static symmetry breaking. (#2735)

5 years agoEnable regular expression elimination by default. (#2736)
Andrew Reynolds [Tue, 4 Dec 2018 19:52:17 +0000 (13:52 -0600)]
Enable regular expression elimination by default. (#2736)

Seems to have no impact on Norn, and is helpful for a number of applications.

5 years ago Skip non-cardinality types in sets min card inference (#2734)
Andrew Reynolds [Mon, 3 Dec 2018 23:00:58 +0000 (17:00 -0600)]
 Skip non-cardinality types in sets min card inference (#2734)

5 years agoBit vector proof superclass (#2599)
Alex Ozdemir [Mon, 3 Dec 2018 19:56:47 +0000 (11:56 -0800)]
Bit vector proof superclass (#2599)

* Split BitvectorProof into a sub/superclass

The superclass contains general printing knowledge.

The subclass contains CNF or Resolution-specific knowledge.

* Renames & code moves

* Nits cleaned in prep for PR

* Moved CNF-proof from ResolutionBitVectorProof to BitVectorProof

Since DRAT BV proofs will also contain a CNF-proof, the CNF proof should
be stored in `BitVectorProof`.

* Unique pointers, comments, and code movement.

Adjusted the distribution of code between BVP and RBVP.
  Notably, put the CNF proof in BVP because it isn't
  resolution-specific.
Added comments to the headers of both files -- mostly BVP.
Changed two owned pointers into unique_ptr.
  BVP's pointer to a CNF proof
  RBVP's pointer to a resolution proof

BVP: `BitVectorProof`
RBVP: `ResolutionBitVectorProof`

* clang-format

* Undo manual copyright modification

* s/superclass/base class/

Co-Authored-By: alex-ozdemir <aozdemir@hmc.edu>
* make LFSCBitVectorProof::printOwnedSort public

* Andres's Comments

Mostly cleaning up (or trying to clean up) includes.

* Cleaned up one header cycle

However, this only allowed me to move the forward-decl, not eliminate
it, because there were actually two underlying include cycles that the
forward-decl solved.

* Added single _s to header gaurds

* Fix Class name in debug output

Credits to Andres

Co-Authored-By: alex-ozdemir <aozdemir@hmc.edu>
* Reordered methods in BitVectorProof per original  ordering

5 years agoOptimizations for PBE strings (#2728)
Andrew Reynolds [Sun, 2 Dec 2018 14:49:17 +0000 (08:49 -0600)]
Optimizations for PBE strings (#2728)

5 years ago Infrastructure for sygus side conditions (#2729)
Andrew Reynolds [Thu, 29 Nov 2018 18:09:19 +0000 (12:09 -0600)]
 Infrastructure for sygus side conditions (#2729)

5 years agoCombine sygus stream with PBE (#2726)
Andrew Reynolds [Thu, 29 Nov 2018 06:17:14 +0000 (00:17 -0600)]
Combine sygus stream with PBE (#2726)

5 years agoImprove interface for sygus grammar cons (#2727)
Andrew Reynolds [Wed, 28 Nov 2018 23:57:18 +0000 (17:57 -0600)]
Improve interface for sygus grammar cons (#2727)

5 years agoInformation gain heuristic for PBE (#2719)
Andrew Reynolds [Wed, 28 Nov 2018 21:49:56 +0000 (15:49 -0600)]
Information gain heuristic for PBE (#2719)

5 years agoOptimize re-elim for re.allchar components (#2725)
Andrew Reynolds [Wed, 28 Nov 2018 20:58:33 +0000 (14:58 -0600)]
Optimize re-elim for re.allchar components (#2725)

5 years agoImprove skolem caching by normalizing skolem args (#2723)
Andres Noetzli [Wed, 28 Nov 2018 20:33:55 +0000 (12:33 -0800)]
Improve skolem caching by normalizing skolem args (#2723)

In certain cases, we can share skolems between similar reductions, e.g.
`(str.replace x y z)` and `(str.replace (str.substr x 0 n) y z)` because the
first occurrence of `y` in `x` has to be the first occurrence
of `y` in `(str.substr x 0 n)` (assuming that `y` appears in both, otherwise the value of
the skolems does not matter). This commit adds a helper function in the
skolem cache that does some of those simplifications.

5 years agoGeneralize sygus stream solution filtering to logical strength (#2697)
Andrew Reynolds [Wed, 28 Nov 2018 17:06:32 +0000 (11:06 -0600)]
Generalize sygus stream solution filtering to logical strength (#2697)

5 years agoImprove cegqi engine trace. (#2714)
Andrew Reynolds [Wed, 28 Nov 2018 01:27:57 +0000 (19:27 -0600)]
Improve cegqi engine trace. (#2714)

5 years agoMake (T)NodeTrie a general utility (#2489)
Andrew Reynolds [Tue, 27 Nov 2018 21:39:13 +0000 (15:39 -0600)]
Make (T)NodeTrie a general utility (#2489)

This moves quantifiers::TermArgTrie in src/theory/quantifiers/term_database to (T)NodeTrie in src/expr, and cleans up all references to it.

5 years agoFix coverity warnings in datatypes (#2553)
Andrew Reynolds [Tue, 27 Nov 2018 21:19:32 +0000 (15:19 -0600)]
Fix coverity warnings in datatypes (#2553)

This caches some information regarding tester applications and changes int -> size_t in a few places.

5 years agoLazy model construction in TheoryEngine (#2633)
Andrew Reynolds [Tue, 27 Nov 2018 16:56:27 +0000 (10:56 -0600)]
Lazy model construction in TheoryEngine (#2633)

5 years agoReduce lookahead when parsing string literals (#2721)
Andres Noetzli [Tue, 27 Nov 2018 16:10:36 +0000 (08:10 -0800)]
Reduce lookahead when parsing string literals (#2721)

5 years agoLRA proof signature fixes and a first proof for linear polynomials (#2713)
Alex Ozdemir [Tue, 27 Nov 2018 08:59:22 +0000 (00:59 -0800)]
LRA proof signature fixes and a first proof for linear polynomials (#2713)

* LRA proof signature fixes and a first proof

The existing LRA signature had a few problems (e.g. referencing symbols
that didn't exist, extra parentheses, etc). I patched it up and wrote an
first example LRA proof. load `th_lra_test.plf` last to run that test.

* Add dependency info to signatures

I chose to indicate shallow dependencies only.

5 years agoUse https for antlr3.org downloads (#2701)
Tom Smeding [Fri, 23 Nov 2018 07:31:21 +0000 (08:31 +0100)]
Use https for antlr3.org downloads (#2701)

This commit changes the two www,antlr3.org URL's in contrib/get-antlr-3.4 to use https instead of http, which is more secure.

5 years agoMove ss-combine rewrite to extended rewriter (#2703)
Andres Noetzli [Thu, 22 Nov 2018 01:44:50 +0000 (17:44 -0800)]
Move ss-combine rewrite to extended rewriter (#2703)

We found that the `ss-combine` rewrite hurts solving performance, so
this commit is moving it to the extended rewriter.

5 years agoAdd rewrite for (str.substr s x y) --> "" (#2695)
Andres Noetzli [Thu, 22 Nov 2018 00:47:57 +0000 (16:47 -0800)]
Add rewrite for (str.substr s x y) --> "" (#2695)

This commit adds the rewrite `(str.substr s x y) --> "" if x >= 0 |= 0
>= str.len(s)`.

5 years agoCache evaluations for PBE (#2699)
Andrew Reynolds [Wed, 21 Nov 2018 23:07:17 +0000 (17:07 -0600)]
Cache evaluations for PBE (#2699)

5 years agoQuickly recognize when PBE conjectures are infeasible (#2718)
Andrew Reynolds [Wed, 21 Nov 2018 22:24:16 +0000 (16:24 -0600)]
Quickly recognize when PBE conjectures are infeasible (#2718)

Recognizes when the conjecture has conflicting I/O pairs. Also includes a minor change to the default behavior of PBE.

This change broke a delicate regression array_search_2, which I fixed by adding some additional options to make it more robust.

After this PR, we immediately find 4/7 unsolved in PBE strings of sygusComp 2018 to be infeasible.

5 years agoObvious rewrites to floating-point < and <=. (#2706)
Martin [Wed, 21 Nov 2018 21:59:51 +0000 (21:59 +0000)]
Obvious rewrites to floating-point < and <=. (#2706)

5 years agoSupport string replace all (#2704)
Andrew Reynolds [Wed, 21 Nov 2018 20:44:44 +0000 (14:44 -0600)]
Support string replace all (#2704)

5 years ago Fix type enumerator for FP (#2717)
Andrew Reynolds [Wed, 21 Nov 2018 14:59:51 +0000 (08:59 -0600)]
 Fix type enumerator for FP (#2717)

5 years agoFix real2int regression. (#2716)
Andrew Reynolds [Tue, 20 Nov 2018 16:48:41 +0000 (10:48 -0600)]
Fix real2int regression. (#2716)

5 years agoChange lemma proof step storage & iterators (#2712)
Alex Ozdemir [Tue, 20 Nov 2018 05:46:29 +0000 (21:46 -0800)]
Change lemma proof step storage & iterators (#2712)

Proof steps were in a std::list, which is a linked list, but really, we
only needed a stack, so I changed it to a vector, because LL's are
usually slower.

Also added an iterator for the proof steps, and << implementations

5 years ago Clausify context-dependent simplifications in ext theory (#2711)
Andrew Reynolds [Tue, 20 Nov 2018 01:18:38 +0000 (19:18 -0600)]
 Clausify context-dependent simplifications in ext theory (#2711)

5 years agoFix E-matching for case where candidate generator is not properly initialized (#2708)
Andrew Reynolds [Mon, 19 Nov 2018 23:29:44 +0000 (17:29 -0600)]
Fix E-matching for case where candidate generator is not properly initialized (#2708)

5 years ago Expand definitions prior to model core computation (#2707)
Andrew Reynolds [Thu, 15 Nov 2018 22:40:37 +0000 (16:40 -0600)]
 Expand definitions prior to model core computation (#2707)

5 years agocmake: Require boost 1.50.0 for examples. (#2710)
Mathias Preiner [Wed, 14 Nov 2018 19:48:49 +0000 (11:48 -0800)]
cmake: Require boost 1.50.0 for examples. (#2710)

5 years agocmake: Add option to explicitely enable/disable static binaries. (#2698)
Mathias Preiner [Thu, 8 Nov 2018 19:10:16 +0000 (11:10 -0800)]
cmake: Add option to explicitely enable/disable static binaries. (#2698)

5 years agoEvaluator: add support for str.code (#2696)
Andres Noetzli [Thu, 8 Nov 2018 01:04:52 +0000 (17:04 -0800)]
Evaluator: add support for str.code (#2696)

5 years agoAdding default SyGuS grammar construction for arrays (#2685)
Haniel Barbosa [Wed, 7 Nov 2018 23:12:38 +0000 (17:12 -0600)]
Adding default SyGuS grammar construction for arrays (#2685)

5 years agoFix collectEmptyEqs in string rewriter (#2692)
Andres Noetzli [Wed, 7 Nov 2018 18:28:25 +0000 (10:28 -0800)]
Fix collectEmptyEqs in string rewriter (#2692)

5 years ago Fix for itos reduction (#2691)
Andrew Reynolds [Wed, 7 Nov 2018 16:52:51 +0000 (10:52 -0600)]
 Fix for itos reduction (#2691)

5 years agoIncorporate static PBE symmetry breaking lemmas into SygusEnumerator (#2690)
Andrew Reynolds [Tue, 6 Nov 2018 23:28:41 +0000 (17:28 -0600)]
Incorporate static PBE symmetry breaking lemmas into SygusEnumerator (#2690)

5 years agoChange default sygus enumeration mode to auto (#2689)
Andrew Reynolds [Mon, 5 Nov 2018 22:50:48 +0000 (16:50 -0600)]
Change default sygus enumeration mode to auto (#2689)

5 years agoFix coverity warnings in sygus enumerator (#2687)
Andrew Reynolds [Mon, 5 Nov 2018 22:16:31 +0000 (16:16 -0600)]
Fix coverity warnings in sygus enumerator (#2687)

5 years agoNew C++ API: Split unit tests. (#2688)
Aina Niemetz [Mon, 5 Nov 2018 17:43:29 +0000 (09:43 -0800)]
New C++ API: Split unit tests. (#2688)

5 years agoIncreasing coverage (#2683)
yoni206 [Mon, 5 Nov 2018 17:25:09 +0000 (09:25 -0800)]
Increasing coverage (#2683)

This PR adds/revises tests in order to increase coverage in some preprocessing passes and in proofs done with --fewer-preprocessing-holes flag.

5 years agoAPI: Fix assignment operators (#2680)
Andres Noetzli [Mon, 5 Nov 2018 17:01:03 +0000 (09:01 -0800)]
API: Fix assignment operators (#2680)

The assignment operators of `Term`, `OpTerm`, and `Sort` currently have
an issue. The operators dereference their `shared_ptr` member and assign
the corresponding member of the other object. This is problematic
because if we have for example two `Term`s pointing to the same `Expr`,
then the assignment changes both `Term`s even though we only assign to
one, which is not what we want (see the unit test in this commit for a
concrete example of the desired behavior). To fix the issue, the
assignment operator should just copy the pointer of the other object.
This happens to be the behavior of the default assignment operator, so
this commit simply removes the overloaded assignment operators.

Testing: I did `make check` with an ASAN build and no errors other than
the one fixed in #2607 were reported.

5 years agoconfigure.sh: Fix option parsing to match --help (#2611)
Andres Noetzli [Mon, 5 Nov 2018 16:42:21 +0000 (08:42 -0800)]
configure.sh: Fix option parsing to match --help (#2611)

5 years agoAllow partial models with optimized sygus enumeration (#2682)
Andrew Reynolds [Mon, 5 Nov 2018 15:25:33 +0000 (09:25 -0600)]
Allow partial models with optimized sygus enumeration (#2682)

5 years ago Implement option to turn off symmetry breaking for basic enumerators (#2686)
Andrew Reynolds [Mon, 5 Nov 2018 00:06:29 +0000 (18:06 -0600)]
 Implement option to turn off symmetry breaking for basic enumerators (#2686)

Improves the existing implementation for sygus-active-gen=basic.

5 years agoRefactor default grammars construction (#2681)
Haniel Barbosa [Sat, 3 Nov 2018 14:48:31 +0000 (09:48 -0500)]
Refactor default grammars construction (#2681)

5 years agofixes to regression docs (#2679)
yoni206 [Fri, 2 Nov 2018 02:06:06 +0000 (19:06 -0700)]
fixes to regression docs (#2679)

5 years agoAdd optimized sygus enumeration (#2677)
Andrew Reynolds [Wed, 31 Oct 2018 21:25:37 +0000 (16:25 -0500)]
Add optimized sygus enumeration (#2677)

5 years agoRecord assumption info in AssertionPipeline (#2678)
Andres Noetzli [Wed, 31 Oct 2018 14:23:09 +0000 (07:23 -0700)]
Record assumption info in AssertionPipeline (#2678)

5 years agoMinor improvement to sygus trace (#2675)
Andrew Reynolds [Wed, 24 Oct 2018 20:20:18 +0000 (15:20 -0500)]
Minor improvement to sygus trace (#2675)

5 years agoCMake: Set RPATH on installed binary (#2671)
Andres Noetzli [Wed, 24 Oct 2018 04:43:28 +0000 (21:43 -0700)]
CMake: Set RPATH on installed binary (#2671)

Currently, when installing CVC4 with a custom installation directory on
macOS, the resulting binary cannot be executed because the linker cannot
find the required libraries (e.g. our parser). This commit changes our
build system to use the `CMAKE_INSTALL_RPATH` variable to add the
installation directory to the RPATH list in the exectuable.

5 years agoDo not use lazy trie for sygus-rr-verify (#2668)
Andrew Reynolds [Tue, 23 Oct 2018 00:26:10 +0000 (19:26 -0500)]
Do not use lazy trie for sygus-rr-verify (#2668)

5 years agoFail for SWIG 3.0.8 (#2656)
makaimann [Mon, 22 Oct 2018 23:24:05 +0000 (16:24 -0700)]
Fail for SWIG 3.0.8 (#2656)

Ran into this bug when compiling with python3 bindings: https://github.com/swig/swig/issues/588

Instantiating any object crashes python. Since swig3.0.8 is currently the apt-get install for Ubuntu 16.04, I thought it'd be good to have a check for that. If python3 is preferred and the swig version is 3.0.8, it errors out and asks users to downgrade or upgrade SWIG.

5 years agoCMake: Set PORTFOLIO_BUILD when building pcvc4 (#2666)
Andres Noetzli [Mon, 22 Oct 2018 23:07:26 +0000 (16:07 -0700)]
CMake: Set PORTFOLIO_BUILD when building pcvc4 (#2666)

Back when we used Autotools, we set the PORTFOLIO_BUILD macro when
building pcvc4. Our CMake build system is currently not doing that, so
setting thread options when running pcvc4 results in an error message
saying that "thread options cannot be used with sequential CVC4."
This commit fixes that behavior by recompiling driver_unified.cpp with
different options for the cvc4 and the pcvc4 binary.

[0] https://github.com/CVC4/CVC4/blob/7de0540252b62080ee9f98617f5718cb1ae08579/src/main/Makefile.am#L36

5 years agoOnly build CryptoMiniSat library, no binary (#2657)
Andres Noetzli [Mon, 22 Oct 2018 22:16:00 +0000 (15:16 -0700)]
Only build CryptoMiniSat library, no binary (#2657)

This commit changes the contrib/get-cryptominisat script to only build
the CryptoMiniSat library instead of both the library and the binary.
The advantage of this is that we can compile a static version of the
CryptoMiniSat library without having a static version of glibc or
libstdc++ (this is fine as long as we do a shared library build of
CVC4). This is an issue on Fedora (tested on version 25) where the
contrib/get-cryptominisat script was failing when building the
CryptoMiniSat binary due to the static version of these libraries not
being available. Since we just want to build the library, the commit
also changes the script to not install CryptoMiniSat anymore and updates
the CMake find script to accomodate the new folder structure. Side note:
the folder structure generated after this commit is a bit more uniform
with, e.g. the CaDiCaL script: The source files are directly in the
cryptominisat5 folder, not in a subfolder.

5 years agoRecover from wrong use of get-info :reason-unknown (#2667)
Andres Noetzli [Mon, 22 Oct 2018 16:12:47 +0000 (09:12 -0700)]
Recover from wrong use of get-info :reason-unknown (#2667)

Fixes #2584. Currently, we are immediately terminating CVC4 if the user
issues a `(get-info :reason-unknown)` command if it didn't succeed a
`(check-sat)` call returning `unknown`. This commit changes the behavior
to return an `(error ...)` but continue executing afterwards. It turns
the `ModalException` thrown in this case into a
`RecoverableModalException` and adds a check in
`GetInfoCommand::invoke()` to turn it into a
`CommandRecoverableFailure`, which solves the issue.

5 years agoRemove antlr_undefines.h. (#2664)
Mathias Preiner [Sat, 20 Oct 2018 21:53:19 +0000 (14:53 -0700)]
Remove antlr_undefines.h. (#2664)

Is not required anymore since we don't use autotools anymore.

5 years agoAdd substr, contains and equality rewrites (#2665)
Andres Noetzli [Sat, 20 Oct 2018 14:20:12 +0000 (07:20 -0700)]
Add substr, contains and equality rewrites (#2665)

5 years agoDisable dumping test for non-dumping builds (#2662)
Andres Noetzli [Sat, 20 Oct 2018 14:02:16 +0000 (07:02 -0700)]
Disable dumping test for non-dumping builds (#2662)

5 years agoTravis: run examples and avoid building them twice (#2663)
Andres Noetzli [Sat, 20 Oct 2018 13:47:30 +0000 (06:47 -0700)]
Travis: run examples and avoid building them twice (#2663)

`make check` builds the examples but does not run them. This commit
changes our Travis script to run the examples after building them and
removes `makeExamples()` to avoid building them twice.

5 years agoBV rewrites (mined): Rule 35: ConcatPullUp with special const simplified. (#2647)
Aina Niemetz [Wed, 17 Oct 2018 21:26:32 +0000 (14:26 -0700)]
BV rewrites (mined): Rule 35: ConcatPullUp with special const simplified. (#2647)

Simplifications based on the special const is now delegated down, only
the concat is pulled up.

5 years agoBV rewrites (mined): Rule 35: ConcatPullUp (BITVECTOR_XOR) with special const. (...
Aina Niemetz [Wed, 17 Oct 2018 16:22:44 +0000 (09:22 -0700)]
BV rewrites (mined): Rule 35: ConcatPullUp (BITVECTOR_XOR) with special const. (#2647)

5 years agoSygus streaming non-implied predicates (#2660)
Andrew Reynolds [Sat, 20 Oct 2018 01:59:51 +0000 (20:59 -0500)]
Sygus streaming non-implied predicates (#2660)

5 years agoRemove autotools build system. (#2639)
Mathias Preiner [Fri, 19 Oct 2018 21:45:42 +0000 (14:45 -0700)]
Remove autotools build system. (#2639)

5 years agoFix util::Random for macOS builds (#2655)
Andres Noetzli [Fri, 19 Oct 2018 17:15:33 +0000 (10:15 -0700)]
Fix util::Random for macOS builds (#2655)

5 years agoAdd helper to detect length one string terms (#2654)
Andres Noetzli [Fri, 19 Oct 2018 15:14:22 +0000 (08:14 -0700)]
Add helper to detect length one string terms (#2654)

This commit introduces a helper function to detect string terms that
have exactly/at most length one. This is useful for a lot of rewrites
because strings of at most length one are guaranteed to not overlap
multiple components in a concatenation, which allows for more aggressive
rewriting.

This commit has been tested with --sygus-rr-synth-check for >1h on the
string term grammar.

5 years agoAdd OptionException handling during initialization (#2466)
Andres Noetzli [Fri, 19 Oct 2018 04:05:48 +0000 (21:05 -0700)]
Add OptionException handling during initialization (#2466)

The initial motivation for this commit was that dump with an invalid tag
was leading to a segfault. The reason for the segfault was as follows:

1. `api::Solver` creates an `ExprManager`, which is stored in a
`unique_ptr` as a class member
2. The `api::Solver` tries to create an SmtEngine instance
3. The `SmtEnginePrivate` constructor subscribes to events in the
NodeManager and starts registering option listeners
4. When the `SmtEnginePrivate` gets to registerSetDumpModeListener, it
registers and notifies the DumpModeListener which calls
Dump::setDumpFromString, which fails with an `OptionException` due to
the invalid tag
5. While propagating the exception through `api::Solver`, the
`ExprManager` is deleted but the non-existent `SmtEnginePrivate` is
still subscribed to its events and there are still option listeners
registered. This leads to a segfault because the NodeManager tries to
notify the `SmtEnginePrivate` about deleted nodes

This commit fixes the issue by catching the `OptionException` in
`SmtEnginePrivate`, unsubscribing the `SmtEnginePrivate` from the
NodeManager events and deleting its option listener registrations before
rethrowing the exception. In addition, it changes the
`Options::registerAndNotify()` method to immediately delete a
registration if notifying the registration resulted in an
``OptionException`` (otherwise only the `ListenerCollection` knows about
the registration and complains about it in its destructor).  Finally,
the commit adds a simple regression test for invalid dump tags.

5 years agocmake: Run regression level 2 for make check. (#2645)
Mathias Preiner [Fri, 19 Oct 2018 02:22:22 +0000 (19:22 -0700)]
cmake: Run regression level 2 for make check. (#2645)

5 years agoNon-implied mode for model cores (#2653)
Andrew Reynolds [Fri, 19 Oct 2018 00:37:11 +0000 (19:37 -0500)]
Non-implied mode for model cores (#2653)

5 years agoNon-contributing find replace rewrite (#2652)
Andrew Reynolds [Thu, 18 Oct 2018 17:51:42 +0000 (12:51 -0500)]
Non-contributing find replace rewrite (#2652)

5 years agoImprove reduction for str.to.int (#2636)
Andrew Reynolds [Thu, 18 Oct 2018 16:58:51 +0000 (11:58 -0500)]
Improve reduction for str.to.int (#2636)

5 years agoIntroducing internal commands for SyGuS commands (#2627)
Haniel Barbosa [Thu, 18 Oct 2018 15:07:18 +0000 (10:07 -0500)]
Introducing internal commands for SyGuS commands (#2627)

5 years agoConstant length regular expression elimination (#2646)
Andrew Reynolds [Thu, 18 Oct 2018 12:37:43 +0000 (07:37 -0500)]
Constant length regular expression elimination (#2646)

5 years ago Skip sygus-rr-synth-check regressions when ASAN on (#2651)
Andres Noetzli [Thu, 18 Oct 2018 05:24:02 +0000 (22:24 -0700)]
 Skip sygus-rr-synth-check regressions when ASAN on (#2651)

This commit disables three regressions when using an ASAN build. The
regressions are all leaking memory when invoking the subsolver (see
issue #2649). Debugging the issue will take a while but is not very
critical since this feature is currently only used by CVC4 developers
but it prevents our nightly builds from going through.

5 years agoShow if ASAN build in --show-config (#2650)
Andres Noetzli [Thu, 18 Oct 2018 04:21:00 +0000 (21:21 -0700)]
Show if ASAN build in --show-config (#2650)

This commit extends `--show-config` to show whether the current build is
an ASAN build or not. This is done by moving a detection that was
previously done for the unit tests into base/configuration_private.h.

In addition to being convenient, this allows us to easily exclude
regression tests from ASAN builds.

5 years agoSygus query generator (#2465)
Andrew Reynolds [Thu, 18 Oct 2018 03:09:45 +0000 (22:09 -0500)]
Sygus query generator (#2465)