@@ -147,6 +147,7 @@ import io.ksmt.decl.KRegexIntersectionDecl
147
147
import io.ksmt.decl.KRegexKleeneClosureDecl
148
148
import io.ksmt.decl.KRegexKleeneCrossDecl
149
149
import io.ksmt.decl.KRegexDifferenceDecl
150
+ import io.ksmt.decl.KRegexComplementDecl
150
151
import io.ksmt.decl.KIteDecl
151
152
import io.ksmt.decl.KNotDecl
152
153
import io.ksmt.decl.KOrDecl
@@ -308,6 +309,7 @@ import io.ksmt.expr.KRegexIntersectionExpr
308
309
import io.ksmt.expr.KRegexKleeneClosureExpr
309
310
import io.ksmt.expr.KRegexKleeneCrossExpr
310
311
import io.ksmt.expr.KRegexDifferenceExpr
312
+ import io.ksmt.expr.KRegexComplementExpr
311
313
import io.ksmt.expr.KIteExpr
312
314
import io.ksmt.expr.KLeArithExpr
313
315
import io.ksmt.expr.KLtArithExpr
@@ -2213,6 +2215,22 @@ open class KContext(
2213
2215
KRegexDifferenceExpr (this , arg0, arg1)
2214
2216
}
2215
2217
2218
+ private val regexComplementExprCache = mkAstInterner<KRegexComplementExpr >()
2219
+
2220
+ /* *
2221
+ * Create regular expression's complement.
2222
+ * */
2223
+ open fun mkRegexComplement (arg : KExpr <KRegexSort >): KExpr <KRegexSort > =
2224
+ mkSimplified(arg, KContext ::mkRegexComplementNoSimplify, ::mkRegexComplementNoSimplify) // Add simplified version
2225
+
2226
+ /* *
2227
+ * Create regular expression's complement.
2228
+ * */
2229
+ open fun mkRegexComplementNoSimplify (arg : KExpr <KRegexSort >): KRegexComplementExpr = regexComplementExprCache.createIfContextActive {
2230
+ ensureContextMatch(arg)
2231
+ KRegexComplementExpr (this , arg)
2232
+ }
2233
+
2216
2234
// bitvectors
2217
2235
private val bv1Cache = mkAstInterner<KBitVec1Value >()
2218
2236
private val bv8Cache = mkAstInterner<KBitVec8Value >()
@@ -4850,6 +4868,8 @@ open class KContext(
4850
4868
4851
4869
fun mkRegexDifferenceDecl (): KRegexDifferenceDecl = KRegexDifferenceDecl (this )
4852
4870
4871
+ fun mkRegexComplementDecl (): KRegexComplementDecl = KRegexComplementDecl (this )
4872
+
4853
4873
// Bit vectors
4854
4874
fun mkBvDecl (value : Boolean ): KDecl <KBv1Sort > =
4855
4875
KBitVec1ValueDecl (this , value)
0 commit comments