arabelatso/skills-4-se/acsl-annotation-assistant
- community
Checking that the SKILL.md file is still in the repository.
Create ACSL (ANSI/ISO C Specification Language) formal annotations for C/C++ programs. Use this skill when working with formal verification, adding function contracts (requires/ensures), loop invariants, assertions, memory safety annotations, or any ACSL specifications. Supports Frama-C verification and generates comprehensive formal specifications for C/C++ code.
Install
npx vskill@latest install arabelatso/skills-4-se/acsl-annotation-assistantSKILL.md
ACSL Annotation Assistant
Generate comprehensive ACSL (ANSI/ISO C Specification Language) annotations for C/C++ programs to support formal verification with tools like Frama-C.
Core Capabilities
1. Function Contracts
Add complete function specifications with preconditions and postconditions:
2. Loop Annotations
Generate loop invariants, variants, and assigns clauses:
3. Memory Safety Specifications
Add pointer validity and separation annotations:
4. Assertions and Assumptions
Insert runtime and verification assertions:
5. Axiomatic Definitions and Predicates
Define reusable logical predicates and axioms:
Annotation Workflow
Step 1: Analyze the Function
Before annotating:
- Identify inputs, outputs, and side effects
- Determine memory access patterns
- Understand algorithmic properties (sorting, searching, etc.)
- Note any implicit assumptions
Step 2: Add Function Contract
Start with the function-level specification:
- Preconditions (
requires): What must be true when function is called - Postconditions (
ensures): What will be true when function returns - Assigns clause: What memory locations may be modified
- Behavioral specification: Normal and exceptional behaviors if applicable
Step 3: Annotate Loops
For each loop, specify:
- Loop invariant: Properties that hold before and after each iteration
- Loop variant: Decreasing measure proving termination
- Loop assigns: Memory modified within the loop
Step 4: Add Assertions
Insert intermediate assertions to:
- Document algorithmic properties
- Help verification tools
- Clarify complex logic
Step 5: Define Helper Predicates
Create reusable logical definitions for:
- Common patterns (sorted arrays, valid ranges)
- Domain-specific properties
- Complex mathematical relationships
Common ACSL Constructs
Memory Validity
Quantifiers
Logic Functions
Integer Ranges
Behaviors
Verification Considerations
For Frama-C WP Plugin
When generating annotations for WP verification:
- Use
assignsclauses to specify frame conditions - Prefer
\validover raw pointer checks - Use
\separatedfor pointer disjointness - Add
loop assignsfor all loops - Include
loop variantfor termination proofs
Common Verification Patterns
Array bounds safety:
Null pointer checks:
Overflow prevention:
Output Format
Generate annotations in standard ACSL comment syntax:
- Multi-line contracts:
/*@ ... */ - Single-line assertions:
//@ assertion - Place contracts immediately before function declarations
- Place loop annotations immediately before loop headers
- Include explanatory comments when annotations are complex
Best Practices
- Start simple: Begin with basic contracts, then refine
- Be precise: Avoid over-specification or under-specification
- Document assumptions: Make implicit assumptions explicit
- Use predicates: Factor out common patterns
- Test incrementally: Verify annotations with Frama-C as you go
- Include rationale: Add comments explaining non-obvious specifications
Example: Complete Annotated Function
Resources
This skill includes reference materials for ACSL:
references/
acsl_reference.md- Comprehensive ACSL syntax referencecommon_patterns.md- Frequently used annotation patternsframa_c_integration.md- Tips for using with Frama-C
Load these references as needed for detailed syntax information or advanced patterns.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/acsl-annotation-assistant/SKILL.md
Popularity
- Repository stars
- 252
- Repository forks
- 24
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 20 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/arabelatso/skills-4-se/acsl-annotation-assistant)