Struct move_model::exp_rewriter::ExpRewriter
source · [−]pub struct ExpRewriter<'env, 'rewriter> { /* private fields */ }
Expand description
Rewriter for expressions, allowing to substitute locals by expressions as well as instantiate types.
Implementations
sourceimpl<'env, 'rewriter> ExpRewriter<'env, 'rewriter>
impl<'env, 'rewriter> ExpRewriter<'env, 'rewriter>
sourcepub fn new<F>(env: &'env GlobalEnv, replacer: &'rewriter mut F) -> Self where
F: FnMut(NodeId, RewriteTarget) -> Option<Exp>,
pub fn new<F>(env: &'env GlobalEnv, replacer: &'rewriter mut F) -> Self where
F: FnMut(NodeId, RewriteTarget) -> Option<Exp>,
Creates a new rewriter with the given replacer map.
sourcepub fn set_type_args(self, type_args: &'rewriter [Type]) -> Self
pub fn set_type_args(self, type_args: &'rewriter [Type]) -> Self
Adds a type argument list to this rewriter. Generic type parameters are replaced by the given types.
Trait Implementations
sourceimpl<'env, 'rewriter> ExpRewriterFunctions for ExpRewriter<'env, 'rewriter>
impl<'env, 'rewriter> ExpRewriterFunctions for ExpRewriter<'env, 'rewriter>
fn rewrite_local_var(&mut self, id: NodeId, sym: Symbol) -> Option<Exp>
fn rewrite_temporary(&mut self, id: NodeId, idx: TempIndex) -> Option<Exp>
fn rewrite_node_id(&mut self, id: NodeId) -> Option<NodeId>
sourcefn rewrite_exp(&mut self, exp: Exp) -> Exp
fn rewrite_exp(&mut self, exp: Exp) -> Exp
Top-level entry for rewriting an expression. Can be re-implemented to do some
pre/post processing embedding a call to do_rewrite
. Read more
fn rewrite_vec(&mut self, exps: &[Exp]) -> Vec<Exp>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
fn rewrite_enter_scope<'a>(
&mut self,
decls: impl Iterator<Item = &'a LocalVarDecl>
)
fn rewrite_exit_scope(&mut self)
fn rewrite_value(&mut self, id: NodeId, value: &Value) -> Option<Exp>
fn rewrite_spec_var(
&mut self,
id: NodeId,
mid: ModuleId,
vid: SpecVarId,
label: &Option<MemoryLabel>
) -> Option<Exp>
fn rewrite_call(
&mut self,
id: NodeId,
oper: &Operation,
args: &[Exp]
) -> Option<Exp>
fn rewrite_invoke(
&mut self,
id: NodeId,
target: &Exp,
args: &[Exp]
) -> Option<Exp>
fn rewrite_lambda(
&mut self,
id: NodeId,
vars: &[LocalVarDecl],
body: &Exp
) -> Option<Exp>
fn rewrite_block(
&mut self,
id: NodeId,
vars: &[LocalVarDecl],
body: &Exp
) -> Option<Exp>
fn rewrite_quant(
&mut self,
id: NodeId,
vars: &[(LocalVarDecl, Exp)],
triggers: &[Vec<Exp>],
cond: &Option<Exp>,
body: &Exp
) -> Option<Exp>
fn rewrite_if_else(
&mut self,
id: NodeId,
cond: &Exp,
then: &Exp,
else_: &Exp
) -> Option<Exp>
fn rewrite_exp_descent(&mut self, exp: Exp) -> Exp
fn internal_rewrite_id(&mut self, id: &NodeId) -> (bool, NodeId)
fn internal_rewrite_exp(&mut self, exp: &Exp) -> (bool, Exp)
fn internal_rewrite_vec(&mut self, exps: &[Exp]) -> Option<Vec<Exp>>
fn internal_rewrite_decls(
&mut self,
decls: &[LocalVarDecl]
) -> (bool, Vec<LocalVarDecl>)
fn internal_rewrite_quant_decls(
&mut self,
decls: &[(LocalVarDecl, Exp)]
) -> (bool, Vec<(LocalVarDecl, Exp)>)
Auto Trait Implementations
impl<'env, 'rewriter> !RefUnwindSafe for ExpRewriter<'env, 'rewriter>
impl<'env, 'rewriter> !Send for ExpRewriter<'env, 'rewriter>
impl<'env, 'rewriter> !Sync for ExpRewriter<'env, 'rewriter>
impl<'env, 'rewriter> Unpin for ExpRewriter<'env, 'rewriter>
impl<'env, 'rewriter> !UnwindSafe for ExpRewriter<'env, 'rewriter>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more