control-flow-analysis
Skill17 starsChanged 9 months agoApache-2.0View on GitHub
A skill for performing control flow analysis on programs to understand execution paths, loop structures, and program structure.
In this repository98 other files it gives its agents.
- abstract-interpretation-engineSkill
- abstract-machineSkill
- acsl-annotation-assistantSkill
- actor-model-implementerSkill
- algebraic-effectsSkill
- alias-and-points-to-analysisSkill
- axiomatic-semanticsSkill
- bidirectional-type-checkingSkill
- bisimulation-checkerSkill
- capability-systemSkill
- closure-converterSkill
- common-subexpression-eliminatorSkill
- concurrency-verifierSkill
- constant-propagation-passSkill
- contextual-equivalenceSkill
- coq-proof-assistantSkill
- cps-transformerSkill
- dafny-verifierSkill
- dataflow-analysis-frameworkSkill
- dead-code-eliminatorSkill
- defunctionalizationSkill
- denotational-semantics-builderSkill
- dependent-type-implementerSkill
- dsl-embeddingSkill
- effect-handlers-implementerSkill
- effect-systemSkill
- effect-type-systemSkill
- escape-analysisSkill
- existential-typesSkill
- ffi-designerSkill
- fuzzer-generatorSkill
- gadt-implementerSkill
- garbage-collector-implementerSkill
- graalvm-truffle-implementerSkill
- gradual-typing-implementerSkill
- higher-order-abstract-syntaxSkill
- hoare-logic-verifierSkill
- incremental-computationSkill
- information-flow-analyzerSkill
- inline-expanderSkill
- interprocedural-analysisSkill
- invariant-generatorSkill
- jit-compiler-builderSkill
- lambda-calculus-interpreterSkill
- language-server-protocolSkill
- lean-proverSkill
- lexer-generatorSkill
- linear-type-implementerSkill
- liveness-analysisSkill
- llvm-backend-generatorSkill
- lock-free-data-structureSkill
- loop-optimizerSkill
- loop-termination-proverSkill
- macro-expanderSkill
- memory-allocatorSkill
- message-passing-systemSkill
- mlir-dialect-designerSkill
- model-checkerSkill
- module-systemSkill
- monad-transformerSkill
- The first 60 shown.
The file
Files
Control Flow Analysis
Domain: Static Analysis / Programming Languages
Overview
A skill for performing control flow analysis on programs to understand execution paths, loop structures, and program structure.
Capabilities
- Build control flow graphs (CFGs) from source code
- Identify basic blocks and control flow transitions
- Detect loops, branches, and jumps
- Perform reachability analysis
- Find dominators and post-dominators
Techniques
- Control Flow Graph Construction: Nodes for statements, edges for jumps
- Dominator Analysis: Find control dependencies
- Loop Detection: Natural loops, back edges
- Data Flow Analysis: Forward/backward analysis frameworks
Use Cases
- Compiler optimization
- Program understanding
- Bug detection (unreachable code, infinite loops)
- Security analysis
References
See: ../dataflow-analysis-framework, ../ssa-constructor, ../abstract-interpretation-engine
Research Tools & Artifacts
Real-world control flow analysis tools:
| Tool | Why It Matters |
| LLVM pass infrastructure | Production CFG construction |
| Soot | Java bytecode CFG analysis |
| WALA | Java analysis framework |
| Frama-C | C CFG construction |
| GCC GIMPLE | GCC intermediate CFG |
Key Systems
- LLVM: Dominator tree, loop analysis
- Spark (Apache): Program analysis infrastructure
Research Frontiers
Current CFA research:
| Direction | Key Papers | Challenge |
| Interprocedural | "Interprocedural CFA" (1990) | Call site sensitivity |
| Context-sensitive | "k-CFA" (1998) | Precision vs cost |
| Object-oriented | "Object-sensitive CFA" (2009) | Virtual dispatch |
| Binary analysis | "Control Flow in Binaries" (2015) | No source |
Hot Topics
- AI for CFA: Learning flow analysis
- Quantum CFG: Control flow for quantum programs
Implementation Pitfalls
Common CFA bugs:
| Pitfall | Real Example | Prevention |
| Missing edges | Indirect jumps | Handle computed gotos |
| Exception paths | Java exception edges | Model exceptional flow |
| Callbacks | Function pointers | Points-to analysis |
| Virtual dispatch | VTable calls | Devirtualization |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

