program-to-model-extractor

program-to-model-extractor is a skill for Claude Code, Codex from ArabelaTso/Skills-4-SE. It costs 107 tokens per session (1,503 once invoked), scanned A, original, Apache-2.0.

A tool that extracts abstract mathematical models from Haskell, OCaml, or F# programs for Isabelle/HOL, a system for formally checking mathematical properties. It focuses on data structures, algorithms, recursion, and properties rather than implementation details.

In plain words
What is it for?
Use it to translate functional data types and functions into Isabelle definitions, and to identify invariants and specifications.
Why use it?
Functional code may be difficult to turn into a form suitable for formal reasoning. This provides a model that can be used to state and check correctness properties.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to translate functional data types and functions into Isabelle definitions, and to identify invariants and specifications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/arabelatso/skills-4-se/program-to-model-extractor
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ArabelaTso/Skills-4-SE --skill program-to-model-extractor
Clone the repo
git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for program-to-model-extractor

README.md
[![agentmods](https://agentmods.dev/badge/skills/arabelatso/skills-4-se/program-to-model-extractor/github.svg)](https://agentmods.dev/skills/arabelatso/skills-4-se/program-to-model-extractor)
Your own site
<a href="https://agentmods.dev/skills/arabelatso/skills-4-se/program-to-model-extractor"><img src="https://agentmods.dev/badge/skills/arabelatso/skills-4-se/program-to-model-extractor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for program-to-model-extractor

Your own site · 80×15
<a href="https://agentmods.dev/skills/arabelatso/skills-4-se/program-to-model-extractor"><img src="https://agentmods.dev/badge/skills/arabelatso/skills-4-se/program-to-model-extractor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,503 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium analysis-evasion · line 1
    Suspicious Unicode normalization or mixed-script content
    Fix: Review the flagged content for security risks. Ensure no credentials, secrets, or sensitive data are exposed.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00107 $0.01503
Opus 5 $0.00053 $0.00751
Sonnet 5 $0.00021 $0.00301
Haiku 4.5 $0.00011 $0.00150

Measured 9d ago against content hash 6fac8170106f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

program-to-model-extractor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/program-to-model-extractor/SKILL.md · 185 lines

How it starts

The opening of the file, as written. The whole thing — 185 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Program-to-Model Extractor

Extract high-level mathematical models from functional code for formal reasoning in Isabelle/HOL.

Overview

This skill transforms functional programs (Haskell, OCaml, F#) into abstract mathematical models suitable for formal verification in Isabelle/HOL. The extraction focuses on the algorithm's mathematical essence—capturing core properties, invariants, and structural patterns while abstracting away language-specific implementation details.

Extraction Workflow

1. Analyze the Source Code

Identify key elements:

  • Data structures: Algebraic types, lists, trees, custom types
  • Core functions: Main computational logic
  • Recursion patterns: Structural, tail, mutual recursion
  • Properties: What should be true about inputs/outputs?

2. Extract Data Types

Convert source language types to Isabelle datatypes:

-- Haskell
data Tree a = Leaf | Node a (Tree a) (Tree a)
(* Isabelle *)
datatype 'a tree = Leaf | Node "'a" "'a tree" "'a tree"

3. Model Functions

Choose the appropriate Isabelle construct:

For primitive recursion (terminates obviously):

fun length :: "'a list ⇒ nat" where
  "length [] = 0" |
  "length (x # xs) = 1 + length xs"

For general recursion (needs termination proof):

function gcd :: "nat ⇒ nat ⇒ nat" where
  "gcd m n = (if n = 0 then m else gcd n (m mod n))"
by pat_completeness auto
termination by (relation "measure snd") auto

For non-recursive definitions:

definition compose :: "('b ⇒ 'c) ⇒ ('a ⇒ 'b) ⇒ ('a ⇒ 'c)" where
  "compose f g = (λx. f (g x))"

4. State Properties

Extract and formalize key properties as lemmas:

lemma length_append: "length (xs @ ys) = length xs + length ys"
lemma quicksort_permutes: "mset (quicksort xs) = mset xs"
lemma quicksort_sorted: "sorted (quicksort xs)"

5. Identify Invariants

For stateful or accumulator-based functions, state what holds during computation:

Read the full file on GitHub · 185 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 185 lines · 107 tokens per session scan A 6fac8170106f

Subscribe to this mod's changes

program-to-model-extractor is a skill published in the GitHub repository ArabelaTso/Skills-4-SE (252 stars, last pushed 22d ago), licensed Apache-2.0. It adds 107 tokens to every session and 1,503 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

datalad

Retrieve, version, and publish scientific datasets with DataLad and git-annex, and capture computational provenance with datalad run, rerun, and containers-run. Use when cloning or fetching data from OpenNeuro, DANDI, datasets.datalad.org, or any DataLad dataset; when a file in a dataset reads as a broken symlink or a…

K-Dense-AI/scientific-agent-skills · 146 tokens

depmap

Query the Cancer Dependency Map (DepMap) for cancer cell line gene dependency scores (CRISPR Chronos), drug sensitivity data, and gene effect profiles. Use for identifying cancer-specific vulnerabilities, synthetic lethal interactions, and validating oncology drug targets.

K-Dense-AI/scientific-agent-skills · 52 tokens

latchbio-integration

Build, register, debug, and operate bioinformatics workflows on Latch using the Python SDK, CLI, Latch Data and Registry, Nextflow, Snakemake, programmatic execution, and Latch MCP. Use when authoring or deploying Latch workflows, configuring resources or interfaces, moving data, integrating Registry, or launching and…

K-Dense-AI/scientific-agent-skills · 76 tokens

ginkgo-cloud-lab

Submit and manage protocols on Ginkgo Bioworks Cloud Lab (cloud.ginkgo.bio), a web-based interface for autonomous lab execution on Reconfigurable Automation Carts (RACs). Use when the user wants to run protein expression and purification (cell-free, E. coli, or Pichia), HiBiT or A280 or LabChip quantification, IVT…

K-Dense-AI/scientific-agent-skills · 135 tokens

write-paper

Full-pipeline medical/scientific paper writing. 8-phase IMRAD workflow from outline to submission-ready manuscript. Supports original articles, case reports, case series, meta-analyses, AI validation studies, animal studies, and technical notes. Do NOT trigger for self-checking (use self-review instead).

Aperivue/medsci-skills · 65 tokens

sync-submission

Audit SSOT-to-submission drift and create journal submission manifests from canonical manuscript artifacts.

Aperivue/medsci-skills · 21 tokens