Module ContingentClaims.Core.Claim¶
Functions¶
- and
: Claim t x a o -> Claim t x a o -> Claim t x a o
Smart constructor for
And
. Because of the explicit representation of the first two arguments of anAnd
, it can be cumbersome to writeAnd c c' []
. With this constructor, you can writec \\``and\\
c’`` instead. Flattens nestedAnd``s and applies additive monoid identity eagerly\. Note this is an ``O(n)
operation. For a more efficient alternative, considermconcat
.
- or
: Claim t x a o -> Claim t x a o -> Claim t x a o
Smart constructor for
Or
. Because of the explicit representation of the first two arguments of anOr
, it can be cumbersome to writeOr c c' []
. With this constructor, you can writec \\``or\\
c’`` instead. Flattens nestedOr``s\. Unlike ``and
, this does not apply a monoid identity. Note this is anO(n)
operation.
- cond
: Inequality t x o -> Claim t x a o -> Claim t x a o -> Claim t x a o
Smart constructor for
Cond
.
- scale
: Observation t x o -> Claim t x a o -> Claim t x a o
Smart constructor for
Scale
.
- when
: Inequality t x o -> Claim t x a o -> Claim t x a o
Smart constructor for
When
.
- anytime
: Inequality t x o -> Claim t x a o -> Claim t x a o
Smart constructor for
Anytime
.
- until
: Inequality t x o -> Claim t x a o -> Claim t x a o
Smart constructor for
Until
.
- mapParams
: (t -> i) -> (i -> t) -> (a -> a’) -> (o -> o’) -> (x -> x’) -> Claim i x a o -> Claim t x’ a’ o’
Replace parameters in an
Claim
with actual values.
- at
: t -> Inequality t x o
Smart constructor for
TimeGte
. This boolean predicate isTrue
for time ≥ t,False
otherwise.
- upTo
: t -> Inequality t x a
Observable that is true for time ≤ t. This boolean predicate is
True
for time ≤ t,False
otherwise.
- (<=)
: Observation t x o -> Observation t x o -> Inequality t x o
Smart constructor for
Lte
.import Prelude hiding ((<=))
in order to use this.
- compare
: (Ord t, Ord x, Number x, Divisible x, Action m) => (o -> t -> m x) -> Inequality t x o -> t -> m Bool
Reify the
Inequality
into an observation function. This function is used to convert an abstract inequalityvation, e.g.S ≤ 50.0
to the actual observation functiont -> m Bool
. The function is only total when the first argument is too (typically it will fail ont
> today).