def hlf
import bend-collections-laws-math@1.0.0.0/proofs/lib/u32half.bend as U32halfimport Base
20# The Nat halving the checker can compute structurally (no Nat.div).
21def hlf(n: Nat) -> Nat:
22 match n:
23 case 0n:
24 0n
25 case 1n+p:
26 match p:
27 case 0n:
28 0n
29 case 1n+q:
30 1n+hlf(q)
Uses (1)
Used by (18)
- bend-collections-laws-math@1.0.0.0/proofs/math/typed/shrn:shrn_high
- bend-collections-laws-math@1.0.0.0/proofs/math/typed/w64add:half_div
- bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32laws:ops_half
- bend-collections-laws-math@1.0.0.0/proofs/lib/u32half:shr_value
- bend-collections-laws-math@1.0.0.0/proofs/lib/u32half:hlf_le
- …