Source/Packages

Runtime.NativePhysicalEmbeddedArtifact

packages/execution/src/Runtime/NativePhysicalEmbeddedArtifact.alpha

976 lines100 declarations49.9 KiBSHA-256 2a58d1c1703e

def · lines 495–549

nativePhysicalEmbeddedBuild

Full file
Validates every fixed-width input before assembling the artifact.
495def nativePhysicalEmbeddedBuild =
496  (lambda unrestricted host : (family NativePhysicalEmbeddedPayload) .
497    (lambda unrestricted program : (family NativePhysicalEmbeddedPayload) .
498      (lambda unrestricted qmd : (family NativePhysicalEmbeddedPayload) .
499        (lambda unrestricted pushbuffer : (family NativePhysicalEmbeddedPayload) .
500          (lambda unrestricted gpfifo : (family NativePhysicalEmbeddedPayload) .
501            (let unrestricted totalLength =
502              (naturalAdd
503                (bytes-length (nativePhysicalEmbeddedPayloadMaterial host))
504                (naturalAdd
505                  (bytes-length (nativePhysicalEmbeddedPayloadMaterial program))
506                  (naturalAdd
507                    (bytes-length (nativePhysicalEmbeddedPayloadMaterial qmd))
508                    (naturalAdd
509                      (bytes-length (nativePhysicalEmbeddedPayloadMaterial pushbuffer))
510                      (naturalAdd
511                        (bytes-length (nativePhysicalEmbeddedPayloadMaterial gpfifo))
512                        (naturalAdd
513                          nativePhysicalEmbeddedManifestLength
514                          nativePhysicalEmbeddedFooterLength))))))
515            in
516              (let unrestricted inputsValid =
517                (naturalAnd
518                  (nativePhysicalEmbeddedPayloadValid host)
519                  (naturalAnd
520                    (nativePhysicalEmbeddedPayloadValid program)
521                    (naturalAnd
522                      (nativePhysicalEmbeddedPayloadValid qmd)
523                      (naturalAnd
524                        (nativePhysicalEmbeddedPayloadValid pushbuffer)
525                        (nativePhysicalEmbeddedPayloadValid gpfifo)))))
526              in
527                (nat-eliminate
528                  (lambda unrestricted current : Nat . (family NativePhysicalEmbeddedBuildResult))
529                  (constructor
530                    NativePhysicalEmbeddedBuildResult
531                    NativePhysicalEmbeddedBuildFailed
532                    (constructor
533                      NativePhysicalEmbeddedErrorCode
534                      NativePhysicalEmbeddedBuildInputsInvalid))
535                  (lambda unrestricted inputsPredecessor : Nat .
536                    (lambda unrestricted inputsInduction : (family NativePhysicalEmbeddedBuildResult) .
537                      (nat-eliminate
538                        (lambda unrestricted current : Nat . (family NativePhysicalEmbeddedBuildResult))
539                        (constructor
540                          NativePhysicalEmbeddedBuildResult
541                          NativePhysicalEmbeddedBuildFailed
542                          (constructor
543                            NativePhysicalEmbeddedErrorCode
544                            NativePhysicalEmbeddedLengthOverflow))
545                        (lambda unrestricted lengthPredecessor : Nat .
546                          (lambda unrestricted lengthInduction : (family NativePhysicalEmbeddedBuildResult) .
547                            (nativePhysicalEmbeddedAssemble host program qmd pushbuffer gpfifo)))
548                        (naturalLessOrEqual totalLength nativePhysicalEmbeddedMaximumLength))))
549                  inputsValid))))))))

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.