Automatically infer loop invariants for code verification and correctness proofs. Use when analyzing loops to identify properties that hold throughout execution, generating assertions for verification, proving loop correctness, or documenting loop behavior. Supports Python, Java, C/C++, and language-agnostic analysis. Generates invariants as code assertions (assert statements). Triggers when users ask to infer invariants, find loop properties, generate loop assertions, prove loop correctness, or verify loop behavior.
94
92%
Does it follow best practices?
Impact
97%
1.12xAverage score across 3 eval scenarios
Passed
No known issues
Assertion-based loop invariant annotation
Assertions not comments
100%
100%
Pre-condition present
0%
100%
Post-condition after total loop
100%
100%
Post-condition after max loop
100%
100%
Bounds invariant in total loop
0%
100%
Relationship invariant in total loop
100%
100%
Bounds invariant in max loop
0%
100%
Relationship invariant in max loop
100%
100%
Assertions placed before updates
100%
100%
Descriptive assertion messages
100%
100%
File is executable
100%
100%
Nested loop invariants and helper predicates
Outer loop invariant present
100%
100%
Inner loop invariant present
100%
100%
Helper predicate used
100%
100%
Helper predicate defined correctly
100%
100%
Data structure invariant specificity
100%
100%
Post-condition after outer loop
100%
100%
Initialization explanation
100%
100%
Maintenance explanation
100%
100%
Termination explanation
100%
100%
Annotated file executable
100%
100%
Both nesting levels covered
100%
100%
Multi-variable and early-exit invariants in Java
Java assert syntax
100%
100%
Flag invariant: found=false branch
25%
100%
Flag invariant: found=true branch
75%
75%
Two-pointer bounds invariant
100%
100%
Two-pointer relationship invariant
40%
50%
Post-condition linearSearch
100%
100%
Assertion messages present
100%
100%
Assertions before updates
100%
100%
File compiles
100%
100%
File runs with assertions enabled
100%
100%
0f00a4f
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.