Lean4 Ffi Constructor Layout
MCP Serverby majiayu000 · Added 5mo ago
Claude
76
Install
git clone https://github.com/majiayu000/claude-skill-registryAdd to Claude
claude mcp add lean4-ffi-constructor-layoutQuick Setup Config
Copy & paste ready~/Library/Application Support/Claude/claude_desktop_config.json (macOS) %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"lean4-ffi-constructor-layout": {
"command": "npx",
"args": [
"@modelcontextprotocol/lean4-ffi-constructor-layout"
]
}
}
}Paste into your Claude Desktop config file, then restart Claude.
About
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, ...
Tags
ai-mlskill