summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-07-27(proof-new) Arithmetic operator elim proof producing (#4783)Andrew Reynolds
This updates the interface for arithmetic operator elimination for the new proof format. The actual proof production of the operator elimination class (providing proofs for introduced witness terms) will be done in a separate PR. This also changes the witness terms introduced by this class so their body is in Skolem form, which simplifies term formula removal. Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu>
2020-07-27Consider negation's proof before triggering arith pfs. (#4776)Alex Ozdemir
The current arith proof machinery can prove conflicts which are explained by assumptions and tightened assumptions. Previously we verified that the conflict constraint was explained in terms of assumptions and tightened assumptions, before trying to save/produce a proof. We did not verify that the negated constraint was an assumption or tightened assumption. This caused us to attempt to prove conflicts around constraints whose negations where proven by general means (in the case of #4714, by the equality engine), which the proof machinery was not prepared to handle. This PR also checks that the negate constraint is an assumption or tightened assumption, before saving the proof. Thanks, Gereon, for doing the initial investigation into this! fixes 4714 Co-authored-by: Gereon Kremer <nafur42@gmail.com>
2020-07-21Support uninterpreted constants in the evaluator (#4777)Andrew Reynolds
2020-07-21Preparations for a CAD-based arithmetic solver (#4762)Gereon Kremer
Based on #4679, this PR contains further preparations for a CAD-based arithmetic solver that extends the current NonlinearExtension. In detail, it provides: a Constraints class that manages all (polynomial) constraints visible to the cad solver, a collection of methods used for cad projections, a VariableOrdering class that provides different variable ordering heuristics tailored to cad, an extension to the NlModel class, allowing for witness terms, further conversion methods, in particular between Node and poly::Polynomial, poly::Value and RealAlgebraicNumber.
2020-07-17Improving equality engine tracing (#4770)Haniel Barbosa
To keep track of the reasoning in the equality engine for n-ary kinds, for which partial applications amount to valid fully-applied terms, it's imperative to be able to see the IDs of the internal representation of the equality engine nodes. This commit updates tracing messages to print these IDs. It also improves the tracing for explanation generation.
2020-07-17(proof-new) Proof recording for assertions pipeline (#4766)Andrew Reynolds
Adds explicit steps to preprocess proof generator if one is provided.
2020-07-17Enumerate shapes feature in fast sygus enumerator (#4742)Andrew Reynolds
This adds the feature of enumerating shapes in the fast sygus enumerator, which is required for a new algorithm for sygus solution reconstruction. This also adds a builtinToSygus backwards mapping that is required for that algorithm as well. Note this also changes the implementation of mkFreeVar in sygus term database from skolem to bound variable, which is required to do proper caching for expr::hasBoundVar.
2020-07-17Add NodeManagerScopes to fix use-after-free issues (#4768)Andres Noetzli
This commit fixes our current ASan issues. Some methods in `NodeManager` were not creating a `NodeManagerScope` for `this` but were indirectly calling methods that get the `NodeManager` from the current scope, so we ended up calling methods on a `NodeManager` that had already been destroyed.
2020-07-17Replace options listener infrastructure (#4764)Andrew Reynolds
This replaces the old options listener infrastructure with the OptionsManager introduced in cb8d041. It eliminates a "beforeSearchListener", which was a custom way of some options throwing a modal exception if they were set after initialization. Now all options are consistent: no option can be set after initialization. It also moves managed ostream objects to the OptionsManager. @mpreiner The next step will be to remove the "notifies" field from the Options build system and then proceed with cleaning src/options/.
2020-07-17Support for using 'libedit' over 'readline' #4571 (#4579)Andrew V. Jones
Signed-off-by: Andrew V. Jones <andrew.jones@vector.com>
2020-07-17(proof-new) Updates to strings core solver (#4642)Andrew Reynolds
This updates the core strings solver in preparation for proofs. The main changes include: The addition of the strings PfRule enum values. The definition of a "getConclusion" static method, used by the core solver, and to be used in the future by the strings proof checker. This includes several optional forms of lemmas, which are added as options in this PR. Major simplifications to our inference schemas for disequality handling (a STRING_DECOMPOSE inference rule). Note this is the only significant intended behavioral change in this PR. Minor updates to the form of inferences send to inference manager, for instance to orient equalities in the expected way, and to reorder assumptions. These changes are done for uniformity and make the strings proof reconstruction from inference steps easier.
2020-07-17Add option manager and simpler option listener (#4745)Andrew Reynolds
This adds the "OptionManager" class, which will live in SmtEngine. This is the required infrastructure for implementing all "reactive" options, i.e. those that must take effect immediately. This PR does not enable this class yet, it simply adds the definitions. After this PR, we can connect it to SmtEngine and delete the old options listener infrastructure.
2020-07-17Integration of libpoly (#4679)Gereon Kremer
This commit integrates LibPoly into CVC4. It adds `contrib/get-poly`, adds it to the configure script, cmake and places where CVC4 inspects its own build configuration. Furthermore, it adds `CVC4::RealAlgebraicNumber` (which wraps `poly::AlgebraicNumber`) including some basic unit tests and some utilities.
2020-07-16Fix EqProof to ProofNode conversion (#4760)Haniel Barbosa
A wrong change slipped away during the cleaning of the module. This commit fixes the conversion.
2020-07-16(proof-new) Implements the conversion between EqProof and ProofNode (#4756)Haniel Barbosa
2020-07-16Resource manager cleanup (#4732)Gereon Kremer
This PR performs some general cleanup in and around the ResourceManager class. In detail, it does remove --hard-limit (we decided to always leave the solver in a usable state, i.e. always do a soft limit), remove --cpu-time (we decided to always use wall-clock time for time limiting) replace old gettimeofday-based Timer by new std::chrono-based WallClockTimer clean up the logic around beginCall() and endCall()
2020-07-16Split abstract values utility from SmtEngine (#4754)Andrew Reynolds
Towards refactoring SmtEngine.
2020-07-16Make ExtTheory a utility and not a member of Theory (#4753)Andrew Reynolds
Previously, we assumed that ExtTheory, the module for doing context-dependent simplification, was one-to-one with Theory. This design is not necessary. This makes this class a utility, which can be used as needed. This makes e.g. the initialization of TheoryStrings much easier, since the ExtTheory object can be created first.
2020-07-16Remove cumulative time limits and cpu time limits (#4711)Gereon Kremer
This PR removes two things from the resource manager: cumulative time limits cpu time limits Cumulative time limiting has been moved to the binary and is (as before) accessible via --tlimit. As per discussion among the devs, we no longer support time limits based on CPU time and thus everything related to that is removed as well. Note that this includes the option --cpu-time, removes an argument from SmtEngine::setTimeLimit() and the method SmtEngine::getTimeRemaining() .
2020-07-15Fixes memory leak when an exception goes through runCvc4(). (Fixes #4590) ↵Gereon Kremer
(#4750) As noted in #4590, CVC4 may leak memory if an exception is thrown that interrupts the command execution loop in runCvc4(). While not a major issue (the binary is terminated anyway in this case, this is also why we label it as feature), we should fix it nevertheless. This commit makes sure that the current command is properly managed by using `std::unique_ptr` to handle its deletion.
2020-07-15(proof-new) Adding API for converting EqProof into ProofNode (#4747)Haniel Barbosa
Also puts EqProof into its own module. Next will come the implementation of the API.
2020-07-15Use Nodes for SmtEngine assertions (#4752)Andres Noetzli
This commit changes SmtEngine::assertFormula() to use Nodes rather than Exprs 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-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>
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback