kuifje-0.1.2.0: A Quantitative Information Flow aware programming language.

Safe HaskellSafe
LanguageHaskell2010

Language.Kuifje.Semantics

Synopsis

Documentation

type (~~>) a b = Dist a -> Hyper b Source #

Hyper-distribution type synonym.

(=>>) :: Ord b => Dist a -> (a -> Dist b) -> Dist b Source #

Bind with reduction applied to the input distribution.

(==>) :: Ord c => (a ~> b) -> (b ~> c) -> a ~> c Source #

Kleisli composition.

hysem :: Ord s => Kuifje s -> s ~~> s Source #

For a given program, returns a function that calculates the hyper-distribution for a given input distribution.

conditional :: Ord s => (s ~> Bool) -> (s ~~> s) -> (s ~~> s) -> s ~~> s Source #

Conditional semantics (If and While).

huplift :: Ord s => (s ~> s) -> s ~~> s Source #

Lifts a distribution to a hyper-distribution.

hobsem :: (Ord s, Ord o) => (s ~> o) -> s ~~> s Source #

Observe semantics.

bayesVuln :: Ord a => Dist a -> Prob Source #

Calculate Bayes Vulnerability for a distribution.

condEntropy :: (Dist a -> Rational) -> Hyper a -> Rational Source #

Based on an entropy function for distributions, calculate the average entropy for a hyper-distribution.

average :: Dist Rational -> Rational Source #

Average a distribution of Rationals.