Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The Drasil Expression language
Synopsis
- type Relation = Expr
- type Variable = String
- data ArithBinOp
- data EqBinOp
- data BoolBinOp
- data LABinOp
- data OrdBinOp
- data VVVBinOp
- data VVNBinOp = Dot
- data NVVBinOp = Scale
- data ESSBinOp
- data ESBBinOp = SContains
- data AssocConcatOper = SUnion
- data AssocArithOper
- data AssocBoolOper
- data UFunc
- data UFuncB = Not
- data UFuncVV = NegV
- data UFuncVN
- data Completeness
- data Expr where
- Lit :: Literal -> Expr
- AssocA :: AssocArithOper -> [Expr] -> Expr
- AssocB :: AssocBoolOper -> [Expr] -> Expr
- AssocC :: AssocConcatOper -> [Expr] -> Expr
- C :: UID -> Expr
- FCall :: UID -> [Expr] -> Expr
- Case :: Completeness -> [(Expr, Relation)] -> Expr
- Matrix :: [[Expr]] -> Expr
- Set :: Space -> [Expr] -> Expr
- Variable :: String -> Expr -> Expr
- UnaryOp :: UFunc -> Expr -> Expr
- UnaryOpB :: UFuncB -> Expr -> Expr
- UnaryOpVV :: UFuncVV -> Expr -> Expr
- UnaryOpVN :: UFuncVN -> Expr -> Expr
- ArithBinaryOp :: ArithBinOp -> Expr -> Expr -> Expr
- BoolBinaryOp :: BoolBinOp -> Expr -> Expr -> Expr
- EqBinaryOp :: EqBinOp -> Expr -> Expr -> Expr
- LABinaryOp :: LABinOp -> Expr -> Expr -> Expr
- OrdBinaryOp :: OrdBinOp -> Expr -> Expr -> Expr
- VVVBinaryOp :: VVVBinOp -> Expr -> Expr -> Expr
- VVNBinaryOp :: VVNBinOp -> Expr -> Expr -> Expr
- NVVBinaryOp :: NVVBinOp -> Expr -> Expr -> Expr
- ESSBinaryOp :: ESSBinOp -> Expr -> Expr -> Expr
- ESBBinaryOp :: ESBBinOp -> Expr -> Expr -> Expr
- Operator :: AssocArithOper -> DiscreteDomainDesc Expr Expr -> Expr -> Expr
- RealI :: UID -> RealInterval Expr Expr -> Expr
- class Pretty p where
- vvvInfer :: TypingContext Space -> VVVBinOp -> Expr -> Expr -> Either Space TypeError
Expression Types
data ArithBinOp Source #
Arithmetic operators (fractional, power, and subtraction).
Instances
Eq ArithBinOp Source # | |
Defined in Language.Drasil.Expr.Lang (==) :: ArithBinOp -> ArithBinOp -> Bool # (/=) :: ArithBinOp -> ArithBinOp -> Bool # |
Equality operators (equal or not equal).
Conditional and Biconditional operators (Expressions can imply one another, or exist if and only if another expression exists).
Index operator.
Ordered binary operators (less than, greater than, less than or equal to, greater than or equal to).
Vector x Vector -> Vector
binary operations (cross product, addition, subtraction).
Vector x Vector -> Number
binary operations (dot product).
Number x Vector -> Vector
binary operations (scaling).
Element + Set -> Set
Element + Set -> Bool
data AssocConcatOper Source #
Instances
Eq AssocConcatOper Source # | |
Defined in Language.Drasil.Expr.Lang (==) :: AssocConcatOper -> AssocConcatOper -> Bool # (/=) :: AssocConcatOper -> AssocConcatOper -> Bool # |
data AssocArithOper Source #
Associative operators (adding and multiplication). Also specifies whether it is for integers or for real numbers.
Instances
Eq AssocArithOper Source # | |
Defined in Language.Drasil.Expr.Lang (==) :: AssocArithOper -> AssocArithOper -> Bool # (/=) :: AssocArithOper -> AssocArithOper -> Bool # |
data AssocBoolOper Source #
Associative boolean operators (and, or).
Instances
Eq AssocBoolOper Source # | |
Defined in Language.Drasil.Expr.Lang (==) :: AssocBoolOper -> AssocBoolOper -> Bool # (/=) :: AssocBoolOper -> AssocBoolOper -> Bool # |
Unary functions (abs, log, ln, sin, etc.).
Bool -> Bool
operators.
Vector -> Vector
operators.
Vector -> Number
operators.
data Completeness Source #
For case expressions (either complete or incomplete).
Instances
Eq Completeness Source # | |
Defined in Language.Drasil.Expr.Lang (==) :: Completeness -> Completeness -> Bool # (/=) :: Completeness -> Completeness -> Bool # |
Expr
Expression language where all terms are supposed to be 'well understood' (i.e., have a definite meaning). Right now, this coincides with "having a definite value", but should not be restricted to that.
Lit :: Literal -> Expr | Brings a literal into the expression language. |
AssocA :: AssocArithOper -> [Expr] -> Expr | Takes an associative arithmetic operator with a list of expressions. |
AssocB :: AssocBoolOper -> [Expr] -> Expr | Takes an associative boolean operator with a list of expressions. |
AssocC :: AssocConcatOper -> [Expr] -> Expr | |
C :: UID -> Expr | C stands for Chunk, for referring to a chunk in an expression. Implicitly assumes that the chunk has a symbol. |
FCall :: UID -> [Expr] -> Expr | Function applications. |
Case :: Completeness -> [(Expr, Relation)] -> Expr | For multi-case expressions, each pair represents one case. |
Matrix :: [[Expr]] -> Expr | Represents a matrix of expressions. |
Set :: Space -> [Expr] -> Expr | Represents a set of expressions |
Variable :: String -> Expr -> Expr | used to refernce the (name + type = variable ) |
UnaryOp :: UFunc -> Expr -> Expr | Unary operation for most functions (eg. sin, cos, log, etc.). |
UnaryOpB :: UFuncB -> Expr -> Expr | Unary operation for |
UnaryOpVV :: UFuncVV -> Expr -> Expr | Unary operation for |
UnaryOpVN :: UFuncVN -> Expr -> Expr | Unary operation for |
ArithBinaryOp :: ArithBinOp -> Expr -> Expr -> Expr | Binary operator for arithmetic between expressions (fractional, power, and subtraction). |
BoolBinaryOp :: BoolBinOp -> Expr -> Expr -> Expr | Binary operator for boolean operators (implies, iff). |
EqBinaryOp :: EqBinOp -> Expr -> Expr -> Expr | Binary operator for equality between expressions. |
LABinaryOp :: LABinOp -> Expr -> Expr -> Expr | Binary operator for indexing two expressions. |
OrdBinaryOp :: OrdBinOp -> Expr -> Expr -> Expr | Binary operator for ordering expressions (less than, greater than, etc.). |
VVVBinaryOp :: VVVBinOp -> Expr -> Expr -> Expr | Binary operator for |
VVNBinaryOp :: VVNBinOp -> Expr -> Expr -> Expr | Binary operator for |
NVVBinaryOp :: NVVBinOp -> Expr -> Expr -> Expr | Binary operator for |
ESSBinaryOp :: ESSBinOp -> Expr -> Expr -> Expr | Set operator for Element + Set -> Set |
ESBBinaryOp :: ESBBinOp -> Expr -> Expr -> Expr | Set operator for Element + Set -> Bool |
Operator :: AssocArithOper -> DiscreteDomainDesc Expr Expr -> Expr -> Expr | Operators are generalized arithmetic operators over a |
RealI :: UID -> RealInterval Expr Expr -> Expr | A different kind of |