Improve skolem caching by normalizing skolem args (#2723)
authorAndres Noetzli <andres.noetzli@gmail.com>
Wed, 28 Nov 2018 20:33:55 +0000 (12:33 -0800)
committerGitHub <noreply@github.com>
Wed, 28 Nov 2018 20:33:55 +0000 (12:33 -0800)
commiteef3d0d658aed64e8014c28eae5841eed298139a
tree7cf4a78c9f8d056c43fb9a8395edabe4787035c2
parente194e29c76f30ab9f0b42d20af699f132ef82fe4
Improve skolem caching by normalizing skolem args (#2723)

In certain cases, we can share skolems between similar reductions, e.g.
`(str.replace x y z)` and `(str.replace (str.substr x 0 n) y z)` because the
first occurrence of `y` in `x` has to be the first occurrence
of `y` in `(str.substr x 0 n)` (assuming that `y` appears in both, otherwise the value of
the skolems does not matter). This commit adds a helper function in the
skolem cache that does some of those simplifications.
src/theory/strings/skolem_cache.cpp
src/theory/strings/skolem_cache.h
test/unit/theory/CMakeLists.txt
test/unit/theory/theory_strings_skolem_cache_black.h [new file with mode: 0644]