summaryrefslogtreecommitdiff
path: root/src/expr
AgeCommit message (Collapse)Author
2019-03-26Fix warnings about wrong line numbers (#2899)Andres Noetzli
2019-03-23Fix memory leak when using subsolvers (#2893)Andres Noetzli
ASAN was reporting memory leaks in regression tests that were using subsolvers. First, I am going to describe the origin of the leaks and then the solution implemented in this commit. Recall an `Expr` stores the `NodeManager` that the internal node is associated with. `Node::toExpr()` converts a `Node` to an `Expr` and assumes that the active `NodeManager` (returned by `NodeManager::currentNM()` is the one associated with the node. In `ExportPrivate::exportInternal()`, when we were exporting a skolem, we created a skolem in the target `NodeManager` by calling `NodeManager::mkSkolem()` (`ExprManager`s do not support the creation of skolems) but then we called `Node::toExpr()` on the resulting skolem while the origin `NodeManager` was the active `NodeManager`. One of the issues of having the wrong `NodeManager` in the `Expr` is that when the `Expr` is destroyed and the internal node's refcount reaches zero in destructor of `Expr`, then the node value associated with the node is added to the set of zombie nodes (nodes waiting to be garbage collected or resurrected) of the wrong `NodeManager`. The problem here is that the set of zombie nodes uses the node id to hash and compare nodes. Node ids, however, are only unique within a given `NodeManager`. Thus, if we have two nodes with the same id from different `NodeManager`s and both reach refcount zero in the context of the same `NodeManager`, only one of them will end up in the set of zombies and thus only that one will be freed. Using a subsolver realiably triggered this issue. `ExportPrivate::exportInternal()` stored the `Expr` with the wrong `NodeManager` in an `ExprManagerMapCollection` which associates variables in the original `ExprManager` with the variables in the target `ExprManager`. When we created a subsolver, we created the `ExprManagerMapCollection` before creating our subsolver, so it was deleted after the subsolver and so deleting the `ExprManagerMapCollection` deleted the last reference to `Expr`s holding skolem nodes associated with the wrong `NodeManager`. This commit fixes the issue by making sure that the correct `NodeManager` is in scope when converting the skolem/bound variable nodes to an `Expr`. It also swaps the creation order of `ExprManagerMapCollection` and `ExprManager` to make sure that `ExprManagerMapCollection` is deleted before the `ExprManager` that the `Expr`s belong to. Additionally, the commit makes it harder to make a similar mistake by asserting that the `Expr`s in the `ExprManagerMapCollection` are associated with the expected `ExprManager`s. Finally, it adds an assertion that tries to identify such issues by checking whether the list of zombies contains a node with the same id but located at a different address.
2019-03-15Adding capture avoiding substitution (#2867)Haniel Barbosa
2019-03-14Properly handle lambdas in relevant domain (#2853)Andrew Reynolds
2019-03-14 Add getFreeVariables method to node algorithm (#2852)Andrew Reynolds
2019-01-29New C++ API: Fix checks for mkTerm. (#2820)Aina Niemetz
This required fixing the OpTerm handling for mkTerm functions in the API.
2019-01-22 Fix parsing of overloaded parametric datatype selectors (#2819)Andrew Reynolds
2018-12-17Remove noop. (#2763)Aina Niemetz
2018-12-17New C++ API: Add tests for term object. (#2755)Aina Niemetz
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-12Improvements to rewrite rules from inputs (#2625)Andrew Reynolds
2018-10-10Fix compiler warnings (#2602)Andres Noetzli
2018-10-10Synthesize rewrite rules from inputs (#2608)Andrew Reynolds
2018-10-04New C++ API: Add checks for Sorts. (#2519)Aina Niemetz
2018-10-03Simplify datatypes printing (#2573)Andrew Reynolds
2018-09-26Fix bug in getSymbols. (#2544)Andrew Reynolds
2018-09-24cmake: Fix dependencies for code generation. (#2524)Mathias Preiner
2018-09-24Fix wiki urls. (#2504)Mathias Preiner
2018-09-24cmake: Fix theory order #2. (#2522)Mathias Preiner
2018-09-23 New C++ API: Add checks for Terms/OpTerms. (#2455)Aina Niemetz
2018-09-22cmake: Only build libcvc4 and libcvc4parser as libraries.Mathias Preiner
The sources of all previous libraries are now added to libcvc4 and built as libcvc4. This removes circular dependencies between libcvc4 and libexpr. Further, we now only have one parser library and don't build additional libraries for each language.
2018-09-22cmake: Rebase with current master, add new tests/source files.Mathias Preiner
2018-09-22cmake: Add missing dependency.Mathias Preiner
2018-09-22cmake: Cleanup CMakeLists.txt files, remove SHARED.Mathias Preiner
2018-09-22cmake: Working build infrastructure.Mathias Preiner
TODO: cvc4autoconfig.h
2018-09-22cmake: .cpp generation done, .h generation not yet completeAina Niemetz
2018-09-22cmake: Added initial build infrastructure.Aina Niemetz
2018-09-10Set NodeManager to nullptr when exporting vars (#2445)Andres Noetzli
PR #2409 assumed that temporarily setting the NodeManager to nullptr when creating variables is not needed anymore. However, this made our portfolio build fail. This commit reintroduces the temporary NodeManager change while creating variables.
2018-09-07 Make isClosedEnumerable a member of TypeNode (#2434)Andrew Reynolds
2018-09-05Finer-grained inference of substitutions in incremental mode (#2403)Andrew Reynolds
2018-08-31Fix export of bound variables (#2409)Haniel Barbosa
2018-08-29Forcing attribute_internals.h to use uint64_t's for shift operations. (#2370)Tim King
2018-08-27Make division chainable in the smt2 parser (#2367)Andrew Reynolds
2018-08-23 Do not print internally generated datatypes in external outputs with sygus ↵Andrew Reynolds
(#2234)
2018-08-16Move node algorithms to separate file (#2311)Andres Noetzli
2018-08-15Removing attribute cleanups. (#2300)Tim King
* Removing attribute cleanups.
2018-08-13Removing support for T* and const T* attributes. (#2297)Tim King
* Removing support for T* and const T* attributes. These are unused.
2018-08-11Make attributes robust to static init orderings (#2295)Andres Noetzli
@taking pointed out that part of the issue fixed in #2293 is also that we should be more robust to different (de-)initialization orders. A common, portable way to achieve this is to allocate the object in question on the heap and make the pointer to it static [0]. This commit fixes the variable in question. I have tested this fix in ASAN (without using --no-static-init flag for CxxTest) and it works. [0] https://isocpp.org/wiki/faq/ctors#construct-on-first-use-v2
2018-08-07Require Swig 3 (#2283)Andres Noetzli
Removes some hacks due to Swig 2's incomplete C++11 support and adds checks for version 3 at configuration time as well as in swig.h
2018-08-07Delete functions instead of using CVC4_UNDEFINED (#1794)Andres Noetzli
C++11 supports explicitly deleting functions that should not be used (explictly or implictly), e.g. copy or assignment constructors. We were previously using the CVC4_UNDEFINED macro that used a compiler-specific attribute. The C++11 feature should be more portable.
2018-08-03Eliminate option for sygus UF evaluation functions (#2262)Andrew Reynolds
2018-08-01Fix API call for reg exp. (#2248)Andrew Reynolds
2018-08-01Fix issues with printing parametric datatypes in smt2 (#2213)Andrew Reynolds
2018-07-27Fix Node::hasFreeVar for function variables (#2216)Andrew Reynolds
A Node has free variables if its operator has free variables.
2018-07-21Optimizations and fixes for computing whether a type is finite (#2179)Andrew Reynolds
2018-07-14exportTo only if needed for --sygus-rr-synth-check (#2168)Andres Noetzli
2018-07-13New C++ API: Implementation of datatype classes. (#2142)Aina Niemetz
2018-06-28Do not rename uninterpreted constants (#2098)Andrew Reynolds
2018-06-25Updated copyright headers.Aina Niemetz
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback