Source/Packages

Component.Pointwise

packages/components/src/Component/Pointwise.alpha

408 lines49 declarations15.8 KiBSHA-256 b4c565ce95d3

def · lines 240–288

pointwiseProgramEvaluate

Full file
240def pointwiseProgramEvaluate =
241  (lambda erased word : Type 0 .
242    erased value : Type 0 .
243    erased inputs : Nat .
244    unrestricted unary : (pi unrestricted operation : PointwiseUnary . unrestricted x : value . value) .
245    unrestricted binary : (pi unrestricted operation : PointwiseBinary . unrestricted x : value . unrestricted y : value . value) .
246    unrestricted literal : (pi unrestricted bits : word . value) .
247    unrestricted program : (family StdList (family PointwiseAssignment word inputs)) .
248    eliminate
249      StdList
250      (lambda unrestricted current : (family StdList (family PointwiseAssignment word inputs)) .
251        pi unrestricted state : (pi unrestricted index : (family StdFin inputs) . value) .
252          unrestricted index : (family StdFin inputs) .
253          value)
254      program
255      (branch
256        StdListEmpty
257        .
258        lambda unrestricted state : (pi unrestricted index : (family StdFin inputs) . value) .
259          state)
260      (branch
261        StdListCons
262        head
263        tail
264        next
265        .
266        lambda unrestricted state : (pi unrestricted index : (family StdFin inputs) . value) .
267          eliminate
268            PointwiseAssignment
269            (lambda unrestricted current : (family PointwiseAssignment word inputs) .
270              pi unrestricted index : (family StdFin inputs) . value)
271            head
272            (branch
273              PointwiseAssign
274              destination
275              expression
276              .
277              let unrestricted result =
278                (pointwiseFold word value inputs unary binary literal expression state)
279                in
280                next
281                  (lambda unrestricted index : (family StdFin inputs) .
282                    nat-eliminate
283                      (lambda unrestricted same : Nat . value)
284                      (state index)
285                      (lambda unrestricted previous : Nat . unrestricted ignored : value . result)
286                      (naturalEqual
287                        (stdFinToNatural inputs destination)
288                        (stdFinToNatural inputs index))))))

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.