summaryrefslogtreecommitdiff
path: root/src/theory
AgeCommit message (Collapse)Author
2021-05-26Merge branch 'master' into includesincludesAndrew Reynolds
2021-05-25address commentsAndres Noetzli
2021-05-24Fix non-fixed length case in re-elim (#6612)Andrew Reynolds
Fixes followup issues from #6604.
2021-05-24documentationAndres Noetzli
2021-05-24fix testsAndres Noetzli
2021-05-24one moreAndres Noetzli
2021-05-24correct typesAndres Noetzli
2021-05-24More precise includes of `Node` constant classesAndres Noetzli
2021-05-24Move proof utilities to src/proof/ (#6611)Andrew Reynolds
This moves all generic proof utilites from src/expr/ and src/theory/ to src/proof/. It also changes the include for term conversion proof generator to conv_proof_generator in preparation to rename this utility on a followup PR (to avoid confusion with the use of "Term").
2021-05-24Fix re-elim length requirement for symbolic RE memberships (#6609)Andrew Reynolds
Fixes #6604. Previously, re-elim was solution unsound for cases where the LHS and a component of the RHS were both empty. This ensures a length requirement is given for the LHS to ensure proper containment.
2021-05-24Fix instance of no rewrite in extended rewriter (#6610)Andrew Reynolds
Fixes #6545. An assertion failure was being raised indicating that we were reporting a rewrite that was not changing the original term.
2021-05-24Better formalization of regular expression unfolding skolems (#6602)Andrew Reynolds
This replaces our previous formalization of RE unfolding skolems with a more explicit one that is amenable to external proof conversion. It adds a few associated utility methods to SkolemManager required for LFSC proof conversion for RE_UNFOLD_POS. It also changes the order of equalities in the RE_UNFOLD_POS rule, which simplifies LFSC proof checking.
2021-05-21Fix and refactor relevant domain (#6528)Andrew Reynolds
In a handcrafted case, one can make the body of quantified formula another quantified formula when special attributes are used. The relevant domain utility was not robust to this case, leading to instantiations with free variables. This fixes the issue and also updates its style to use a term context stack, which also avoids a tree traversal of the bodies of quantified formulas in this utility. Fixes #6476. The benchmark from that issue now times out.
2021-05-21Minor simplification to boolean proof checker (#6590)Andrew Reynolds
2021-05-21(proof-new) Minor documentation sync (#6592)Andrew Reynolds
2021-05-21Update to sygus standard output for check-synth responses (#6521)Andrew Reynolds
This PR does two things: (1) It eliminates the ad-hoc implementation of printSynthSolutions and removes it from the API. Now, printing response to a check-synth command is done in a more standard way, using the API + symbol manager. This is analogous to recent refactoring to get-model. (2) It updates cvc5's output in response to check-synth to be compliant with the upcoming sygus 2.1 standard. The standard has changed slightly: responses to check-synth are now closed in parentheses, mirroring the smt2 response to get-model. It also removes the unused command GetSynthSolutionCommand.
2021-05-21Support braced-init-lists with `mkNode()` (#6580)Andres Noetzli
This commit adds support for braced-init-lists in calls to `mkNode()`, e.g., `mkNode(REGEXP_EMPTY, {})`. Previously, such a call would result in a node of kind `REGEXP_EMPTY` with a single null node as a child because the compiler chose the `mkNode(Kind kind, TNode child1)` variant and converted `{}` to a node using the default constructor. This commit adds an overload of `mkNode()` that takes an `initializer_list<TNode>` to allow this use case. It also adds a `mkNode()` overload with zero children for convenience and removes the 4- and 5-children variants because they saw little use. Finally, it makes the default constructor of `NodeTemplate` explicit to avoid accidental conversions.
2021-05-21BV: Rename BITVECTOR_PLUS to BITVECTOR_ADD. (#6589)Aina Niemetz
2021-05-20Remove old unsat cores (#6581)Haniel Barbosa
This commit removes the remaining old proof code and the code to produce unsat cores based on it.
2021-05-20Expand arith's farkas lemma rule as a macro (#6577)Alex Ozdemir
reflects that it is a macro, which we will eliminate
2021-05-19Pass empty vector when constructing re empty, fixes rewrite (#6576)Andrew Reynolds
Fixes #6567.
2021-05-19Make strings emp inference an unhandled inference for proofs (#6575)Andrew Reynolds
The strings inference id STRINGS_INFER_EMP is a rare inference that currently leads to a segfault when proof reconstruction is tried for it. This PR makes it unhandled. This was caught by a new regression on the soon-to-be-merged jh-new branch.
2021-05-19Fix strings rewriter for non-standard re range (#6570)Andrew Reynolds
Fixes #6561. Previously we missed a case where a rewrite fired for (re.range x x) where x is not a character.
2021-05-19Add more missing inference ids (#6313)Andrew Reynolds
This also makes the relations solver use the inference manager in the standard way.
2021-05-19bv: Add support for --bitblast=eager. (#6516)Mathias Preiner
This PR adds support for handling --bitblast=eager in the new bitblast solver.
2021-05-19Fix positive contains indexof rewrites for empty string second argument (#6566)Andrew Reynolds
Fixes #6560.
2021-05-19Fix handling of non-standard re.range terms (#6563)Andrew Reynolds
Fixes #6561. That benchmark now gives an error: (error "expecting a single constant string term in regexp range"). This PR also makes isConstRegExp do a non-recursive dag traversal.
2021-05-18Loop over terms to reconstruct instead of obligations. (#6504)Abdalrhman Mohamed
This PR modifies the rcons algorithm to loop over terms to reconstruct instead of obligations. It also modifies the Obs data structure to reflect this change. The rest of the PR is mostly updating documentation and refactoring the affected code.
2021-05-18Fix `collectEmptyEqs()` in string utils (#6562)Andres Noetzli
Fixes #6483. The benchmark in the issue was performing the following incorrect rewrite: Rewrite (str.replace "B" (str.replace (str.++ (str.replace "B" a "B") a) "B" "") "B") to (str.replace "B" a "B") by RPL_X_Y_X_SIMP. The rewrite RPL_X_Y_X_SIMP rewrites terms of the form (str.replace x y x), where x is of length one and (= y "") rewrites to a conjunction of equalities of the form (= y_i "") where y_i is some term. The function responsible for collecting the terms y_i from this conjunction, collectEmptyEqs(), returns a bool and a vector of Nodes. The bool indicates whether all equalities in the conjunction were of the form (= y_i ""). The rewrite RPL_X_Y_X_SIMP only applies if this is true. However, collectEmptyEqs() had a bug where it would not return false when all of the conjuncts were equalities but not all of them were equalities with the empty string. This commit fixes collectEmptyEqs() and adds tests.
2021-05-18(proof-new) Miscellaneous updates to strings from proof-new (#6557)Andrew Reynolds
This includes: (1) The type rule for `re.range` no longer insists on constant arguments, or a non-empty range. This is required for LFSC proof conversion, where re.range terms take arguments that are not (cvc5 internal) constants. (2) Simplifications to reductions for indexof, which fixes proof checking errors in LFSC.
2021-05-17Fix `SPLIT_EQ_STRIP_R`/`SPLIT_EQ_STRIP_L` rewrites (#6550)Andres Noetzli
Fixes #6520. The `SPLIT_EQ_STRIP_R`/`SPLIT_EQ_STRIP_L` rewrites were applied too aggressively. Those rewrites attempt to rewrite string equalities between concatenations where the prefix on one side is provably shorter than the prefix on the other side. The length of the shorter prefix is then stripped from the longer prefix. However, cvc5 was not checking whether it was able to strip the length of the full prefix. If cvc5 cannot strip the full length of the shorter prefix, then the rewrite does not apply because parts of the shorter prefix would have to be kept. This commit adds an additional condition that checks whether the length of the full prefix was stripped.
2021-05-17Improve integration of CAD with nl-Ext (#6542)Gereon Kremer
This PR improves the integration of the CAD solver with the nl-ext solver in a simple way: we simply use a few of the simple linearization lemmas in combination with CAD by default, significantly improving the performance on QF_NRA.
2021-05-14bv: Assert input facts on user-level 0. (#6515)Mathias Preiner
The bitblast solver currently uses solving under assumptions for all facts that are sent to the bit-vector solver. For input facts on user-level 0 we can however assert the fact to the SAT solver, which allows the SAT solver to do more preprocessing. This PR adds the option to assert user-level 0 input facts, which is disabled by default.
2021-05-13Add std::hash overloads for Node, TNode and TypeNode. (#6534)Mathias Preiner
Eliminates NodeHashFunction, TNodeHashFunction and TypeNodeHashFunction.
2021-05-12Ensure sequences of Booleans generate Boolean term variable skolems when ↵Andrew Reynolds
applicable (#6529) Fixes #6510. This PR also eliminates a deprecated variant mkBooleanTermVariable from SkolemManager.
2021-05-10Unify top-level substitutions and model substitutions (#6499)Andrew Reynolds
This unifies top-level substitutions and theory model substitutions. Env is now passed to the TheoryModel, which has access to top-level substitutions. The former was used for simplfying assertions in the preprocessor, the latter was used for evaluating terms in the model. There is no reason to have these two things be separate.
2021-05-07Add support for datatype update (#6449)Andrew Reynolds
This removes the special case of TUPLE_UPDATE and RECORD_UPDATE in favor of the more general datatype update. Datatype update is handled analogously to APPLY_SELECTOR / APPLY_TESTER.
2021-05-07Simplifications to expand definitions (#6487)Andrew Reynolds
This removes the expandOnly flag from expandDefinitions. The use of expandOnly = true is equivalent to applying top-level substitutions only, which should be done explicitly via Env::getTopLevelSubstitutions. It updates the trust substitutions utility to distinguish apply vs applyTrusted for convenience for this purpose. This also breaks several dependencies in e.g. expand definitions module.
2021-05-06[proof-new] Updating documentation for Subs/Rw ids (#6502)Haniel Barbosa
2021-05-06Discard duplicate terms in patterns (#6501)Andrew Reynolds
Fixes #6495.
2021-05-06Use constant folding for evaluating BV eager atom (#6494)Andrew Reynolds
This is work towards unifying top-level substitutions with model substitutions. Currently, for model evaluation, BV eager atom preprocessing pass adds mappings (BV_EAGER_ATOM X) -> X to say how (BV_EAGER_ATOM X) should be evaluated in the model. This is not necessary since a rewrite rule (BV_EAGER_ATOM c) -> c for constant c would suffice. This eliminates the call to addModelSubstitution in that preprocessing pass. It also makes it so that we don't make true/false themselves into eager atoms.
2021-05-05Do not have quantifiers model inherit from theory model (#6493)Andrew Reynolds
This is work towards making the initialization of theory engine, theory models, quantifiers engine more flexible. This makes it so that the specialized quantifiers models classes (FirstOrderModel) do not inherit from TheoryModel. There is no longer any reason for this, since FirstOrderModel does not have any override methods. As a result of this PR, there is only one kind of TheoryModel and it is constructed immediately when ModelManager is constructed. This required refactoring the initialization of when FirstOrderModel is constructed in ModelBuilder classes in quantifiers. This also avoids the need for casting TheoryModel to FirstOrderModel.
2021-05-04Move env into smt solver, theory engine, prop engine (#6486)Andrew Reynolds
This is work towards eliminating singletons. Also, TheoryModel should use the same substitution map as the preprocessor. This is work towards unifying these things, which will be done in a future PR.
2021-05-04FP: Move removal of generic to_fp operations to rewriter. (#6480)Aina Niemetz
2021-05-04FP: Move type check from expandDefinitions. (#6479)Aina Niemetz
2021-05-03FP: Rewrite to_fp conversion from signed bit-vector. (#6472)Aina Niemetz
SymFPU does not allow to_fp conversion from signed bv of size 1. This adds rewrites for this case. Rewrites for the constant and the non-constant cases were tested in isolation.
2021-04-30bv: Refactor ppAssert and move to TheoryBV. (#6470)Mathias Preiner
This PR refactors ppAssert from the lazy BV solver and moves it to TheoryBV.
2021-04-30Add parameter name for argument `isPreRewrite` for FP rewrites. (#6469)Aina Niemetz
2021-04-30Use substitutions for implementing defined functions (#6437)Andrew Reynolds
This eliminates explicit tracking of defined functions, and instead makes define-fun add to preprocessing substitutions. In other words, the effect of: (define-fun f X t) is to add f -> (lambda X t) to the set of substitutions known by the preprocessor. This is essentially the same as when (= f (lambda X t)) was an equality solved by non-clausal simplification The motivation for this change is both uniformity and for performance, as fewer traversals of the input formula. In this PR: define-fun are now conceptually higher-order equalities provided to smt::Assertions. These assertions are always added as substitutions instead of being pushed to AssertionPipeline. Top-level substitutions are moved from PreprocessingContext to Env, since they must be accessed by Assertions. Proofs for this class are enabled dynamically during SmtEngine::finishInit. The expandDefinitions preprocessing step is replaced by apply-substs. The process assertions module no longer needs access to expand definitions. The proof manager does not require a special case of using the define-function maps. Define-function maps are eliminated from SmtEngine. Further work will reorganize the relationship between the expand definitions module and the rewriter, after which global calls to SmtEngine::expandDefinitions can be cleaned up. There is also further work necessary to better integrate theory expand definitions and top-level substitutions, which will be done on a followup PR.
2021-04-29Avoid exponential explosion of small constant in CEGQI (#6461)Gereon Kremer
This PR fixes an issue that can lead to an exponential explosion of a rational constant for repeated calls to the cegqi instantiation strategy. The d_small_const variable was squared regularly, we now simply multiply it with its original value.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback