This makes preregistration of terms SAT-context dependent in strings instead of user-context dependent.
Fixes #5547.
This is required to avoid model unsoundness on sequence benchmarks, as demonstrated in that issue.
It furthermore impacts how we have been handling theory combination with arithmetic for str.len and impacts how propagation is setup for the strings equality engine.
I will do performance testing on this PR.
d_hasStrCode(false),
d_functionsTerms(s.getSatContext()),
d_inputVars(s.getUserContext()),
- d_preregisteredTerms(s.getUserContext()),
+ d_preregisteredTerms(s.getSatContext()),
d_registeredTerms(s.getUserContext()),
d_registeredTypes(s.getUserContext()),
d_lengthLemmaTermsCache(s.getUserContext()),
regress0/seq/intseq.smt2
regress0/seq/issue4370-bool-terms.smt2
regress0/seq/issue5543-unit-cmv.smt2
+ regress0/seq/issue5547-seq-len-unit.smt2
+ regress0/seq/issue5547-small-seq-len-unit.smt2
regress0/seq/seq-2var.smt2
regress0/seq/seq-ex1.smt2
regress0/seq/seq-ex2.smt2
--- /dev/null
+; COMMAND-LINE: --strings-exp
+; EXPECT: sat
+(set-logic QF_SLIA)
+(declare-fun seq3 () (Seq Int))
+(declare-fun seq10 () (Seq Int))
+(declare-fun seq12 () (Seq Int))
+(assert (seq.suffixof (seq.++ (seq.unit (seq.len (seq.++ seq12 (seq.rev seq3)))) seq3) seq10))
+(check-sat)
--- /dev/null
+; COMMAND-LINE: --simplification=none --strings-exp
+; EXPECT: sat
+(set-logic ALL)
+(declare-fun a () (Seq Int))
+(declare-fun b () (Seq Int))
+(assert (= a (seq.++ b (seq.unit (+ (seq.len b) 1)))))
+(check-sat)