88. Product domains domain State = (V, K) (2026-11-21)
- Lower product domains (
domain State = (V, K)and nameddomain State = (v: V, d: Dir, ok: Bool)) to a flat row-majorDomainIdwithlo = 0andlen = Π len(F_i).- Reason: Packing factors into a standard nominal
DomainId(idx = (...((ord_0 * len_1 + ord_1) * len_2)...)) means[State]Tis a single contiguous flat array with zero runtime representation overhead, and every existing domain-generic structure (SegTree<State, T>,LazySegTree,Fenwick,Bitset<State>,for s in State,State.len) works automatically in bothcpl-interpandcpl-codegenwith zero backend special cases. Incpl-checkandcpl-ir,(v, k)tuples/records coerce toState(sodp[(v, k)],dp[v, k],State(v, k), andfn f() -> ?State: (v, k)work while swapped order(k, v)is rejected withE0301), andlet (v, k) = s,for (v, k) in State,s.0/s.1, and nameds.vdecode via div/rem.DomainInforecords factor types and combinedmax_sizeso LSP hover reports total state count and array byte size. - Reverse: Remove
factorsfromDomainInfo,product_domainsand its encode/decode helpers fromcrates/cpl-ir/src/lower/{mod,stmt,expr,call}.rs, and the product-factor checks fromcrates/cpl-check/src/check/{types,stmt,expr,call}.rs.
- Reason: Packing factors into a standard nominal