Mathias Preiner [Wed, 4 Aug 2021 19:38:24 +0000 (12:38 -0700)]
syqi: Add debug information for dumping instantiations. (#6978)
Adds the datatype values as debug information for dumping instantiations produced by --sygus-inst.
Andrew Reynolds [Wed, 4 Aug 2021 19:19:51 +0000 (14:19 -0500)]
Add optional debug information for dumping instantiations (#6950)
This complete the implementation of dump-instantiations-debug.
With this option, we can print the source of instantiations. For example:
$ cvc5 regress1/quantifiers/dump-inst-proof.smt2 --dump-instantiations-debug --produce-proofs
unsat
(instantiations (forall ((x Int)) (or (P x) (Q x)))
(! ( 2 ) :source QUANTIFIERS_INST_E_MATCHING_SIMPLE ((not (= (P x) true))))
)
(instantiations (forall ((x Int)) (or (not (S x)) (not (Q x))))
(! ( 2 ) :source QUANTIFIERS_INST_E_MATCHING_SIMPLE ((not (= (S x) false))))
)
Aina Niemetz [Wed, 4 Aug 2021 19:01:08 +0000 (12:01 -0700)]
Update bug_report.md
Andrew Reynolds [Wed, 4 Aug 2021 18:58:14 +0000 (13:58 -0500)]
Add containsAssumption proof utility (#6953)
Work towards making our policy for subproof merging safer.
Gereon Kremer [Wed, 4 Aug 2021 18:35:41 +0000 (11:35 -0700)]
Refactor managed streams (#6934)
This PR introduces a new ManagedStream class that replaces the previous ManagedOstream. It allows to directly store the (wrapped) stream objects in the options. Handling the stream options is moved from the options manager to option predicates and the different options for input and output streams are combined into a single one.
Some associated utilities (open_ostream.h and update_ostream.h) are now obsolete and thus removed.
Gereon Kremer [Wed, 4 Aug 2021 18:17:42 +0000 (11:17 -0700)]
Add API function to get list of option names (#6971)
This PR adds a new API function api::Solver::getOptionNames() that exposes a list of all option names as strings. This PR will be followed by another that adds a method to further inspect a particular option by name, and thereby allows to inspect the solver options in a sensible way.
Gereon Kremer [Wed, 4 Aug 2021 17:49:26 +0000 (10:49 -0700)]
Replace numeric predicates by explicit minimum and maximum (#6976)
This PR replaces some option predicates by explicit minimum and maximum values. This allows us to export information about an options domain/range in the future.
Andrew Reynolds [Wed, 4 Aug 2021 16:32:48 +0000 (11:32 -0500)]
Add missing inference identifiers (#6962)
The only remaining unknown inferences covered by our regressions are from the sygus solver, will address in later PR.
Haniel Barbosa [Wed, 4 Aug 2021 15:28:12 +0000 (12:28 -0300)]
[proof] Add getProof to API and use it in GetProofCommand (#6974)
Also adds a call to get proof in a unit test.
Alex Ozdemir [Wed, 4 Aug 2021 01:41:04 +0000 (18:41 -0700)]
Add IEEE-BV-to-FP to external-to-internal mapping in C++ API (#6951)
Without this, you can't make terms with that kind.
Andrew Reynolds [Wed, 4 Aug 2021 01:15:43 +0000 (20:15 -0500)]
Remove dependencies on smt engine in smt solver (#6965)
This is work towards eliminating circular dependencies on SmtEngine.
This simplifies several interfaces and makes it so that SmtSolver does not take a pointer to its parent SmtEngine.
It is also work towards eliminating the output manager, which is now subsumed by Env.
Gereon Kremer [Tue, 3 Aug 2021 21:44:35 +0000 (14:44 -0700)]
Use int64_t, uint64_t or double for all numeric options. (#6970)
This PR further simplifies the option setup by only using int64_t or uint64_t for integer options.
Andrew Reynolds [Tue, 3 Aug 2021 16:50:51 +0000 (11:50 -0500)]
Refactor shared solver to use theory builtin inference manager (#6960)
This ensures that e.g. COMBINATION_SPLIT shows up under theory::builtin::inferencesLemmas, and -t im. It also removes outdated interfaces from OutputChannel, and makes the feature TheoryEngine::ensureLemmaAtoms more modular, which was required for making these interfaces more consistent.
It also ensures that TheoryBuiltin has an inference manager, which will simplify special casing in #6956.
Andrew Reynolds [Tue, 3 Aug 2021 01:21:04 +0000 (20:21 -0500)]
Remove "inUnsatCore" flag throughout (#6964)
The internal solver no longer cares about what assertions are named / are in the unsat core.
This simplifies the code so that the (now unused) `inUnsatCore` flag is removed from all interfaces.
This eliminates another external use of `getSmtEngine`.
Gereon Kremer [Tue, 3 Aug 2021 00:05:54 +0000 (17:05 -0700)]
Properly honor --stats-all and --stats-expert when printing statistics (#6967)
This PR fixes an issue that was introduced with
fda4613 where printing the statistics would only show non-defaulted and non-expert options.
Aina Niemetz [Mon, 2 Aug 2021 23:28:53 +0000 (16:28 -0700)]
Add 'REQUIRES: poly' to regression. (#6966)
This regression times out without libpoly.
Mathias Preiner [Mon, 2 Aug 2021 21:33:34 +0000 (14:33 -0700)]
bv: Enable equality engine for bitblast-internal. (#6961)
Gereon Kremer [Sat, 31 Jul 2021 01:21:36 +0000 (18:21 -0700)]
Perform statistics printing via the API (#6952)
This PR changes how the command executor prints the statistics by moving stuff around a bit, eventually using only proper API methods of api::Solver. This PR also removes the smt_engine.h include from command_executor.cpp.
Gereon Kremer [Fri, 30 Jul 2021 17:23:44 +0000 (10:23 -0700)]
Allow changing certain options while solving (#6945)
This PR allows changing some select options ever after the smt engine has been fully initialized, following the SMT-LIB standard (section 4.1.7).
Andrew Reynolds [Fri, 30 Jul 2021 17:13:07 +0000 (12:13 -0500)]
Simplify smt2 printer (#6954)
The common case of printing function applications is to print the kind in smt2 format, this makes this the default case and removes spurious cases. It also makes a few minor fixes.
Gereon Kremer [Thu, 29 Jul 2021 19:40:00 +0000 (12:40 -0700)]
Integrate installation instructions into documentation (#6814)
This PR migrates the current INSTALL.md to an rst file and then includes it in the documentation. It also does some minor improvements to this file, in particular it now mentions --dep-path
Aina Niemetz [Thu, 29 Jul 2021 17:45:25 +0000 (10:45 -0700)]
quickstart: Add python example to docs. (#6949)
Haniel Barbosa [Thu, 29 Jul 2021 17:22:10 +0000 (14:22 -0300)]
[proofs] Set BV solver to better proof-producing one when proofs on (#6903)
Since the internal bitblaster can be way slower, the regressions that would have slow runs when --check-proofs is passed now have the command line that forces the use of the default bitblaster.
yoni206 [Thu, 29 Jul 2021 16:43:30 +0000 (09:43 -0700)]
Python quick start example (#6939)
This is a translation of quickstart.cpp to python.
Andrew Reynolds [Thu, 29 Jul 2021 16:11:05 +0000 (11:11 -0500)]
Integrate central equality engine approach into theory engine, add option and regressions (#6943)
This commit makes TheoryEngine take into account whether theories are using the central equality engine.
With this commit, the central equality engine can now be optionally enabled via `--ee-mode=central`.
Andrew Reynolds [Thu, 29 Jul 2021 15:53:48 +0000 (10:53 -0500)]
Minor updates to shared terms database for central equality engine (#6929)
Includes proper set up of the proof equality engine it uses (which may be shared over multiple theories). Also makes its assertEquality method robust to non-equality atoms.
makaimann [Wed, 28 Jul 2021 22:13:43 +0000 (18:13 -0400)]
Fixes for building python wheels on manylinux2014 (#6947)
This PR makes several fixes to the wheel building infrastructure for manylinux2014.
don't statically link to Python (see: this section of PEP-513)
use standard 'build' directory. I noticed that the wheel infrastructure uses directory 'build' to prepare the wheel anyway, so it doesn't make a lot of sense for us to use a separate working directory. I tried changing the name of the build directory in setuptools by setting member variables in initialize_options but that didn't seem to work and I decided it wasn't worth the effort. The wheel should be built in a clean environment anyway, i.e., docker.
find the correct include directory and python library paths for building on manylinux2014 using skbuild. manylinux2014 has several versions of python installed in /opt/python. The CMake infrastructure can't find the necessary information (plus the libraries are deleted from the docker image to save space -- the library is just set to a generic libpython<version>.a). Instead, this PR would manually set them via CMake options.
to allow setting the python information, I extended the configure.sh script to allow directly setting CMake options. There are definitely other options here if you'd rather not change configure.sh. My reasoning was that it could be useful in other situations and I just marked it as an advanced feature. Another approach would be to use skbuild directly in the CMake infrastructure. I didn't like that solution because it would make the CMakeLists.txt more complicated and it wouldn't follow the standard CMake/Cython/Python approach which means we won't benefit from future improvements to that CMake infrastructure. Plus, this issue should only come up on systems with non-standard installations of Python, such as manylinux. This approach (setting CMake options) is basically what scikit-build does automatically if we had used that infrastructure directly.
Andrew Reynolds [Wed, 28 Jul 2021 21:50:08 +0000 (16:50 -0500)]
Minor changes to arrays in preparation for central equality engine (#6917)
Makes arrays more robust to the order in which terms can be added to the equality engine vs. when they are preregistered.
We should probably performance test this.
FYI @barrettcw
Gereon Kremer [Wed, 28 Jul 2021 21:41:22 +0000 (14:41 -0700)]
Only use libedit on tty inputs (#6946)
This PR improves the check when we use libedit: only when the input is an interactive terminal.
This is motivated by a change to the unit test for the interactive mode that now properly redirects standard input (and output).
Andres Noetzli [Wed, 28 Jul 2021 21:28:25 +0000 (14:28 -0700)]
Print link to docs preview (#6922)
This commit adds a message to the `docs` target with a link to a preview
of the documentation, e.g.:
```
Preview docs in browser: file://localhost/home/noetzli/repos/cvc5_win/build-docs/docs/sphinx/index.html
```
Andrew Reynolds [Wed, 28 Jul 2021 21:00:49 +0000 (16:00 -0500)]
Make extended rewriter methods const (#6948)
Mathias Preiner [Tue, 27 Jul 2021 20:23:32 +0000 (13:23 -0700)]
bv: Refactor getEqualityStatus and use for both bitblasting solvers. (#6933)
This commit refactors the getEqualityStatus handling for bitblast and bitblast-internal.
Mathias Preiner [Tue, 27 Jul 2021 19:39:53 +0000 (12:39 -0700)]
proof: Add eqrange expansion rule. (#6936)
Adds proof support for the eqrange operator.
Co-authored-by: Andrew Reynolds <andrew.j.reynolds@gmail.com>
Andrew Reynolds [Tue, 27 Jul 2021 17:24:17 +0000 (12:24 -0500)]
Track instantiation reasons in proofs (#6935)
This adds optional arguments to INSTANTIATE steps in proofs to track fine-grained reasons for relevant instantiations.
Also simplifies an old argument modEq which was unused.
FYI @MikolasJanota
Andrew Reynolds [Tue, 27 Jul 2021 15:30:31 +0000 (10:30 -0500)]
Add basic LFSC utilities (#6879)
Adds basic utilities in preparation for the LFSC proof conversion.
Depends on #6881, review that first.
Andrew Reynolds [Tue, 27 Jul 2021 14:51:02 +0000 (09:51 -0500)]
Move enum value generator to own file (#6941)
Work towards integrating the enumerator callback into the fast enumerator.
Andrew Reynolds [Tue, 27 Jul 2021 14:24:20 +0000 (09:24 -0500)]
Minor fix for term database + central equality engine (#6928)
Previously we provided a bogus (self) explanation in a rare case of setting up the term database for higher order. This is incompatible with cases where central equality engine = master equality engine.
Andrew Reynolds [Tue, 27 Jul 2021 14:06:33 +0000 (09:06 -0500)]
Revert change to regression (#6940)
Although it works on most machines, it times out in the nightly builds.
Andrew Reynolds [Tue, 27 Jul 2021 13:50:38 +0000 (08:50 -0500)]
Make all dependencies in the fast enumerator optional (#6918)
This allows one to use a fast enumerator without having access to sygus term database, statistics, etc.
Andrew Reynolds [Tue, 27 Jul 2021 13:33:23 +0000 (08:33 -0500)]
Add print expression utility (#6880)
This will be used in the LFSC printer. It may be of general use to other proof printers.
Andres Noetzli [Tue, 27 Jul 2021 11:57:02 +0000 (04:57 -0700)]
Add regression for fixed `str.indexof_re` issue (#6938)
Fixes #6639. The issue cannot be reproduced on current master and git bisect suggests that commit
adf497a
fixed the issue.
Andrew Reynolds [Tue, 27 Jul 2021 06:36:18 +0000 (01:36 -0500)]
Minor changes from proof-new (#6937)
Note the change to the unit test makes it so the test is not dependent on Node ID order.
Andrew Reynolds [Tue, 27 Jul 2021 01:52:15 +0000 (20:52 -0500)]
Miscellaneous fixes from proof-new (#6914)
Andrew Reynolds [Tue, 27 Jul 2021 01:31:21 +0000 (20:31 -0500)]
Add proof letify utility (#6881)
Towards support for external proof conversions.
Andrew Reynolds [Tue, 27 Jul 2021 01:21:20 +0000 (20:21 -0500)]
Fix eq proof conversion for constant merged parameterized ops (#6926)
This issue arises when using the central equality engine on several regressions.
Andrew Reynolds [Tue, 27 Jul 2021 00:48:03 +0000 (19:48 -0500)]
Default equality proofs for bags and separation logic (#6932)
This is the last 2 remaining theories not to use the default handling of equality proofs.
In preparation for proofs in central equality engine.
Andrew Reynolds [Tue, 27 Jul 2021 00:20:40 +0000 (19:20 -0500)]
Add sygus enumerator callback (#6923)
This class will make the uses of the fast enumerator customizable.
Gereon Kremer [Mon, 26 Jul 2021 23:42:20 +0000 (16:42 -0700)]
Move public options functions to separate file (#6671)
This PR moves the remaining special purpose functions out of the Options class. This set of functions is only used to implement API functions in the smt engine (getting and setting options by string), and by the main driver for parsing and printing usage information.
Andrew Reynolds [Mon, 26 Jul 2021 21:03:48 +0000 (16:03 -0500)]
Enable default equality proofs for sets (#6931)
This enables default support for equality proofs in the theory of sets.
This is in preparation for proofs in the central equality engine, which requires that all active theories that use the central equality engine at least support the default interaction with the equality engine.
Andrew Reynolds [Mon, 26 Jul 2021 18:26:55 +0000 (13:26 -0500)]
More updates to arithmetic in preparation for central equality engine (#6927)
Makes arithEqSolver more robust to propagations from multiple sources, changes the default relationship to congruence manager based on preliminary results on SMT-LIB.
Andrew Reynolds [Sun, 25 Jul 2021 16:04:00 +0000 (11:04 -0500)]
Changes to datatypes in preparation for central equality engine (#6901)
This adds changes from the centralEeDev branch for datatypes.
The changes in behavior are that the inference manager clears its pending inferences when the state is in conflict, and preCheck processes pending facts immediately (which may have been enqueued prior to the call to check via ee merges). These are required to make datatypes robust to the order in which check / merge / backtracks can occur.
Andrew Reynolds [Sun, 25 Jul 2021 14:54:28 +0000 (09:54 -0500)]
Refactor equality engine setup for arithmetic congruence manager (#6902)
Allows congruence manager to use its own (non-official) equality engine if both it and the arithmetic equality solver are enabled.
Andres Noetzli [Sat, 24 Jul 2021 00:06:51 +0000 (17:06 -0700)]
Fix CLN build (#6920)
Currently, the CLN `CONFIGURE_COMMAND` chains multiple commands using
`&&` but this does not seem to work with CMake 3.20.4 and CMake 3.19.7
and is also not the recommended way of doing it. The commit fixes the
issue by using additional `COMMAND`s and also switches to using the
CMake's `chdir` instead of `cd`.
Andres Noetzli [Fri, 23 Jul 2021 20:57:42 +0000 (13:57 -0700)]
Configuration: Indicate dependencies being built (#6921)
This commit changes the output of our configuration to show which
dependencies are being built as part of the cvc5 build. For example:
```
ABC : off
CryptoMiniSat : off
GLPK : off
Kissat : off
LibPoly : on (local)
CoCoALib : off
Build libcvc5 only : off
MP library : gmp (system)
Editline : off
```
Indicates that `LibPoly` was not found in the system and is thus built
as part of the cvc5 build and GMP was found in the system.
Andres Noetzli [Fri, 23 Jul 2021 20:47:16 +0000 (13:47 -0700)]
Fix CoCoA build for newer compilers (#6919)
Newer compilers, such as GCC 11, default to C++17. CoCoA does not
compile with C++17 and its check for the C++ version used by the
compiler does not take into account newer C++ versions. As a result,
building CoCoA using `--auto-download` fails with GCC 11. This commit
adds a patch that makes the test in CoCoA take into account compilers
that default to C++17 or newer.
Aina Niemetz [Fri, 23 Jul 2021 17:51:22 +0000 (10:51 -0700)]
FP: Add option to word-blast more lazily. (#6904)
When enabled, this does not word-blast when registering term but at preNotifyFact (= more lazily) instead.
This is enabled via option --fp-lazy-wb.
Andrew Reynolds [Thu, 22 Jul 2021 16:57:46 +0000 (11:57 -0500)]
Simplify computation of relevant terms in datatypes (#6885)
This makes it so that we do not consider non-singleton equivalence classes of DT for non-datatype terms to be relevant. This impacts how model construction is done for datatypes.
It's not clear why this method considered such terms to be relevant, I believe this was done to mask a previous bug; regressions now pass when this method is simplified.
Doing this is definitely wrong when using central equality engine, hence the motivation for this simplification.
Andrew Reynolds [Thu, 22 Jul 2021 14:23:35 +0000 (09:23 -0500)]
Add the central equality engine manager (#6893)
This class is responsible for setting up the central equality engine. It relies on a new static method Theory::usesCentralEqualityEngine, which will be refined in followup PRs.
This PR does not change the behavior, it only adds the class.
Further PRs will connect this class to CombinationEngine, make it optionally enabled, and make the remaining changes to TheoryEngine to make it compatible.
Andrew Reynolds [Thu, 22 Jul 2021 13:59:17 +0000 (08:59 -0500)]
Miscellaneous changes in preparation for central equality engine (#6900)
Andres Noetzli [Thu, 22 Jul 2021 07:50:02 +0000 (00:50 -0700)]
Add support for minimal unsat cores (#4605)
This commit adds support for computing minimal unsat cores. The
algorithm implemented in this commit is just a trivial deletion-based
algorithm that tries to remove each assertion in the unsat core
individually.
Andrew Reynolds [Thu, 22 Jul 2021 07:22:02 +0000 (02:22 -0500)]
Preparation for carry the rewrite rule database in the proof checker (#6915)
mudathirmahgoub [Thu, 22 Jul 2021 07:10:39 +0000 (02:10 -0500)]
Add std::vector<Term> Op:: getIndices() and operator[] for Op (#6397)
Haniel Barbosa [Tue, 20 Jul 2021 17:36:41 +0000 (14:36 -0300)]
[AUTHORS] Add CVC4 as part of CVC series (#6907)
Andres Noetzli [Tue, 20 Jul 2021 16:11:15 +0000 (09:11 -0700)]
ANTLR3: Install into `CMAKE_INSTALL_LIBDIR` (#6912)
On some platforms, autotools installs ANTLR3's libraries into lib but
CMAKE_INSTALL_LIBDIR is set to lib64 (e.g., Fedora 33). This commit
sets --libdir to force autotools to install the library into the
directory specified by CMAKE_INSTALL_LIBDIR.
Andrew V. Jones [Mon, 19 Jul 2021 07:06:53 +0000 (08:06 +0100)]
'CryptoMiniSat_LIBRARIES' should respect lib/lib64 (#6905)
On 64-bit openSUSE (and maybe other distributions), the default install directory for static libraries is `lib64` *not* `lib`. This has an impact on cvc5 when it is automatically building CMS (e.g., with `./configure.sh --cryptominisat --auto-download`): CMS adheres to the default value of `CMAKE_INSTALL_LIBDIR` to work out where to install the library files (so `lib64` on openSUSE), which fails when cvc5 tries to find these in `lib`.
Without this change, the build fails as follows:
```
<snip>
src/CMakeFiles/cvc5.dir/theory/type_enumerator.cpp.o -Wl,-rpath,:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: deps/lib/libcadical.a deps/lib/libcryptominisat5.a ../deps/install/lib64/libglpk.a deps/lib/libpicpolyxx.a /usr/lib64/libgmp.so deps/lib/libpicpoly.a /usr/lib64/libgmp.so && :
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: cannot find deps/lib/libcryptominisat5.a: No such file or directory
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
```
and where:
```
avj@platypus ~/clones/cvc5/master/build$ find . -iname "libcryptominisat5.a"
./deps/src/CryptoMiniSat-EP-build/lib/libcryptominisat5.a
./deps/lib64/libcryptominisat5.a
```
(notice: `lib64` in the second path!)
This commit fixes this discrepancy to ensure that cvc5 checks for CMS on `CMAKE_INSTALL_LIBDIR` as well.
**Note**: `CMAKE_INSTALL_LIBDIR` comes from `GNUInstallDirs`, and this is `include`'d in cvc5's top-level `CMakeLists.txt`
Signed-off-by: Andrew V. Jones <andrewvaughanj@gmail.com>
Andrew V. Jones [Mon, 19 Jul 2021 06:55:35 +0000 (07:55 +0100)]
'ANTLR3_RUNTIME' should respect lib/lib64 (#6906)
On 64-bit openSUSE (and maybe other distributions), the default install directory for static libraries is `lib64` *not* `lib`. This has an impact on cvc5 when it is automatically building ANTLR3: ANTLR3 follows the system-wide default of `lib64`, which fails when cvc5 tries to find these in `lib`.
Without this change, the build fails as follows:
```
<snip>
src/parser/CMakeFiles/cvc5parser.dir/smt2/Smt2Parser.c.o -Wl,-rpath,/home/avj/clones/cvc5/lib64_cms/build/src:::::::::::::::::::::::: src/libcvc5.so.1 deps/lib/libantlr3c.a && :
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: cannot find deps/lib/libantlr3c.a: No such file or directory
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
```
and where:
```
avj@platypus ~/clones/cvc5/lib64_cms/build$ find . -iname "libantlr3c.a"
./deps/src/ANTLR3-EP-runtime/.libs/libantlr3c.a
./deps/lib64/libantlr3c.a
```
(notice: `lib64` in the second path!)
This commit fixes this discrepancy to ensure that cvc5 checks for ANTLR3 on `CMAKE_INSTALL_LIBDIR`, which matches that `autotools` will use.
**Note**: `CMAKE_INSTALL_LIBDIR` comes from `GNUInstallDirs`, and this is `include`'d in cvc5's top-level `CMakeLists.txt`
Signed-off-by: Andrew V. Jones <andrewvaughanj@gmail.com>
Andrew Reynolds [Sun, 18 Jul 2021 19:29:13 +0000 (14:29 -0500)]
Add n-ary term utilities (#6896)
Initial work towards rewrite rule reconstruction
Andrew Reynolds [Fri, 16 Jul 2021 17:04:39 +0000 (12:04 -0500)]
Do not exhaustive instantiation when FMF is disabled (#6899)
This makes FMF not handle quantified formulas when FMF options are disabled, apart from those marked internal.
This is required for combinations of sequences + quantified formulas.
Andres Noetzli [Fri, 16 Jul 2021 16:28:30 +0000 (09:28 -0700)]
[Unit Tests] Avoid linking against external libs (#6898)
Fixes #6866. The `theory_airth_cad_white` unit test has been failing on
some platforms (e.g., macOS) due to statically linking libpoly in
libcvc5 and then separately linking it in the unit tests. This resulted
in issues with `static` variables. This commit fixes the issue by
avoiding linking libpoly in the unit tests and instead relying solely on
libcvc5.
Co-authored-by: Ouyancheng <1024842937@qq.com>
Andres Noetzli [Fri, 16 Jul 2021 03:11:24 +0000 (20:11 -0700)]
[Unit Tests] Reenable `top_scope_context_obj` (#6892)
Fixes #6047. The test was disabled because ASan found a use-after-free
due to an object allocated in the top scope being destroyed after the
scope (see #2607 for a detailed explanation). At first, the plan was to
add support for this use case. However, we have decided that we
currently don't need support for this feature and added a guard against
it (#6082). This commit reenables the test but changes it to destroy the
object allocated in the top level scope before the corresponding level
is popped. It additionally adds a test of the guard from #6082.
Andrew Reynolds [Thu, 15 Jul 2021 18:45:12 +0000 (13:45 -0500)]
Fix context for proofs of instantiations (#6890)
Caught by a regression on proof-new, where an instantiation was the symmetric equality of an instantiation on a previous call to check-sat. Proofs of instantiation should be user-context dependent.
Andrew Reynolds [Thu, 15 Jul 2021 17:56:05 +0000 (12:56 -0500)]
Distinguish quantifiers preprocess as its own proof rule (#6897)
Andrew Reynolds [Thu, 15 Jul 2021 15:53:05 +0000 (10:53 -0500)]
Connect the equality solver to theory arith (#6894)
--arith-eq-solver is a new option to enable the equality solver in arithmetic, disabled by default.
This PR connects the equality solver to TheoryArith when this option is enabled.
This is in preparation for the central equality engine.
Andrew Reynolds [Thu, 15 Jul 2021 13:25:28 +0000 (08:25 -0500)]
Arithmetic equality solver (#6876)
This is work towards the central equality engine. This adds a module of arithmetic that uses the equality engine in the default way.
This class will be incorporated into theory_arith.cpp. It will be the replacement for CongruenceManager when we use the central equality engine architecture.
Andrew Reynolds [Thu, 15 Jul 2021 05:20:11 +0000 (00:20 -0500)]
Move master equality engine notification to own file (#6877)
Preparation for central equality engine.
Andrew Reynolds [Thu, 15 Jul 2021 04:25:36 +0000 (23:25 -0500)]
Add node converter utility (#6878)
Adds a utility for converting nodes. This is the first step towards the LFSC proof conversion.
Mathias Preiner [Thu, 15 Jul 2021 02:39:00 +0000 (19:39 -0700)]
bv: Disable bv-assert-input if proofs are enabled. (#6886)
Mathias Preiner [Thu, 15 Jul 2021 02:19:12 +0000 (19:19 -0700)]
bv: Rename BBSimple to NodeBitblaster. (#6891)
Mathias Preiner [Thu, 15 Jul 2021 01:54:33 +0000 (18:54 -0700)]
bv: Rename lazy solver to layered solver. (#6889)
Mathias Preiner [Thu, 15 Jul 2021 01:27:33 +0000 (18:27 -0700)]
bv: Rename simple solver to bitblast-internal. (#6888)
Haniel Barbosa [Wed, 14 Jul 2021 23:02:30 +0000 (20:02 -0300)]
[proof] Fix open proof issues in SAT proof (#6887)
Commit
d1eee40cc (PR #6346), in a foolish attempt to prevent speculated issues, introduced an overwriting policy to addition of resolution chains during SAT solving at the SAT proof manager. First, this is nonsensical because the lazy proof chain is context-dependent and at the same level other ways of proving that clause are simply redundant and therefore should be ignored. Second, and catastrophically, this policy, for reasons beyond me, can lead to open SAT proofs when the same clause is rederived at the same level.
So this commit simply reverts the change and adds an optimization that when the clause would be rederived at the same level we do nothing and leave the method.
Haniel Barbosa [Wed, 14 Jul 2021 22:29:50 +0000 (19:29 -0300)]
Add option that exercises the previously buggy behavior (#6884)
Haniel Barbosa [Wed, 14 Jul 2021 21:35:21 +0000 (18:35 -0300)]
Generalize congruence handling for HO in eq proofs (#6883)
Previously we were not considering proofs for HO equalities (i.e., between operators) that were transitivity chains. This commit generalizes the elaboration procedure in eq_proof to do so.
Andrew Reynolds [Wed, 14 Jul 2021 21:15:28 +0000 (16:15 -0500)]
Fix for context on input proof generator (#6873)
The preprocess proof generator uses a dummy CDProof to mark input assertions that do not need justification. This CDProof should be user-context dependent to avoid rare cases where an input assertion was the symmetric equality of another, it was previously context independent.
This also refactors the debugging traces in this class.
Andrew Reynolds [Wed, 14 Jul 2021 20:42:40 +0000 (15:42 -0500)]
Move synthesis verification check to own file (#6882)
In preparation for more extensions to this aspect of the synthesis solver.
Andrew Reynolds [Wed, 14 Jul 2021 14:15:25 +0000 (09:15 -0500)]
Refactor setup of proof equality engine for central EE (#6831)
Users of an equality engine should each use the same proof equality engine that wraps it. This ensures that theory inference managers do so, by tracking the official proof equality engine for an equality engine in theory inference manager.
This is in preparation for (proper equality proofs for) central equality engine.
It also adds some debugging code that is highly useful for debugging issues related to when equalities are processed in theory inference manager.
Andrew Reynolds [Wed, 14 Jul 2021 13:43:25 +0000 (08:43 -0500)]
Fix models for sequences of infinite element type (#6870)
This fixes our model construction for sequences of infinite element type.
We were relying on getModelValue in our model construction which is incorrect since it assumes that the element type's theory can provide concrete values during model generation time. This makes the sequence model construction more robust by generalizing how model values are assigned: we use skeletons instead of concrete values when the element type is infinite.
This fixes some open model generation issues with Facebook benchmarks.
Gereon Kremer [Wed, 14 Jul 2021 07:40:30 +0000 (09:40 +0200)]
Clean up option usage in command executor (#6844)
This PR makes the CommandExecutor class use the options object from its SmtEngine instead of the driver one. This makes sure that options that are set via (set-option ...) are in effect for the CommandExecutor. It still stores the driver options, though, as they are used for resets.
The PR also does some minor cleanups along the way (remove unused pOptions, make things const).
Fixes #2376.
Mathias Preiner [Wed, 14 Jul 2021 06:57:13 +0000 (23:57 -0700)]
Add missing space for check macro error messages. (#6875)
Mathias Preiner [Wed, 14 Jul 2021 03:09:07 +0000 (20:09 -0700)]
bv: Add missing BV_EAGER_ATOM proof rule. (#6874)
Fixes an issue with --proof-eager-checking and --bitblast=eager.
Mathias Preiner [Tue, 13 Jul 2021 19:02:37 +0000 (12:02 -0700)]
bv: Simplify BV_BITBLAST_* proof rules. (#6871)
Introduces BV_BITBLAST_STEP rule, which replaces BV_BITBLAST_X rules.
Haniel Barbosa [Tue, 13 Jul 2021 18:38:23 +0000 (15:38 -0300)]
[rewriter] Add rewrite to order IFF (equality for Booleans) (#6872)
Not doing this rewrite for Booleans is probably an artifact of the old IFF kind being removed. This rewrite is important to simplify the generation of proofs for the SAT solver, as clarified in the new comment in the SAT proof manager.
Mathias Preiner [Tue, 13 Jul 2021 16:11:33 +0000 (09:11 -0700)]
bv: Do not rewrite below BV leafs in BBProof's TConvProofGenerator. (#6869)
Introduces a TermContext class that can be used to skip rewrites below theory leafs. Fixes issues related to bit-vector leafs begin incorrectly rewritten.
Andrew Reynolds [Tue, 13 Jul 2021 07:12:46 +0000 (02:12 -0500)]
Add branch and bound lemma if linear arithmetic generates a non-integer assignment (#6868)
This double checks that TheoryArithPrivate generates a model that does not assign real values to integer variables.
This is done outside of TheoryArithPrivate intentionally, so that it can be checked independently.
This code should very rarely be applied but would have caught the incorrect model which led to wrong results in the UFNIA division of smtcomp 2021.
Mathias Preiner [Tue, 13 Jul 2021 02:33:08 +0000 (19:33 -0700)]
bv: Expand bitblast proof steps in the proof post processor. (#6867)
This commit changes BV proof logging to record coarse-grained bit-blast steps during solving and expanding these steps on-demand in the proof post processor.
Andrew Reynolds [Mon, 12 Jul 2021 20:59:25 +0000 (15:59 -0500)]
Add branch and bound (#6865)
This PR moves https://github.com/cvc5/cvc5/blob/master/src/theory/arith/theory_arith_private.cpp#L3451 to its own module.
The next PR will connect this module to theory_arith / theory_arith_private.
Towards ensuring type constraints are met for linear arithmetic models.
Andrew Reynolds [Mon, 12 Jul 2021 19:18:17 +0000 (14:18 -0500)]
Fix for learned rewrite pass, add regression (#6850)
Fixes #4791.
Andres Noetzli [Mon, 12 Jul 2021 19:05:14 +0000 (12:05 -0700)]
Fix ANTLR build on CMake <3.11 (#6864)
With CMake 3.11 and later, `<DOWNLOAD_DIR>` is substituted in
`ExternalProject_Add` but not in older versions [0]. To maintain
compatibility with older versions of CMake, this commit changes
`ExternalProject_Add` to use `<DOWNLOADED_FILE>` instead, which is both
nicer and substituted in older versions of CMake.
[0] https://cmake.org/cmake/help/latest/release/3.11.html#modules
Andrew Reynolds [Mon, 12 Jul 2021 18:55:13 +0000 (13:55 -0500)]
Add arithmetic preprocess rewrite equality module (#6860)
This is the first part of a refactoring which will ensure that the linear arithmetic solver does not violate integer type constraints in its model.
This PR moves the method https://github.com/ajreynol/CVC4/blob/master/src/theory/arith/theory_arith.cpp#L129 to its own module / file.
Andrew Reynolds [Mon, 12 Jul 2021 18:15:48 +0000 (13:15 -0500)]
Add trace for combination splits (#6862)
Followup PRs will unify these with the lemmas / stats infrastructure in theory inference manager.