{-# LANGUAGE GADTs #-}
module Language.Drasil.ModelExpr.Lang where
import Prelude hiding (sqrt)
import Language.Drasil.Expr.Lang (Completeness)
import Language.Drasil.Literal.Lang (Literal(..))
import Language.Drasil.Space (Space, DomainDesc, RealInterval)
import Language.Drasil.UID (UID)
import Language.Drasil.Literal.Class (LiteralC(..))
data ArithBinOp = Frac | Pow | Subt
deriving ArithBinOp -> ArithBinOp -> Bool
(ArithBinOp -> ArithBinOp -> Bool)
-> (ArithBinOp -> ArithBinOp -> Bool) -> Eq ArithBinOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ArithBinOp -> ArithBinOp -> Bool
== :: ArithBinOp -> ArithBinOp -> Bool
$c/= :: ArithBinOp -> ArithBinOp -> Bool
/= :: ArithBinOp -> ArithBinOp -> Bool
Eq
data EqBinOp = Eq | NEq
deriving EqBinOp -> EqBinOp -> Bool
(EqBinOp -> EqBinOp -> Bool)
-> (EqBinOp -> EqBinOp -> Bool) -> Eq EqBinOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EqBinOp -> EqBinOp -> Bool
== :: EqBinOp -> EqBinOp -> Bool
$c/= :: EqBinOp -> EqBinOp -> Bool
/= :: EqBinOp -> EqBinOp -> Bool
Eq
data BoolBinOp = Impl | Iff
deriving BoolBinOp -> BoolBinOp -> Bool
(BoolBinOp -> BoolBinOp -> Bool)
-> (BoolBinOp -> BoolBinOp -> Bool) -> Eq BoolBinOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BoolBinOp -> BoolBinOp -> Bool
== :: BoolBinOp -> BoolBinOp -> Bool
$c/= :: BoolBinOp -> BoolBinOp -> Bool
/= :: BoolBinOp -> BoolBinOp -> Bool
Eq
data LABinOp = Index | IndexOf
deriving LABinOp -> LABinOp -> Bool
(LABinOp -> LABinOp -> Bool)
-> (LABinOp -> LABinOp -> Bool) -> Eq LABinOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LABinOp -> LABinOp -> Bool
== :: LABinOp -> LABinOp -> Bool
$c/= :: LABinOp -> LABinOp -> Bool
/= :: LABinOp -> LABinOp -> Bool
Eq
data OrdBinOp = Lt | Gt | LEq | GEq
deriving OrdBinOp -> OrdBinOp -> Bool
(OrdBinOp -> OrdBinOp -> Bool)
-> (OrdBinOp -> OrdBinOp -> Bool) -> Eq OrdBinOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: OrdBinOp -> OrdBinOp -> Bool
== :: OrdBinOp -> OrdBinOp -> Bool
$c/= :: OrdBinOp -> OrdBinOp -> Bool
/= :: OrdBinOp -> OrdBinOp -> Bool
Eq
data VVVBinOp = Cross | VAdd | VSub
deriving VVVBinOp -> VVVBinOp -> Bool
(VVVBinOp -> VVVBinOp -> Bool)
-> (VVVBinOp -> VVVBinOp -> Bool) -> Eq VVVBinOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VVVBinOp -> VVVBinOp -> Bool
== :: VVVBinOp -> VVVBinOp -> Bool
$c/= :: VVVBinOp -> VVVBinOp -> Bool
/= :: VVVBinOp -> VVVBinOp -> Bool
Eq
data VVNBinOp = Dot
deriving VVNBinOp -> VVNBinOp -> Bool
(VVNBinOp -> VVNBinOp -> Bool)
-> (VVNBinOp -> VVNBinOp -> Bool) -> Eq VVNBinOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VVNBinOp -> VVNBinOp -> Bool
== :: VVNBinOp -> VVNBinOp -> Bool
$c/= :: VVNBinOp -> VVNBinOp -> Bool
/= :: VVNBinOp -> VVNBinOp -> Bool
Eq
data NVVBinOp = Scale
deriving NVVBinOp -> NVVBinOp -> Bool
(NVVBinOp -> NVVBinOp -> Bool)
-> (NVVBinOp -> NVVBinOp -> Bool) -> Eq NVVBinOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NVVBinOp -> NVVBinOp -> Bool
== :: NVVBinOp -> NVVBinOp -> Bool
$c/= :: NVVBinOp -> NVVBinOp -> Bool
/= :: NVVBinOp -> NVVBinOp -> Bool
Eq
data ESSBinOp = SAdd | SRemove
deriving ESSBinOp -> ESSBinOp -> Bool
(ESSBinOp -> ESSBinOp -> Bool)
-> (ESSBinOp -> ESSBinOp -> Bool) -> Eq ESSBinOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ESSBinOp -> ESSBinOp -> Bool
== :: ESSBinOp -> ESSBinOp -> Bool
$c/= :: ESSBinOp -> ESSBinOp -> Bool
/= :: ESSBinOp -> ESSBinOp -> Bool
Eq
data ESBBinOp = SContains
deriving ESBBinOp -> ESBBinOp -> Bool
(ESBBinOp -> ESBBinOp -> Bool)
-> (ESBBinOp -> ESBBinOp -> Bool) -> Eq ESBBinOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ESBBinOp -> ESBBinOp -> Bool
== :: ESBBinOp -> ESBBinOp -> Bool
$c/= :: ESBBinOp -> ESBBinOp -> Bool
/= :: ESBBinOp -> ESBBinOp -> Bool
Eq
data AssocConcatOper = SUnion
deriving AssocConcatOper -> AssocConcatOper -> Bool
(AssocConcatOper -> AssocConcatOper -> Bool)
-> (AssocConcatOper -> AssocConcatOper -> Bool)
-> Eq AssocConcatOper
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AssocConcatOper -> AssocConcatOper -> Bool
== :: AssocConcatOper -> AssocConcatOper -> Bool
$c/= :: AssocConcatOper -> AssocConcatOper -> Bool
/= :: AssocConcatOper -> AssocConcatOper -> Bool
Eq
data AssocArithOper = Add | Mul
deriving AssocArithOper -> AssocArithOper -> Bool
(AssocArithOper -> AssocArithOper -> Bool)
-> (AssocArithOper -> AssocArithOper -> Bool) -> Eq AssocArithOper
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AssocArithOper -> AssocArithOper -> Bool
== :: AssocArithOper -> AssocArithOper -> Bool
$c/= :: AssocArithOper -> AssocArithOper -> Bool
/= :: AssocArithOper -> AssocArithOper -> Bool
Eq
data AssocBoolOper = And | Or | Equivalence
deriving (AssocBoolOper -> AssocBoolOper -> Bool
(AssocBoolOper -> AssocBoolOper -> Bool)
-> (AssocBoolOper -> AssocBoolOper -> Bool) -> Eq AssocBoolOper
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AssocBoolOper -> AssocBoolOper -> Bool
== :: AssocBoolOper -> AssocBoolOper -> Bool
$c/= :: AssocBoolOper -> AssocBoolOper -> Bool
/= :: AssocBoolOper -> AssocBoolOper -> Bool
Eq, Int -> AssocBoolOper -> ShowS
[AssocBoolOper] -> ShowS
AssocBoolOper -> String
(Int -> AssocBoolOper -> ShowS)
-> (AssocBoolOper -> String)
-> ([AssocBoolOper] -> ShowS)
-> Show AssocBoolOper
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AssocBoolOper -> ShowS
showsPrec :: Int -> AssocBoolOper -> ShowS
$cshow :: AssocBoolOper -> String
show :: AssocBoolOper -> String
$cshowList :: [AssocBoolOper] -> ShowS
showList :: [AssocBoolOper] -> ShowS
Show)
data UFunc = Abs | Log | Ln | Sin | Cos | Tan | Sec | Csc | Cot | Arcsin
| Arccos | Arctan | Exp | Sqrt | Neg
deriving UFunc -> UFunc -> Bool
(UFunc -> UFunc -> Bool) -> (UFunc -> UFunc -> Bool) -> Eq UFunc
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UFunc -> UFunc -> Bool
== :: UFunc -> UFunc -> Bool
$c/= :: UFunc -> UFunc -> Bool
/= :: UFunc -> UFunc -> Bool
Eq
data UFuncB = Not
deriving UFuncB -> UFuncB -> Bool
(UFuncB -> UFuncB -> Bool)
-> (UFuncB -> UFuncB -> Bool) -> Eq UFuncB
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UFuncB -> UFuncB -> Bool
== :: UFuncB -> UFuncB -> Bool
$c/= :: UFuncB -> UFuncB -> Bool
/= :: UFuncB -> UFuncB -> Bool
Eq
data UFuncVV = NegV
deriving UFuncVV -> UFuncVV -> Bool
(UFuncVV -> UFuncVV -> Bool)
-> (UFuncVV -> UFuncVV -> Bool) -> Eq UFuncVV
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UFuncVV -> UFuncVV -> Bool
== :: UFuncVV -> UFuncVV -> Bool
$c/= :: UFuncVV -> UFuncVV -> Bool
/= :: UFuncVV -> UFuncVV -> Bool
Eq
data UFuncVN = Norm | Dim
deriving UFuncVN -> UFuncVN -> Bool
(UFuncVN -> UFuncVN -> Bool)
-> (UFuncVN -> UFuncVN -> Bool) -> Eq UFuncVN
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UFuncVN -> UFuncVN -> Bool
== :: UFuncVN -> UFuncVN -> Bool
$c/= :: UFuncVN -> UFuncVN -> Bool
/= :: UFuncVN -> UFuncVN -> Bool
Eq
data StatBinOp = Defines
deriving StatBinOp -> StatBinOp -> Bool
(StatBinOp -> StatBinOp -> Bool)
-> (StatBinOp -> StatBinOp -> Bool) -> Eq StatBinOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StatBinOp -> StatBinOp -> Bool
== :: StatBinOp -> StatBinOp -> Bool
$c/= :: StatBinOp -> StatBinOp -> Bool
/= :: StatBinOp -> StatBinOp -> Bool
Eq
data SpaceBinOp = IsIn
deriving SpaceBinOp -> SpaceBinOp -> Bool
(SpaceBinOp -> SpaceBinOp -> Bool)
-> (SpaceBinOp -> SpaceBinOp -> Bool) -> Eq SpaceBinOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SpaceBinOp -> SpaceBinOp -> Bool
== :: SpaceBinOp -> SpaceBinOp -> Bool
$c/= :: SpaceBinOp -> SpaceBinOp -> Bool
/= :: SpaceBinOp -> SpaceBinOp -> Bool
Eq
data DerivType = Part | Total
deriving DerivType -> DerivType -> Bool
(DerivType -> DerivType -> Bool)
-> (DerivType -> DerivType -> Bool) -> Eq DerivType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DerivType -> DerivType -> Bool
== :: DerivType -> DerivType -> Bool
$c/= :: DerivType -> DerivType -> Bool
/= :: DerivType -> DerivType -> Bool
Eq
data ModelExpr where
Lit :: Literal -> ModelExpr
Spc :: Space -> ModelExpr
AssocA :: AssocArithOper -> [ModelExpr] -> ModelExpr
AssocB :: AssocBoolOper -> [ModelExpr] -> ModelExpr
AssocC :: AssocConcatOper -> [ModelExpr] -> ModelExpr
Deriv :: Integer -> DerivType -> ModelExpr -> UID -> ModelExpr
C :: UID -> ModelExpr
FCall :: UID -> [ModelExpr] -> ModelExpr
Case :: Completeness -> [(ModelExpr, ModelExpr)] -> ModelExpr
Matrix :: [[ModelExpr]] -> ModelExpr
Set :: Space -> [ModelExpr] -> ModelExpr
Variable :: String -> ModelExpr -> ModelExpr
UnaryOp :: UFunc -> ModelExpr -> ModelExpr
UnaryOpB :: UFuncB -> ModelExpr -> ModelExpr
UnaryOpVV :: UFuncVV -> ModelExpr -> ModelExpr
UnaryOpVN :: UFuncVN -> ModelExpr -> ModelExpr
ArithBinaryOp :: ArithBinOp -> ModelExpr -> ModelExpr -> ModelExpr
BoolBinaryOp :: BoolBinOp -> ModelExpr -> ModelExpr -> ModelExpr
EqBinaryOp :: EqBinOp -> ModelExpr -> ModelExpr -> ModelExpr
LABinaryOp :: LABinOp -> ModelExpr -> ModelExpr -> ModelExpr
OrdBinaryOp :: OrdBinOp -> ModelExpr -> ModelExpr -> ModelExpr
SpaceBinaryOp :: SpaceBinOp -> ModelExpr -> ModelExpr -> ModelExpr
StatBinaryOp :: StatBinOp -> ModelExpr -> ModelExpr -> ModelExpr
VVVBinaryOp :: VVVBinOp -> ModelExpr -> ModelExpr -> ModelExpr
VVNBinaryOp :: VVNBinOp -> ModelExpr -> ModelExpr -> ModelExpr
NVVBinaryOp :: NVVBinOp -> ModelExpr -> ModelExpr -> ModelExpr
ESSBinaryOp :: ESSBinOp -> ModelExpr -> ModelExpr -> ModelExpr
ESBBinaryOp :: ESBBinOp -> ModelExpr -> ModelExpr -> ModelExpr
Operator :: AssocArithOper -> DomainDesc t ModelExpr ModelExpr -> ModelExpr -> ModelExpr
RealI :: UID -> RealInterval ModelExpr ModelExpr -> ModelExpr
ForAll :: UID -> Space -> ModelExpr -> ModelExpr
type Variable = String
instance Eq ModelExpr where
Lit Literal
l == :: ModelExpr -> ModelExpr -> Bool
== Lit Literal
r = Literal
l Literal -> Literal -> Bool
forall a. Eq a => a -> a -> Bool
== Literal
r
AssocA AssocArithOper
o1 [ModelExpr]
l1 == AssocA AssocArithOper
o2 [ModelExpr]
l2 = AssocArithOper
o1 AssocArithOper -> AssocArithOper -> Bool
forall a. Eq a => a -> a -> Bool
== AssocArithOper
o2 Bool -> Bool -> Bool
&& [ModelExpr]
l1 [ModelExpr] -> [ModelExpr] -> Bool
forall a. Eq a => a -> a -> Bool
== [ModelExpr]
l2
AssocB AssocBoolOper
o1 [ModelExpr]
l1 == AssocB AssocBoolOper
o2 [ModelExpr]
l2 = AssocBoolOper
o1 AssocBoolOper -> AssocBoolOper -> Bool
forall a. Eq a => a -> a -> Bool
== AssocBoolOper
o2 Bool -> Bool -> Bool
&& [ModelExpr]
l1 [ModelExpr] -> [ModelExpr] -> Bool
forall a. Eq a => a -> a -> Bool
== [ModelExpr]
l2
Deriv Integer
a DerivType
t1 ModelExpr
b UID
c == Deriv Integer
d DerivType
t2 ModelExpr
e UID
f = Integer
a Integer -> Integer -> Bool
forall a. Eq a => a -> a -> Bool
== Integer
d Bool -> Bool -> Bool
&& DerivType
t1 DerivType -> DerivType -> Bool
forall a. Eq a => a -> a -> Bool
== DerivType
t2 Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
e Bool -> Bool -> Bool
&& UID
c UID -> UID -> Bool
forall a. Eq a => a -> a -> Bool
== UID
f
C UID
a == C UID
b = UID
a UID -> UID -> Bool
forall a. Eq a => a -> a -> Bool
== UID
b
FCall UID
a [ModelExpr]
b == FCall UID
c [ModelExpr]
d = UID
a UID -> UID -> Bool
forall a. Eq a => a -> a -> Bool
== UID
c Bool -> Bool -> Bool
&& [ModelExpr]
b [ModelExpr] -> [ModelExpr] -> Bool
forall a. Eq a => a -> a -> Bool
== [ModelExpr]
d
Case Completeness
a [(ModelExpr, ModelExpr)]
b == Case Completeness
c [(ModelExpr, ModelExpr)]
d = Completeness
a Completeness -> Completeness -> Bool
forall a. Eq a => a -> a -> Bool
== Completeness
c Bool -> Bool -> Bool
&& [(ModelExpr, ModelExpr)]
b [(ModelExpr, ModelExpr)] -> [(ModelExpr, ModelExpr)] -> Bool
forall a. Eq a => a -> a -> Bool
== [(ModelExpr, ModelExpr)]
d
UnaryOp UFunc
a ModelExpr
b == UnaryOp UFunc
c ModelExpr
d = UFunc
a UFunc -> UFunc -> Bool
forall a. Eq a => a -> a -> Bool
== UFunc
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
UnaryOpB UFuncB
a ModelExpr
b == UnaryOpB UFuncB
c ModelExpr
d = UFuncB
a UFuncB -> UFuncB -> Bool
forall a. Eq a => a -> a -> Bool
== UFuncB
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
UnaryOpVV UFuncVV
a ModelExpr
b == UnaryOpVV UFuncVV
c ModelExpr
d = UFuncVV
a UFuncVV -> UFuncVV -> Bool
forall a. Eq a => a -> a -> Bool
== UFuncVV
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
UnaryOpVN UFuncVN
a ModelExpr
b == UnaryOpVN UFuncVN
c ModelExpr
d = UFuncVN
a UFuncVN -> UFuncVN -> Bool
forall a. Eq a => a -> a -> Bool
== UFuncVN
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
ArithBinaryOp ArithBinOp
o ModelExpr
a ModelExpr
b == ArithBinaryOp ArithBinOp
p ModelExpr
c ModelExpr
d = ArithBinOp
o ArithBinOp -> ArithBinOp -> Bool
forall a. Eq a => a -> a -> Bool
== ArithBinOp
p Bool -> Bool -> Bool
&& ModelExpr
a ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
BoolBinaryOp BoolBinOp
o ModelExpr
a ModelExpr
b == BoolBinaryOp BoolBinOp
p ModelExpr
c ModelExpr
d = BoolBinOp
o BoolBinOp -> BoolBinOp -> Bool
forall a. Eq a => a -> a -> Bool
== BoolBinOp
p Bool -> Bool -> Bool
&& ModelExpr
a ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
EqBinaryOp EqBinOp
o ModelExpr
a ModelExpr
b == EqBinaryOp EqBinOp
p ModelExpr
c ModelExpr
d = EqBinOp
o EqBinOp -> EqBinOp -> Bool
forall a. Eq a => a -> a -> Bool
== EqBinOp
p Bool -> Bool -> Bool
&& ModelExpr
a ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
OrdBinaryOp OrdBinOp
o ModelExpr
a ModelExpr
b == OrdBinaryOp OrdBinOp
p ModelExpr
c ModelExpr
d = OrdBinOp
o OrdBinOp -> OrdBinOp -> Bool
forall a. Eq a => a -> a -> Bool
== OrdBinOp
p Bool -> Bool -> Bool
&& ModelExpr
a ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
SpaceBinaryOp SpaceBinOp
o ModelExpr
a ModelExpr
b == SpaceBinaryOp SpaceBinOp
p ModelExpr
c ModelExpr
d = SpaceBinOp
o SpaceBinOp -> SpaceBinOp -> Bool
forall a. Eq a => a -> a -> Bool
== SpaceBinOp
p Bool -> Bool -> Bool
&& ModelExpr
a ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
StatBinaryOp StatBinOp
o ModelExpr
a ModelExpr
b == StatBinaryOp StatBinOp
p ModelExpr
c ModelExpr
d = StatBinOp
o StatBinOp -> StatBinOp -> Bool
forall a. Eq a => a -> a -> Bool
== StatBinOp
p Bool -> Bool -> Bool
&& ModelExpr
a ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
LABinaryOp LABinOp
o ModelExpr
a ModelExpr
b == LABinaryOp LABinOp
p ModelExpr
c ModelExpr
d = LABinOp
o LABinOp -> LABinOp -> Bool
forall a. Eq a => a -> a -> Bool
== LABinOp
p Bool -> Bool -> Bool
&& ModelExpr
a ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
VVVBinaryOp VVVBinOp
o ModelExpr
a ModelExpr
b == VVVBinaryOp VVVBinOp
p ModelExpr
c ModelExpr
d = VVVBinOp
o VVVBinOp -> VVVBinOp -> Bool
forall a. Eq a => a -> a -> Bool
== VVVBinOp
p Bool -> Bool -> Bool
&& ModelExpr
a ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
VVNBinaryOp VVNBinOp
o ModelExpr
a ModelExpr
b == VVNBinaryOp VVNBinOp
p ModelExpr
c ModelExpr
d = VVNBinOp
o VVNBinOp -> VVNBinOp -> Bool
forall a. Eq a => a -> a -> Bool
== VVNBinOp
p Bool -> Bool -> Bool
&& ModelExpr
a ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
ESSBinaryOp ESSBinOp
o ModelExpr
a ModelExpr
b == ESSBinaryOp ESSBinOp
p ModelExpr
c ModelExpr
d = ESSBinOp
o ESSBinOp -> ESSBinOp -> Bool
forall a. Eq a => a -> a -> Bool
== ESSBinOp
p Bool -> Bool -> Bool
&& ModelExpr
a ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
ESBBinaryOp ESBBinOp
o ModelExpr
a ModelExpr
b == ESBBinaryOp ESBBinOp
p ModelExpr
c ModelExpr
d = ESBBinOp
o ESBBinOp -> ESBBinOp -> Bool
forall a. Eq a => a -> a -> Bool
== ESBBinOp
p Bool -> Bool -> Bool
&& ModelExpr
a ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
c Bool -> Bool -> Bool
&& ModelExpr
b ModelExpr -> ModelExpr -> Bool
forall a. Eq a => a -> a -> Bool
== ModelExpr
d
ModelExpr
_ == ModelExpr
_ = Bool
False
instance LiteralC ModelExpr where
int :: Integer -> ModelExpr
int = Literal -> ModelExpr
Lit (Literal -> ModelExpr)
-> (Integer -> Literal) -> Integer -> ModelExpr
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Literal
forall r. LiteralC r => Integer -> r
int
str :: String -> ModelExpr
str = Literal -> ModelExpr
Lit (Literal -> ModelExpr)
-> (String -> Literal) -> String -> ModelExpr
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Literal
forall r. LiteralC r => String -> r
str
dbl :: Double -> ModelExpr
dbl = Literal -> ModelExpr
Lit (Literal -> ModelExpr)
-> (Double -> Literal) -> Double -> ModelExpr
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Double -> Literal
forall r. LiteralC r => Double -> r
dbl
exactDbl :: Integer -> ModelExpr
exactDbl = Literal -> ModelExpr
Lit (Literal -> ModelExpr)
-> (Integer -> Literal) -> Integer -> ModelExpr
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Literal
forall r. LiteralC r => Integer -> r
exactDbl
perc :: Integer -> Integer -> ModelExpr
perc Integer
l Integer
r = Literal -> ModelExpr
Lit (Literal -> ModelExpr) -> Literal -> ModelExpr
forall a b. (a -> b) -> a -> b
$ Integer -> Integer -> Literal
forall r. LiteralC r => Integer -> Integer -> r
perc Integer
l Integer
r