xpile 0.1.616

Polyglot transpile workbench (Python/C/C++/Rust/Ruchy/Lean ↔ Rust/Ruchy/PTX/WGSL/SPIR-V) with provable contracts at every layer.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# PMAT-502y (Tranche 2): for k, v in d.items() — iterate dict pairs,
# destructuring each (k, v). Order-independent sums for determinism.
def sum_kv(d: dict[int, int]) -> int:
    total = 0
    for k, v in d.items():
        total = total + k + v
    return total


def sum_values(d: dict[int, int]) -> int:
    total = 0
    for k, v in d.items():
        total = total + v
    return total