acsl-annotation-assistant

Solid

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.

AI & Automation 252 stars 24 forks Updated 1 months ago Apache-2.0

Install

View on GitHub

Quality Score: 84/100

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

Skill Content

# 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: ```c /*@ requires \valid(array + (0..n-1)); requires n > 0; ensures \result >= 0 && \result < n; ensures \forall integer i; 0 <= i < n ==> array[\result] >= array[i]; assigns \nothing; */ int find_max_index(int *array, int n); ``` ### 2. Loop Annotations Generate loop invariants, variants, and assigns clauses: ```c /*@ loop invariant 0 <= i <= n; loop invariant \forall integer k; 0 <= k < i ==> sum == \sum(0, k, array); loop assigns i, sum; loop variant n - i; */ for (i = 0; i < n; i++) { sum += array[i]; } ``` ### 3. Memory Safety Specifications Add pointer validity and separation annotations: ```c /*@ requires \valid(dest + (0..n-1)); requires \valid_read(src + (0..n-1)); requires \separated(dest + (0..n-1), src + (0..n-1)); ensures \forall integer i; 0 <= i < n ==> dest[i] == \old(src[i]); assigns dest[0..n-1]; */ void memcpy_safe(char *dest, const char *src, size_t n); ``` ### 4. Assertions and Assumptions Insert runtime and verification assertions: ```c //@ assert 0 <= index && index < array_length; //@ assume divisor != 0; ``` ### 5. Axiomatic Definitions and Predicates Define reusable logical predicates and axioms: ```c /*@ ...

Details

Author
ArabelaTso
Repository
ArabelaTso/Skills-4-SE
Created
7 months ago
Last Updated
1 months ago
Language
Python
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

fsl

Shared FSL language and verifier reference for writing, checking, verifying, repairing, explaining, mutating, refining, replaying, generating scenarios/test scaffolds, and interpreting fslc JSON results. Use directly for FSL syntax, kernel specs, verifier errors, repair loops, and command usage. For role-specific authoring, prefer fsl-business for business flows, fsl-requirements for PM requirements/acceptance/NFR specs, and fsl-design for engineering design/refinement work.

3 Updated 1 weeks ago
fuwasegu
AI & Automation Listed

sota-c-cpp

State-of-the-art C and C++ engineering rules that Claude applies when writing or auditing C/C++. Covers modern idioms (RAII, value semantics, smart pointers, C++23), memory safety (lifetimes, bounds, sanitizers, hardening flags), undefined behavior, security (SEI CERT C/C++, MISRA, integer/buffer/format-string, injection), concurrency (C/C++ memory model, atomics, data races), build/tooling/CI (CMake, clang-tidy, cppcheck, ASan/UBSan/TSan, vcpkg/Conan, supply chain), and performance. Trigger keywords - C, C++, RAII, smart pointer, unique_ptr, shared_ptr, undefined behavior, UB, buffer overflow, use-after-free, sanitizer, ASan, UBSan, TSan, valgrind, CMake, clang-tidy, cppcheck, MISRA, CERT C, memory safety, std::thread, atomics, std::move. Use for BOTH building C/C++ libraries/systems and reviewing or auditing them. Owns firmware's LANGUAGE layer; does NOT own its SYSTEMS layer — ISRs, DMA coherency, MMIO, RTOS scheduling, priority inversion, WCET, linker scripts — unowned library-wide.

23 Updated today
martinholovsky
AI & Automation Listed

ccg-annotate

code-context-graph — annotation system. AI-driven annotation workflow, tag reference, and annotation search.

17 Updated 1 months ago
tae2089