feat(control_tree): Phase 131 normalized loop(true) break-once builder (dev-only)

Implement Normalized shadow builder for loop(true) break-once pattern:

**New Module** (407 lines):
- src/mir/control_tree/normalized_shadow/loop_true_break_once.rs
  - LoopTrueBreakOnceBuilderBox: loop(true) { <assign>* ; break } lowering
  - PHI-free: env parameters + continuation-passing style
  - Generated structure: main → loop_step → loop_body → k_exit
  - Scope: Bool(true) literal condition only, break at end only

**Integration**:
- src/mir/control_tree/normalized_shadow/builder.rs
  - Added lower_with_loop_support() for loop patterns
  - try_lower_if_only() now falls through to loop support on capability reject
- src/mir/control_tree/normalized_shadow/mod.rs
  - Module declaration added

**Contract**:
- Accepted: loop(true) { <assign of int literal/var/add>* ; break }
- Rejected (Ok(None)): continue, return in body, nested control flow
- Out of scope: general loop conditions, complex post-loop statements

**Limitations**:
- Structure-only (dev-only observation mode)
- Execution path not yet wired (follow-up phase required)
- Shadow JoinModule generation working, structural verification passing
- Unit tests: 1155/1155 PASS

Related: Phase 131 P0
This commit is contained in:
nyash-codex
2025-12-18 09:36:38 +09:00
parent 38d3c98822
commit b531a64d67
3 changed files with 423 additions and 2 deletions

View File

@ -34,6 +34,7 @@ pub mod contracts;
pub mod normalized_verifier;
pub mod env_layout;
pub mod if_as_last_join_k;
pub mod loop_true_break_once; // Phase 131: loop(true) break-once
pub mod post_if_post_k; // Phase 129-C: post-if with post_k continuation
pub mod legacy;
pub mod dev_pipeline;