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
15
# PMAT-502be (Tranche 2): bool(x) truthiness cast.
def from_int(x: int) -> bool:
    return bool(x)


def from_str(s: str) -> bool:
    return bool(s)


def from_list(xs: list[int]) -> bool:
    return bool(xs)


def idempotent(b: bool) -> bool:
    return bool(b)