summaryrefslogtreecommitdiff
path: root/src/theory/strings/rewrites.h
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-12-08 00:38:14 -0600
committerGitHub <noreply@github.com>2020-12-08 00:38:14 -0600
commit0309ef4aa7462c6fa2a65c1ef408dc9063bb1f21 (patch)
tree6a5165e43890811a91d01bce0ff7cb3893a4257c /src/theory/strings/rewrites.h
parent3223d3c765b87db9d87a7ca65c4b7cf5dc9a7885 (diff)
Proper implementation of expand definitions for sequences (#5616)
Expand definitions for sequences was wrong in two ways: (1) we replaced str.from_code with a witness term. This led to it being unevaluatable in models. (2) we did not handle seq.nth, meaning its model value was unevaluatable if it was out of bounds. Now it evaluates the value of the uninterpreted function we replace with. This corrects both issues and adds a regression to demonstrate both kinds of terms evaluate correctly. To do this, I added a helper function to skolem cache as well as a new (internal-only) kind SEQ_NTH_TOTAL. Notice applications of this kind should only be used for model evaluation. Notice this fixes several check-model warnings in the regressions. It still does not fix others since other things must be corrected for model evaluation (e.g. expandDefinitions must be applied on theory assertions for --debug-check-models). This will be done in later PRs.
Diffstat (limited to 'src/theory/strings/rewrites.h')
-rw-r--r--src/theory/strings/rewrites.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/theory/strings/rewrites.h b/src/theory/strings/rewrites.h
index f9824405b..a450ae7f6 100644
--- a/src/theory/strings/rewrites.h
+++ b/src/theory/strings/rewrites.h
@@ -213,7 +213,8 @@ enum class Rewrite : uint32_t
LEN_SEQ_UNIT,
CHARAT_ELIM,
SEQ_UNIT_EVAL,
- SEQ_NTH_EVAL
+ SEQ_NTH_EVAL,
+ SEQ_NTH_TOTAL_OOB
};
/**
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback