pub struct ActivityTable {
pq: KeyedPriorityQueue<usize, OrderedFloat<f64>>,
activities: Vec<f64>,
var_inc: f64,
var_decay: f64,
}Expand description
VSIDS 的变量活跃度表。
启发式目标:
- 冲突相关变量会被
bump,分数上升; var_inc随冲突递增并经衰减控制,强调近期冲突;- 通过优先队列选取当前分数最高的未赋值变量。
例:设初始 var_inc = 1.0、var_decay = 0.8。
- 第 1 次冲突命中变量
v:activity[v] += 1.0 - 调用
decay_inc()后:var_inc = 1.25 - 第 2 次冲突再次命中
v:activity[v] += 1.25
因而近期冲突对分数贡献更大,变量选择会更偏向“最近导致冲突”的区域。
Fields§
§pq: KeyedPriorityQueue<usize, OrderedFloat<f64>>§activities: Vec<f64>§var_inc: f64§var_decay: f64Implementations§
Source§impl ActivityTable
impl ActivityTable
Sourcepub fn bump_var_score(&mut self, var_id: usize)
pub fn bump_var_score(&mut self, var_id: usize)
提升变量活跃度(通常在冲突分析中调用)。
若变量已在堆中,更新其优先级; 若暂不在堆中,按当前活跃度重新插入。
Sourcepub fn bump_decay_factor(&mut self)
pub fn bump_decay_factor(&mut self)
调整衰减系数,逐步降低历史冲突的影响。
Auto Trait Implementations§
impl Freeze for ActivityTable
impl RefUnwindSafe for ActivityTable
impl Send for ActivityTable
impl Sync for ActivityTable
impl Unpin for ActivityTable
impl UnsafeUnpin for ActivityTable
impl UnwindSafe for ActivityTable
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