summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-07-15minornodeAssertionListAndres Noetzli
2020-07-15disable stats testAndres Noetzli
2020-07-15Use Nodes for SmtEngine assertionsAndres Noetzli
This commit changes `SmtEngine::assertFormula()` to use `Node`s rather than `Expr`s and changes `AssertionList` to be `Node`-based. This is work towards removing the `Expr` layer.
2020-07-15Split abduction solver from SmtEngine (#4733)Andrew Reynolds
This splits everything related to abducts into its own standalone module, AbductionSolver. It furthermore converts some of the interfaces of SmtEngine to make them take Node instead of Expr (this will be done for every method eventually). The code for interpolation should follow a similar pattern, e.g. InterpolantSolver.
2020-07-15Use TypeNode in UninterpretedConstant (#4748)Andres Noetzli
This commit changes UninterpretedConstant to use TypeNode instead of Type.
2020-07-15Add missing header (Fixes #4743) (#4749)Gereon Kremer
Thanks to Dejan for this hint (in #4743)
2020-07-15Simplify entailment check interface (#4744)Andrew Reynolds
The generality of this interface is unnecessary.
2020-07-14Make use of options in setDefaults more consistent (#4729)Andrew Reynolds
The plan is to make setDefaults (the method to update the default options based on our internal heuristics) modify an explicit copy of options. This is the first step, which eliminates the dependence of this method on SmtEngine. This PR is furthermore required to eliminate options listeners.
2020-07-14Remove sygus print callback (#4727)Andrew Reynolds
This removes sygus print callbacks, since they are no longer necessary to support the sygus v1 parser. This involved generalizing the scope of the datatype utility sygusToBuiltin. Now, printing "as sygus" simply is accomplished by doing sygusToBuiltin conversion and then calling the printer on the builtin term. This is required for further work towards eliminating the Expr layer. FYI @4tXJ7f
2020-07-14Fix regression output. (#4741)Andrew Reynolds
This regression output was unexpected previously since conflict-based instantiation caught a conflict early, this makes it so that the output of this regression should be deterministic. Fixes regress1.
2020-07-14(proof-new) Skeleton proof support in the Rewriter (#4730)Andrew Reynolds
This adds support for skeleton proofs in the rewriter (REWRITE -> THEORY_REWRITE). It adds "extended equality rewrite" as a new method of the rewriter/theory rewriters. The unit test of this feature should be added on a followup PR. Co-authored-by: Andres Noetzli <andres.noetzli@gmail.com>
2020-07-14Use TypeNode in EmptySet (#4740)Andres Noetzli
This commit changes EmptySet to use TypeNode instead of Type.
2020-07-13Debug instantiations output (#4739)Andrew Reynolds
This prints # instantiations per round (during solving) for each quantified formula with `--debug-inst`, giving output like this: ``` (num-instantiations myQuant1 1) (num-instantiations myQuant2 1) unsat ``` It also changes the default value of print-inst-full to match the behavior of unsat-cores vs unsat-cores-full (by default, nameless quantifiers are ignored). It fixes an issue with qid, where mkVar was accidentally used instead of mkConst, leading to assertion failures in debug. Marking major since this fixes debug regress1.
2020-07-13Minor refactoring of subsolver initialization (#4731)Andrew Reynolds
This decouples asserting a formula with initialization (previously it was a complex process to assert a formula due to having to clone/export to a new ExprManager). Now it is trivial. This commit fixes an unintended consequence of the previous complications. Previously, SmtEngine::setOption would be set after asserting formulas to an SmtEngine subsolver, which is technically incorrect, as options should be finalized before the first assert. This is required for further cleaning up of options listeners.
2020-07-13Fix caching in TheoryEngine::getExplanation() (#4736)Andres Noetzli
Commit 64a7db86206aa0993f75446a3e7f77f3c0c023c6 introduced a caching mechanism in `TheoryEngine::getExplanation()`. However, there seem to be issues related to the timestamps of the explanations. This commit fixes the issue by making the timestamp part of the cache. The change ensures that explanations for a certain node never rely on other explanations for that node with a later timestamp.
2020-07-13Fix options messages that were inverted (#4734)Haniel Barbosa
2020-07-13Use TypeNode/Node in ArrayStoreAll (#4728)Andres Noetzli
This commit changes ArrayStoreAll to use Node/TypeNode instead of Expr/Type.
2020-07-13Fix type comparisons involving pointer. (#4738)Andrew Reynolds
Fixes debug regressions, introduced by a combination of the addition of sequence update and the change to pointers.
2020-07-13Fix whitespace issue in instantiations output. (#4737)Andrew Reynolds
Fixes regress1.
2020-07-13 (proof-new) SMT Preprocess proof generator (#4708)Andrew Reynolds
This adds the proof generator for storing proofs of preprocessing. It stores assertions added via preprocessing passes and their rewrites. This utility will eventually live in SmtEngine. It also adds 2 new proof rules, and fixes an issue in ProofNodeUpdater.
2020-07-13 User-facing print debug option for sygus candidates (#4720)Andrew Reynolds
This makes an option --debug-sygus available to the user for tracing the sygus solver. For the classic max2 example the option is: (sygus-enum 0) (sygus-candidate (max 0)) (sygus-enum 0) (sygus-enum 1) (sygus-enum x) (sygus-enum x) (sygus-candidate (max x)) (sygus-enum x) (sygus-enum y) (sygus-enum y) (sygus-candidate (max y)) (sygus-enum y) (sygus-enum (+ x x)) (sygus-enum (+ x 1)) (sygus-enum (+ 1 1)) ... (sygus-enum (ite (<= x y) y 1)) (sygus-candidate (max (ite (<= x y) y 1))) (sygus-enum (ite (<= x y) y 1)) (sygus-enum (ite (<= x y) y x)) (sygus-enum (ite (<= x y) y x)) (sygus-enum (ite (<= x y) y x)) (sygus-candidate (max (ite (<= x y) y x))) unsat (define-fun max ((x Int) (y Int)) Int (ite (<= x y) y x)) Where sygus-enum denotes enumerated terms and sygus-candidate is one that passes a CEGIS refinement check.
2020-07-13Statistics on instantiations per quantified formula. (#4719)Andrew Reynolds
This adds a new print format for instantiations --print-instantiations=num, which prints the total number of instantations of quantified formulas. This count is user-context-dependent, which is in sync with the existing print-instantiation format (list). It also simplifies and improves printing of Instantiation Tries.
2020-07-13Implement --tlimit for windows (#4716)Gereon Kremer
The new mechanism for --tlimit only works for POSIX compatible systems (that implement setitimer). This PR implements an alternative (though roughly equivalent) approach for windows, based on SetWaitableTimer(). To make this work (without code duplication) we need to call the timeout_handler function from time_limit.cpp as the windows solution employs an asynchronous callback instead of signals. I used the opportunity to rename util.cpp to signal_handlers.cpp (as it really does not do anything else) and reformat the file. As I do not have a windows system at hand, I have not been able to actually test this apart from making sure that it compiles with the mingw setup.
2020-07-12Add support for string/sequence update (#4725)Andrew Reynolds
This adds basic support for string/sequence updating, which has a semantics that is length preserving.
2020-07-12Remove ExprSequence (#4724)Andres Noetzli
Now that we can break the old API, we don't need an ExprSequence anymore. This commit removes ExprSequence and replaces all of its uses with Sequence. Note that I had to temporarily make sequence.h public because we currently include it in a "public" header because we still generate the code for Expr::mkConst<Sequence>().
2020-07-11Cache explanations in TheoryEngine::getExplanation (#4722)Andrew Reynolds
For some hard verification benchmarks from Facebook, TheoryEngine::getExplanation was found to be the bottleneck, where the main loop of TheoryEngine::getExplanation would be run regularly 30k times, sometimes over 1 million times for a single conflict. This caches explanations in this loop, where now the loop is executed roughly 1k times at max for the same benchmark. One challenging benchmark that previously solved in 8 min 45 sec now solves in 2 min 45 sec. FYI @barrettcw .
2020-07-11Changing bv_to_int options (#4721)yoni206
This PR changes --solve-bv-as-int from a numerical option (specifying the granularity) to an enum (specifying the approach). Currently we support only two modes: OFF and SUM. Future PRs will add more modes. The numerical value of the granularity is now captured by the new option --bvand-integer-granularity. Tests are updated accordingly.
2020-07-10Adding test for whether a kind is n-ary (#4718)Haniel Barbosa
2020-07-10Add support for printing 'get-abduct' in verbose mode (#4710)Andrew V. Jones
Issue For any of the following files: test/regress/regress1/abduct-dt.smt2 test/regress/regress1/sygus-abduct-test-ccore.smt2 test/regress/regress1/sygus-abduct-test.smt2 test/regress/regress1/sygus-abduct-ex1-grammar.smt2 test/regress/regress1/sygus-abduct-test-user.smt2 test/regress/regress1/sygus/abduction_1255.corecstrs.readable.smt2 test/regress/regress1/sygus/abduction_streq.readable.smt2 test/regress/regress1/sygus/abd-simple-conj-4.smt2 test/regress/regress1/sygus/uf-abduct.smt2 test/regress/regress1/sygus/yoni-true-sol.smt2 running the following: ./bin/cvc4 -vvv <file> would print: Invoking: ERROR: don't know how to print a Command of class: N4CVC416GetAbductCommandE Resolution This PR adds support in src/printer/smt2/smt2_printer.cpp to be able to print a Command of type GetAbductCommand. Given the similarities between get-abduct and synth-fun, I have refactored the printing logic in toStream(std::ostream& out, const SynthFunCommand* c) for a printing a SyGuS grammar to be shared between both SynthFunCommand and GetAbductCommand. As a result, you now see something like this: [avj@tempvm build]$ ./bin/cvc4 -vvv ../test/regress/regress1/abduct-dt.smt2 Invoking: (set-option :incremental false) Invoking: (set-logic ALL) Invoking: (declare-datatypes ((List 0)) (((nil) (cons (head Int) (tail List))))) Invoking: (declare-fun x () List) Invoking: (assert (distinct x nil)) minisat: Incremental solving is forced on (to avoid variable elimination) unless using internal decision strategy. Invoking: (get-abduct A (= x (cons (head x) (tail x)))) (error "Cannot get abduct when produce-abducts options is off.") Signed-off-by: Andrew V. Jones andrew.jones@vector.com
2020-07-10(proof-new) Add ONCE and FIXPOINT modes for term conversion proof generator ↵Andrew Reynolds
(#4709) We need multiple policies for generic proofs for term conversion, in particular, substitution has a "apply once" semantics which does not apply rewrite steps to a fixpoint like the rewriter. This is required for eliminating SUBS steps in the final proof. Also note that an internal method for getting proofs was generalized, which will be required for doing multiple variants of proofs in this utility in the future.
2020-07-10(proof-new) Update Theory interface for proof-new (#4648)Andrew Reynolds
This includes 4 changes: Theory constructor takes a ProofNodeManager, Theory::explain returns a TrustNode (of kind PROP_EXP), Theory::expandDefinitions returns a TrustNode (of kind REWRITE), Theory::ppRewrite returns a TrustNode (of kind REWRITE). These are all currently planned updates to the interface of Theory. This PR also connects some of the existing proof rule checkers into the proof checker, if one is provided to the constructor. It updates TheoryEngine and other places to process TrustNode in trivial ways (converting them into Node). These calls will later be updated as needed for proof support. This PR is also contingent on the performance tests for proof-new on SMT-LIB.
2020-07-10Always Update Git information when rebuilding (#4696)Andres Noetzli
Commit 61734b41b7b96e7e7cbf46021a357d840d64b42e changed the way some of our source files are generated. However, the change meant that once `git_versioninfo.cpp` was generated, it was never updated again: The custom command for `git_versioninfo.cpp` has no dependencies, so CMake does not rebuild it unless the output file is missing [0]. This commit reverts the change to our `gen-gitinfo` target and adds `git_versioninfo.cpp` to `BYPRODUCTS` for the target to indicate that the file may have changed. I am not sure if there is a better solution because we actually have to run `GitInfo.cmake` to see if there have been any changes in the Git information. Introducing a dependency on all source files is not sufficient because other files or just the branch name may change. Note: The original solution only updates the timestamp of `git_versioninfo.cpp` if its contents actually change (`GitInfo.cmake` uses `configure_file()` to generate `git_versioninfo.cpp`, which only updates the timestamp when the contents changed [1]), so we don't do any unnecessary work. [0] https://cmake.org/cmake/help/latest/command/add_custom_command.html [1] https://cmake.org/cmake/help/latest/command/configure_file.html Signed-off-by: Andrew V. Jones <andrew.jones@vector.com> Co-authored-by: Andrew V. Jones <andrew.jones@vector.com>
2020-07-10Front end support for integer AND (#4717)Andrew Reynolds
2020-07-10[Interpolation] Add interface for SyGuS interpolation module (#4677)Ying Sheng
This is the second step of adding Interpolation. The whole change will be adding the API for (get-interpol s B), which is aim for computes an I that A->I and I->B. Here A is the assertions in the stack. The second step creates the component for computing interpolation, while omits the implementation.
2020-07-10Add deps/install/lib to RPATH and warn user when using dynamic libs. (#4684)Gereon Kremer
Installing the cvc4 binary does not work right now if it links against a shared library obtained via one of the contrib scripts. This PR thus adds deps/install/lib to the RPATH so that the installed binary works at all in this case. This change however paves the way to more problems: If one install such a dynamically linked binary and then removes (or updates) one the shared libraries in deps/install/lib, the installed binary most probably stops working. Hence, this PR checks whether this may happen (whether we link dynamically and link against a shared library from deps/install/lib) and, if this is the case, informs and warns the user about this issue. If the user tries to install to the default install prefix (/usr/local) we disallow installation entirely.
2020-07-10Update competition scripts (#4715)Andrew Reynolds
This PR creates a "current" sygus comp scripts, similar to what we have been doing for SMT COMP. It updates these scripts to fix the option names, as many have changed recently. This also copies the SMT COMP current scripts to 2020, since they were used in the current state. @4tXJ7f let me know if this is not the case.
2020-07-09Ensure legal elimination for witness rewrite (#4688)Andrew Reynolds
Fixes #4685. A recent commit #4661 added assertions for checking whether a witness rewrite corresponded to a legal elimination. #4685 demonstrates that these assertions can be violated and hence should be checked to ensure the rewrite is sound.
2020-07-09Disable unsat cores in timeout regression (#4713)Andrew Reynolds
Fixes a timeout in the nightlies. One regression times out during unsat core checking. This appears to be random, the subcall to check for unsat-cores is applying sygus-inst in the expected way, however, it struggles to find the right instances. Furthermore note that we are planning to redo implementation of unsat cores soon (when proof-new is fully merged), so we should revisit this (and all other) regressions with --no-check-unsat-cores when that happens.
2020-07-09Associate all lemmas in non-linear arithmetic with an inference identifier ↵Andrew Reynolds
(#4712) This marks all lemmas in non-linear arithmetic with an identifier, which indicates informally the kind of justification that was used for them. The main motivation for this is for debugging the behavior of the non-linear solver. The number of inferences can then be seen with --stats: nl::inferences, [(SPLIT_ZERO : 19), (SIGN : 4), (COMPARISON : 29)] The same design was used in strings and has been quite helpful. This also adds a few high level stats to the new statistics class for non-linear.
2020-07-09(proof-new) Theory engine proof generator (#4657)Andrew Reynolds
This adds the proof generator used by TheoryEngine for generating proofs for explanations.
2020-07-08Re-implement handling of --tlimit (#4655)Gereon Kremer
As a first step within this project, this PR provides a new implementation that backs --tlimit. It uses setitimer (as timer_settime is not available on MacOS) to make the OS send a signal after the given wall clock time has passed. In more detail, this PR: removes the current handling of --tlimit (TlimitListener and its integration in the NodeManager) adds a new TimeLimitListener that lives in src/main uses TimeLimitListener directly in runCvc4() adds a signal handler for SIGALRM (that also uses the existing timeout_handler)
2020-07-08Add getName() method to options. (#4704)Mathias Preiner
getName() returns the long option name if it exists and an empty string otherwise.
2020-07-08Always interleave theory combination with quantifiers (#4703)Andrew Reynolds
This removes an option setting that made quantifiers always run at full effort (before theory combination) when an undecidable theory was present. The intuition is that such theories may also be unfair wrt theory combination, so quantifiers might as well "join them" at full effort. However, this option modification significantly hurts our performance in terms of timeouts on verification benchmarks from Facebook, where theory combination needs to run but quantifiers (alone) is preempting it from running. The correct solution is in fact to have other theories interleave with theory combination with the same policy as quantifiers (I've opened CVC4/cvc4-wishues#74).
2020-07-07Improve and fix secant and tangent lemmas in the transcendental solver (#4689)Andrew Reynolds
Fixes #4686. This benchmark failed an assertion that corresponded to the fact that a refinement lemma did not evaluate to false in the current model (and hence does not rule out the current model). This was caused by applying the rewriter in a way that led to an incorrect approximation. This meant that some tangent and secant lemmas would be ineffective. The benchmark in that issue now times out, but makes progress in the refinement lemmas it generates. This also simplifies and improves the use of approximated values (instead of model values) when constructing tangent and secant lemmas.
2020-07-07Transfer ownership of internal Options from NodeManager to SmtEngine (#4682)Andrew Reynolds
This PR decouples Options from NodeManager. Instead, options now live in SmtEngine. The changes that were required for this PR include: The main internal options object is now owned by SmtEngine instead of ExprManager. The ownership resource manager is moved from NodeManager to SmtEngine. Node manager listeners are deleted, timeouts and resource limits are set during SmtEngine::finishInit. A temporary hack was added to make the last constructed SmtEngine to be the one in scope. This ensures that options are in scope whenever an SmtEngine is created. The methods for invoking "subsolvers" (theory/smt_engine_subsolver.h,cpp) was simplified, as versions of these calls that change options do not have to clone a new copy of the ExprManager anymore. Resource manager was removed from the smt2 parser. Minor refactoring was done in SmtEngine to copy "original options" so that options are restored to their state after parsing command line options on reset. Updates to unit tests to ensure conformance to new options scoping.
2020-07-07Increase the minimum version of CMake due to the use of 'APPEND' with ↵Andrew V. Jones
strings (#4702) Signed-off-by: Andrew V. Jones <andrew.jones@vector.com>
2020-07-06Front end support for sequences (#4690)Andrew Reynolds
With this PR, we now support a preliminary draft of a theory of sequences. This PR adds front end support for sequences in the smt2 parser, in the new API, adds regressions and unit tests for them. As discussed offline, many of the string kinds are given a sequence version in the external API, but not in the internal one. This means that a special case for such kinds, getKindHelper was added to Term. We do not yet support proper smt2 printing of sequences, which will require access to this code for Kind conversions (to distinguish e.g. str.++ from seq.++).
2020-07-06[GitHub] Add link to fuzzing guidelines in issues (#4695)Andres Noetzli
2020-07-02Remove SWIG bindings (#4683)Andres Noetzli
This commit removes support for SWIG bindings for the legacy API. The bindings were already broken by 19054b3b1d427e662d30d4322df2b2f2361353da and we are not planning on using SWIG for the Java API for the new API.
2020-07-02Fix regression option (#4680)Andrew Reynolds
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback