loop-invariant-generator

Solid

Automatically generate and verify loop invariants for algorithm correctness proofs

AI & Automation 1,160 stars 71 forks Updated today MIT

Install

View on GitHub

Quality Score: 94/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
46
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Loop Invariant Generator ## 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

Details

Author
a5c-ai
Repository
a5c-ai/babysitter
Created
4 months ago
Last Updated
today
Language
JavaScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

invariant-analyzer

Identify and verify loop invariants for correctness proofs

1,160 Updated today
a5c-ai
AI & Automation Listed

invariant-guard

Use when writing or reviewing algorithms where the obvious implementation is subtly wrong — postcondition stronger than the loop's natural invariant (Boyer–Moore majority, Floyd cycle, leftmost vs any binary search, QuickSelect partition); in-place mutation with read+write pointers (dedup-in-place, partition, rotate); recursion with multiple parameters or accumulator state; off-by-one suspects with duplicates, empty inputs, boundary values; iterative refinements that must terminate (fixed-point, Newton, EM); any function where you catch yourself thinking "I know this algorithm" — the trap is usually in the contract, not the loop body. Forces writing the function contract (especially the postcondition) and loop invariant BEFORE code. Pairs with lemmaly (picks the algorithm) and mathguard (picks the math).

1 Updated 2 days ago
morsechimwai
AI & Automation Solid

proof-structure-analyzer

Analyze and restructure mathematical proofs for clarity and completeness

1,160 Updated today
a5c-ai
AI & Automation Solid

test-case-generator

Generate comprehensive test cases including edge cases, stress tests, and counter-examples for algorithm correctness verification. Supports random generation, constraint-based generation, and brute force oracle comparison.

1,160 Updated today
a5c-ai
AI & Automation Solid

optimization-correctness-verifier

Verify correctness of compiler optimizations using formal methods

1,160 Updated today
a5c-ai