plutus-core-1.38.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

Documentation

data Node Source #

A node in a dependency graph. Either a specific 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
Show Node Source # 
Instance details

Defined in PlutusIR.Analysis.Dependencies

Methods

showsPrecIntNodeShowS Source #

showNodeString Source #

showList ∷ [Node] → ShowS Source #

Eq Node Source # 
Instance details

Defined in PlutusIR.Analysis.Dependencies

Methods

(==)NodeNodeBool Source #

(/=)NodeNodeBool Source #

Ord Node Source # 
Instance details

Defined in PlutusIR.Analysis.Dependencies

Methods

compareNodeNodeOrdering Source #

(<)NodeNodeBool Source #

(<=)NodeNodeBool Source #

(>)NodeNodeBool Source #

(>=)NodeNodeBool Source #

maxNodeNodeNode Source #

minNodeNodeNode Source #

type DepGraph g = (Graph g, Vertex g ~ Node) Source #

A constraint requiring g to be a Graph (so we can compute e.g. a Relation from it), whose vertices are Nodes.

runTermDeps ∷ (DepGraph g, HasUnique tyname TypeUnique, HasUnique name TermUnique, ToBuiltinMeaning uni fun) ⇒ BuiltinsInfo uni fun → VarsInfo tyname name uni a → Term tyname name uni fun a → g Source #

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