summaryrefslogtreecommitdiff
path: root/src/expr
AgeCommit message (Collapse)Author
2020-07-27(proof-new) Proof production for term formula removal (#4687)Andrew Reynolds
This adds proof support in the term formula removal pass. It also refactors this class heavily so that its interface is more intuitive and does not depend on AssertionPipeline.
2020-07-17Add NodeManagerScopes to fix use-after-free issues (#4768)Andres Noetzli
This commit fixes our current ASan issues. Some methods in `NodeManager` were not creating a `NodeManagerScope` for `this` but were indirectly calling methods that get the `NodeManager` from the current scope, so we ended up calling methods on a `NodeManager` that had already been destroyed.
2020-07-17(proof-new) Updates to strings core solver (#4642)Andrew Reynolds
This updates the core strings solver in preparation for proofs. The main changes include: The addition of the strings PfRule enum values. The definition of a "getConclusion" static method, used by the core solver, and to be used in the future by the strings proof checker. This includes several optional forms of lemmas, which are added as options in this PR. Major simplifications to our inference schemas for disequality handling (a STRING_DECOMPOSE inference rule). Note this is the only significant intended behavioral change in this PR. Minor updates to the form of inferences send to inference manager, for instance to orient equalities in the expected way, and to reorder assumptions. These changes are done for uniformity and make the strings proof reconstruction from inference steps easier.
2020-07-15Use TypeNode in UninterpretedConstant (#4748)Andres Noetzli
This commit changes UninterpretedConstant to use TypeNode instead of Type.
2020-07-14Remove sygus print callback (#4727)Andrew Reynolds
This removes sygus print callbacks, since they are no longer necessary to support the sygus v1 parser. This involved generalizing the scope of the datatype utility sygusToBuiltin. Now, printing "as sygus" simply is accomplished by doing sygusToBuiltin conversion and then calling the printer on the builtin term. This is required for further work towards eliminating the Expr layer. FYI @4tXJ7f
2020-07-14(proof-new) Skeleton proof support in the Rewriter (#4730)Andrew Reynolds
This adds support for skeleton proofs in the rewriter (REWRITE -> THEORY_REWRITE). It adds "extended equality rewrite" as a new method of the rewriter/theory rewriters. The unit test of this feature should be added on a followup PR. Co-authored-by: Andres Noetzli <andres.noetzli@gmail.com>
2020-07-14Use TypeNode in EmptySet (#4740)Andres Noetzli
This commit changes EmptySet to use TypeNode instead of Type.
2020-07-13Use TypeNode/Node in ArrayStoreAll (#4728)Andres Noetzli
This commit changes ArrayStoreAll to use Node/TypeNode instead of Expr/Type.
2020-07-13Fix type comparisons involving pointer. (#4738)Andrew Reynolds
Fixes debug regressions, introduced by a combination of the addition of sequence update and the change to pointers.
2020-07-13 (proof-new) SMT Preprocess proof generator (#4708)Andrew Reynolds
This adds the proof generator for storing proofs of preprocessing. It stores assertions added via preprocessing passes and their rewrites. This utility will eventually live in SmtEngine. It also adds 2 new proof rules, and fixes an issue in ProofNodeUpdater.
2020-07-12Add support for string/sequence update (#4725)Andrew Reynolds
This adds basic support for string/sequence updating, which has a semantics that is length preserving.
2020-07-12Remove ExprSequence (#4724)Andres Noetzli
Now that we can break the old API, we don't need an ExprSequence anymore. This commit removes ExprSequence and replaces all of its uses with Sequence. Note that I had to temporarily make sequence.h public because we currently include it in a "public" header because we still generate the code for Expr::mkConst<Sequence>().
2020-07-10Adding test for whether a kind is n-ary (#4718)Haniel Barbosa
2020-07-10(proof-new) Add ONCE and FIXPOINT modes for term conversion proof generator ↵Andrew Reynolds
(#4709) We need multiple policies for generic proofs for term conversion, in particular, substitution has a "apply once" semantics which does not apply rewrite steps to a fixpoint like the rewriter. This is required for eliminating SUBS steps in the final proof. Also note that an internal method for getting proofs was generalized, which will be required for doing multiple variants of proofs in this utility in the future.
2020-07-07Transfer ownership of internal Options from NodeManager to SmtEngine (#4682)Andrew Reynolds
This PR decouples Options from NodeManager. Instead, options now live in SmtEngine. The changes that were required for this PR include: The main internal options object is now owned by SmtEngine instead of ExprManager. The ownership resource manager is moved from NodeManager to SmtEngine. Node manager listeners are deleted, timeouts and resource limits are set during SmtEngine::finishInit. A temporary hack was added to make the last constructed SmtEngine to be the one in scope. This ensures that options are in scope whenever an SmtEngine is created. The methods for invoking "subsolvers" (theory/smt_engine_subsolver.h,cpp) was simplified, as versions of these calls that change options do not have to clone a new copy of the ExprManager anymore. Resource manager was removed from the smt2 parser. Minor refactoring was done in SmtEngine to copy "original options" so that options are restored to their state after parsing command line options on reset. Updates to unit tests to ensure conformance to new options scoping.
2020-07-06Front end support for sequences (#4690)Andrew Reynolds
With this PR, we now support a preliminary draft of a theory of sequences. This PR adds front end support for sequences in the smt2 parser, in the new API, adds regressions and unit tests for them. As discussed offline, many of the string kinds are given a sequence version in the external API, but not in the internal one. This means that a special case for such kinds, getKindHelper was added to Term. We do not yet support proper smt2 printing of sequences, which will require access to this code for Kind conversions (to distinguish e.g. str.++ from seq.++).
2020-07-02Remove SWIG bindings (#4683)Andres Noetzli
This commit removes support for SWIG bindings for the legacy API. The bindings were already broken by 19054b3b1d427e662d30d4322df2b2f2361353da and we are not planning on using SWIG for the Java API for the new API.
2020-07-02 (proof-new) Updates to skolem manager interface (#4664)Andrew Reynolds
Adds a fix for mkPurifySkolem and introduces new interfaces in preparation for arithmetic operator elimination and term formula removal proofs.
2020-07-02(proof-new) Proof rule checkers run on skolem forms (#4660)Andrew Reynolds
Previously, the proof rule checkers were run on witness form for convenience. However, it is more flexible for the sake of the internal calculus to run on Skolem forms. The main reason is that the conversion to/from witness form does not preserve terms that contain witness. Our preprocessing steps rely on using witness terms. This design change additionally simplifies a lot of the code of the builtin proof rule checker. Instead, witness forms can be queried on an as-needed basis, e.g. in MACRO_SR_PRED_TRANSFORM.
2020-07-02(proof-new) Proof node updater (#4647)Andrew Reynolds
Adds utility for updating proof nodes. The module for post-processing proof nodes in the SmtEngine for the sake of proof conversion to external formats will build on this utility. Requires #4617.
2020-06-29Make ExprManager constructor private (#4669)Andres Noetzli
This commit makes the ExprManager constructor private and updates the initialization of subsolvers, unit tests, and system tests accordingly. This is a step towards making options part of SmtEngine instead of NodeManager.
2020-06-28Proof Rules and Checker for Arithmetic (#4665)Alex Ozdemir
This PR introduces proof rules for arithmetic and their checker. The code is dead, since these rules are never used.
2020-06-25fix and test (#4658)yoni206
This PR adds support for indexed operators (such as extract) to getOperatorsMap in node_algorithm.cpp. The corresponding test is augmented accordingly.
2020-06-23(proof-new) Updates to proof node manager (#4617)Andrew Reynolds
Main feature added is the mkScope interface, which is agnostic to symmetry of (dis)equalities. It also adds a check for cyclic proofs when using the interface ProofNodeManager::updateNode. Note that an earlier version of this method was agnostics to predicates vs Boolean equality with constants. This is no longer required.
2020-06-19Use traversal iterators in IntToBv (#4169)Alex Ozdemir
This commit rips the traversal machinery out of Int-to-Bv, replacing it with traversal iterators. Also, cleaned `childrenTypesChanged` a bit. While basically I just cut out some lines, the diff is rather messy (I think the diffing tool doesn't like indentation changes).
2020-06-19Add Match utility function. (#4632)Abdalrhman Mohamed
2020-06-19(proof-new) CDProof inherits from ProofGenerator (#4622)Andrew Reynolds
This design simplifies a number of issues and makes the PRefProofGenerator class obsolete.
2020-06-19Convert more uses of strings to words (#4584)Andrew Reynolds
Towards theory of sequences. This PR also adds support for sequences in default sygus grammars. Also removes an interface for mkEmptyWord which doesn't have an equivalent for sequences.
2020-06-18Improve memory management in Java bindings (#4629)Andres Noetzli
Fixes #2846. One of the challenges of the Java bindings is that the garbage collector can delete unused objects at any time in any order. This is an issue with CVC4's API because we require all `Expr`s to be deleted before the corresponding `ExprManager`. In the past, we were using `NewGlobalRef`/`DeleteGlobalRef` on the wrapper object of `ExprManager`. The problem is that we can have multiple instances of the wrapper that internally all refer to the same `ExprManager`. This commit implements a different approach where the Java wrappers hold an explicit reference to the `ExprManager`. The commit also removes some unused or unimportant API bits from the bindings.
2020-06-16Update copyright headers.Aina Niemetz
2020-06-15(proof-new) Add quantifiers proof checker (#4593)Andrew Reynolds
Adds core rules for quantifiers, some of which also will be used as a general way for introducing and skolemizing witness terms. This PR also changes the order of other rules in proof_rule.h/cpp which was in an abnormal order from previous merges.
2020-06-15(proof-new) Update proof node, add proof node algorithm utility file. (#4600)Andrew Reynolds
Moves get free assumptions to a proof_node_algorithm.h/cpp file, analogous to node_algorithm.h/cpp. Adds a more general form of it, getFreeAssumptionsMap, which is required for future method ProofNodeManager::mkScope.
2020-06-12(proof-new) Term conversion proof generator utility (#4603)Andrew Reynolds
This utility is used for constructing any proof where a term is "converted" into another by small step rewrites. This utility will be used to construct the skeleton of the proofs of rewrites, preprocessing steps, expand definitions, results of substitutions, and so on.
2020-06-11 (proof-new) Add lazy proof utility (#4589)Andrew Reynolds
Adds an extension of CDProof where facts can be mapped to (lazy) proof generators.
2020-06-09(proof-new) Refactor skolemization (#4586)Andrew Reynolds
This PR refactors skolemization in SkolemManager so that we use a "curried" form, where witnesses for a variable x is based on the existential where the prefix up to x has already been skolemized. This additionally adds more utility functions that will be used in the internal proof checker for quantifiers.
2020-06-08(proof-new) Add abstract proof generator class (#4574)Andrew Reynolds
Also adds a commonly used proof generator: the proof reference proof generator.
2020-06-06Fix destruction order in NodeManager (#4578)Andres Noetzli
Fixes #4576. ASan was reporting memory leaks because the skolem manager was being destroyed after the attributes and zombies were already cleaned up in the destructor of NodeManager. This commit changes the destruction order to ensure that the skolem manager is destroyed before the rest of the cleanup. Note: this issue did not only make the benchmark in #4576 fail but several tests in our regressions.
2020-06-05Datatypes with nested recursion are not handled in TheoryDatatypes unless ↵Andrew Reynolds
option is set (#3707) Towards experimental support for non-simply recursive datatypes (https://github.com/ajreynol/CVC4/tree/dtNonSimpleRec). Builds a check for non-simple recursion in the DType class. If a term of a datatype type is registered to TheoryDatatypes for a datatype that has nested recursion, we throw a LogicException unless the option dtNestedRec is set to true. Also includes a bug discovered in the TypeMatcher utility and another in expr::getComponentTypes. It also adds a unit test using the new API for a simple parametric datatype example as well, not related to nested recursion, as this was previously missing.
2020-06-05(proof-new) Updates to CDProof (#4565)Andrew Reynolds
This updates CDProof with several new functionalities, including making it agnostic to symmetry of (dis)equalites.
2020-06-05(proof-new) Rename ProofSkolemCache to SkolemManager (#4556)Andrew Reynolds
This PR changes the design of ProofSkolemCache so that it has facilities for tracking proofs. This is required so that the term formula removal pass can be made proof-producing. This makes it so that ProofSkolemCache is renamed to SkolemManager, which lives in NodeManager. Creating (most) skolems must be accompanied by a corresponding ProofGenerator that can provide the proof for the existential corresponding to their witness form. Further updates will include refactoring the mkSkolemExists method of SkolemManager so that its contract wrt proofs is simpler. Once all calls to mkSkolem go through the standard interface, then NodeManager::mkSkolem will be moved to SkolemManager::mkSkolemInternal.
2020-06-05Fix lifetime and copy issues with NodeDfsIterable (#4569)Andres Noetzli
When running node_traversal_black with ASan and UBSan, there were two distinct issues being reported. UBSan was complaining that we were assigning an invalid value to a Boolean. This happened because d_initialized in NodeDfsIterator was uninitialized and the default copy constructor tried to copy it. This commit removes that data member. ASan was complainig that NodeDfsIterator::begin() was trying to access a skip function that had been freed. In particular, this happened when NodeDfsIterable was used in a range-based for loop like so: for (auto n : NodeDfsIterable(n).inPostorder()) { ... } The problem here is that the lifetime of a temporary within the range expression is not extended (the lifetime of the result of the range expression is extended, however) [0]. This is a problem because NodeDfsIterable(n) is a temporary and inPostorder() returns a reference to that temporary. It makes sense that the compiler cannot possibly know that the reference from inPostorder() corresponds to NodeDfsIterable(n), so it cannot extend its lifetime. See [1] for more details on the problem with chained functions. This commit fixes the issue by replacing the fluent interface of NodeDfsIterable by a constructor with default arguments. Additionally, it introduces an enum to represent the visit order to avoid having a nondescript Boolean argument. [0] https://en.cppreference.com/w/cpp/language/range-for#Temporary_range_expression [1] http://cpptruths.blogspot.com/2018/10/chained-functions-break-reference.html?m=1
2020-06-03(proof-new) Adding rules and proof checker for EUF (#4559)Haniel Barbosa
2020-06-03(proof-new) Adding rules and proof checker for Boolean reasoning (#4560)Haniel Barbosa
2020-06-03(proof-new) Add builtin proof checker (#4537)Andrew Reynolds
This adds the proof checker for TheoryBuiltin, which handles the core proof rules (SCOPE and ASSUME) and all proof rules corresponding to generic operations on Node objects. This includes proof rules for rewriting and substitution, which are added in this PR.
2020-06-01(proof-new) Proof step buffer utilities (#4533)Andrew Reynolds
This class is used for delaying proof node creation until it is necessary.
2020-05-30Add the sequence type (#4539)Andrew Reynolds
This adds basic infrastructure for the sequence type, including its type rules, type enumerator and extensions to type functions. The next step will be to finalize the support in TheoryStrings for sequences and then add front end support for sequences in the API/parsers.
2020-05-27Add the Expr-level sequence datatype (#4526)Andrew Reynolds
This adds the expr-level sequence datatypes. This is required for further progress on sequences. However, note that this class may be deleted in the further when the Expr level is replaced.
2020-05-26(proof-new) Update proof checker. (#4511)Andrew Reynolds
This adds new required features to proof checker and the base class of proof rule checker. This is required as the first dependency towards merging further infrastructure related to proofs.
2020-05-23Add the sequence datatype (#4153)Andrew Reynolds
This class is the Node-level representation of a sequence. It is analogous to CVC4::String.
2020-05-22(proof-new) Proof node to SExpr utility. (#4512)Andrew Reynolds
This is required for dag-ifying ProofNode output.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback