rec-def-0.2.2: Recursively defined values
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Propagator.P2

Description

A propagator for the two-point lattice

Synopsis

Documentation

data P2 Source #

A type for propagators for the two-point lattice, consisting of bottom and top

Instances

Instances details
Propagator P2 Bool Source # 
Instance details

Defined in Data.Propagator.P2

newP2 :: IO P2 Source #

A new propagator, initialized at bottom

newTopP2 :: IO P2 Source #

A new propagator, already set to top

setTop :: P2 -> IO () Source #

Set a propagator to top.

If it was bottom before, runs the actions queued with whenTop. It does so after setting the propagator to top, so that cycles are broken.

whenTop :: P2 -> IO () -> IO () Source #

whenTop p act runs act if p is already top, or after setTop p is run

implies :: P2 -> P2 -> IO () Source #

p1 implies p2 chains propagators: If p1 becomes top, then so does p2.

isTop :: P2 -> IO Bool Source #

Queries the current state of the propagator. All related calls to setTop that have executed so far are taken into account.