home / skills / a5c-ai / babysitter / abstract-domain-library

This skill helps you select and apply abstract domains for static analysis, improving precision and termination while balancing performance.

npx playbooks add skill a5c-ai/babysitter --skill abstract-domain-library

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
945 B
---
name: abstract-domain-library
description: Library of abstract domains for static analysis and abstract interpretation
allowed-tools:
  - Bash
  - Read
  - Write
  - Edit
  - Glob
  - Grep
metadata:
  specialization: computer-science
  domain: science
  category: formal-verification
  phase: 6
---

# Abstract Domain Library

## Purpose

Provides expert guidance on abstract domains for abstract interpretation-based static analysis.

## Capabilities

- Interval domain
- Octagon domain
- Polyhedra domain
- Congruence domain
- Domain combination (reduced product)
- Widening and narrowing operators

## Usage Guidelines

1. **Domain Selection**: Choose appropriate abstract domain
2. **Operations**: Implement domain operations
3. **Widening**: Design widening for termination
4. **Precision Tuning**: Balance precision and efficiency
5. **Combination**: Combine domains for precision

## Tools/Libraries

- Apron
- ELINA
- Crab
- Frama-C

Overview

This skill is a compact library and guide for abstract domains used in static analysis and abstract interpretation. It presents common domains, domain combination techniques, and strategies for ensuring termination and reasonable precision. The material suits developers building or tuning static analyzers and formal verification tools.

How this skill works

The skill catalogs abstract domains (intervals, octagons, polyhedra, congruences) and describes the core operations each domain must implement: join, meet, transfer, and comparison. It explains reduced product combination to merge domains and covers widening and narrowing operators to guarantee fixpoint termination. Practical notes point to existing implementations and tools for integration.

When to use it

  • When building a static analyzer for numeric properties or overflow detection
  • When you need to balance precision and performance in abstract interpretation
  • When combining multiple property analyses for greater precision
  • When designing widening strategies to ensure analysis termination
  • When evaluating existing libraries (Apron, ELINA, Crab) for reuse

Best practices

  • Select the least-complex domain that achieves required precision to reduce cost
  • Design widening operators tailored to your program patterns to avoid excessive loss of precision
  • Use reduced product combinations incrementally to limit state-space explosion
  • Profile and tune precision/efficiency trade-offs on representative inputs
  • Reuse mature libraries for heavy-weight domains (polyhedra) instead of implementing from scratch

Example use cases

  • Detecting integer overflow and bounds violations using interval or congruence domains
  • Tracking relational constraints between variables with octagon or polyhedra domains
  • Combining congruence with intervals to infer modulus and range simultaneously
  • Implementing a termination-guaranteed analyzer by adding widening and narrowing passes
  • Integrating ELINA or Apron backends into an analyzer for advanced numeric domains

FAQ

Which domain should I choose first for a new analyzer?

Start with intervals for low cost and basic range checks; add congruence for modulus properties and octagons or polyhedra only when relational precision is required.

How do I avoid non-termination during fixpoint computation?

Implement widening operators that force convergence and follow them with narrowing iterations to recover precision where needed.