summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-09-03Remove unused postsolve infrastructurermPostsolveAndres Noetzli
The theory property `postsolve` was not used by any of the theories. This commit removes the property and associated infrastructure.
2020-09-03Split lazy bit-vector solver from TheoryBV (#5009)Mathias Preiner
This commit separates the lazy bit-vector solver from TheoryBV, which is now a thin wrapper around a bit-vector solver d_internal . This will allow us to easily swap out the bit-vector solver in the future.
2020-09-03Add interfaces for making trust nodes in TheoryInferenceManager. (#5016)Andrew Reynolds
This gives theories a finer grained control over explained lemmas and conflicts. A theory may now use an inference manager to construct "explained" lemmas/conflicts e.g. via mkLemmaExp, subsequently do any theory-specific debugging or modification to that lemma before sending it via trustedLemma. This is required for the new strings inference manager on proof-new. This also adds a missing variant of conflicts for the proof equality engine. It also does a minor simplification of a previous variant for constructing conflicts from proof equality engine based on a proof step buffer.
2020-09-03Update sets inference manager to inherit from InferenceManagerBuffered (#5007)Andrew Reynolds
This updates the inference manager of sets to inherit from the standard base class InferenceManagerBuffered. It matches that base class almost exactly, with cosmetic changes. Notice that sets currently has a design issue: the state object sends lemmas and hence currently requires a pointer to the theory. This will be untangled in a future PR. This PR makes a few very minor changes to the behavior, including not to use the "preprocess" property for subtype lemmas.
2020-09-03Added a new rule to simplify (bvugt (bvurem T x) x) (#4993)Gereon Kremer
Motivated by #4936, this PR adds a new BV rewrite rule: (bvugt (bvurem T x) x) ==> (ite (= x 0) (bvugt T 0) false) Fixes #4936.
2020-09-03Minor cleanup of quantifiers engine (#4994)Andrew Reynolds
Eventually, QuanitifersEngine should not depend on TheoryEngine. This is a first step in this direction. It eliminates some uses of TheoryEngine and eliminates a unnecessary friend relationship between quantifiers::TermDb and TheoryEngine. Further refactoring will be done in future PRs.
2020-09-03Changing the handled operators in bv2int preprocessing pass (#4970)yoni206
Some of the bit-vector operators are directly translated to integers, while others are eliminated before the translation. This PR changes the set of operators that we eliminate (and as a consequence, also the set of operators that we handle directly): The only bit-wise operator that is translated is bvand. The rest are now eliminated. bvneg is now eliminated. The various division operators are still eliminated, but using different rewrite rules. zero-extend and sign-extend are now handled directly. shifting is changed to favor ITEs over non-linear multiplication.
2020-09-03Basic integration of arith::InferenceManager (#4999)Gereon Kremer
This PR adds a first basic integration of the arith::InferenceManager into the arithmetic theory and the nonlinear extension in particular. While the lemma collection mechanism (in the nonlinear extension) remains unchanged, the lemmas are ultimately not directly pushed to the output channel but instead added to the inference manager. Additionally, we no longer use the cache within the nonlinear extension but instead rely on the inference manager. This PR is based on #4960.
2020-09-03Make nonlinear extension (more) deterministic (#4996)Gereon Kremer
This PR tries to make the nonlinear extension more deterministic by keeping the order of input assertion (instead of taking them from a hash set). This makes the ordering somewhat more robust against varying node ids, which proved to be a problem for debugging... Also adds a few logging messages at interesting places.
2020-09-02Drop {INCLUDE,LIBRARY,RUNTIME}_INSTALL_DIR variables in CMakeLists.txt (#4979)FabianWolff
On Debian (for instance), libraries aren't installed into `/usr/lib/`, but into something like `/usr/lib/x86_64-linux-gnu/`. In particular, this means that setting the `LIBRARY_INSTALL_DIR` to `lib` in the top-level `CMakeLists.txt` file is wrong. Luckily, there is a simple solution: CMake provides [`CMAKE_INSTALL_LIBDIR`](https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html) for this very purpose, which has sensible defaults and can be set by the user. In particular, since `CMAKE_INSTALL_LIBDIR` is a standardized variable, tools like the ones used for building Debian packages can set it to what they want it to be, whereas using a custom variable like `LIBRARY_INSTALL_DIR` wouldn't work in this setting. Signed-off-by: Fabian Wolff <fabi.wolff@arcor.de>
2020-09-02Make ExtTheory independent of Theory (#5010)Andrew Reynolds
This makes it so that ExtTheory uses a generic callback instead of relying on Theory. The primary purpose of this commit is to eliminate the connection of TheoryBV and ExtTheory. This commit moves all things related to ExtTheory in BV into CoreSolver. It also refactors the use of ExtTheory in strings and arithmetic.
2020-09-02(proof-new) Support proofs of quantifier instantiation (#5001)Andrew Reynolds
This adds basic support for proofs of quantifier instantiation, which is the main method for sending lemmas from TheoryQuantifiers. Quantifier instantiation is also heavily used for solving extended string functions.
2020-09-02(proof-new) Improve debugging infrastructure for open proofs (#4984)Andrew Reynolds
This includes more versions of checking whether a proof node is closed and standardizing output.
2020-09-02Fix CryptoMiniSat build, regression (#5006)Andres Noetzli
This commit fixes builds that include CryptoMiniSat after commit 8ad308b removed them. It also fixes one of the regressions that requires unsat cores but was run when the build was configured without them.
2020-09-02[Python API] Add missing methods to Datatype/Term (#4998)Andres Noetzli
Fixes #4942. The Python API was missing some methods related to datatypes. Most importantly, it was missing mkDatatypeSorts, which meant that datatypes with unresolved placeholders could not be resolved. This commit adds missing methods and ports the corresponding tests of datatype_api_black.h to Python. The commit also adds support for __getitem__ in Term.
2020-09-02Remove #line directives from generated files. (#5005)Gereon Kremer
This PR removes any usage of the #line directive. We no longer consider it particularly useful, and it obstructs reproducible builds (see #4980). Fixes #4980.
2020-09-02(proof-new) Updates to builtin proof checker (#4962)Andrew Reynolds
This includes support for some trusted rules (whose use is to come). It also modifies THEORY_REWRITE so that it is a "trusted" rule, that is, it is not re-checked. The reason for this is that TheoryRewriter is not deterministic. An example of non-determinism in TheoryRewriter are rules that introduce bound variables (e.g. quantifiers rewriter) since these bound variables are fresh each time it is invoked. Non-deterministic theory rewriters cannot be rechecked, which was leading to failures on proof-new at proof check time. The other way to fix this would be to cache TheoryRewriter responses, but then the checker would only be verifying that the caching was being done properly. This is not worthwhile.
2020-09-02(proof-new) Add proof support in TheoryUF (#5002)Andrew Reynolds
This makes TheoryUF use a standard theory inference manager, which thus makes it proof producing when proof-new is enabled. This additionally cleans HoExtension so that it does not keep a backwards reference to TheoryUF and instead takes its inference manager. This additionally adds two rules for higher-order that are required to make its equality engine proofs correct. Co-authored-by: Haniel Barbosa <hanielbbarbosa@gmail.com>
2020-09-02Use SMT-COMP configuration for competition build (#4995)Andres Noetzli
This commit changes our `competition` build to include the libraries that we have used for SMT-COMP by default. This makes it easier for users to reproduce our SMT-COMP configuration for performance measurements. We are using GPL libraries for this build type, so the commit adds color to highlight the fact that this build type produces a GPL build.
2020-09-02(proof-new) Make term conversion proof generator optionally term-context ↵Andrew Reynolds
sensitive (#4972) This will be used by TermFormulaRemoval.
2020-09-02Migrating from using the 'glpk-cut-log' repo to using an official GPLK ↵Andrew V. Jones
release + a set of patches (#4775) This PR attempts to migrate from @timothy-king's repo for glpk-cut-log to using a set of patches against the official release that 'glpk-cut-log' was based off of (4.52). This is in preparation of trying to rework these patches to be against the latest GPLK release (4.65). If we can do this, then it makes it easier for CVC4's dependancy on GPLK to be able to follow upstream (rather than being stuck on a release that is 6.5 years old!). I have added GPLK as an option for CI, but I do not know if we actually want this. My concern with adding this to CI is that we're then not testing non-GPL builds, which doesn't seem ideal. However, before starting to rework the patches to be against 4.65, I want to make sure that things are actually working/stable against 4.52; so having at least one CI target that does use GPLK would be great. Signed-off-by: Andrew V. Jones andrew.jones@vector.com
2020-09-02Introduce an internal version of Commands. (#4988)Abdalrhman Mohamed
This PR is a step towards the migration of Commands to the public API. Node versions of some Commands are introduced for internal use (as necessary). The DumpManager is refactored to make use of those commands.
2020-09-02Minor updates to theory inference manager (#5004)Andrew Reynolds
These updates are inspired by the current inference manager for sets.
2020-09-02(new theory) Update TheoryArrays to the new standard (#5000)Andrew Reynolds
This includes using the standard d_conflict flag in TheoryState and splitting its check into 3 callbacks. It also deletes some unused code and eliminates an assertion (line 791 of theory_arrays.cpp) which doesn't hold in a central architecture. Further work on standardization for arrays will add an InferenceManager to guard its uses of asserting facts to equality engine (both for proofs and configurable theory combination). FYI @barrettcw
2020-09-02Use std::unique_ptr instead of std::shared_ptr for inference manager (#5003)Gereon Kremer
We now use std::unique_ptr instead of std::shared_ptr when storing TheoryInference objects.
2020-09-02Add ArithLemma and arith::InferenceManager (#4960)Gereon Kremer
This PR adds a new ArithLemma that is essentiall NlLemma, but derived from the new theory::Lemma and meant to be used all across the arithmetic theory. Also, based on theory::InferenceManagerBuffered this PR adds arith::InferenceManager that shall become the sole interface between the arithmetic theory and the OutputChannel.
2020-09-02(new theory) Update TheorySets to the new interface (#4951)Andrew Reynolds
This updates the theory of sets to the new interface (see #4929).
2020-09-01[API] Fix Python Examples (#4943)Andres Noetzli
When testing the API examples, Python examples were not included. This commit changes that and fixes multiple minor issues that came up once the tests were enabled: - It adds `Solver::supportsFloatingPoint()` as an API method that returns whether CVC4 is configured to support floating-point numbers or not (this is useful for failing gracefully when floating-point support is not available, e.g. in the case of our floating-point example). - It updates the `expections.py` example to use the new API. - It fixes the `sygus-fun.py` example. The example was passing a _set_ of non-terminals to `Solver::mkSygusGrammar()` but the order in which the non-terminals are passed in matters because the first non-terminal is considered to be the starting terminal. The commit also updates the documentation of that function. - It fixes the Python API for datatypes. The `__getitem__` function had a typo and the `datatypes.py` example was crashing as a result.
2020-09-01Removes old proof code (#4964)Haniel Barbosa
This deletes much of the old proof code. Basically everything but the minimal necessary infra-structure for producing unsat cores. That includes dependency tracking in preprocessing, the prop engine proof and the unsat core computation code in the old proof manager. These should also go once we fully integrate into master the new proof infrastructure. It also cleans interfaces that were using old-proof-code-specific constructs (such as LemmaProofRecipe). When possible or when it made sense standalone local proof production code was kept, but deactivated (such is in the equality engine and in the arithmetic solver).
2020-09-01 (new theory) Update TheoryDatatypes to the new standard (#4986)Andrew Reynolds
Updates it to use the new inference manager as well as updating its check to the standard callbacks.
2020-09-01Add TheoryInference base class (#4990)Andrew Reynolds
This introduces a TheoryInference base class, which is a generalization and cleaner version of the former Lemma object. This changes the name of Lemma -> SimpleTheoryLemma, and makes the callback responsible for calling the inference manager. This PR also updates the datatypes inference manager to use the new style. This required adding some additional interfaces to TheoryInferenceManager.
2020-09-01CMS: Update to version 5.8.0. (#4991)Aina Niemetz
2020-09-01Add arithmetic-specific, runtime, proof-macros. (#4992)Alex Ozdemir
We'll use this to gate farkas-coefficient machinery after we remove the old proof-macros. I've changed the macros slightly from the proof-new branch: I removed the dependence on options::proof() (no longer wanted) and options::unsatCores() (I had copied this from the original proof macros, but it's not needed either, since we're in a theory).
2020-08-31'fix-install-headers.sh' should respect DESTDIR environment variable (#4978)FabianWolff
When using CMake with Unix Makefiles, one can invoke `make install` as ``` make install DESTDIR=/a/b/c ``` so that the files will be installed into `$DESTDIR$CMAKE_INSTALL_PREFIX` (see the [documentation](https://cmake.org/cmake/help/latest/envvar/DESTDIR.html) for details). This currently doesn't work with the `fix-install-headers.sh` script: ``` [...] -- Installing: /<<PKGBUILDDIR>>/debian/tmp/usr/include/cvc4/util/integer.h -- Installing: /<<PKGBUILDDIR>>/debian/tmp/usr/include/cvc4/util/rational.h find: ‘/usr/include/cvc4/’: No such file or directory ``` Here, `CMAKE_INSTALL_PREFIX` is `/usr` but `DESTDIR` is `/<<PKGBUILDDIR>>/debian/tmp/`. This commit makes the script consider `DESTDIR` (if it is not set, then `$DESTDIR` will be empty and nothing changes) to fix this issue. Signed-off-by: Fabian Wolff <fabi.wolff@arcor.de>
2020-08-31Add the inference manager for datatypes (#4968)Andrew Reynolds
This is in preparation for converting datatypes to the new standard. It adds a specialized version of inference manager buffered that datatypes uses. This required adding several utility methods to its base classes. A follow up PR will connect this to TheoryDatatypes.
2020-08-31Fix spelling errors (#4977)FabianWolff
Signed-off-by: Fabian Wolff <fabi.wolff@arcor.de>
2020-08-31(new theory) Update TheoryStrings to new standard (#4963)Andrew Reynolds
This updates theory of strings to the new standard. This makes strings use the standard template for check and collectModelInfo. It also updates its inference manager to the standard and makes use of assertFactInternal for processing internal facts. This now enables preNotifyFact and notifyFact to be defined in TheoryStrings instead of inside inference manager, which is clearer and eliminates some dependencies within inference manager. Note that the inference manager of strings for now inherits from TheoryInferenceManager. Further standardization will make it inherit from the new InferenceManagerBuffered class. This design will be merged into proof-new, which also has significant changes to strings inference manager.
2020-08-31Fix --ackermann in the presence on syntactically different but possibly ↵Gereon Kremer
equal selects (#4981) The implementation of --ackermann mishandled selects in a subtle way: If select is applied to two syntactically different arrays (that may be semantically equal), the ackermann preprocessing failed to generate the "all arguments equal implies terms equal" lemmas. The problem is that we used the first argument (that is: the array) as lookup to identify terms that need to be considered for these lemmas. Instead we now use their operator (select) just like for uninterpreted function applications. Fixes #4957 . Also adds a regression.
2020-08-31Simplify interface for computing relevant terms. (#4966)Andrew Reynolds
This is a followup to #4945 which simplifies the contract for computeRelevantTerms.
2020-08-31[CI] Fix Cython installation (#4983)Andres Noetzli
Cython has been causing issues recently, see e.g. https://github.com/CVC4/CVC4/pull/4982/checks?check_run_id=1052433862. It looks like the issue is that globally installed packages can't be found by Python (maybe the global site-package directories changed/are not included in the search paths anymore?). This commit changes the installation of Cython to install it locally to the user instead of globally. It also adds `bin` in the user base directory to `PATH` s.t. CMake is able to find the `cython` binary.
2020-08-31Basic proof support in inference manager (#4975)Andrew Reynolds
This adds basic support for asserting internal facts with proofs in the inference manager class. The purpose of this PR is twofold: (1) From the point of view of proofs, this PR standardizes the management of proof equality engine within inference manager. Theories no longer have to manually construct proof equality engines, and instead are recommended to create inference managers. (2) From the point of view of the new approach to theory combination, this PR ensures standard theory callbacks (preNotifyFact / notifyFact) are used for internal facts, regardless of whether proofs are enabled. This will simplify several of the current (unmerged) changes for proof production in theory solvers on proof-new. Notice this PR adds the utility method NodeManager::mkAnd, which is arguably long overdue. Also notice this code is not yet active, but will be used on proof-new after this PR is merged.
2020-08-28(proof-new) More term context utilities. (#4912)Andrew Reynolds
These utilities will be used for making some of the core proof utilities term-context-sensitve.
2020-08-28New C++ API: Add REGEXP_{REPEAT,LOOP}_OP handling in getIndices. (#4969)Mathias Preiner
2020-08-28Replace Theory::Set with TheoryIdSet (#4959)Andrew Reynolds
This makes it so that equality_engine.h does not include theory.h. This is a bad dependency since Theory contains EqualityEngine. This dependency between equality engine and theory was due to the use of a helper (Theory::Set) for representing sets of theories that is inlined into Theory. This PR moves this definition and utilities to theory_id.h. It fixes the resulting include dependencies which are broken by changing the include theory.h -> theory_id.h in equality_engine.h. This avoids a circular dependency in the includes between Theory -> InferenceManager -> ProofEqualityEngine -> EqualityEngine -> Theory.
2020-08-28Incremental support for bv_to_int (#4967)yoni206
This PR adds support for incremental solving in bv_to_int. This amounts to: using context dependent data structures adding a test In addition, we check for parametrized operations in a more robust way (using kind::metakind::PARAMETERIZED) and rename some tests for convenience.
2020-08-28(proof-new) Make CombinationEngine proof producing (#4955)Andrew Reynolds
Makes combination engine proof producing (for Boolean splits). Followup PRs will start to add proof production in TheoryEngine.
2020-08-28(new theory) Update TheoryQuantifiers to the new interface (#4950)Andrew Reynolds
TheoryQuantifiers is a theory that passes quantified formulas to QuantifiersEngine. This updates it to the new check template (see #4929). Also does some minor cleanup in the cpp file.
2020-08-28(proof-new) Add the SMT proof post processor (#4913)Andrew Reynolds
This PR adds the proof post-processor, which is the final authority on putting together the overall proof. It additionally implements lazy pedantic failures and statistics. This PR also corrects a subtle bug in the elimination of SUBS which requires a TRUE_INTRO/FALSE_INTRO in certain cases.
2020-08-28(new theory) Update TheoryFP to the new interface (#4953)Andrew Reynolds
This updates the theory of floating points to the new interface (see #4929). Notice that TheoryFP was not adding trigger terms to its equality engine (which should be done during notifySharedTerm), and thus was not propagating equalities between shared terms in combined theories. This PR updates its notifySharedTerm method to the default one. FYI @martin-cs
2020-08-28(cad-solver) Fixed excluding lemma generation. (#4958)Gereon Kremer
The lemma generation for partial cad checks had a number of issues that have been fixed in this PR. The previous version had both soundness issues and a very naive approach to handling algebraic numbers. This new version is sound (fingers crossed) and allows to construct more precise, but also more complex lemmas. To avoid constructing very large lemmas, a (somewhat arbitrary) limit based on the size of coefficients was added.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback