imperative-to-coq-model-extractor

imperative-to-coq-model-extractor is a skill for Claude Code, Codex from ArabelaTso/Skills-4-SE. It costs 75 tokens per session (2,754 once invoked), scanned A, original, Apache-2.0.

A translation tool that turns imperative programs—code that changes data step by step—into abstract Coq definitions. Coq is a system for writing and checking mathematical proofs about programs.

In plain words
What is it for?
Use it to create Coq specifications and mathematical models of C, C++, Python, Java, and similar programs for proving their behavior.
Why use it?
It gives formal verification work a structured model of code with mutable state, loops, memory, and side effects.

Skill for Claude CodeCodex

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

Good fit Use it to create Coq specifications and mathematical models of C, C++, Python, Java, and similar programs for proving their behavior.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/arabelatso/skills-4-se/imperative-to-coq-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 imperative-to-coq-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 imperative-to-coq-model-extractor

README.md
[![agentmods](https://agentmods.dev/badge/skills/arabelatso/skills-4-se/imperative-to-coq-model-extractor/github.svg)](https://agentmods.dev/skills/arabelatso/skills-4-se/imperative-to-coq-model-extractor)
Your own site
<a href="https://agentmods.dev/skills/arabelatso/skills-4-se/imperative-to-coq-model-extractor"><img src="https://agentmods.dev/badge/skills/arabelatso/skills-4-se/imperative-to-coq-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 imperative-to-coq-model-extractor

Your own site · 80×15
<a href="https://agentmods.dev/skills/arabelatso/skills-4-se/imperative-to-coq-model-extractor"><img src="https://agentmods.dev/badge/skills/arabelatso/skills-4-se/imperative-to-coq-model-extractor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,754 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 pass 7 Sept 2026
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.00075 $0.02754
Opus 5 $0.00037 $0.01377
Sonnet 5 $0.00015 $0.00551
Haiku 4.5 $0.00007 $0.00275

Measured 8d ago against content hash abb965fe41c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

imperative-to-coq-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 8d 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/imperative-to-coq-model-extractor/SKILL.md · 421 lines

How it starts

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

Imperative to Coq Model Extractor

Overview

Extract abstract mathematical models from imperative code that can be used for formal reasoning and verification in Coq. This skill transforms imperative programs into functional Coq definitions with explicit state modeling, enabling formal proofs about program behavior.

Extraction Workflow

Step 1: Analyze Imperative Code

Understand the program structure and semantics:

  1. Identify components:

    • Functions and their signatures
    • Data structures and types
    • State and mutable variables
    • Control flow (loops, conditionals)
    • Side effects and I/O
  2. Understand semantics:

    • What does the program compute?
    • What state does it maintain?
    • What are the invariants?
    • What are preconditions and postconditions?
  3. Note modeling challenges:

    • Mutable state
    • Imperative loops
    • Pointers and memory
    • Side effects

Step 2: Design Coq Model Structure

Plan the Coq representation:

  1. Choose appropriate types:

    • Z for arbitrary precision integers
    • nat for natural numbers
    • bool for booleans
    • list for sequences
    • Record for structured state
    • Inductive types for enumerations
  2. Model state explicitly:

    • Pure functions: Direct translation
    • Mutable state: State transformation functions
    • Side effects: Explicit state passing
  3. Plan control flow translation:

    • Conditionals → Pattern matching or if-then-else
    • Loops → Recursive functions (Fixpoint)
    • Early returns → Conditional expressions

Step 3: Extract Core Model

Translate imperative constructs to Coq:

Pattern: Pure function

// Imperative
int add(int a, int b) {
    return a + b;
}
(* Coq Model *)
Definition add (a b : Z) : Z := a + b.

Pattern: Function with state

// Imperative
int counter = 0;
void increment() {
    counter++;
}
(* Coq Model *)
Definition counter_state : Type := Z.
Definition increment (c : counter_state) : counter_state := c + 1.

Read the full file on GitHub · 421 lines

Files

What ships with it

1 file 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. 8d ago First seen · 421 lines · 75 tokens per session scan A abb965fe41c3

Subscribe to this mod's changes

imperative-to-coq-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 75 tokens to every session and 2,754 once invoked, about $0.0004 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

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

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

cobrapy

Constraint-based metabolic modeling (COBRA). FBA, FVA, gene knockouts, flux sampling, SBML models, for systems biology and metabolic engineering analysis.

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

matlab

Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.

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

bioservices

Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use…

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

pennylane

Hardware-agnostic quantum ML framework with automatic differentiation. Use when training quantum circuits via gradients, building hybrid quantum-classical models, or needing device portability across IBM/Google/Rigetti/IonQ. Best for variational algorithms (VQE, QAOA), quantum neural networks, and integration with…

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

cran-extrachecks

Prepare R packages for CRAN submission by checking for common ad-hoc requirements not caught by devtools::check(). Use when: (1) Preparing a package for first CRAN release, (2) Preparing a package update for CRAN resubmission, (3) Reviewing a package to ensure CRAN compliance, (4) Responding to CRAN reviewer feedback.…

posit-dev/skills · 98 tokens