/// <summary> /// Check for regular expression membership. /// </summary> public BoolExpr MkInRe(SeqExpr s, ReExpr re) { Contract.Requires(s != null); Contract.Requires(re != null); Contract.Ensures(Contract.Result<BoolExpr>() != null); CheckContextMatch(s, re); return new BoolExpr(this, Native.Z3_mk_seq_in_re(nCtx, s.NativeObject, re.NativeObject)); }
/// <summary> /// Replace the first occurrence of src by dst in s. /// </summary> public SeqExpr MkReplace(SeqExpr s, SeqExpr src, SeqExpr dst) { Contract.Requires(s != null); Contract.Requires(src != null); Contract.Requires(dst != null); Contract.Ensures(Contract.Result<SeqExpr>() != null); CheckContextMatch(s, src, dst); return new SeqExpr(this, Native.Z3_mk_seq_replace(nCtx, s.NativeObject, src.NativeObject, dst.NativeObject)); }
/// <summary> /// Convert a regular expression that accepts sequence s. /// </summary> public ReExpr MkToRe(SeqExpr s) { Contract.Requires(s != null); Contract.Ensures(Contract.Result<ReExpr>() != null); return new ReExpr(this, Native.Z3_mk_seq_to_re(nCtx, s.NativeObject)); }
/// <summary> /// Extract index of sub-string starting at offset. /// </summary> public IntExpr MkIndexOf(SeqExpr s, SeqExpr substr, ArithExpr offset) { Contract.Requires(s != null); Contract.Requires(offset != null); Contract.Requires(substr != null); Contract.Ensures(Contract.Result<IntExpr>() != null); CheckContextMatch(s, substr, offset); return new IntExpr(this, Native.Z3_mk_seq_index(nCtx, s.NativeObject, substr.NativeObject, offset.NativeObject)); }
/// <summary> /// Extract subsequence. /// </summary> public SeqExpr MkExtract(SeqExpr s, IntExpr offset, IntExpr length) { Contract.Requires(s != null); Contract.Requires(offset != null); Contract.Requires(length != null); Contract.Ensures(Contract.Result<SeqExpr>() != null); CheckContextMatch(s, offset, length); return new SeqExpr(this, Native.Z3_mk_seq_extract(nCtx, s.NativeObject, offset.NativeObject, length.NativeObject)); }
/// <summary> /// Retrieve sequence of length one at index. /// </summary> public SeqExpr MkAt(SeqExpr s, IntExpr index) { Contract.Requires(s != null); Contract.Requires(index != null); Contract.Ensures(Contract.Result<SeqExpr>() != null); CheckContextMatch(s, index); return new SeqExpr(this, Native.Z3_mk_seq_at(nCtx, s.NativeObject, index.NativeObject)); }
/// <summary> /// Check for sequence containment of s2 in s1. /// </summary> public BoolExpr MkContains(SeqExpr s1, SeqExpr s2) { Contract.Requires(s1 != null); Contract.Requires(s2 != null); Contract.Ensures(Contract.Result<BoolExpr>() != null); CheckContextMatch(s1, s2); return new BoolExpr(this, Native.Z3_mk_seq_contains(nCtx, s1.NativeObject, s2.NativeObject)); }
/// <summary> /// Retrieve the length of a given sequence. /// </summary> public IntExpr MkLength(SeqExpr s) { Contract.Requires(s != null); Contract.Ensures(Contract.Result<IntExpr>() != null); return (IntExpr) Expr.Create(this, Native.Z3_mk_seq_length(nCtx, s.NativeObject)); }