(self, p)
| 637 | raise RuntimeError(f"Cannot convert uint64 {n} to Nat: lean_big_uint64_to_nat not found") |
| 638 | |
| 639 | def lean_uint64_of_nat(self, p): |
| 640 | # Inline: small scalar fast-path; large path via lean_uint64_of_big_nat. |
| 641 | if self.lean_is_scalar(p): |
| 642 | return int(self.lean_unbox(p)) |
| 643 | fn = getattr(self.lib, "lean_uint64_of_big_nat", None) |
| 644 | if fn is None: |
| 645 | raise RuntimeError("lean_uint64_of_big_nat not found and Nat is not scalar") |
| 646 | fn.argtypes = [LeanObjectPtr] |
| 647 | fn.restype = c_uint64 |
| 648 | return int(fn(p)) |
| 649 | |
| 650 | def lean_int64_to_int(self, n): |
| 651 | # Prefer the C-side helper from leanpy_native, which delegates |
no outgoing calls
no test coverage detected