summaryrefslogtreecommitdiff
path: root/src/theory
AgeCommit message (Collapse)Author
2021-05-27Merge branch 'master' into indexof_reindexof_reAndrew Reynolds
2021-05-27updateAndres Noetzli
2021-05-27Update src/theory/strings/theory_strings_preprocess.cppAndres Noetzli
Co-authored-by: Andrew Reynolds <andrew.j.reynolds@gmail.com>
2021-05-27Update proof namespaces (#6614)Andrew Reynolds
This removes namespace theory from proof utilities, and moves MethodId to its own file in src/proof/.
2021-05-27minorAndres Noetzli
2021-05-27Fix CEGQI for datatypes with Boolean subfields (#6630)Andrew Reynolds
Fixes a solution soundness issue caused by allowing ineligible terms of kind BOOLEAN_TERM_VARIABLE to appear in instantiations. This also corrects the expected solution on a benchmark that had an incorrect status. Fixes #6603.
2021-05-27update commentAndres Noetzli
2021-05-27address commentsAndres Noetzli
2021-05-27FP: Rename FLOATINGPOINT_PLUS to FLOATINGPOINT_ADD. (#6628)Aina Niemetz
This is to make it consistent with the name of the SMT-LIB operator (fp.add).
2021-05-27Return `REWRITE_AGAIN` after rewriting bvcomp (#6624)Andres Noetzli
This commit fixes an assertion failure in the rewriter on some of the SMT-LIB QF_ABVFP benchmarks (the regression in this commit is the minified version of `non_incremental/QF_ABVFP/20170428-Liew-KLEE/imperial_gsl_benchmarks_statistics_klee.x86_64/query.14.smt2`). The problem was that after applying the `BvComp` rewrite, the bit-vector rewriter was returning `REWRITE_DONE` instead of `REWRITE_AGAIN`. The rewrite simplifies expressions of the form `bvcomp(t, c)` where `c` is a constant of bit-width 1. If `c` is zero, then the rewrite returns `bvnot(t)`. This node can potentially be rewritten further, e.g., if `t` is `bvnot(x)`. This commit fixes the response and adds the corresponding tests.
2021-05-26 More precise includes of `Node` constants (#6617)Andres Noetzli
We store constants, e.g., BitVector and Rational, in our node infrastructure. As a result, we were indirectly including some headers in almost all files, e.g., the GMP headers. This commit changes that by forward-declaring the classes for the constants. As a result, we have to include headers like util/rational.h explicitly when we use Rational but it saves about 3 minutes in compile time (CPU time). The commit changes RoundingMode from an enum to an enum class such that it can be forward declared.
2021-05-24Fix non-fixed length case in re-elim (#6612)Andrew Reynolds
Fixes followup issues from #6604.
2021-05-24Fix `str.replace_re` and `str.replace_re_all`Andres Noetzli
Fixes #6057. The reductions of `str.replace_re` and `str.replace_re_all` were not correctly enforcing that the operations replace the _first_ occurrence of some regular expression in a string. This commit fixes the issue by introducing a new operator `str.indexof_re(s, r, n)`, which, analoguously to `str.indexof`, returns the index of the first match of the regular expression `r` in `s`. The commit adds basic rewrites for evaluating the operator as well as its reduction. Additionally, it converts the reductions of `str.replace_re` and `str.replace_re_all` to use that new operator. This simplifies the reductions of the two operators and ensures that the semantics are consistent between the two.
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
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback