From 558758fcf1e41669752a8f5dddb6a9c9744cc9ec Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sun, 12 Jan 2025 11:14:17 -0800 Subject: [PATCH] another stab at fixing substring interval extraction combinatorics - i is the offset into val_other. The valid offsets are 0... |val_other|-1. - j is the length of the substring. It only makes sense to extract strings of length 1,... |val_other|-i --- src/ast/sls/sls_seq_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ast/sls/sls_seq_plugin.cpp b/src/ast/sls/sls_seq_plugin.cpp index 3f09f3792..eaccfb9bd 100644 --- a/src/ast/sls/sls_seq_plugin.cpp +++ b/src/ast/sls/sls_seq_plugin.cpp @@ -694,7 +694,7 @@ namespace sls { hashtable> set; set.insert(zstring("")); for (unsigned i = 0; i < val_other.length(); ++i) { - for (unsigned j = val_other.length() - i; j-- > 0; ) { + for (unsigned j = 1; j <= val_other.length() - i; ++j) { zstring sub = val_other.extract(i, j); if (set.contains(sub)) break;