Skip to content

Commit

Permalink
Add binding for seq.++ and seq.unit
Browse files Browse the repository at this point in the history
Signed-off-by: Yage Hu <[email protected]>
  • Loading branch information
yagehu committed Nov 7, 2024
1 parent cb10013 commit 392c890
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions z3/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,11 @@ impl<'ctx> Seq<'ctx> {
}
}

/// Create a unit sequence of `a`.
pub fn unit<A: Ast<'ctx>>(ctx: &'ctx Context, a: &A) -> Self {
unsafe { Self::wrap(ctx, Z3_mk_seq_unit(ctx.z3_ctx, a.get_z3_ast())) }
}

/// Retrieve the unit sequence positioned at position `index`.
/// Use [`Seq::nth`] to get just the element.
pub fn at(&self, index: &Int<'ctx>) -> Self {
Expand Down Expand Up @@ -1871,6 +1876,10 @@ impl<'ctx> Seq<'ctx> {
pub fn length(&self) -> Int<'ctx> {
unsafe { Int::wrap(self.ctx, Z3_mk_seq_length(self.ctx.z3_ctx, self.z3_ast)) }
}

varop! {
concat(Z3_mk_seq_concat, Self);
}
}

impl<'ctx> Dynamic<'ctx> {
Expand Down

0 comments on commit 392c890

Please sign in to comment.