summaryrefslogtreecommitdiff
path: root/src/theory/sets
AgeCommit message (Collapse)Author
2020-04-15Always flush lemmas from downwards closure in sets (#4297)Andrew Reynolds
Fixes #4283. This also makes a few minor improvements to how lemmas are sent in sets. In particular, lemmas are not sent if we are already in conflict.
2020-04-08Added CHOOSE operator for sets (#4211)mudathirmahgoub
This PR enables THEORY_UF by default for sets and adds the operator CHOOSE for sets which returns an element from a given set. The semantics is as follows: If a set A = {x}, then the term (choose A) is equivalent to the term x. If the set is empty, then (choose A) is an arbitrary value. If the set has cardinality > 1, then (choose A) will deterministically return an element in A.
2020-04-08Perform theory widening eagerly (#4044)Andres Noetzli
Fixes #3971 and fixes #3991. In incremental mode, the logic can change from one (check-sat) call to another. In the reported issue, we start with QF_NIA but then switch to QF_UFNIA because there is a div term (which has a UF in its expanded form). Dealing with this issue is challenging in general. As a result, we have decided not to allow theory widening in Theory::expandDefinitions() anymore but instead to do it eagerly in SmtEngine::setDefaults().
2020-04-03Update theory rewriter ownership, add stats to strings (#4202)Andres Noetzli
This commit adds statistics for string rewrites. This is work towards proof support in the string solver. At a high level, this commit adds a pointer to a `SequenceStatistics` in the rewriters and modifies `SequencesRewriter::returnRewrite()` to count the rewrites done. In practice, to make this work requires a couple of changes, some of them temporary: - We can't have a single `Rewriter` instance shared between different `SmtEngine` instances anymore. Thus the `Rewriter` is now owned by the `SmtEngine` and calling the rewriter retrieves the rewriter associated with the current `SmtEngine`. This is a temporary workaround before we get rid of singletons. - Methods in the `SequencesRewriter` and the `StringsRewriter` are made non-`static` because they need access to the statistics instance. - `StringsEntail` now has non-`static` methods because it needs a reference to the sequences rewriter that it can call. - The interaction between the `StringsRewriter` and the `SequencesRewriter` changed: the `StringsRewriter` is now a proper `TheoryRewriter` that inherits from `SequencesRewriter` and calls its `postRewrite()` before applying its own rewrites (this is essentially a reversal of roles from before: the `SequencesRewriter` used to call `static` methods in the `StringsRewriter`). - The theory rewriters are now owned by the individual theories. This design mirrors the `EqualityEngine`s owned by the individual theories.
2020-04-01Initialize theory rewriters in theories (#4197)Andres Noetzli
Until now, the `Rewriter` was responsible for creating `TheoryRewriter` instances. This commit adds a method `mkTheoryRewriter()` that theories override to create an instance of their corresponding theory rewriter. The advantage is that the theories can pass additional information to their theory rewriter (e.g. a statistics object).
2020-03-06Minor refactor for theory of sets (#3924)Andrew Reynolds
Flattens a block of code and refactors the main check loop, will make it easier to incorporate new extensions. It also avoids a needless call to check() for Relations when there are no relations constraints.
2020-03-05Enable -Wshadow and fix warnings. (#3909)Mathias Preiner
Fixes all -Wshadow warnings and enables the -Wshadow compile flag globally. Co-authored-by: Clark Barrett <barrett@cs.stanford.edu> Co-authored-by: Andres Noetzli <andres.noetzli@gmail.com> Co-authored-by: Aina Niemetz <aina.niemetz@gmail.com> Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu> Co-authored-by: makaimann <makaim@stanford.edu> Co-authored-by: yoni206 <yoni206@users.noreply.github.com> Co-authored-by: Andrew Reynolds <andrew.j.reynolds@gmail.com> Co-authored-by: AleksandarZeljic <zeljic@stanford.edu> Co-authored-by: Caleb Donovick <cdonovick@users.noreply.github.com> Co-authored-by: Amalee <amaleewilson@gmail.com> Co-authored-by: Scott Kovach <dskovach@gmail.com> Co-authored-by: ntsis <nekuna@gmail.com>
2020-03-03Refactoring and cleaning the type enumerator for sets (#3908)mudathirmahgoub
* Miscellaneous changes * Removed unnecessary vector of enumerators * cleanup * cleanup * cleanup * refactoring * cleanup * refactoring * used binary numbers for sets * isFinished for enumerator * format * added theory_sets_type_enumerator_white.h * format * Used BitVector class * Tracing * Documentation * moved implementation to theory_sets_type_enumerator.cpp * minor changes
2020-03-02Fix `TheorySetsPrive::eqNotifyPostMerge()` (#3901)Andres Noetzli
A local declaration of `s1` was shadowing `s1`, which meant that the non-local definition of `s1` could never be not null. This meant that parts of the code were never run. This commit fixes the issue by removing the local declaration.
2020-03-02Fix variable shadowing bug in sets. (#3898)Mathias Preiner
2020-02-26Initial work towards -Wshadow (#3817)Andrew Reynolds
2020-02-07Univeset Cardinality constraints for infinite types (#3712)mudathirmahgoub
2020-02-03Fix cardinality of uninterpreted types when univset is not used (#3663)mudathirmahgoub
* Fixed bug 3662 * format * small change * added bug3663.smt2 file * throw Logic Exception * throw Logic Exception * ;EXIT: 1 Co-authored-by: Andrew Reynolds <andrew.j.reynolds@gmail.com>
2020-01-07Universe set cardinality for finite types with finite cardinality (#3392)mudathirmahgoub
* rewrote set cardinality for finite-types * small changes and format
2019-12-13Add support for set comprehension (#3312)Andrew Reynolds
2019-12-12Use the node-level datatypes API (#3556)Andrew Reynolds
2019-12-09Make theory rewriters non-static (#3547)Andres Noetzli
This commit changes theory rewriters to be non-static. This refactoring is needed as a stepping stone to making our rewriter configurable: If we have multiple solver objects with different rewrite configurations, we cannot use `static` variables for the rewriter table in the BV rewriter for example. It is also in line with our goal of getting rid of singletons in general. Note that the `Rewriter` class is still a singleton, which will be changed in a future commit.
2019-11-09Fixes in relations related to datatypes not passed by reference (#3449)Andrew Reynolds
The current code is creating/destroying datatypes unnecessarily.
2019-10-30Unify CVC4_CHECK/CVC4_DCHECK/AlwaysAssert/Assert. (#3366)Mathias Preiner
2019-10-22Refactoring skolems for sets (#3381)Andrew Reynolds
This refactors skolems introduced in the theory of sets. This is analogous to how skolems are treated for the theory of strings. A key change that this commit enables is to identify "variable" sets based on those that weren't introduced by the SkolemCache (instead of via a check that their kind is `VARIABLE`, which is done currently and is error prone).
2019-10-08prefer prefix ++ operator for iteratorsPiotr Trojanek
Detected with cppcheck static analyser, which said: (performance) Prefer prefix ++/-- operators for non-primitive types. Reformat with clang-format as needed. Signed-off-by: Piotr Trojanek <piotr.trojanek@gmail.com>
2019-09-16Initialize fields in sets inference manager (#3289)Andrew Reynolds
2019-09-13Split, refactor and document the theory of sets (#3085)Andrew Reynolds
2019-08-28Removing comments related to issues (#3232)Andrew Reynolds
2019-07-08Towards refactoring relations (#3078)Andrew Reynolds
2019-04-24Do not use __ prefix for header guards. (#2974)Mathias Preiner
Fixes 2887.
2019-04-01Modify strategy in sets+cardinality (#2909)Andrew Reynolds
2019-03-29Apply empty splits more aggressively in sets+cardinality (#2907)Andrew Reynolds
2019-03-26Update copyright headers.Aina Niemetz
2018-12-14 Fix extended rewriter for binary associative operators. (#2751)Andrew Reynolds
This was causing assertion failures when using Sets + Sygus.
2018-12-03 Skip non-cardinality types in sets min card inference (#2734)Andrew Reynolds
2018-11-27Make (T)NodeTrie a general utility (#2489)Andrew Reynolds
This moves quantifiers::TermArgTrie in src/theory/quantifiers/term_database to (T)NodeTrie in src/expr, and cleans up all references to it.
2018-10-19Remove autotools build system. (#2639)Mathias Preiner
2018-10-03Fix stale op list in sets (#2572)Andrew Reynolds
2018-09-22cmake: Remove unused CMakeLists.txtMathias Preiner
2018-09-22cmake: Added initial build infrastructure.Aina Niemetz
2018-08-24 Fix more simple coverity warnings (#2372)Andrew Reynolds
2018-08-22Wrapping TheorySetsPrivate in a unique_ptr. (#2356)Tim King
2018-08-22Fix invalid iterator comparisons (#2349)Andrew Reynolds
2018-08-17Remove miscellaneous unused code (#2333)Andrew Reynolds
2018-08-16Move node algorithms to separate file (#2311)Andres Noetzli
2018-07-25Removing support for CDHashMap::iterator's postfix increment. (#2208)Tim King
2018-07-24Improvements to sets + cardinality + quantifiers (#2200)Andrew Reynolds
2018-06-25Updated copyright headers.Aina Niemetz
2018-05-03Sets subtypes (#1095)Andrew Reynolds
Make sets theory properly handle equalities between (Set T1) and (Set T2) whenever equalities between T1 and T2 are also handled. Generalizes previous approach for type correctness conditions. Add regression.
2018-03-06Make statistics output consistent. (#1647)Mathias Preiner
* Fixes --hide-zero-stats (and really skips the 0 values) * Removes the additional newline after each statistic * Introduces theory::getStatsPrefix(TheoryId) to generate consistent prefixes for statistics based on the theory id (e.g., THEORY_BV -> "theory::bv").
2018-03-05Enable -Wsuggest-override by default. (#1643)Mathias Preiner
Adds missing override keywords.
2018-02-06Resolving warnings from -Winconsistent-missing-override on clang. (#1563)Tim King
2018-01-10Removing throw specifiers for TypeRules. (#1501)Tim King
2018-01-10Removing throw specifiers from type enumerators. (#1502)Tim King
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback