atom-1.0.13: An EDSL for embedded hard realtime applications.

Copyright(c) 2013 Tom Hawkins & Lee Pike
Safe HaskellNone
LanguageHaskell98

Language.Atom.UeMap

Description

Sharing for UE s, based on IntMaps. The idea is to share subexpressions of UE s.

Documentation

data UeElem Source

Corresponds to UE s --- the elements in the sharing structure.

Constructors

Instances

data MUV Source

Untyped variables map.

Constructors

Instances

type UeMap = (Hash, Bimap Int UeElem) Source

An entry in the Map.

emptyMap :: UeMap Source

type Hash = Int Source

typeOf :: Hash -> UeMap -> Type Source

type UeState a = State UeMap a Source

Wrapped in the State Monad.

recoverUE :: UeMap -> Hash -> UE Source

Get a UE back out of the UeMap .

getUE :: Hash -> UeMap -> UeElem Source

Get the element associated with a Hash value. It's an error if the element is not in the map.

newUE :: UE -> UeMap -> (Hash, UeMap) Source

Put a new UE in the map, unless it's already in there, and return the hash pointing to the UE and a new map.

newUV :: UV -> UeMap -> (MUV, UeMap) Source

Transforms a UV into a MUV , returning the possibly updated map.

maybeUpdate :: UeElem -> UeState Hash Source

Lookup an element in the map, and if it's in there, do nothing, but return its hash value. Otherwise, update the map and return the new hash value for the inserted element.

ueUpstream :: Hash -> UeMap -> [Hash] Source

The list of Hashes to adjacent upstream of a UE.

nearestUVs :: Hash -> UeMap -> [MUV] Source

The list of all UVs that directly control the value of an expression.

arrayIndices :: Hash -> UeMap -> [(UA, Hash)] Source

All array indexing subexpressions.

isMathHCall :: UeElem -> Bool Source

AltStyle によって変換されたページ (->オリジナル) /