@@ -133,6 +133,7 @@ import io.ksmt.decl.KStringLiteralDecl
133
133
import io.ksmt.decl.KStringConcatDecl
134
134
import io.ksmt.decl.KStringLenDecl
135
135
import io.ksmt.decl.KStringToRegexDecl
136
+ import io.ksmt.decl.KStringInRegexDecl
136
137
import io.ksmt.decl.KSuffixOfDecl
137
138
import io.ksmt.decl.KPrefixOfDecl
138
139
import io.ksmt.decl.KRegexLiteralDecl
@@ -289,6 +290,7 @@ import io.ksmt.expr.KStringLiteralExpr
289
290
import io.ksmt.expr.KStringConcatExpr
290
291
import io.ksmt.expr.KStringLenExpr
291
292
import io.ksmt.expr.KStringToRegexExpr
293
+ import io.ksmt.expr.KStringInRegexExpr
292
294
import io.ksmt.expr.KSuffixOfExpr
293
295
import io.ksmt.expr.KPrefixOfExpr
294
296
import io.ksmt.expr.KRegexLiteralExpr
@@ -1959,22 +1961,6 @@ open class KContext(
1959
1961
KStringLenExpr (this , arg)
1960
1962
}
1961
1963
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
-
1978
1964
private val suffixOfExprCache = mkAstInterner<KSuffixOfExpr >()
1979
1965
1980
1966
/* *
@@ -2009,6 +1995,38 @@ open class KContext(
2009
1995
KPrefixOfExpr (this , arg0, arg1)
2010
1996
}
2011
1997
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
+ }
2012
2030
2013
2031
private val regexLiteralCache = mkAstInterner<KRegexLiteralExpr >()
2014
2032
@@ -4727,6 +4745,8 @@ open class KContext(
4727
4745
4728
4746
fun mkStringToRegexDecl (): KStringToRegexDecl = KStringToRegexDecl (this )
4729
4747
4748
+ fun mkStringInRegexDecl (): KStringInRegexDecl = KStringInRegexDecl (this )
4749
+
4730
4750
fun mkSuffixOfDecl (): KSuffixOfDecl = KSuffixOfDecl (this )
4731
4751
4732
4752
fun mkPrefixOfDecl (): KPrefixOfDecl = KPrefixOfDecl (this )
0 commit comments