drasil-lang-0.1.60.0: A framework for code and document generation for scientific software - Language SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.ModelExpr.Lang

Description

The Drasil Modelling Expression language

Synopsis

Documentation

data ArithBinOp Source #

Arithmetic operators (fractional, power, and subtraction).

Constructors

Frac 
Pow 
Subt 

Instances

Instances details
Eq ArithBinOp Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

data EqBinOp Source #

Equality operators (equal or not equal).

Constructors

Eq 
NEq 

Instances

Instances details
Eq EqBinOp Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

Methods

(==) :: EqBinOp -> EqBinOp -> Bool #

(/=) :: EqBinOp -> EqBinOp -> Bool #

data BoolBinOp Source #

Conditional and Biconditional operators (Expressions can imply one another, or exist if and only if another expression exists).

Constructors

Impl 
Iff 

Instances

Instances details
Eq BoolBinOp Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

data LABinOp Source #

Index operator.

Constructors

Index 

Instances

Instances details
Eq LABinOp Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

Methods

(==) :: LABinOp -> LABinOp -> Bool #

(/=) :: LABinOp -> LABinOp -> Bool #

data OrdBinOp Source #

Ordered binary operators (less than, greater than, less than or equal to, greater than or equal to).

Constructors

Lt 
Gt 
LEq 
GEq 

Instances

Instances details
Eq OrdBinOp Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

data VVVBinOp Source #

Vector x Vector -> Vector binary operations (cross product, vector addition, subtraction).

Constructors

Cross 
VAdd 
VSub 

Instances

Instances details
Eq VVVBinOp Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

data VVNBinOp Source #

Vector x Vector -> Number binary operations (dot product).

Constructors

Dot 

Instances

Instances details
Eq VVNBinOp Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

data NVVBinOp Source #

Number x Vector -> Vector binary operations (scaling).

Constructors

Scale 

Instances

Instances details
Eq NVVBinOp Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

data AssocArithOper Source #

Associative operators (adding and multiplication). Also specifies whether it is for integers or for real numbers.

Constructors

AddI 
AddRe 
MulI 
MulRe 

Instances

Instances details
Eq AssocArithOper Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

data AssocBoolOper Source #

Associative boolean operators (and, or).

Constructors

And 
Or 
Equivalence 

data UFunc Source #

Unary functions (abs, log, ln, sin, etc.).

Constructors

Abs 
Log 
Ln 
Sin 
Cos 
Tan 
Sec 
Csc 
Cot 
Arcsin 
Arccos 
Arctan 
Exp 
Sqrt 
Neg 

Instances

Instances details
Eq UFunc Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

Methods

(==) :: UFunc -> UFunc -> Bool #

(/=) :: UFunc -> UFunc -> Bool #

data UFuncB Source #

Bool -> Bool operators.

Constructors

Not 

Instances

Instances details
Eq UFuncB Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

Methods

(==) :: UFuncB -> UFuncB -> Bool #

(/=) :: UFuncB -> UFuncB -> Bool #

data UFuncVV Source #

Vector -> Vector operators.

Constructors

NegV 

Instances

Instances details
Eq UFuncVV Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

Methods

(==) :: UFuncVV -> UFuncVV -> Bool #

(/=) :: UFuncVV -> UFuncVV -> Bool #

data UFuncVN Source #

Vector -> Number operators.

Constructors

Norm 
Dim 

Instances

Instances details
Eq UFuncVN Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

Methods

(==) :: UFuncVN -> UFuncVN -> Bool #

(/=) :: UFuncVN -> UFuncVN -> Bool #

data StatBinOp Source #

Statements involving 2 arguments.

Constructors

Defines 

Instances

Instances details
Eq StatBinOp Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

data SpaceBinOp Source #

Value -> Space -> Bool operators.

Constructors

IsIn 

Instances

Instances details
Eq SpaceBinOp Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

data DerivType Source #

Determines the type of the derivative (either a partial derivative or a total derivative).

Constructors

Part 
Total 

Instances

Instances details
Eq DerivType Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

data ModelExpr where Source #

Expression language where all terms are supposed to have a meaning, but that meaning may not be that of a definite value. For example, specification expressions, especially with quantifiers, belong here.

Constructors

Lit :: Literal -> ModelExpr

Brings a literal into the expression language.

Spc :: Space -> ModelExpr

Introduce Space values into the expression language.

AssocA :: AssocArithOper -> [ModelExpr] -> ModelExpr

Takes an associative arithmetic operator with a list of expressions.

AssocB :: AssocBoolOper -> [ModelExpr] -> ModelExpr

Takes an associative boolean operator with a list of expressions.

Deriv :: Integer -> DerivType -> ModelExpr -> UID -> ModelExpr

Derivative syntax is: Type (Partial or Total) -> principal part of change -> with respect to For example: Deriv Part y x1 would be (dy/dx1).

C :: UID -> ModelExpr

C stands for Chunk, for referring to a chunk in an expression. Implicitly assumes that the chunk has a symbol.

FCall :: UID -> [ModelExpr] -> ModelExpr

Function applications.

Case :: Completeness -> [(ModelExpr, ModelExpr)] -> ModelExpr

For multi-case expressions, each pair represents one case.

Matrix :: [[ModelExpr]] -> ModelExpr

Represents a matrix of expressions.

UnaryOp :: UFunc -> ModelExpr -> ModelExpr

Unary operation for most functions (eg. sin, cos, log, etc.).

UnaryOpB :: UFuncB -> ModelExpr -> ModelExpr

Unary operation for Bool -> Bool operations.

UnaryOpVV :: UFuncVV -> ModelExpr -> ModelExpr

Unary operation for Vector -> Vector operations.

UnaryOpVN :: UFuncVN -> ModelExpr -> ModelExpr

Unary operation for Vector -> Number operations.

ArithBinaryOp :: ArithBinOp -> ModelExpr -> ModelExpr -> ModelExpr

Binary operator for arithmetic between expressions (fractional, power, and subtraction).

BoolBinaryOp :: BoolBinOp -> ModelExpr -> ModelExpr -> ModelExpr

Binary operator for boolean operators (implies, iff).

EqBinaryOp :: EqBinOp -> ModelExpr -> ModelExpr -> ModelExpr

Binary operator for equality between expressions.

LABinaryOp :: LABinOp -> ModelExpr -> ModelExpr -> ModelExpr

Binary operator for indexing two expressions.

OrdBinaryOp :: OrdBinOp -> ModelExpr -> ModelExpr -> ModelExpr

Binary operator for ordering expressions (less than, greater than, etc.).

SpaceBinaryOp :: SpaceBinOp -> ModelExpr -> ModelExpr -> ModelExpr

Space-related binary operations.

StatBinaryOp :: StatBinOp -> ModelExpr -> ModelExpr -> ModelExpr

Statement-related binary operations.

VVVBinaryOp :: VVVBinOp -> ModelExpr -> ModelExpr -> ModelExpr

Binary operator for Vector x Vector -> Vector operations (cross product).

VVNBinaryOp :: VVNBinOp -> ModelExpr -> ModelExpr -> ModelExpr

Binary operator for Vector x Vector -> Number operations (dot product).

NVVBinaryOp :: NVVBinOp -> ModelExpr -> ModelExpr -> ModelExpr

Binary operator for Number x Vector -> Vector operations (scaling).

Operator :: AssocArithOper -> DomainDesc t ModelExpr ModelExpr -> ModelExpr -> ModelExpr

Operators are generalized arithmetic operators over a DomainDesc of an Expr. Could be called BigOp. ex: Summation is represented via Add over a discrete domain.

RealI :: UID -> RealInterval ModelExpr ModelExpr -> ModelExpr

A different kind of IsIn. A UID is an element of an interval.

ForAll :: UID -> Space -> ModelExpr -> ModelExpr

Universal quantification

Instances

Instances details
ExprC ModelExpr Source # 
Instance details

Defined in Language.Drasil.Expr.Class

Methods

lit :: Literal -> ModelExpr Source #

($=) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($!=) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($<) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($>) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($<=) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($>=) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($.) :: ModelExpr -> ModelExpr -> ModelExpr Source #

addI :: ModelExpr -> ModelExpr -> ModelExpr Source #

addRe :: ModelExpr -> ModelExpr -> ModelExpr Source #

mulI :: ModelExpr -> ModelExpr -> ModelExpr Source #

mulRe :: ModelExpr -> ModelExpr -> ModelExpr Source #

($-) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($/) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($^) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($=>) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($<=>) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($&&) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($||) :: ModelExpr -> ModelExpr -> ModelExpr Source #

abs_ :: ModelExpr -> ModelExpr Source #

neg :: ModelExpr -> ModelExpr Source #

log :: ModelExpr -> ModelExpr Source #

ln :: ModelExpr -> ModelExpr Source #

sqrt :: ModelExpr -> ModelExpr Source #

sin :: ModelExpr -> ModelExpr Source #

cos :: ModelExpr -> ModelExpr Source #

tan :: ModelExpr -> ModelExpr Source #

sec :: ModelExpr -> ModelExpr Source #

csc :: ModelExpr -> ModelExpr Source #

cot :: ModelExpr -> ModelExpr Source #

arcsin :: ModelExpr -> ModelExpr Source #

arccos :: ModelExpr -> ModelExpr Source #

arctan :: ModelExpr -> ModelExpr Source #

exp :: ModelExpr -> ModelExpr Source #

dim :: ModelExpr -> ModelExpr Source #

norm :: ModelExpr -> ModelExpr Source #

negVec :: ModelExpr -> ModelExpr Source #

not_ :: ModelExpr -> ModelExpr Source #

idx :: ModelExpr -> ModelExpr -> ModelExpr Source #

defint :: Symbol -> ModelExpr -> ModelExpr -> ModelExpr -> ModelExpr Source #

defsum :: Symbol -> ModelExpr -> ModelExpr -> ModelExpr -> ModelExpr Source #

defprod :: Symbol -> ModelExpr -> ModelExpr -> ModelExpr -> ModelExpr Source #

realInterval :: HasUID c => c -> RealInterval ModelExpr ModelExpr -> ModelExpr Source #

euclidean :: [ModelExpr] -> ModelExpr Source #

cross :: ModelExpr -> ModelExpr -> ModelExpr Source #

vScale :: ModelExpr -> ModelExpr -> ModelExpr Source #

vAdd :: ModelExpr -> ModelExpr -> ModelExpr Source #

vSub :: ModelExpr -> ModelExpr -> ModelExpr Source #

completeCase :: [(ModelExpr, ModelExpr)] -> ModelExpr Source #

incompleteCase :: [(ModelExpr, ModelExpr)] -> ModelExpr Source #

matrix :: [[ModelExpr]] -> ModelExpr Source #

apply :: (HasUID f, HasSymbol f) => f -> [ModelExpr] -> ModelExpr Source #

sy :: (HasUID c, HasSymbol c) => c -> ModelExpr Source #

Express ModelExpr Source #

No change, it's already a ModelExpr.

Instance details

Defined in Language.Drasil.ExprClasses

LiteralC ModelExpr Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Lang

ModelExprC ModelExpr Source # 
Instance details

Defined in Language.Drasil.ModelExpr.Class

Eq ModelExpr Source #

Expressions are equal if their constructors and contents are equal.

TODO: This needs to add more equality checks

Instance details

Defined in Language.Drasil.ModelExpr.Lang

type Variable = String Source #

The variable type is just a renamed String.