Copyright | (c) David Janin, 2016 |
---|---|
License | see the LICENSE file in the distribution |
Maintainer | janin@labri.fr |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
Lattice complemention of the affine type with explicit min and max when non reducible.
- type MinMaxAffine d i = MinMax (Affine d i)
- varDur :: Num d => i -> MinMaxAffine d i
- constDur :: d -> MinMaxAffine d i
- compareMinMaxAffine :: (Ord d, Num d, Ord i) => MinMaxAffine d i -> MinMaxAffine d i -> Maybe Ordering
- meetD :: (Num d, Ord d, Ord i) => [MinMaxAffine d i] -> MinMaxAffine d i
- joinD :: (Num d, Ord d, Ord i) => [MinMaxAffine d i] -> MinMaxAffine d i
- getConstDurMaybe :: (Num d, Ord d, Ord i) => MinMaxAffine d i -> Maybe d
- getMaybeMin :: Ord e => (d -> Maybe e) -> MinMax d -> Maybe e
- getMaybeMax :: Ord e => (d -> Maybe e) -> Max d -> Maybe e
- isPosDur :: (Num d, Ord d, Ord i) => MinMaxAffine d i -> Bool
- isNegDur :: (Num d, Ord d, Ord i) => MinMaxAffine d i -> Bool
- isZeroDur :: (Eq d, Num d, Ord d, Ord i) => MinMaxAffine d i -> Bool
- updateMinMaxOnDelay :: (Num d, Ord d, Ord i) => d -> MinMax (Affine d i) -> MinMax (Affine d i)
- updateMinMaxOnVariable :: (Num d, Ord i, Ord d) => [i] -> MinMax (Affine d i) -> MinMax (Affine d i)
- d :: MinMax (Affine Integer Integer)
- evalMinMaxAffine :: (Ord d, Num d, Ord i) => d -> MinMax (Affine d i) -> MinMax (Affine d i)
- evalMaxAffine :: (Ord d, Num d, Ord i) => d -> Max (Affine d i) -> Max (Affine d i)
type MinMaxAffine d i = MinMax (Affine d i) Source #
Duration over a numeric type d and unknown indices i
Primitive setters
varDur :: Num d => i -> MinMaxAffine d i Source #
Creates a duration from variable index i
constDur :: d -> MinMaxAffine d i Source #
Creates a duration from a duration constant d
Partial order
compareMinMaxAffine :: (Ord d, Num d, Ord i) => MinMaxAffine d i -> MinMaxAffine d i -> Maybe Ordering Source #
Compares two durations
meetD :: (Num d, Ord d, Ord i) => [MinMaxAffine d i] -> MinMaxAffine d i Source #
Takes the min of two durations
joinD :: (Num d, Ord d, Ord i) => [MinMaxAffine d i] -> MinMaxAffine d i Source #
Takes the max of two durations
Checks constant value and extracts if possible.
getConstDurMaybe :: (Num d, Ord d, Ord i) => MinMaxAffine d i -> Maybe d Source #
Checks if the arguement is actually a defined constant of type d, and send it back if true.
Related boolean queries
isPosDur :: (Num d, Ord d, Ord i) => MinMaxAffine d i -> Bool Source #
True when provably positive or null
isNegDur :: (Num d, Ord d, Ord i) => MinMaxAffine d i -> Bool Source #
True when provably negative or null
isZeroDur :: (Eq d, Num d, Ord d, Ord i) => MinMaxAffine d i -> Bool Source #
True when provably zero
Update queries
updateMinMaxOnDelay :: (Num d, Ord d, Ord i) => d -> MinMax (Affine d i) -> MinMax (Affine d i) Source #
Replaces every unknown X by X + d
updateMinMaxOnVariable :: (Num d, Ord i, Ord d) => [i] -> MinMax (Affine d i) -> MinMax (Affine d i) Source #
Replaces every unknown Xi by 0 for specified indices.
Basic functions for tests
d :: MinMax (Affine Integer Integer) Source #
An inspiring examples. Observe that 0 == d - d will fail unless some more (LP based) advanced polytopes comparison are put in practice.
d = meetM [varDur 1, varDur 2]