Download cstack/include/l2_alp.h from Snapkitty/flash-attention-rtl: direct link, hf CLI and curl.
- Browser
- Download file 2.07 kB
-
https://huggingface.co/Snapkitty/flash-attention-rtl/resolve/main/cstack/include/l2_alp.h
- Command line
-
hf download hf://Snapkitty/flash-attention-rtl/cstack/include/l2_alp.h
-
curl -L -o l2_alp.h https://huggingface.co/Snapkitty/flash-attention-rtl/resolve/main/cstack/include/l2_alp.h
2.07 kB
| /* Layer 2 - ALP boundary: which claims have machine-checked proofs available, and a manifest of | |
| * every `sorry` (unproven placeholder) in the proof sources. A claim may only be relied on by the | |
| * layers above when its proof is available and contains no sorry. */ | |
| typedef enum alp_state { | |
| ALP_MISSING = 0, /* declared, no proof attached */ | |
| ALP_PROVEN, /* proof attached, zero sorry */ | |
| ALP_SORRY /* proof attached but contains sorry */ | |
| } alp_state; | |
| typedef struct alp_claim { | |
| char name[ALP_NAME_MAX]; | |
| alp_state state; | |
| size_t sorries; | |
| size_t proof_len; | |
| uint8_t proof_hash[32]; | |
| } alp_claim; | |
| typedef struct alp_registry { | |
| alp_claim claims[ALP_MAX_CLAIMS]; | |
| size_t count; | |
| } alp_registry; | |
| /* Counts `sorry` tokens in Lean-style source, ignoring line comments (-- ...), nested block | |
| * comments (/- ... -/) and string literals. */ | |
| size_t alp_scan_sorries(const char *text, size_t len); | |
| void alp_init(alp_registry *r); | |
| cs_status alp_declare(alp_registry *r, const char *name); | |
| cs_status alp_attach_proof(alp_registry *r, const char *name, const char *text, size_t len); | |
| cs_status alp_attach_file(alp_registry *r, const char *name, const char *path); | |
| alp_state alp_state_of(const alp_registry *r, const char *name); /* undeclared -> ALP_MISSING */ | |
| int alp_proof_available(const alp_registry *r, const char *name); | |
| cs_status alp_require(const alp_registry *r, const char *name); /* CS_ERR_UNPROVEN unless proven */ | |
| /* Re-checks a proof text against the recorded hash (detects a changed proof source). */ | |
| cs_status alp_verify_proof(const alp_registry *r, const char *name, const char *text, size_t len); | |
| size_t alp_total_sorries(const alp_registry *r); | |
| /* Deterministic text manifest, snprintf-style: returns the length that would be written. */ | |
| size_t alp_manifest(const alp_registry *r, char *buf, size_t cap); | |