drasil-code-0.1.9.0: A framework for code and document generation for scientific software - Code SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.CodeSpec

Description

Defines the CodeSpec structure and related functions.

Synopsis

Documentation

type Input = CodeVarChunk Source #

Program input.

type Output = CodeVarChunk Source #

Program output.

type Const = CodeDefinition Source #

Constants in the problem.

type Derived = CodeDefinition Source #

Derived inputs.

type Def = CodeDefinition Source #

Mathematical definition.

data CodeSpec where Source #

Code specifications. Holds information needed to generate code.

Constructors

CodeSpec 

Fields

type ConstantMap = Map UID CodeDefinition Source #

Maps constants to their respective CodeDefinition.

assocToMap :: HasUID a => [a] -> Map UID a Source #

Converts a list of chunks that have UIDs to a Map from UID to the associated chunk.

getODE :: [ExtLib] -> Maybe ODE Source #

Get ODE from ExtLib

mapODE :: Maybe ODE -> [CodeDefinition] Source #

Maps ODE to their respective CodeDefinition.

codeSpec :: SystemInformation -> Choices -> [Mod] -> CodeSpec Source #

Defines a CodeSpec based on the SystemInformation, Choices, and Mods defined by the user.

asVC :: Func -> QuantityDict Source #

Convert a Func to an implementation-stage QuantityDict representing the function.

funcUID :: Func -> UID Source #

Get a UID of a chunk corresponding to a Func.

getDerivedInputs :: [DataDefinition] -> [Input] -> [Const] -> ChunkDB -> [SimpleQDef] Source #

Determines the derived inputs, which can be immediately calculated from the knowns (inputs and constants). If there are DDs, the derived inputs will come from those. If there are none, then the QDefinitions are used instead.

type Known = CodeVarChunk Source #

Known values.

type Need = CodeVarChunk Source #

Calculated values.

getExecOrder :: [Def] -> [Known] -> [Need] -> ChunkDB -> [Def] Source #

Orders a list of definitions such that they form a path between Known values and values that Need to be calculated.

getConstraints :: HasUID c => ConstraintCEMap -> [c] -> [ConstraintCE] Source #

Get a list of Constraints for a list of CodeChunks.

constraintvars :: ConstraintCE -> ChunkDB -> [CodeChunk] Source #

Get a list of CodeChunks from a constraint.