Module ErgoSpec.Backend.Lib.QOps
Require
Import
Ascii
.
Require
Import
ZArith
.
Require
Import
Qcert.Brands.BrandRelation
.
Require
Import
ErgoSpec.Backend.Lib.QBackendModel
.
Require
Import
ErgoSpec.Backend.Lib.QBackendRuntime
.
Require
Import
ErgoSpec.Backend.Lib.QData
.
Module
QOps
(
ergomodel
:
QBackendModel
).
Module
ErgoData
:=
QData.QData
ergomodel
.
Module
Unary
.
Definition
op
:
Set
:=
UnaryOperators.unary_op
.
Definition
t
:
Set
:=
op
.
Module
Double
.
Definition
opuminus
:
op
:=
UnaryOperators.OpFloatUnary
UnaryOperators.FloatNeg
.
Definition
opabs
:
op
:=
UnaryOperators.OpFloatUnary
UnaryOperators.FloatAbs
.
Definition
oplog2
:
op
:=
UnaryOperators.OpFloatUnary
UnaryOperators.FloatLog
.
Definition
opsqrt
:
op
:=
UnaryOperators.OpFloatUnary
UnaryOperators.FloatSqrt
.
Definition
opsum
:
op
:=
UnaryOperators.OpFloatSum
.
Definition
opnummin
:
op
:=
UnaryOperators.OpFloatBagMin
.
Definition
opnummax
:
op
:=
UnaryOperators.OpFloatBagMax
.
Definition
opnummean
:
op
:=
UnaryOperators.OpFloatMean
.
End
Double
.
Definition
opidentity
:
op
:=
UnaryOperators.OpIdentity
.
Definition
opneg
:
op
:=
UnaryOperators.OpNeg
.
Definition
oprec
:
String.string
->
op
:=
UnaryOperators.OpRec
.
Definition
opdot
:
String.string
->
op
:=
UnaryOperators.OpDot
.
Definition
oprecremove
:
String.string
->
op
:=
UnaryOperators.OpRecRemove
.
Definition
oprecproject
:
list
String.string
->
op
:=
UnaryOperators.OpRecProject
.
Definition
opbag
:
op
:=
UnaryOperators.OpBag
.
Definition
opsingleton
:
op
:=
UnaryOperators.OpSingleton
.
Definition
opflatten
:
op
:=
UnaryOperators.OpFlatten
.
Definition
opdistinct
:
op
:=
UnaryOperators.OpDistinct
.
Definition
opcount
:
op
:=
UnaryOperators.OpCount
.
Definition
optostring
:
op
:=
UnaryOperators.OpToString
.
Definition
opsubstring
:
Z
->
option
Z
->
op
:=
UnaryOperators.OpSubstring
.
Definition
oplike
:
String.string
->
op
:=
UnaryOperators.OpLike
.
Definition
opleft
:
op
:=
UnaryOperators.OpLeft
.
Definition
opright
:
op
:=
UnaryOperators.OpRight
.
Definition
opbrand
b
:
op
:=
UnaryOperators.OpBrand
b
.
Definition
opunbrand
:
op
:=
UnaryOperators.OpUnbrand
.
Definition
opcast
:
BrandRelation.brands
->
op
:=
UnaryOperators.OpCast
.
Definition
eval
(
h
:
BrandRelation.brand_relation_t
)
(
uop
:
UnaryOperators.unary_op
)
(
d
:
ErgoData.data
) :
option
ErgoData.data
:=
UnaryOperatorsSem.unary_op_eval
h
uop
d
.
End
Unary
.
Module
Binary
.
Definition
op
:
Set
:=
BinaryOperators.binary_op
.
Definition
t
:
Set
:=
op
.
Module
Double
.
Definition
opplus
:
op
:=
BinaryOperators.OpFloatBinary
BinaryOperators.FloatPlus
.
Definition
opminus
:
op
:=
BinaryOperators.OpFloatBinary
BinaryOperators.FloatMinus
.
Definition
opmult
:
op
:=
BinaryOperators.OpFloatBinary
BinaryOperators.FloatMult
.
Definition
opmin
:
op
:=
BinaryOperators.OpFloatBinary
BinaryOperators.FloatMin
.
Definition
opmax
:
op
:=
BinaryOperators.OpFloatBinary
BinaryOperators.FloatMax
.
Definition
opdiv
:
op
:=
BinaryOperators.OpFloatBinary
BinaryOperators.FloatDiv
.
Definition
oppow
:
op
:=
BinaryOperators.OpFloatBinary
BinaryOperators.FloatPow
.
Definition
oplt
:
op
:=
BinaryOperators.OpFloatCompare
BinaryOperators.FloatLt
.
Definition
ople
:
op
:=
BinaryOperators.OpFloatCompare
BinaryOperators.FloatLe
.
Definition
opgt
:
op
:=
BinaryOperators.OpFloatCompare
BinaryOperators.FloatGt
.
Definition
opge
:
op
:=
BinaryOperators.OpFloatCompare
BinaryOperators.FloatGe
.
End
Double
.
Module
Integer
.
Definition
opplusi
:
op
:=
BinaryOperators.OpNatBinary
BinaryOperators.NatPlus
.
Definition
opminusi
:
op
:=
BinaryOperators.OpNatBinary
BinaryOperators.NatMinus
.
Definition
opmulti
:
op
:=
BinaryOperators.OpNatBinary
BinaryOperators.NatMult
.
Definition
opdivi
:
op
:=
BinaryOperators.OpNatBinary
BinaryOperators.NatDiv
.
Definition
oplti
:
op
:=
BinaryOperators.OpLt
.
Definition
oplei
:
op
:=
BinaryOperators.OpLe
.
End
Integer
.
Module
DateTime
.
Definition
opdateadd
:
op
:=
QcertModel.CompEnhanced.Enhanced.Ops.Binary.OpDateTimeAdd
.
Definition
opdatesubtract
:
op
:=
QcertModel.CompEnhanced.Enhanced.Ops.Binary.OpDateTimeSubtract
.
Definition
opdateisbefore
:
op
:=
QcertModel.CompEnhanced.Enhanced.Ops.Binary.OpDateTimeIsBefore
.
Definition
opdateisafter
:
op
:=
QcertModel.CompEnhanced.Enhanced.Ops.Binary.OpDateTimeIsAfter
.
Definition
opdatediff
:
op
:=
QcertModel.CompEnhanced.Enhanced.Ops.Binary.OpDateTimeDiff
.
End
DateTime
.
Definition
opequal
:
op
:=
BinaryOperators.OpEqual
.
Definition
oprecconcat
:
op
:=
BinaryOperators.OpRecConcat
.
Definition
oprecmerge
:
op
:=
BinaryOperators.OpRecMerge
.
Definition
opand
:
op
:=
BinaryOperators.OpAnd
.
Definition
opor
:
op
:=
BinaryOperators.OpOr
.
Definition
opbagunion
:
op
:=
BinaryOperators.OpBagUnion
.
Definition
opbagdiff
:
op
:=
BinaryOperators.OpBagDiff
.
Definition
opbagmin
:
op
:=
BinaryOperators.OpBagMin
.
Definition
opbagmax
:
op
:=
BinaryOperators.OpBagMax
.
Definition
opnth
:
op
:=
BinaryOperators.OpBagNth
.
Definition
opcontains
:
op
:=
BinaryOperators.OpContains
.
Definition
opstringconcat
:
op
:=
BinaryOperators.OpStringConcat
.
Definition
opstringjoin
:
op
:=
BinaryOperators.OpStringJoin
.
Definition
eval
(
h
:
BrandRelation.brand_relation_t
)
(
bop
:
BinaryOperators.binary_op
)
(
d1
d2
:
ErgoData.data
) :
option
ErgoData.data
:=
BinaryOperatorsSem.binary_op_eval
h
bop
d1
d2
.
End
Binary
.
End
QOps
.