pub struct BacktrackingTraversal {
pub branch_factor: u64,
pub max_depth: usize,
pub init_aux: u64,
pub path: Vec<u64>,
pub aux: u64,
pub ledger: Vec<UndoToken>,
pub visited: Vec<Vec<u64>>,
}Expand description
Reversible depth-first traversal owner.
Fields§
§branch_factor: u64Number of admitted choices at each non-leaf depth.
max_depth: usizeRequired depth of a complete leaf path.
init_aux: u64Auxiliary value at the root.
path: Vec<u64>Current branch-choice path.
aux: u64Current auxiliary value.
ledger: Vec<UndoToken>Undo tokens aligned with the current path.
visited: Vec<Vec<u64>>A Vec is the executable representation of the TLA+ visited set;
visited_unique and Visit’s freshness guard preserve set semantics.
Implementations§
Source§impl BacktrackingTraversal
impl BacktrackingTraversal
Sourcepub fn mutate_exec(v: u64, d: u64) -> u64
pub fn mutate_exec(v: u64, d: u64) -> u64
Apply the modulo-three auxiliary mutation.
Sourcepub fn new(
branch_factor: u64,
max_depth: usize,
init_aux: u64,
) -> BacktrackingTraversal
pub fn new( branch_factor: u64, max_depth: usize, init_aux: u64, ) -> BacktrackingTraversal
Construct a traversal at its root with an empty visited set.
Sourcepub fn is_leaf_exec(&self) -> bool
pub fn is_leaf_exec(&self) -> bool
Whether the current path has reached the configured leaf depth.
Sourcepub fn can_descend(&self, c: u64, d: u64) -> bool
pub fn can_descend(&self, c: u64, d: u64) -> bool
Whether a choice and mutation delta enable another descent.
Sourcepub fn can_ascend(&self) -> bool
pub fn can_ascend(&self) -> bool
Whether an undo token is available for ascent.
Sourcepub fn has_visited(&self, p: &Vec<u64>) -> bool
pub fn has_visited(&self, p: &Vec<u64>) -> bool
Whether a path occurs in the visited-leaf ledger.
Auto Trait Implementations§
impl Freeze for BacktrackingTraversal
impl RefUnwindSafe for BacktrackingTraversal
impl Send for BacktrackingTraversal
impl Sync for BacktrackingTraversal
impl Unpin for BacktrackingTraversal
impl UnsafeUnpin for BacktrackingTraversal
impl UnwindSafe for BacktrackingTraversal
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