pub struct Phases {
target_phase: Vec<bool>,
saved_phases: Vec<bool>,
}Expand description
决策相位(phase)状态表。
这是相位选择策略的简化实现:
target_phase:偏向稳定阶段的目标相位;saved_phases:历史相位(phase saving),回溯后可复用。
Fields§
§target_phase: Vec<bool>目标相位。
saved_phases: Vec<bool>保存相位(回溯后优先复用的历史相位)。
Implementations§
Source§impl Phases
impl Phases
Sourcepub fn decide_phase(&self, var_id: usize, target: bool) -> Literal
pub fn decide_phase(&self, var_id: usize, target: bool) -> Literal
按优先级选择变量相位并返回对应文字。
当前优先级:
target == true时使用target_phase- 其他情况使用
saved_phases
flowchart TD
A[输入 var_id, target] --> B{target?}
B -->|是| C[返回 target_phase[var_id]]
B -->|否| D[返回 saved_phases[var_id]]
例:若 target=false 且 saved_phases[var_id]=true,
则本次决策文字为正文字 +var_id。
Sourcepub fn save_phase_for_variable(&mut self, var_id: usize, phase: bool)
pub fn save_phase_for_variable(&mut self, var_id: usize, phase: bool)
保存变量最近一次赋值相位(phase saving)。
Auto Trait Implementations§
impl Freeze for Phases
impl RefUnwindSafe for Phases
impl Send for Phases
impl Sync for Phases
impl Unpin for Phases
impl UnsafeUnpin for Phases
impl UnwindSafe for Phases
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