@@ -133,6 +133,7 @@ import io.ksmt.decl.KStringLiteralDecl
133133import io.ksmt.decl.KStringConcatDecl
134134import io.ksmt.decl.KStringLenDecl
135135import io.ksmt.decl.KStringToRegexDecl
136+ import io.ksmt.decl.KStringInRegexDecl
136137import io.ksmt.decl.KSuffixOfDecl
137138import io.ksmt.decl.KPrefixOfDecl
138139import io.ksmt.decl.KRegexLiteralDecl
@@ -289,6 +290,7 @@ import io.ksmt.expr.KStringLiteralExpr
289290import io.ksmt.expr.KStringConcatExpr
290291import io.ksmt.expr.KStringLenExpr
291292import io.ksmt.expr.KStringToRegexExpr
293+ import io.ksmt.expr.KStringInRegexExpr
292294import io.ksmt.expr.KSuffixOfExpr
293295import io.ksmt.expr.KPrefixOfExpr
294296import io.ksmt.expr.KRegexLiteralExpr
@@ -1959,22 +1961,6 @@ open class KContext(
19591961 KStringLenExpr (this , arg)
19601962 }
19611963
1962- private val stringToRegexExprCache = mkAstInterner<KStringToRegexExpr >()
1963-
1964- /* *
1965- * Create a regular expression based on a string expression.
1966- * */
1967- open fun mkStringToRegex (arg : KExpr <KStringSort >): KExpr <KRegexSort > =
1968- mkSimplified(arg, KContext ::mkStringToRegexNoSimplify, ::mkStringToRegexNoSimplify) // Add simplified version
1969-
1970- /* *
1971- * Create a regular expression based on a string expression.
1972- * */
1973- open fun mkStringToRegexNoSimplify (arg : KExpr <KStringSort >): KStringToRegexExpr = stringToRegexExprCache.createIfContextActive {
1974- ensureContextMatch(arg)
1975- KStringToRegexExpr (this , arg)
1976- }
1977-
19781964 private val suffixOfExprCache = mkAstInterner<KSuffixOfExpr >()
19791965
19801966 /* *
@@ -2009,6 +1995,38 @@ open class KContext(
20091995 KPrefixOfExpr (this , arg0, arg1)
20101996 }
20111997
1998+ private val stringToRegexExprCache = mkAstInterner<KStringToRegexExpr >()
1999+
2000+ /* *
2001+ * Create a regular expression based on a string expression.
2002+ * */
2003+ open fun mkStringToRegex (arg : KExpr <KStringSort >): KExpr <KRegexSort > =
2004+ mkSimplified(arg, KContext ::mkStringToRegexNoSimplify, ::mkStringToRegexNoSimplify) // Add simplified version
2005+
2006+ /* *
2007+ * Create a regular expression based on a string expression.
2008+ * */
2009+ open fun mkStringToRegexNoSimplify (arg : KExpr <KStringSort >): KStringToRegexExpr = stringToRegexExprCache.createIfContextActive {
2010+ ensureContextMatch(arg)
2011+ KStringToRegexExpr (this , arg)
2012+ }
2013+
2014+ private val stringInRegexExprCache = mkAstInterner<KStringInRegexExpr >()
2015+
2016+ /* *
2017+ * Check if a string belongs to the language defined by the regular expression.
2018+ * */
2019+ open fun mkStringInRegex (arg0 : KExpr <KStringSort >, arg1 : KExpr <KRegexSort >): KExpr <KBoolSort > =
2020+ mkSimplified(arg0, arg1, KContext ::mkStringInRegexNoSimplify, ::mkStringInRegexNoSimplify) // Add simplified version
2021+
2022+ /* *
2023+ * Check if a string belongs to the language defined by the regular expression.
2024+ * */
2025+ open fun mkStringInRegexNoSimplify (arg0 : KExpr <KStringSort >, arg1 : KExpr <KRegexSort >): KStringInRegexExpr =
2026+ stringInRegexExprCache.createIfContextActive {
2027+ ensureContextMatch(arg0, arg1)
2028+ KStringInRegexExpr (this , arg0, arg1)
2029+ }
20122030
20132031 private val regexLiteralCache = mkAstInterner<KRegexLiteralExpr >()
20142032
@@ -4727,6 +4745,8 @@ open class KContext(
47274745
47284746 fun mkStringToRegexDecl (): KStringToRegexDecl = KStringToRegexDecl (this )
47294747
4748+ fun mkStringInRegexDecl (): KStringInRegexDecl = KStringInRegexDecl (this )
4749+
47304750 fun mkSuffixOfDecl (): KSuffixOfDecl = KSuffixOfDecl (this )
47314751
47324752 fun mkPrefixOfDecl (): KPrefixOfDecl = KPrefixOfDecl (this )
0 commit comments