summaryrefslogtreecommitdiff
path: root/src/theory
AgeCommit message (Collapse)Author
2020-08-04lazy registrationeqNotifyRewriteAndres Noetzli
2020-08-04Add eqNotifyRewriteAndres Noetzli
2020-08-04Add CAD-based solver (#4834)Gereon Kremer
Based on #4774, this PR adds a new CadSolver class that allows the NonlinearExtension to actually employ the CAD-based method. In more detail: add --nl-cad option add CadSolver class that wraps cad::CDCAC with support for checks, model construction and conflict generation add new Inference types for the NlLemma class use CadSolver in NonlinearExtension (if --nl-cad is given)
2020-08-03Add implementation for SyGuS interpolation module (step4) (#4811)Ying Sheng
This is the 4th step of adding interface for SyGuS Interpolation module. 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 4th step finished the implementation of the interpolation module.
2020-08-03New BV rewrite rules aimed at bv_to_int preprocessing pass (#4769)yoni206
This PR adds new rewrite rules for BV. None of them is meant to be used by the default BV rewriter. However, they are planned to be used in bv_to_int preprocessing pass. In the pass we use FixpointRewriteStrategy to call various rewrite rules. After consulting @4tXJ7f , we thought that the best way to include more rewrite rules in that call is to implement them using the existing BV rewrites infrastructure.
2020-08-03Generalize interface for candidate rewrite database (#4797)Andrew Reynolds
This class will be used as a utility in a new algorithm for solution reconstruction and requires a generalized interface. FYI @abdoo8080
2020-08-02Updates to dtype constructor in preparation for eliminating Expr-level ↵Andrew Reynolds
datatype (#4825)
2020-08-01Ensure strict length constraint for decompose rule (#4821)Andres Noetzli
Fixes #4820. The performance issue was caused by 0988217562006d3f59e01dc261f39121df6d75f5. That commit introduced an option (`--strings-len-conc`) that optionally moves the length constraint for skolems to the conclusion of an inference instead of making it part of the term registration. However, for `DEQ_DISL_STRINGS_SPLIT`, we were only asserting that `LENGTH_GEQ_ONE` in the case where this option was not enabled, instead of asserting that the length of the skolem is equal to the component on the other side of the disequality. This lead to an infinite loop of inferences because we effectively were just splitting a component into two skolems and the only restriction was that the first one was non-empty. We guessed the second skolem to be empty, so the first skolem was equal to the component, the skolem was marked congruent, and we ended up with the same normal form as before. The commit fixes the issue by adding an argument to `getDecomposeConclusion()` that specifies whether to add the length constraint or not. This option is used to always add the length constraint in the case of `DEQ_DISL_STRINGS_SPLIT`.
2020-08-01Fix component contains for splicing due to substring. (#4705)Andrew Reynolds
Fixes #4701. That benchmark now times out.
2020-07-30Standardize explanations in arrays (#4804)Andrew Reynolds
Some internal inferences had a non-standard way of providing (disjunctive) reasons and a custom way of explaining them. This PR simplifies the array solver so that its explanations are analogous to the other equality engine based theory solvers (strings, datatypes, sets, ...). This is done in preparation for the incorporation of the proof equality engine in arrays, which follows a standard design for reasons/explanations. The performance impact on QF arrays is negligible
2020-07-30Cad implementation (#4774)Gereon Kremer
This commit implements the CAD interface added in #4773.
2020-07-30Adds the interface for the CAD-based arithmetic solver. (#4773)Gereon Kremer
This PR adds some utilities and, most importantly, the interface of the new CAD-based solver. The approach is based on https://arxiv.org/pdf/2003.05633.pdf and the code structure follows the paper rather closely.
2020-07-30Fix null case for sygus printing (#4793)Andrew Reynolds
Avoids crashing on some of our debug traces.
2020-07-28fixing issue #4808. (#4810)Ying Sheng
fixing issue #4808. Remove structural binding, which only supported by c++17.
2020-07-28Remove arrays lazy rintro option (#4806)Andrew Reynolds
This option has model soundness issues (#4771) and moreover is overall worse performance on SMT-LIB {QF_ABV QF_ABVFP QF_ABVFPLRA QF_ALIA QF_ANIA QF_AUFBV QF_AUFLIA QF_AUFNIA QF_AX}: Configuration #unsat time #sat time #solved #total CVC4-072720_def 9428 9405.46 24932 16631.6 34360 35399 CVC4-072720_nalr1 9446 9536.41 24924 16146.3 34370 35399 where def = default, nalr1 = --no-arrays-lazy-rintro1. Fixes #4771. FYI @barrettcw
2020-07-28Fix regular expression delta for complement (#4765)Andrew Reynolds
Fixes #4759 . Also refactors this method.
2020-07-28Supporting seq.nth (#4723)yoni206
This PR adds support for seq.nth operator by eliminating it during expandDefinitions, based on sub-sequences. Tests that use this operator are also included.
2020-07-28Interpolation: Add interface for SyGuS interpolation module (step3) (#4726)Ying Sheng
This is the 3rd step of adding interface for SyGuS Interpolation module. 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 3rd step partially implemented the interpolation module.
2020-07-28Use lemma property enum for OutputChannel::lemma (#4755)Andrew Reynolds
There are 3 Boolean flags for OutputChannel::lemma, and plans to add another for relevance. This makes them into a enum.
2020-07-27(proof-new) Proof production for term formula removal (#4687)Andrew Reynolds
This adds proof support in the term formula removal pass. It also refactors this class heavily so that its interface is more intuitive and does not depend on AssertionPipeline.
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-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-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-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-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-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-15Simplify entailment check interface (#4744)Andrew Reynolds
The generality of this interface is unnecessary.
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-13Use TypeNode/Node in ArrayStoreAll (#4728)Andres Noetzli
This commit changes ArrayStoreAll to use Node/TypeNode instead of Expr/Type.
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-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 .
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback