katydid-0.1.1.0: A haskell implementation of Katydid

Safe HaskellNone
LanguageHaskell2010

Expr

Contents

Description

This module contains all the Relapse expressions.

It also contains an eval function and a simplfication function for these expressions.

Synopsis

Expressions

data Expr a where Source #

Constructors

Const :: a -> Expr a 
BoolVariable :: Expr Bool 
OrFunc :: Expr Bool -> Expr Bool -> Expr Bool 
AndFunc :: Expr Bool -> Expr Bool -> Expr Bool 
NotFunc :: Expr Bool -> Expr Bool 
BoolEqualFunc :: Expr Bool -> Expr Bool -> Expr Bool 
DoubleEqualFunc :: Expr Double -> Expr Double -> Expr Bool 
IntEqualFunc :: Expr Int -> Expr Int -> Expr Bool 
UintEqualFunc :: Expr Uint -> Expr Uint -> Expr Bool 
StringEqualFunc :: Expr String -> Expr String -> Expr Bool 
BytesEqualFunc :: Expr Bytes -> Expr Bytes -> Expr Bool 
IntListContainsFunc :: Expr Int -> [Expr Int] -> Expr Bool 
StringListContainsFunc :: Expr String -> [Expr String] -> Expr Bool 
UintListContainsFunc :: Expr Uint -> [Expr Uint] -> Expr Bool 
StringContainsFunc :: Expr String -> Expr String -> Expr Bool 
BoolListElemFunc :: [Expr Bool] -> Expr Int -> Expr Bool 
BytesGreaterOrEqualFunc :: Expr Bytes -> Expr Bytes -> Expr Bool 
DoubleGreaterOrEqualFunc :: Expr Double -> Expr Double -> Expr Bool 
IntGreaterOrEqualFunc :: Expr Int -> Expr Int -> Expr Bool 
UintGreaterOrEqualFunc :: Expr Uint -> Expr Uint -> Expr Bool 
BytesGreaterThanFunc :: Expr Bytes -> Expr Bytes -> Expr Bool 
DoubleGreaterThanFunc :: Expr Double -> Expr Double -> Expr Bool 
IntGreaterThanFunc :: Expr Int -> Expr Int -> Expr Bool 
UintGreaterThanFunc :: Expr Uint -> Expr Uint -> Expr Bool 
StringHasPrefixFunc :: Expr String -> Expr String -> Expr Bool 
StringHasSuffixFunc :: Expr String -> Expr String -> Expr Bool 
BytesLessOrEqualFunc :: Expr Bytes -> Expr Bytes -> Expr Bool 
DoubleLessOrEqualFunc :: Expr Double -> Expr Double -> Expr Bool 
IntLessOrEqualFunc :: Expr Int -> Expr Int -> Expr Bool 
UintLessOrEqualFunc :: Expr Uint -> Expr Uint -> Expr Bool 
BytesLessThanFunc :: Expr Bytes -> Expr Bytes -> Expr Bool 
DoubleLessThanFunc :: Expr Double -> Expr Double -> Expr Bool 
IntLessThanFunc :: Expr Int -> Expr Int -> Expr Bool 
UintLessThanFunc :: Expr Uint -> Expr Uint -> Expr Bool 
BytesNotEqualFunc :: Expr Bytes -> Expr Bytes -> Expr Bool 
BoolNotEqualFunc :: Expr Bool -> Expr Bool -> Expr Bool 
DoubleNotEqualFunc :: Expr Double -> Expr Double -> Expr Bool 
IntNotEqualFunc :: Expr Int -> Expr Int -> Expr Bool 
StringNotEqualFunc :: Expr String -> Expr String -> Expr Bool 
UintNotEqualFunc :: Expr Uint -> Expr Uint -> Expr Bool 
BytesTypeFunc :: Expr Bytes -> Expr Bool 
BoolTypeFunc :: Expr Bool -> Expr Bool 
DoubleTypeFunc :: Expr Double -> Expr Bool 
IntTypeFunc :: Expr Int -> Expr Bool 
UintTypeFunc :: Expr Uint -> Expr Bool 
StringTypeFunc :: Expr String -> Expr Bool 
RegexFunc :: Expr String -> Expr String -> Expr Bool 
DoubleVariable :: Expr Double 
DoubleListElemFunc :: [Expr Double] -> Expr Int -> Expr Double 
IntVariable :: Expr Int 
IntListElemFunc :: [Expr Int] -> Expr Int -> Expr Int 
BytesListLengthFunc :: [Expr Bytes] -> Expr Int 
BoolListLengthFunc :: [Expr Bool] -> Expr Int 
BytesLengthFunc :: Expr Bytes -> Expr Int 
DoubleListLengthFunc :: [Expr Double] -> Expr Int 
IntListLengthFunc :: [Expr Int] -> Expr Int 
StringListLengthFunc :: [Expr String] -> Expr Int 
UintListLengthFunc :: [Expr Uint] -> Expr Int 
StringLengthFunc :: Expr String -> Expr Int 
UintVariable :: Expr Uint 
UintListElemFunc :: [Expr Uint] -> Expr Int -> Expr Uint 
StringVariable :: Expr String 
StringListElemFunc :: [Expr String] -> Expr Int -> Expr String 
StringToLowerFunc :: Expr String -> Expr String 
StringToUpperFunc :: Expr String -> Expr String 
BytesVariable :: Expr Bytes 
BytesListElemFunc :: [Expr Bytes] -> Expr Int -> Expr Bytes 

Instances

Eq a => Eq (Expr a) Source # 

Methods

(==) :: Expr a -> Expr a -> Bool #

(/=) :: Expr a -> Expr a -> Bool #

Ord a => Ord (Expr a) Source # 

Methods

compare :: Expr a -> Expr a -> Ordering #

(<) :: Expr a -> Expr a -> Bool #

(<=) :: Expr a -> Expr a -> Bool #

(>) :: Expr a -> Expr a -> Bool #

(>=) :: Expr a -> Expr a -> Bool #

max :: Expr a -> Expr a -> Expr a #

min :: Expr a -> Expr a -> Expr a #

Show a => Show (Expr a) Source # 

Methods

showsPrec :: Int -> Expr a -> ShowS #

show :: Expr a -> String #

showList :: [Expr a] -> ShowS #

type Uint = Int Source #

Functions

simplifyBoolExpr :: Expr Bool -> Expr Bool Source #

simplifyBoolExpr returns an equivalent, but simpler version of the input boolean expression.

eval :: Expr Bool -> Label -> Except ValueErr Bool Source #

eval evaluates a boolean expression, given an input label.

Errors