control-flow-abstraction-generator

Solid

Generate abstract Control Flow Graph (CFG) representations of programs showing loops, branches, and function calls for static analysis or verification. Use when users need to: (1) Visualize program control flow structure, (2) Generate CFGs for static analysis tools, (3) Create control flow abstractions for formal verification, (4) Analyze program paths and reachability, (5) Document program structure. Supports both function-level (intraprocedural) and program-level (interprocedural) analysis with multiple output formats (textual, DOT/Graphviz, JSON).

Data & Documents 160 stars 17 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 87/100

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

Skill Content

# Control Flow Abstraction Generator Generate abstract Control Flow Graph representations of programs. ## Overview This skill analyzes program code and generates Control Flow Graphs (CFGs) that abstract the program's control flow structure. CFGs show how execution flows through the program via nodes (statements, conditions) and edges (control transfers), making them suitable for static analysis, formal verification, and program understanding. ## How to Use Provide: 1. **Program code**: Function or program to analyze 2. **Analysis scope**: Function-level or program-level 3. **Output format** (optional): Textual, DOT, JSON, or multiple The skill will generate: - CFG with nodes and edges - Node types (entry, exit, statement, condition, merge) - Edge types (sequential, true/false branches, back edges, calls) - Optional: DOT format for visualization, JSON for tool integration ## CFG Generation Workflow ### Step 1: Parse Program Structure Identify program constructs: - **Sequential statements**: Assignments, expressions, declarations - **Conditional statements**: if-then-else, switch-case - **Loop statements**: while, for, do-while - **Function calls**: Direct calls, recursive calls - **Control transfers**: break, continue, return, goto - **Exception handling**: try-catch-finally ### Step 2: Create CFG Nodes Generate nodes for each construct: **Entry Node**: Function/program start - Label: `ENTRY` or function name - Type: `entry` - Successors: First statement **Exit No...

Details

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

Similar Skills

Semantically similar based on skill content — not just same category