Rewrites for substr of strings of length one (#1712)
authorAndres Noetzli <andres.noetzli@gmail.com>
Mon, 26 Mar 2018 15:52:40 +0000 (08:52 -0700)
committerGitHub <noreply@github.com>
Mon, 26 Mar 2018 15:52:40 +0000 (08:52 -0700)
commit11c698936c10321db68131eb95e8648a20051e3a
treef81a21dda693780d3211881448323ecc57f1bf3e
parentf7e0adeae28bae50632edef3ed2325df67a7ee7a
Rewrites for substr of strings of length one (#1712)

This commit adds a rewrite for substrings of strings of length one to
the empty string if it can be shown that it is not possible that the
start position and the length are both greater than zero:

```
(str.substr "A" x y) --> "" if x = 0 |= 0 >= y
```

The commit introduces a set of functions to check such entailments
with assumptions.
src/theory/strings/theory_strings_rewriter.cpp
src/theory/strings/theory_strings_rewriter.h
test/unit/Makefile.am
test/unit/theory/theory_strings_rewriter_white.h [new file with mode: 0644]