Skip to main content

foundry_evm_symbolic/executor/
mod.rs

1use super::{abi::*, runtime::*, *};
2
3/// Pops the next pending path according to the configured exploration order.
4pub(crate) fn pop_worklist<T>(
5    worklist: &mut VecDeque<T>,
6    order: SymbolicExplorationOrder,
7) -> Option<T> {
8    pop_batch(worklist, order)
9}
10
11/// Pops the current path from a local batch according to the configured exploration order.
12pub(crate) fn pop_batch<T>(batch: &mut VecDeque<T>, order: SymbolicExplorationOrder) -> Option<T> {
13    match order {
14        SymbolicExplorationOrder::Bfs => batch.pop_front(),
15        SymbolicExplorationOrder::Dfs => batch.pop_back(),
16    }
17}
18
19/// Spills the remaining local batch onto the global worklist in scheduler order.
20pub(crate) fn spill_batch<T>(
21    batch: VecDeque<T>,
22    worklist: &mut VecDeque<T>,
23    order: SymbolicExplorationOrder,
24) {
25    match order {
26        SymbolicExplorationOrder::Bfs => worklist.extend(batch),
27        SymbolicExplorationOrder::Dfs => {
28            worklist.reserve(batch.len());
29            for path in batch {
30                worklist.push_back(path);
31            }
32        }
33    }
34}
35
36mod calls;
37mod cheatcodes;
38mod constraints;
39mod create;
40mod invariant;
41mod opcodes;
42mod run;