Module refinery.lib.scripts.analysis

The language-agnostic half of the script analysis substrate: the graph representation every language's control-flow model is built out of, and the solvers that read it.

A language contributes two things and nothing else — the shape of its statements, expressed by driving CfgBuilder, and the oracles the solvers ask about bindings and effects. Everything between those two is the same for every language, which is why it lives here: ModelCacheBase established the pattern for the caches, and this package is the same move for the flow layer.

Expand source code Browse git
"""
The language-agnostic half of the script analysis substrate: the graph representation every
language's control-flow model is built out of, and the solvers that read it.

A language contributes two things and nothing else — the shape of its statements, expressed by
driving `refinery.lib.scripts.analysis.cfg.CfgBuilder`, and the oracles the solvers ask about
bindings and effects. Everything between those two is the same for every language, which is why it
lives here: `refinery.lib.scripts.modelcache.ModelCacheBase` established the pattern for the caches,
and this package is the same move for the flow layer.
"""

Sub-modules

refinery.lib.scripts.analysis.cfg

Per-body control-flow graphs, derived from an AST and independent of the language it came from …

refinery.lib.scripts.analysis.cycles

Whether a point in a script can be reached more than once, over the control-flow graphs of one script …

refinery.lib.scripts.analysis.dominance

Dominance over the per-body control-flow graphs of one script, in the graph-theoretic sense only …

refinery.lib.scripts.analysis.liveness

The backward live-variable worklist, over one control-flow graph and a caller's gen/kill oracle …

refinery.lib.scripts.analysis.reaching

The path-between query — does anything in a given set of control-flow nodes lie on a path from one node to another — and the definition selection …