plutus-core-1.60.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusIR.Analysis.Dependencies

Description

Functions for computing the dependency graph of variables within a term or type. A "dependency" between two nodes "A depends on B" means that B cannot be removed from the program without also removing A.

Synopsis
  • data Node
    • = Variable Unique, or a specific node indicating the root of the graph. We need the root node because when computing the dependency graph of, say, a term, there will not be a binding for the term itself which we can use to represent it in the graph.

Constructors

Variable Unique 
Root 

Instances

Instances details
Graph (so we can compute e.g. a Relation from it), whose vertices are Nodes.

runTermDeps :: (DepGraph g, ToBuiltinMeaning uni fun) => BuiltinsInfo uni fun -> VarsInfo tyname name uni a -> Term tyname name uni fun a -> g #

Compute the dependency graph of a Term. The Root node will correspond to the term itself.

For example, the graph of [(let (nonrec) (vardecl x t) y) [x z]] is ROOT -> x ROOT -> z x -> y x -> t