Skip to content

Commit

Permalink
Add a binding for Z3_simplify()
Browse files Browse the repository at this point in the history
  • Loading branch information
cdisselkoen authored and waywardmonkeys committed Jul 2, 2019
1 parent a8f4f4c commit bea28c9
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 @@ -160,6 +160,15 @@ pub trait Ast<'ctx>: Sized {
Z3_get_sort(self.get_ctx().z3_ctx, self.get_z3_ast())
})
}

/// Simplify the `Ast`. Returns a new `Ast` which is equivalent,
/// but simplified using algebraic simplification rules, such as
/// constant propagation.
fn simplify(&self) -> Self {
Self::new(self.get_ctx(), unsafe {
Z3_simplify(self.get_ctx().z3_ctx, self.get_z3_ast())
})
}
}

macro_rules! impl_ast {
Expand Down

0 comments on commit bea28c9

Please sign in to comment.