summaryrefslogtreecommitdiff
path: root/src/theory/sets
AgeCommit message (Collapse)Author
2021-11-11Merge branch 'master' into mapConstRationalAndres Noetzli
2021-11-11Remove `ConstantMap<Rational>`Andres Noetzli
This is in preparation of having two different kinds (`CONST_RATIONAL` and `CONST_INT`) share the same payload. To do so, we cannot rely on `ConstantMap<Rational>` anymore to map the payload type to a kind. This commit extends support in the `mkmetakind` script to deal with such payloads by adding a `+` suffix to the type. The commit also does some minor refactoring of `NodeManager::mkConst()` and `NodeManager::mkConstInternal()` to support setting the kind explicitly. Finally, the commit addresses all instances where `mkConst<Rational>()` is used, including the API.
2021-11-10sets: Rename set.intersection to set.inter. (#7622)Aina Niemetz
This further renames kind SET_INTERSECTION to SET_INTER.
2021-11-08expand bag.choose operator (#7481)mudathirmahgoub
This PR expands bag.choose operator as a preprocessing step. It also refactors the implementation of choose operator for sets
2021-11-08sets: Rename kinds with a more consistent naming scheme. (#7595)Aina Niemetz
This prefixes sets kinds with SET_ and relation kinds with RELATION_. It also prefixes the corresponding SMT-LIB operators with 'set.' and relation operators with 'rel.'.
2021-11-05Remove many static calls to rewrite (#7580)Andrew Reynolds
This is the result of a global replace Rewriter::rewrite( -> rewrite( + patching the results. It makes several classes into EnvObj. Many calls to Rewriter::rewrite remain (that are embedded in classes that should not be EnvObj).
2021-11-03Refactor skolem construction (#7561)Andrew Reynolds
This makes all methods for constructing skolems local to SkolemManager. It removes infrastructure for node manager listeners being notified when skolems are constructed. This was used for 2 things: (1) The old dumping infrastructure, where skolems could contribute in part to traces to print benchmarks. This code will be deleted soon. (2) The miplib preprocessing pass, which used this functionality to listen to what skolems were constructed, and subsequently assumed these skolems coincided with what Boolean variables appeared in assertions. This is highly error prone, and has been replaced by a simple traversal to collect Boolean variables in assertions. This is in preparation for a lazy lambda lifting technique, which will require more infrastructure in SkolemManager.
2021-11-01Eliminate calls to Rewriter::rewrite and options:: in sets and bags (#7550)Andrew Reynolds
There is 1 remaining call to Rewriter::rewrite in the bags type enumerator which is not straightforward to eliminate; it should perhaps call an intermediate call to a normal form utility instead of the full rewriter.
2021-11-01Fix upwards closure for relations (#7515)Andrew Reynolds
This PR fixes an issue where we did compute upwards closure (for join, product, etc.) on equivalence classes whose membership cache had already been initialized (perhaps recursively from the computation of upwards/downwards closures on other terms). It also generalizes the fix from #7511. Instead of doing explicit splitting, we mark shared terms and let theory combination (when necessary) do splitting. This is required to fix a more general version of the benchmark from the previous PR, where instead now a term c+1 is used in a position that is relevant to a join. It disables a regression that times out after these fixes, and does further cleanup.
2021-10-27Fix model unsoundness for relation join (#7511)Andrew Reynolds
This fixes a model unsoundness issue in the theory solver for relations.
2021-10-22Refactor theory inference manager constructor (#7457)Andrew Reynolds
Eliminates a style where proof node manager was passed as an argument to indicate proofs enabled if non-null. All theory inference managers now check Env::isTheoryProofProducing instead. Since BV did not pass a proof node manager to its inference manager, this PR also incidentally enables equality engine proofs for BV.
2021-10-20api: Improve documentation for special cases with nullary ops. (#7433)Aina Niemetz
Fixes #7430.
2021-10-04Move isFiniteType from theory engine to Env (#7287)Andrew Reynolds
In preparation for breaking more dependencies on TheoryEngine.
2021-09-13Remove context getters from `TheoryState` (#7174)Andres Noetzli
This removes TheoryState::getSatContext() and TheoryState::getUserContext().
2021-09-07Use `EnvObj` methods instead of `Theory` methods (#7144)Andres Noetzli
This removes the methods `getEnv()`, `options()`, `getSatContext()`, and `getUserContext()` from the `Theory` class because they are now part of `EnvObj`. Additionally, this commit converts the inference managers to `EnvObj` because of there were some calls to retrieve the contexts from `Theory` in those classes.
2021-09-03EnvObj: Add options(), context(), userContext(). (#7137)Aina Niemetz
This further renames EnvObj::getLogicInfo to EnvObj::logicInfo.
2021-08-16Push Env class into TheoryState (#7012)Gereon Kremer
This PR is a follow-up to #7011, making the Env object available in the TheoryState base class.
2021-08-16Make Theory class use Env (#7011)Gereon Kremer
This PR changes the Theory base class and the constructors of all theories to use the Env class to access contexts, logic information and the proof node manager.
2021-08-04Add missing inference identifiers (#6962)Andrew Reynolds
The only remaining unknown inferences covered by our regressions are from the sygus solver, will address in later PR.
2021-07-26Enable default equality proofs for sets (#6931)Andrew Reynolds
This enables default support for equality proofs in the theory of sets. This is in preparation for proofs in the central equality engine, which requires that all active theories that use the central equality engine at least support the default interaction with the equality engine.
2021-07-22Miscellaneous changes in preparation for central equality engine (#6900)Andrew Reynolds
2021-07-09Fix sets cardinality inference involving equivalent parents (#6855)Andrew Reynolds
This fixes an unsoundness issue in the sets + cardinality solver. One rule of this solver applies in sets when two parents of a child of a cardinality graph are equal, in which case we know that child or one of its siblings must be equal to the opposite parent. For example, this rule tells us that: if T = (union T S), then (intersect T S) = S. The explanation of this rule could consider the representative term of one the parents instead of the term itself say (union T S) is representative T, giving the unsound inference: if (union T S) = (union T S), then (intersect T S) = S. This ensures we use the original terms. This PR also does some minor cleanup.
2021-06-22Set up fine grained equality notifications (#6734)Andrew Reynolds
This adds fields to equality engine setup information which will be used to hook up theories to the central equality engine. This PR does not impact any behavior. This is in preparation for the central equality engine.
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-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-19Add more missing inference ids (#6313)Andrew Reynolds
This also makes the relations solver use the inference manager in the standard way.
2021-05-13Add std::hash overloads for Node, TNode and TypeNode. (#6534)Mathias Preiner
Eliminates NodeHashFunction, TNodeHashFunction and TypeNodeHashFunction.
2021-04-23(proof-new) Proofs for sets purification lemmas (#6416)Andrew Reynolds
This adds proofs for sets purification lemmas, which are of the form (= t (skolem t)) and (member t (skolem (singleton t))). Each can be trivially justified in the internal calculus by MACRO_SR_PRED_INTRO.
2021-04-22Move expand definition from Theory to TheoryRewriter (#6408)Andrew Reynolds
This is work towards eliminating global calls to getCurrentSmtEngine()->expandDefinition. The next step will be to add Rewriter::expandDefinition.
2021-04-21Goodbye CVC4, hello cvc5! (#6371)Mathias Preiner
This commits changes the build system to cvc5 and removes the remaining occurrences of CVC4. It further cleans up outdated/unused scripts in contrib/.
2021-04-21Sets: Move implementation of type rules to cpp. (#6401)Aina Niemetz
2021-04-15Rename occurrences of CVC4 to CVC5. (#6351)Aina Niemetz
This renames everything but GitHub links and build system related macros. Switching the build system to cvc5 will be the last step in the renaming process.
2021-04-14Fix type rule for relations join image (#6349)Andrew Reynolds
The join image type rule restricted that an argument was a constant. This is a logic restriction that should not be a part of the type checker. This is required for not throwing type checking exceptions during proof conversion to LFSC.
2021-04-14Refactor / reimplement statistics (#6162)Gereon Kremer
This PR refactors how we collect statistics. It splits the current statistic values into the values and a proxy object. The actual values now live inside the registry (making the ownership model way easier) while the proxy object are handed to whoever wants to collect a new statistic. It also extends the C++ API to obtain and inspect the statistics. To change the ownership, this PR needs to touch every single statistic in the whole codebase and change how it is registered.
2021-04-14Rename public and private headers in src/include. (#6352)Aina Niemetz
2021-04-12Fix computation of whether a type is finite (#6312)Andrew Reynolds
This PR generalizes TypeNode::isFinite / TypeNode::isInterpretedFinite with TypeNode::getCardinalityClass. It then uses this method to fix our computation of when a type should be treated as finite. Fixes #4260, fixes #6100 (that benchmark now says unknown without an error).
2021-04-12Refactor and update copyright headers. (#6316)Aina Niemetz
2021-04-09Rename CVC4__ header guards to CVC5__. (#6326)Aina Niemetz
2021-04-08Add identifiers for sources of incompleteness (#6311)Andrew Reynolds
This PR classifies all internal kinds of incompleteness as identifiers. It makes it so TheoryEngine records an identifier when its incomplete flag is set. The next step will be to possibly communicate this value to the user.
2021-04-07Replace calls to NodeManager::mkSkolem with SkolemManager::mkDummySkolem (#6291)Andrew Reynolds
This is in preparation for refactoring skolem creation throughout the code base to improve proofs and migrate Theory::expandDefinitions to Rewriter::expandDefinitions. This PR also eliminates some unused code in TheoryArithPrivate. Followup PRs will start formalizing/eliminating calls to mkDummySkolem.
2021-04-06Remove template argument from `NodeBuilder` (#6290)Andres Noetzli
Currently, NodeBuilder takes a single template argument: An integer that determines the expected number of arguments. This argument is used to determine the size of the d_inlineNvChildSpace array. This array is used to construct nodes inline. The advantage of this is that we don't have to allocate a NodeValue on the heap for the node under construction until we are sure that the node is new. While templating the array size may save some stack space (or avoid a heap allocation if we statically know that we a fixed number of children and that number is greater than 10), it complicates the code and leads to longer compile times. Thus, this commit removes the template argument and moves some of the NodeBuilder code to a source file for faster compilation. CPU build time before change (debug build): 2429.68s CPU build time after change (debug build): 2228.44s Signed-off-by: Andres Noetzli noetzli@amazon.com
2021-04-06Fix issue with lemma during equality engine iterator in sets (#6289)Andrew Reynolds
Fixes #4370.
2021-04-05[proof-new] Registering proof checkers uniformly from the SMT solver (#6275)Haniel Barbosa
Each theory has its own proof checker, responsible for checking the rules pertaining to that theory. The main proof checker uses these specialized checkers. Previously the main proof checker (of the proof node manager used across the SMT solver) was connected to these theory proof checkers during initialization of the theory. This commit adds an interface to the theories for retrieving its proof checker (analogous to how one retrieves the rewriter of a theory) which is used by a new method in the theory engine to register a theory proof checker to a given proof checker according to a theory id. This is in preparation for the new unsat cores based on proofs.
2021-04-05Fix subtyping for sets care graph (#6278)Andrew Reynolds
We were getting types for set singleton/membership in a way that was unsafe for subtyping, which was leading to incorrectly computing care graphs for sets of reals. Fixes #5705.
2021-04-01Rename namespace CVC5 to cvc5. (#6258)Aina Niemetz
2021-03-31Rename namespace CVC4 to CVC5. (#6249)Aina Niemetz
2021-03-31Add missing inference ids (#6242)Andrew Reynolds
Towards having complete stats on inference ids for each lemma, fact, and conflict.
2021-03-16cmake: Generate cvc4_export.h and set visibility to hidden. (#6139)Mathias Preiner
The build system (cmake) will automatically generate an export header cvc4_export.h, which makes sure that the correct export features are defined depending on the compiler and target platform. The macro CVC4_EXPORT replaces CVC4_PUBLIC and its usage is reduced by 2/3. Co-authored-by: Gereon Kremer <nafur42@gmail.com>
2021-03-11Delete Expr layer. (#6117)Aina Niemetz
2021-03-11(proof-new) Clean up uses of witness with skolem lemmas (#6109)Andrew Reynolds
This ensures we do not return WITNESS terms in response to ppRewrite. This makes standard utility methods in SkolemLemma to help make this easy. It also removes TheorySetsPrivate::expandDefinitions, which was returning WITNESS in response to expandDefinitions, which is no longer permitted.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback