Download ada/heap_model.adb from Snapkitty/unlambda-idris-spark: direct link, hf CLI and curl.
- Browser
- Download file 650 Bytes
-
https://huggingface.co/Snapkitty/unlambda-idris-spark/resolve/main/ada/heap_model.adb
- Command line
-
hf download hf://Snapkitty/unlambda-idris-spark/ada/heap_model.adb
-
curl -L -o heap_model.adb https://huggingface.co/Snapkitty/unlambda-idris-spark/resolve/main/ada/heap_model.adb
650 Bytes
| -- Copyright (c) 2026 Ahmad Ali Parr. All rights reserved. | |
| -- SPDX-License-Identifier: LicenseRef-Proprietary | |
| -- Public source visibility does not grant an open-source license. See LICENSE. | |
| package body Heap_Model with SPARK_Mode is | |
| function Used (H : Heap) return Count is (H.Allocated); | |
| procedure Reset (H : out Heap) is | |
| begin | |
| H := (Allocated => 0); | |
| end Reset; | |
| procedure Allocate (H : in out Heap; Success : out Boolean) is | |
| begin | |
| if H.Allocated < Capacity then | |
| H.Allocated := H.Allocated + 1; | |
| Success := True; | |
| else | |
| Success := False; | |
| end if; | |
| end Allocate; | |
| end Heap_Model; | |