Phase 2: TypeOp変換の一本化(Optimizer安全ネット削除)\nPhase 3: 可視化/スナップショット基盤(--mir-verbose-effects, snapshot/compare/ci_check)\nDocs: Phase 1/2 完了マーク・利用方法追記

This commit is contained in:
Moe Charm
2025-08-24 01:58:41 +09:00
parent 3c3dc86be0
commit 0aef8d49a7
19 changed files with 835 additions and 132 deletions

View File

@ -129,7 +129,8 @@ impl EffectMask {
/// Check if the computation is pure (no side effects)
pub fn is_pure(self) -> bool {
self.contains(Effect::Pure) || self.0 == 0
// 純粋性は一次カテゴリで判定Pureビットが立っていてもIO/WRITE/CONTROL等があれば純粋ではない
self.primary_category() == Effect::Pure
}
/// Check if the computation is mutable (modifies state)
@ -346,5 +347,9 @@ mod tests {
let display = format!("{}", read_io);
assert!(display.contains("read"));
assert!(display.contains("io"));
// is_pure should be false when IO is present, even if PURE bit was set initially
let mixed = EffectMask::PURE | EffectMask::IO;
assert!(!mixed.is_pure());
}
}