Files
marqdo-cli/tests/conformance/semantics/70-matrix-multiply.mq.md
T
cflmy 5d3a5fb13b test(rfc-cm): close P2 evidence gaps for C01/C06/C12
- Add alloc.double_free detection to the .mq.md free-list allocator and a
  fixture assertion for a second free returning a recoverable Result.
- Add table group fixture 69 (table.row -> Map of value lists).
- Add Int matrix-multiply fixture 70 for C12 layout/iteration.
- Update counts and P2 evidence/status docs.

Gate: fmt, clippy -D warnings, 407 tests passed.
2026-11-20 21:22:44 +08:00

720 B

矩阵乘

(左, 右)

List-of-List 行主序矩阵乘法;调用方保证维度匹配。使用 Int 精确算术。

结果 = []

行号 = 0

  • 行号 < 长度(左)

    左行 = 左[行号]

    新行 = []

    列号 = 0

    • 列号 < 长度(右[0])

      总和 = 0

      内号 = 0

      • 内号 < 长度(左行)

        总和 = 总和 + 左行[内号] * 右[内号][列号]

        内号 = 内号 + 1

      新行 = list.append(新行, 总和)

      列号 = 列号 + 1

    结果 = list.append(结果, 新行)

    行号 = 行号 + 1

结果

main

左 = 1, 2, 3], [4, 5, 6

右 = 7, 8], [9, 10], [11, 12

[左, 右, 矩阵乘(左, 右)]