[−][src]Trait z3::ast::Ast
Abstract syntax tree (AST) nodes represent terms, constants, or expressions.
The Ast
trait contains methods common to all AST subtypes.
Required methods
fn get_ctx(&self) -> &'ctx Context
fn get_z3_ast(&self) -> Z3_ast
fn new(ctx: &'ctx Context, ast: Z3_ast) -> Self
Provided methods
fn _eq(&self, other: &Self) -> Bool<'ctx>
Compare this Ast
with another Ast
, and get a Bool
representing the result.
This operation works with all possible Ast
s (int, real, BV, etc), but the two
Ast
s being compared must be the same type.
fn distinct(&self, other: &[&Self]) -> Bool<'ctx>
Compare this Ast
with a list of other Ast
s, and get a Bool
which is true only if all arguments (including Self) are pairwise distinct.
This operation works with all possible Ast
s (int, real, BV, etc), but the
Ast
s being compared must all be the same type.
fn get_sort(&self) -> Sort<'ctx>
Get the Sort
of the Ast
fn simplify(&self) -> Self
Simplify the Ast
. Returns a new Ast
which is equivalent,
but simplified using algebraic simplification rules, such as
constant propagation.
fn substitute<T: Ast<'ctx>>(&self, substitutions: &[(&T, &T)]) -> Self
Performs substitution on the Ast
. The slice substitutions
contains a
list of pairs with a "from" Ast
that will be substituted by a "to" Ast
.