Source/Packages

Component.Pointwise

packages/components/src/Component/Pointwise.alpha

408 lines49 declarations15.8 KiBSHA-256 b4c565ce95d3

def · lines 318–333

pointwiseTemporaryValues

Full file
Each literal or arithmetic node defines one temporary value. Inputs refer to existing state. This expression traversal is representation-independent; a target maps values to register pairs or arena words and checks its own limit. Assignments reuse the largest expression workspace, not their sum.
318def pointwiseTemporaryValues =
319  (lambda erased word : Type 0 .
320    erased inputs : Nat .
321    unrestricted expression : (family PointwiseExpression word inputs) .
322    pointwiseFold
323      word
324      Nat
325      inputs
326      (lambda unrestricted operation : PointwiseUnary . unrestricted child : Nat . succ child)
327      (lambda unrestricted operation : PointwiseBinary .
328        unrestricted left : Nat .
329        unrestricted right : Nat .
330        succ (naturalAdd left right))
331      (lambda unrestricted bits : word . 1)
332      expression
333      (lambda unrestricted index : (family StdFin inputs) . 0))

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.