Source/Packages

Std.Natural

packages/foundation/standard/src/Std/Natural.alpha

335 lines48 declarations13.5 KiBSHA-256 0a0af2339e6a

def · lines 83–89

naturalAnd

Full file
The flag operations below are written on the primitives themselves, not on one another: a realization calls them millions of times, and each call of one helper from another costs the machine an application chain (an equality through naturalAnd, naturalIsZero and naturalSelect took 44 steps where these take a handful; they were three fifths of realizing a tiled product). Each eliminates only a 0/1 flag from nat-less-than.
83def naturalAnd =
84  (lambda unrestricted left : Nat . unrestricted right : Nat .
85    nat-eliminate
86      (lambda unrestricted current : Nat . Nat)
87      0
88      (lambda unrestricted predecessor : Nat . unrestricted induction : Nat . nat-less-than 0 right)
89      (nat-less-than 0 left))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.