tokstyle
Safe HaskellNone
LanguageHaskell2010

Tokstyle.C.Analysis.Program

Description

Facts about a whole program, found by analysing each of its translation units without knowing anything about the rest, and joining what they show.

A field's values are the values the program stores in it, as long as it only changes the field in ways the analysis sees. A function's results are the values it returns, and a static function's parameters are the values its direct calls pass, as long as nothing takes its address. A function's reach into what a pointer parameter points to is the furthest of its own accesses there, as long as its parameters bound each of them.

Synopsis

Documentation

type Observed = [Observation] Source #

type Analysed = (FunDef, Function, [(Node, Facts, [Term])]) Source #

A function, with the facts before each of its nodes when nothing is known about the rest of the program.

analysedWith :: Program -> Analysed -> [(Node, Facts, [Term])] Source #

The facts before each node of a function, knowing what is known about the program.

observe :: MonadTrav m => (FunDef -> Bool) -> FilePath -> Map String [IdentDecl] -> GlobalDecls -> m (Observed, [Analysed]) Source #

What a translation unit shows about the program, and the analysis of the functions it defines that are wanted.

programFrom :: Observed -> Program Source #

Facts that say no more than a value's type are left out.