Commit d2c48eb9 authored by Tim Steenvoorden's avatar Tim Steenvoorden
Browse files

move Bounded to Algebra.Lattice

parent bd0acdeb
...@@ -108,12 +108,14 @@ class UpperBounded a | MeetSemilattice a where ...@@ -108,12 +108,14 @@ class UpperBounded a | MeetSemilattice a where
/// forall a, join a bottom == bottom /// forall a, join a bottom == bottom
class Bounded a | UpperBounded a & LowerBounded a class Bounded a | UpperBounded a & LowerBounded a
/* TODO needed?
class Complemented a | Bounded a where class Complemented a | Bounded a where
complement :: !a -> a complement :: !a -> a
*/
/// # Calculations /// # Calculations
/* TODO add /* TODO add?
/// Implementation of Kleene fixed-point theorem <http://en.wikipedia.org/wiki/Kleene_fixed-point_theorem>. /// Implementation of Kleene fixed-point theorem <http://en.wikipedia.org/wiki/Kleene_fixed-point_theorem>.
/// Assumes that the function is monotone and does not check if that is correct. /// Assumes that the function is monotone and does not check if that is correct.
unsafeLfp :: (a -> a) -> a | Eq a & LowerBounded a unsafeLfp :: (a -> a) -> a | Eq a & LowerBounded a
...@@ -144,4 +146,3 @@ gfp f = gfpFrom top f ...@@ -144,4 +146,3 @@ gfp f = gfpFrom top f
gfpFrom :: a -> (a -> a) -> a | Eq a & BoundedMeetSemiLattice a gfpFrom :: a -> (a -> a) -> a | Eq a & BoundedMeetSemiLattice a
gfpFrom init f = unsafeGfpFrom init (\x -> f x /\ x) gfpFrom init f = unsafeGfpFrom init (\x -> f x /\ x)
*/ */
...@@ -19,17 +19,6 @@ class Ord a | Eq a where ...@@ -19,17 +19,6 @@ class Ord a | Eq a where
min :: !a !a -> a | Ord a min :: !a !a -> a | Ord a
max :: !a !a -> a | Ord a max :: !a !a -> a | Ord a
//TODO other module?
/// # Bound
class LowerBounded a where
bottom :: a
class UpperBounded a where
top :: a
class Bounded a | UpperBounded a & LowerBounded a
/// # Helpers /// # Helpers
:: Ordering = Lesser | Equal | Greater :: Ordering = Lesser | Equal | Greater
......
...@@ -7,17 +7,18 @@ import Data.Int ...@@ -7,17 +7,18 @@ import Data.Int
import Data.Real import Data.Real
import Data.Tuple import Data.Tuple
import Data.Enum
import Data.Array import Data.Array
// import Data.Array.Unboxed
import Data.String import Data.String
import Control.Function import Control.Function
import Algebra.Order import Algebra.Order
import Algebra.Enum
import Algebra.Group import Algebra.Group
import Algebra.Ring import Algebra.Ring
import Algebra.Lattice
import System.Console import System.Console
// import System.File // import System.File
// import System.Process // import System.Process
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment