Applies abstract interpretation using different abstract domains (intervals, octagons, polyhedra, sign, congruence) to statically analyze program variables and infer invariants, value ranges, and relationships. Use when analyzing program properties, inferring loop invariants, detecting potential errors, or understanding variable relationships through static analysis.
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill abstract-domain-explorer
This skill applies abstract interpretation to statically analyze programs using various abstract domains. It infers invariants, value ranges, and relationships between variables without executing the code. Different domains offer different trade-offs between precision and efficiency.
Follow these steps to analyze programs with abstract domains:
Choose based on analysis goals:
Interval Domain:
Sign Domain:
Congruence Domain:
Octagon Domain:
Polyhedra Domain:
Reduced Product:
Set initial values for program entry:
Example:
int x = 0; // x ∈ [0, 0]
int y = input(); // y ∈ [-∞, +∞]
For each statement, compute abstract semantics:
Assignment (x = e):
Condition (assume c):
Join (control flow merge):
Example (Intervals):
x = y + 5; // If y ∈ [a, b], then x ∈ [a+5, b+5]
assume(x > 10); // If x ∈ [a, b], then x ∈ [max(a, 11), b]
For loops, apply widening to ensure termination:
Example:
int x = 0;
while (x < 100) {
x = x + 1;
}
Apply narrowing to improve precision:
Identify inferred properties:
Report format:
Code:
int x = 0;
int y = 100;
while (x < 10) {
x = x + 1;
y = y - 1;
}
// What are the values of x and y here?
Analysis (Interval Domain):
Inferred Invariants:
Code:
int x = 0;
int y = 0;
while (x < 10) {
x = x + 1;
y = y + 1;
}
Analysis (Octagon Domain):
Inferred Invariants:
Advantage over Intervals:
Intervals would only infer x ∈ [0, 10], y ∈ [0, 10] but miss the relationship x = y.
Code:
int x = 0, y = 0, z = 0;
while (x < 10) {
x = x + 1;
y = y + 2;
z = x + y;
}
Analysis (Polyhedra Domain):
Inferred Invariants:
Advantage over Octagons:
Polyhedra can express y = 2x, which octagons cannot.
Code:
int sum = 0;
for (int i = 0; i < 100; i++) {
sum = sum + 3;
}
Analysis (Congruence Domain):
Analysis (Interval Domain):
Combined (Reduced Product):
Inferred Invariants:
Code:
int x = read_input();
int y = x * x;
int z = 100 / y; // Safe?
Analysis (Sign Domain):
Analysis (Interval Domain):
Inferred Property:
Code:
int arr[10];
int i = 0;
while (i < 10) {
arr[i] = 0; // Safe?
i = i + 1;
}
Analysis (Interval Domain):
Inferred Property:
Code:
int i = 0, j = 0;
while (i < 10) {
j = 0;
while (j < i) {
j = j + 1;
}
i = i + 1;
}
Analysis (Octagon Domain):
Inferred Invariants:
| Domain | Precision | Cost | Relationships | Best For |
|--------|-----------|------|---------------|----------|
| Sign | Very Low | O(1) | None | Sign errors, division by zero |
| Interval | Low-Medium | O(1) | None | Range analysis, bounds checking |
| Congruence | Medium | O(1) | None | Modular patterns, alignment |
| Octagon | Medium-High | O(n³) | ±x ± y ≤ c | Simple relational invariants |
| Polyhedra | High | Exponential | Linear | Complex linear relationships |
| Reduced Product | Higher | Sum of components | Combined | Precise analysis with multiple aspects |
Start with Intervals if:
Use Octagons if:
Use Polyhedra if:
Use Reduced Products if:
Use Sign if:
Use Congruence if:
MUST:
MUST NOT:
Comprehensive reference covering:
Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
Use when completing tasks, implementing major features, or before merging to verify work meets requirements
Execute git commit with conventional commit message analysis, intelligent staging, and message generation. Use when user asks to commit changes, create a git commit, or mentions "/commit". Supports: (1) Auto-detecting type and scope from changes, (2) Generating conventional commit messages from diff, (3) Interactive commit with optional type/scope/description overrides, (4) Intelligent file staging for logical grouping
Comprehensive GitHub code review with AI-powered swarm coordination
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.
Use this skill to review code. It supports both local changes (staged or working tree) and remote Pull Requests (by ID or URL). It focuses on correctness, maintainability, and adherence to project standards.
Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow progressive disclosure principles. Splits monolithic files into organized, linked documentation.
Create high-quality git commits: review/stage intended changes, split into logical commits, and write clear commit messages (including Conventional Commits). Use when the user asks to commit, craft a commit message, stage changes, or split work into multiple commits.
Take arabelatso/abstract-domain-explorer from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.