summaryrefslogtreecommitdiff
path: root/src/expr
AgeCommit message (Collapse)Author
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.
2021-03-11Refactor Node::getOperator() to fix compiler warning. (#6110)Aina Niemetz
2021-03-10[proof-new] Clarifying doc (#6108)Haniel Barbosa
2021-03-10Move ExprManager::isNAryKind to NodeManager. (#6107)Aina Niemetz
This also renames metakind::getLowerBoundForKind and metakind::getUpperBoundForKind for consistency. Note that the NodeManager class needs to be reordered to comply to our style guidelines. This PR does not reorder but introduces a public block at the top (where the rest of the public interface of the class should go eventually).
2021-03-10Improve arithmetic proofs (#6106)Gereon Kremer
The proof rules for ARITH_MULT_POS and ARITH_MULT_NEG were complex than necessary in that they incorporated a rewriting step. This PR removes rewriting from these rules, making them cleaner and easier to understand. The proof now applies these simpler rule and uses MACRO_SR_PRED_TRANSFORM to prove the lemma that is actually added.
2021-03-10(proof-new) Update ppRewrite to use skolem lemmas (#6102)Andrew Reynolds
This is required for proofs. The internal calculus no longer uses witness forms for reasoning, and hence we cannot return witness terms in ppRewrite. This is required to fix a debug failure, as well as making life easier on external proof conversions. As a result of this PR, for example, given (P a) as input to ppRewrite, previous we returned: (P (witness ((x T)) (A x))) now we return: (P k), with skolem lemma ( (A k), k ) Followup PRs will remove the use of WITNESS in ppRewrite (e.g. in sets and strings); this PR modifies arithmetic to not return WITNESS in response to ppRewrite.
2021-03-10(proof-new) Replace witness form by original form in the internal proof ↵Andrew Reynolds
calculus (#6051) This makes a simplification to the internal proof calculus. In particular, purification skolems are no longer are special case of witness skolems. They are now independent concepts. The concept of "witness form" is replaced in most places by "original form". This is required for fixing two issues: (1) variable shadowing issues in skolemization. (2) bookkeeping issues for bound variables introduced to construct witness terms. This made the LFSC proof conversion extremely cumbersome for e.g. string reductions. In this PR, the main changes: The internals of SkolemManager are changed to use original form vs witness form when necessary. This eliminates the need to do variable renaming in SkolemManager::skolemize. the rule WITNESS_INTRO is replaced by SKOLEM_INTRO MACRO_SR_* rules use original form Proof post processing is simplified These changes imply that ppRewrite should not return WITNESS terms. Followup PRs will modify arithmetic preprocessing so that its ppRewrite method returns skolems instead.
2021-03-09Some more cleanup of includes (#6083)Gereon Kremer
This PR does some more cleanup of the includes.
2021-03-09Update copyright headers to 2021. (#6081)Aina Niemetz
2021-03-08New C++ API: Migrate to Node layer. (#6070)Aina Niemetz
The following items will be added / adressed in subsequent PRs: * migrate statistics tracking for variables and bound variables * migrate adding of listeners when variables and bound variables are created * consistent and clean NodeManagerScope handling (out of scope for this PR) * clean up all interfaces to use const references when possible
2021-03-03More cleanup of includes to reduce compilation times (#6037)Gereon Kremer
Similar to #6031, this PR implements suggestions from iwyu to reduce the number of includes in header files by introducing forward declarations and moving includes to source files.
2021-03-02Clean up includes to reduce compile times (#6031)Gereon Kremer
This PR cleans up a ton of includes, based on the suggestions of iwyu. Mostly, it removes includes from header files in favor of forward declarations and adds includes to source files.
2021-02-26Optionally permit creation of non-flat function types (#6010)Andrew Reynolds
This is required for creating the representation of closues in LFSC, which are of the form ((forall x T) P) where notice that forall has non-flat function type (-> Int Sort (-> Bool Bool)).
2021-02-24Enable -Werror. (#5969)Mathias Preiner
2021-02-23Switch to C++17. (#5959)Mathias Preiner
Co-authored-by: Gereon Kremer <nafur42@gmail.com>
2021-02-23Add proof for mult sign lemma (#5966)Gereon Kremer
This PR adds the proof for a nonlinear refinement lemma that infers the sign of a monomial from the sign of the variables.
2021-02-23Add proof for monomial bounds check (#5965)Gereon Kremer
This PR adds proofs for a nonlinear refinement lemma that deals with multiplication of inequalities with some term. This lemma is split into two proof rules for positive or negative factors.
2021-02-23(proof-new) Add proof generator for CAD solver (#5964)Gereon Kremer
This PR adds a proof generator for the CAD solver, including two new proof rules. The code is not yet used, but will be integrated into the CAD solver itself in another PR.
2021-02-22Add trans secant proofs. (#5957)Gereon Kremer
This PR adds proofs for secant lemmas in the transcendental lemmas for both exponential and sine functions. It also adds proof rules and corresponding proof checkers.
2021-02-22(proof-new) Change proof-new option to proof (#5955)Andrew Reynolds
Also moves several proof-specific options to proof_options.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback