summaryrefslogtreecommitdiff
path: root/src/expr
AgeCommit message (Collapse)Author
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-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-06[proof-new] Updating documentation for Subs/Rw ids (#6502)Haniel Barbosa
2021-04-27Add internal support for datatype update (#6450)Andrew Reynolds
2021-04-27Fix refutational soundness bug in quantifier prenexing (#6448)Andrew Reynolds
This bug can be triggered by define-fun, quantifier macros or inferred substitutions whose RHS contain quantified formulas. This corrects the issue by ensuring that bound variables introduced for prenexing are fresh for distinct quantified formula subterms that may share quantified variables. This was reported by Geoff Sutcliffe via a TPTP run.
2021-04-27Simplify making function types (#6447)Andrew Reynolds
Previously, we were conditionally checking whether a function was "flat" e.g. did not have a function type as the range type. The original motivation for this was to catch cases where the user made a declare-fun that had function return type, which is not permitted. All these checks are already done at the API level https://github.com/CVC4/CVC4/blob/master/src/api/cpp/cvc5_checks.h#L441. However, internally we should have no such restriction. This is required for simplifying the LFSC term processor.
2021-04-27Use std::hash for API types (#6432)Gereon Kremer
This PR replaces all api::*HashFunction objects by specializations of std::hash. std::hash is meant to be extended in this way, and it allows for a much cleaner usage of std::unordered_set and std::unordered_map with these types.
2021-04-23Add assumption-based unsat cores. (#6427)Mathias Preiner
This PR adds an assumption-based unsat cores option. If enabled it will disable proof logging in the SAT solver and adds input assertions as assumptions to the SAT solver. When an unsat core is requested we extract the unsat core in terms of the unsat assumption in the SAT solver. Assumption-based unsat cores use the proof infrastructure to map the input assumptions back to the original assertions.
2021-04-23Add new substitution apply methods fixpoint, sequential, simultaneous (#6429)Andrew Reynolds
This adds various methods for applying substitution as an options to MACRO_SR_* rules. It extends the proof checker and the proof post processor to eliminate based on these types. It updates the trust substitutions utility used by non-clausal simplification to use fixed-point semantics for substitution, which is highly important for efficiency. As a result of this PR, we are orders of magnitude faster for checking proofs for problems where non-clausal substitution infers many substitutions. It also makes our regressions noticeably faster:
2021-04-23BV: Add proof logging for bit-blasting. (#6373)Aina Niemetz
2021-04-21Datatypes: Move implementation of type rules to cpp. (#6418)Aina Niemetz
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-20Add guards to disable clang-format around placeholders in templates. (#6375)Aina Niemetz
2021-04-16Fix ONCE for post-rewrite (#6372)Andrew Reynolds
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-15Fix printing of stats when aborted. (#6362)Gereon Kremer
This PR improves/fixes printing of statistics when the solver has been aborted, i.e. when we use printSafe(), and a few other minor issues with the new statistics setup. add toString() methods for TypeConstant, api::Kind to allow for automatic printing by print_safe<>() improve kindToString() to avoid std::stringstream fix newlines between statistics in printSafe() make printing of histograms consistent make --stats-all, --stats-expert and --stats-every-check automatically enable --stats (and vice versa)
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-14[proof-new] Fix explanation of literals in SAT proof manager (#6346)Haniel Barbosa
Prevents exponential behavior in SAT proof generation by not reexplaining previously explained literals. Also fix a potential issue in not previously overwriting rederived resolution chains during solving.
2021-04-13Formalize more skolems (#6307)Andrew Reynolds
This formalizes more skolems in preparation for moving Theory::expandDefinitions to Rewriter::expandDefinitions. It also adds proof support for datatypes purification.
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_ macros to CVC5_. (#6327)Aina Niemetz
2021-04-09Rename CVC4__ header guards to CVC5__. (#6326)Aina Niemetz
2021-04-09[proof-new] Optimizing sat proof (#6324)Haniel Barbosa
For some benchmarks, checking MACRO_RESOLUTION can be up to 80% (!!!) of the running time. This commit introduces a new rule that does not perform checking. The old rule and checker are kept for ground truth. Some miscellaneous minor changes are also made in the PR.
2021-04-08Use exceptions when constructing malformed datatypes (#6303)Andrew Reynolds
Fixes #5150.
2021-04-08Initial support for parametric datatypes in sygus (#6304)Andrew Reynolds
Fixes #6298. Enables parsing of par in the sygus parser, and adds support for default grammar construction. Also fixes a bug related to single invocation for non-function types.
2021-04-07[proof-new] Fixing SMT post-processor's handling of assumptions (#6277)Haniel Barbosa
Previously the SMT post-processor would update any assumption as long as it had a proof for it. This can be a problem when one as assumption introduced in a scope that should not be expanded. This commit fixes the issue by adding the option of configuring a proof node updater to track scopes and the assumptions they introduce, which can be used to determine the prood nodes which should be updated. It also changes the SMT post-processor to only update assumptions that have not been introduced in some scope. This commit fixes an issue found by @Lachnitt during the integration of CVC4 and Isabelle.
2021-04-07(proof-new) Proper implementation of proof node cloning (#6285)Andrew Reynolds
Previously, we were traversing proof node as a tree, now we use a dag traversal. This also makes sure that proofs work when we have a external proof conversion and we are in incremental mode. In such cases, the final proof must be cloned to ensure that we do not overwrite proof nodes, which may be reused across multiple check-sat.
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-05New C++ Api: Rename and move headers. (#6292)Aina Niemetz
2021-04-05Add interface for skolem functions in SkolemManager (#6256)Andrew Reynolds
This PR introduces the notion of a "skolem function" to SkolemManager, which is implemented as a simple cache of canonical skolem functions/variables. This is a prerequisite for two things: (1) Making progress on the LFSC proof conversion, which currently is cumbersome for skolems corresponding to regular expression unfolding. (2) Cleaning up singletons. Having the ability make canonical skolem functions in skolem manager will enable Theory::expandDefinitions to move to TheoryRewriter::expandDefinitions. This will then enable removal of calls to SmtEngine::expandDefinitions. This PR also makes arithmetic make use of this functionality already. The next steps will be to clean up all raw uses of NodeManager::mkSkolem, especially for other theories that manually track allocated skolem functions.
2021-04-01Rename namespace CVC5 to cvc5. (#6258)Aina Niemetz
2021-03-31Rename namespace CVC4 to CVC5. (#6249)Aina Niemetz
2021-03-30Make SEXPR simply typed (#6160)Andrew Reynolds
Currently, SEXPR applications are given a parametric type SEXPR_TYPE applied to the types of its arguments. This means that SEXPR that are type checked consume roughly double the memory. This issue arises in practice when printing proofs in the internal calculus. There is no need to have SEXPR_TYPE as a parametric type, this PR makes SEXPR simply typed. Also moves some implementation of TypeNode methods to type_node.cpp.
2021-03-25Add missing includes. (#6207)Gereon Kremer
This PR adds includes that are missing from source files, but currently provided by other includes. This mostly concerns <sstream> which is currently included by the statistics, which will change in the future.
2021-03-23Replace old sygus term reconstruction algorithm with a new one. (#5779)Abdalrhman Mohamed
This PR replaces the old algorithm for reconstructing sygus terms with a new "proper" implementation.
2021-03-22Move statistics from the driver into the SmtEngine (#6170)Gereon Kremer
This PR does some refactoring on how we handle statistics in the driver, and some minor cleanup along the way. The SmtEngine now has dedicated statistics for the data collected within the driver and provides utility functions to set them. The driver pushes the collected statistics to the SmtEngine instead of adding them itself to the statistics registry. The node manager no longer holds a statistics registry (that nobody used anymore anyway) The command executor no longer holds a pointer to the SmtEngine itself. The pointer is not necessary and seems to become stale after we call reset on the command executor (which, luckily, we don't seem to do usually) The main motivation for this change is to make the whole statistics infrastructure private to the library and not exporting it to the outside world.
2021-03-22 Function types are always first-class (#6167)Andrew Reynolds
This eliminates one of the dependencies of TypeNode on options. In particular, this makes it so that function types are always considered first-class. This change makes it so that higher-order types can always be constructed; logic exceptions should occur if they are used in constraints.
2021-03-22Guard for non-unique skolems in term formula removal (#6179)Andrew Reynolds
In rare cases, we may reuse skolems for different terms (those that are the same up to purification) due to recent changes in how skolem are generated. This guards for this case in the term formula remover, which avoids assertion failures in cd insert hash map. Fixes #6132.
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-16[proof-new] Renaming proof option to be in sync with SMT-LIB (#6154)Haniel Barbosa
2021-03-15Replace HistogramStat by IntegralHistogramStat (#6126)Gereon Kremer
This PR uses IntegralHistogramStat instead of HistogramStat when appropriate, that is everywhere.
2021-03-12(proof-new) Miscellaneous sync to master (#6129)Andrew Reynolds
Towards having proofs working on master.
2021-03-11arith proof rules shuffle & add ARITH_SUM_UB (#6118)Alex Ozdemir
Preparation for making ARITH_SCALE_SUM_UB a macro. Adds a proof rule for summing upper bounds: ARITH_SUM_UB. Moves ARITH_MULT_* rules from the non-linear extension to the main arithmetic checker, since they will be needed for all of arith now. Aligns the ARITH_SCALE_SUM_UB documentation with its checker.
2021-03-11First refactoring of statistics classes (#6105)Gereon Kremer
This PR does a first round of refactoring on the statistics, in particular the Stat class and derived classes. It significantly shrinks the class hierarchy, modernizes some code (e.g. use std::chrono instead of clock_gettime), removes unused features (e.g. nesting of statistics) and does some general cleanup and consolidation. Subsequent PRs are planned to change the ownership model (right now every module owns the Stat object) which makes the whole register / unregister mechanism obsolete.
2021-03-11Delete Expr layer. (#6117)Aina Niemetz
2021-03-11Clean up ownership of Datatypes in NodeManager. (#6113)Aina Niemetz
This is in preparation for deleting the Expr layer. This further fixes incorrect handling of ownership for the datatypes owned by the NodeManager.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback