Agent Skill
2/7/2026lean4-ffi-constructor-layout
Lean 4 FFI memory layout for constructors with mixed object and scalar fields. Use when: (1) assertion violation "i < lean_ctor_num_objs(o)" accessing constructor fields, (2) assertion violation "offset >= lean_ctor_num_objs(o) * sizeof(void*)" with scalar getters, (3) lean_ctor_get_uint8/uint16/uint32 crashes or returns garbage, (4) creating FFI bindings for Lean inductives or structures with small integer fields (UInt8, UInt16, UInt32). Covers lean_alloc_ctor, lean_ctor_get, lean_ctor_set, and scalar field offset calculation.
N
nathanial
0GitHub Stars
1Views
Skills Info
Original Name:lean4-ffi-constructor-layoutAuthor:nathanial
Download