rec-def-0.1: Recusively defined values
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Recursive.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

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.

newtype PBool Source #

A newtype around P2 to denote that bottom is False and top is True

Constructors

PBool P2 

Instances

Instances details
Propagator PBool Bool Source # 
Instance details

Defined in Data.Recursive.Propagator.Class

newtype PDualBool Source #

A newtype around P2 to denote that bottom is True and top is False

Constructors

PDualBool P2