pub struct SumUpdateL<U>(pub U);Expand description
Apply an update to the left side of a Sum.
This requires the resource to be in the Left state.
§Example
use creusot_std::{
ghost::resource::Resource,
logic::ra::{
excl::{Excl, ExclUpdate},
sum::{Sum, SumUpdateL},
},
prelude::*,
};
let mut res: Ghost<Resource<Sum<Excl<Int>, Excl<()>>>> =
Resource::alloc(snapshot!(Sum::Left(Excl(1))));
ghost! { res.update(SumUpdateL(ExclUpdate(snapshot!(2)))) };
proof_assert!(res@ == Sum::Left(Excl(2)));Tuple Fields§
§0: UTrait Implementations§
Source§impl<R1: RA, R2: RA, U: Update<R1>> Update<Sum<R1, R2>> for SumUpdateL<U>
impl<R1: RA, R2: RA, U: Update<R1>> Update<Sum<R1, R2>> for SumUpdateL<U>
Source§fn premise(self, from: Sum<R1, R2>) -> bool
fn premise(self, from: Sum<R1, R2>) -> bool
logic(open, inline)
match from { Sum::Left(from) => self.0.premise(from), Sum::Right(_) => false, }
Source§fn update(self, from: Sum<R1, R2>, ch: U::Choice) -> Sum<R1, R2>
fn update(self, from: Sum<R1, R2>, ch: U::Choice) -> Sum<R1, R2>
logic(open, inline)
match from { Sum::Left(from) => Sum::Left(self.0.update(from, ch)), x => x, /* Dummy */ }
requires
self.premise(from)Auto Trait Implementations§
impl<U> Freeze for SumUpdateL<U>where
U: Freeze,
impl<U> Objective for SumUpdateL<U>where
U: Objective,
impl<U> RefUnwindSafe for SumUpdateL<U>where
U: RefUnwindSafe,
impl<U> Send for SumUpdateL<U>where
U: Send,
impl<U> Sync for SumUpdateL<U>where
U: Sync,
impl<U> Unpin for SumUpdateL<U>where
U: Unpin,
impl<U> UnsafeUnpin for SumUpdateL<U>where
U: UnsafeUnpin,
impl<U> UnwindSafe for SumUpdateL<U>where
U: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more