ddc-core-llvm-0.3.1.1: Disciplined Disciple Compiler LLVM code generator.

Safe HaskellSafe-Inferred

DDC.Core.Llvm.Metadata.Graph

Contents

Synopsis

Graphs and Trees for TBAA metadata

newtype UG a Source

An undirected graph.

Constructors

UG (Dom a, Rel a) 

Instances

Show a => Show (UG a) 

newtype DG a Source

A directed graph.

Constructors

DG (Dom a, Rel a) 

Instances

Show a => Eq (DG a) 
Show a => Show (DG a) 

minOrientation :: (Show a, Eq a) => UG a -> DG aSource

Find the orientation with the smallest transitive closure

partitionDG :: Eq a => DG a -> [Tree a]Source

Partition a DG into the minimum set of (directed) trees

newtype Tree a Source

An inverted tree (with edges going from child to parent)

Constructors

Tree (Dom a, Rel a) 

Instances

Show a => Show (Tree a) 

sources :: Eq a => a -> Tree a -> [a]Source

Get the sources of a tree.

anchor :: Eq a => a -> Tree a -> Tree aSource

Enroot a tree with the given root.

Quickcheck Testing ONLY

type Dom a = [a]Source

type Rel a = a -> a -> BoolSource

A binary relation.

fromList :: Eq a => [(a, a)] -> Rel aSource

Convert a list to a relation.

toList :: Dom a -> Rel a -> [(a, a)]Source

Convert a relation.

allR :: Eq a => Rel aSource

The universal negative relation. All members of the domain are not related.

differenceR :: Rel a -> Rel a -> Rel aSource

Fifference of two relations.

unionR :: Rel a -> Rel a -> Rel aSource

Union two relations.

composeR :: Dom a -> Rel a -> Rel a -> Rel aSource

Compose two relations.

transitiveR :: Dom a -> Rel a -> BoolSource

Check whether a relation is transitive.

transClosure :: Eq a => Dom a -> Rel a -> Rel aSource

Find the transitive closure of a binary relation using Floyd-Warshall algorithm

transReduction :: Eq a => Dom a -> Rel a -> Rel aSource

aliasMeasure :: Eq a => Rel a -> Partitioning a -> IntSource

Calculate the aliasing induced by a set of trees this includes aliasing within each of the trees and aliasing among trees.

isTree :: Dom a -> Rel a -> BoolSource

A relation is an (inverted) tree if each node has at most one outgoing arc

orientation :: Eq a => UG a -> DG aSource

orientations :: Eq a => UG a -> [Rel a]Source

transOrientation :: Eq a => UG a -> Maybe (DG a)Source

Find the transitive orientation of an undirected graph if one exists

smallOrientation :: (Show a, Eq a) => UG a -> DG aSource

Find the orientation with a `small enough' transitive closure

partitionings :: Eq a => [a] -> [Partitioning a]Source

Generate all possible partitions of a list by nondeterministically decide which sublist to add an element to.

minimumCompletion :: (Show a, Eq a) => UG a -> UG aSource

Add a minimum number of edges to an undirected graph such that it has a transitive orientation