summaryrefslogtreecommitdiff
path: root/src/expr
AgeCommit message (Collapse)Author
2019-07-01Support sygus version 2 format (#3066)Andrew Reynolds
2019-06-21Add floating-point support in the Java API (#3063)Andres Noetzli
This commit adds support for the theory of floating-point numbers in the Java API. Previously, floating-point related classes were missing in the JAR. The commit also provides an example that showcases how to work with the theory of floating-point numbers through the API.
2019-06-12Refactor parser to define fewer tokens for symbols (#2936)Andres Noetzli
2019-06-05Prevent letification from shadowing variables (#3042)Andres Noetzli
Fixes #3005. When printing nodes, we introduce `let` expressions on the fly. However, when doing that, we have to be careful that we don't shadow existing variables with the same name. When quantifiers are involved, we do not descend into the quantifiers to avoid letifying terms with bound variables that then go out of scope (see #1863). Thus, to avoid shadowing variables appearing in quantifiers, we have to collect all the variables appearing in that term to make sure that the let does not shadow them. In #3005, the issue was caused by a `let` that was introduced outside of a quantifier and then was shadowed in the body of the quantifier by another `let` introduced for that body.
2019-06-02Add check for limit of number of node children (#3035)Andres Noetzli
This commit adds a check that makes sure that we do not try to create nodes with more children than the maxmimum number. This can currently happen when flattening nodes in QF_BV with lots of duplicate children.
2019-05-15Fix iterators in Java API (#3000)Andres Noetzli
Fixes #2989. SWIG 3 seems to have an issue properly resolving `T::const_iterator::value_type` if that type itself is a `typedef`. This is for example the case in the `UnsatCore` class, which `typedef`s `const_iterator` to `std::vector<Expr>::const_iterator`. As a workaround, this commit changes the `JavaIteratorAdapter` class to take two template parameters, one of which is the `value_type`. The commit also adds a compile-time assertion that `T::const_iterator::value_type` can be converted to `value_type` to avoid nasty surprises. A nice side-effect of this solution is that explicit `typemap`s are not necessary anymore, so they are removed. Additionally, the commit adds a `toString()` method for the Java API of `UnsatCore` and adds examples that show and test the iteration over the unsat core and the statistics. Iterating over `Statistics` now returns instances of `Statistic` instead of `Object[]`, which is a bit cleaner and requires less glue code.
2019-04-29Eliminate APPLY kind (#2976)Andrew Reynolds
2019-04-24Do not use __ prefix for header guards. (#2974)Mathias Preiner
Fixes 2887.
2019-04-17More use of isClosure (#2959)Andrew Reynolds
2019-03-28Fix freeing nodes with maxed refcounts (#2903)Andres Noetzli
2019-03-26Update copyright headers.Aina Niemetz
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
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback