Loop Invariant Generator

SkillDev tools

Automatically generate and verify loop invariants for algorithm correctness proofs

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Then ask your AI: use the Loop Invariant Generator skill

What this skill tells your AI

The instructions your AI receives, as published by a5c-ai/babysitter in library/specializations/domains/science/computer-science/skills/loop-invariant-generator/SKILL.md and read by ahel’s review.

Purpose

Provides expert guidance on generating and verifying loop invariants for algorithm correctness proofs using formal methods.

Capabilities

  • Infer candidate loop invariants from code structure
  • Verify initialization, maintenance, and termination conditions
  • Generate formal proof templates
  • Handle nested loops and complex data structures
  • Export to theorem provers (Dafny, Why3)
  • Suggest invariant strengthening

Usage Guidelines

  1. Code Analysis: Analyze loop structure and identify key properties
  2. Candidate Generation: Generate candidate invariants from code patterns
  3. Verification: Check initialization, maintenance, termination
  4. Strengthening: Refine invariants to prove desired properties
  5. Export: Generate proof obligations for theorem provers

Tools/Libraries

  • Dafny
  • Why3
  • SMT solvers (Z3, CVC5)
  • Static analysis frameworks

Signals

GitHub stars
2k
Forks
112
Last commit
Sep 2026
Advanced
Item type
skill
Key
loop-invariant-generator
Source
github.com/a5c-ai/babysitter