ocaml: phase 5.1 gray_code.ml baseline (4-bit reflected Gray code, sum+len = 136)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 35s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 35s
Single-formula generation: gray[i] = i lxor (i lsr 1) For n = 4, generates 16 values, each differing from its neighbour by one bit. Output is a permutation of 0..15, so its sum equals the natural-sequence sum 120; +16 entries -> 136. Tests lsl / lxor / lsr together (the iter-127 bitwise ops) plus Array.make / Array.fold_left. 95 baseline programs total.
This commit is contained in:
@@ -407,6 +407,12 @@ _Newest first._
|
||||
binary search tree (`type 'a tree = Leaf | Node of 'a * 'a tree *
|
||||
'a tree`) with insert + in-order traversal. Tests parametric ADT,
|
||||
recursive match, List.append, List.fold_left.
|
||||
- 2026-05-09 Phase 5.1 — gray_code.ml baseline (4-bit binary
|
||||
reflected Gray code, sum 120 + length 16 = 136). Single-formula
|
||||
generation: `gray[i] = i lxor (i lsr 1)`. Outputs a permutation of
|
||||
0..15, so its sum is the same 120 as the natural sequence; the
|
||||
length-16 confirms 2^4 entries. Tests `lsl`/`lxor`/`lsr` together
|
||||
and Array.make + Array.fold_left. 95 baseline programs total.
|
||||
- 2026-05-09 Phase 5.1 — max_run.ml baseline (longest consecutive
|
||||
run, sum of three test cases = 4+1+0 = 5). Walks list with
|
||||
`Some y when y = x` guard pattern in match for the prev-value
|
||||
|
||||
Reference in New Issue
Block a user