Implement ANF transformation for impure expressions to fix evaluation order: Phase 145 P0 (Skeleton): - Add anf/ module with contract/plan/execute 3-layer separation - AnfDiagnosticTag, AnfOutOfScopeReason, AnfPlan enums - Stub execute_box (always returns Ok(None)) - 11 unit tests pass Phase 145 P1 (Minimal success): - String.length() whitelist implementation - BinaryOp + MethodCall pattern: x + s.length() → t = s.length(); result = x + t - Exit code 12 verification (VM + LLVM EXE) - 17 unit tests pass Phase 145 P2 (Generalization): - Recursive ANF for compound expressions - Left-to-right, depth-first evaluation order - Patterns: x + s.length() + z, s1.length() + s2.length() - ANF strict mode (HAKO_ANF_STRICT=1) - Diagnostic tags (joinir/anf/*) - 21 unit tests pass, 0 regression Also includes Phase 143 P2 (else symmetry) completion. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2.6 KiB
2.6 KiB
CURRENT_TASK (moved)
Status: SSOT
Scope: Repo root の旧リンク互換。現行の入口は docs/development/current/main/10-Now.md。
- Now:
docs/development/current/main/10-Now.md - Backlog:
docs/development/current/main/30-Backlog.md
Handoff (current)
状況(SSOT)
- 現行の入口:
docs/development/current/main/10-Now.md - 次の候補:
docs/development/current/main/30-Backlog.md
直近の道筋(JoinIR / Normalized)
- Phase 139: if-only
post_kの return lowering をReturnValueLowererBoxに統一(DONE)docs/development/current/main/phases/phase-139/README.md
- Phase 140:
NormalizedExprLowererBox初版(pure expression のみ)(DONE)- SSOT:
docs/development/current/main/design/normalized-expr-lowering.md docs/development/current/main/phases/phase-140/README.md
- SSOT:
- Phase 141 P0: impure 拡張点(contract)を SSOT 化(Call/MethodCall はまだ out-of-scope)(DONE)
docs/development/current/main/phases/phase-141/README.md
- Phase 141 P1: “既知 intrinsic だけ” を許可して段階投入(DONE)
docs/development/current/main/phases/phase-141/README.md
- Phase 141 P1.5: known intrinsic registry + available_inputs 3-source merge + diagnostics(DONE)
docs/development/current/main/phases/phase-141/README.md
- Phase 142-loopstmt P0: 正規化単位を statement(loop 1個)へ寄せる(DONE)
docs/development/current/main/phases/phase-142-loopstmt/README.md
- Phase 142-loopstmt P1: LLVM EXE smoke(同 fixture)を追加(DONE)
docs/development/current/main/phases/phase-142-loopstmt/README.md
- Phase 141 P2+: Call/MethodCall(effects + typing)を分離して段階投入
- Historical context:
docs/development/current/main/investigations/joinir-generalization-study.md
- Historical context:
- Phase 143-loopvocab P0/P1: loop 内 if/break/continue の語彙追加(DONE)
docs/development/current/main/phases/phase-143-loopvocab/README.md
- Phase 143-loopvocab P2: else 対称化(B-C / C-B)(DONE)
docs/development/current/main/phases/phase-143-loopvocab/README.md
- Phase 145-anf P0/P1/P2: ANF(impure hoist + 再帰的線形化)(DONE)
docs/development/current/main/phases/phase-145-anf/README.md
Resolved (historical)
WSL EXDEV / cargo build failure (resolved)
- 2025-12-18:
Invalid cross-device link (os error 18)によりcargo buildが失敗する事象があったが、wsl --shutdown再起動後に復旧。 - 再発時のワークアラウンド:
tools/build_llvm.shは EXDEV を避けるためTMPDIRをtarget/...配下へ寄せる。