fuzzySets-1.0.0: Library for constructing and manipulating fuzzy sets and fuzzy relations.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Fuzzy.Sets.LSet

Synopsis

Documentation

data ResiduatedLattice l => LSet a l Source #

Fuzzy set A is a mapping from universe set U to the set of Truth values L A: U -> L this function is called membership function

Constructors

LSet (a -> l) ![a] 

Instances

Instances details
(Eq a, Show a, Show l, ResiduatedLattice l) => Show (LSet a l) Source # 
Instance details

Defined in Fuzzy.Sets.LSet

Methods

showsPrec :: Int -> LSet a l -> ShowS

show :: LSet a l -> String

showList :: [LSet a l] -> ShowS

(ResiduatedLattice l, Eq a) => FuzzySet (LSet a l) a l Source # 
Instance details

Defined in Fuzzy.Sets.LSet

Methods

mkFuzzySet :: (a -> l) -> [a] -> LSet a l Source #

member :: LSet a l -> a -> l Source #

universe :: LSet a l -> [a] Source #

truthDegrees :: LSet a l -> [l] Source #

universeCardinality :: LSet a l -> Int Source #

class (ResiduatedLattice l, Eq a) => FuzzySet set a l | set -> a l where Source #

Type class defines the basic behavior for a fuzzy set

Minimal complete definition

mkFuzzySet, member, universe

Methods

member :: set -> a -> l Source #

membership function

universe :: set -> [a] Source #

Instances

Instances details
(ResiduatedLattice l, Eq a) => FuzzySet (LSet a l) a l Source # 
Instance details

Defined in Fuzzy.Sets.LSet

Methods

mkFuzzySet :: (a -> l) -> [a] -> LSet a l Source #

member :: LSet a l -> a -> l Source #

universe :: LSet a l -> [a] Source #

truthDegrees :: LSet a l -> [l] Source #

universeCardinality :: LSet a l -> Int Source #

(Eq a, ResiduatedLattice l) => FuzzySet (LRelation a l) (a, a) l Source # 
Instance details

Defined in Fuzzy.Relations.LRelation

Methods

mkFuzzySet :: ((a, a) -> l) -> [(a, a)] -> LRelation a l Source #

member :: LRelation a l -> (a, a) -> l Source #

universe :: LRelation a l -> [(a, a)] Source #

truthDegrees :: LRelation a l -> [l] Source #

universeCardinality :: LRelation a l -> Int Source #

fromPairs :: (ResiduatedLattice l, Eq a) => [(a, l)] -> LSet a l Source #

Construct fuzzy set from list of pairs

fromFunction :: ResiduatedLattice l => (a -> l) -> [a] -> LSet a l Source #

Construct a fuzzy set from a membership function and a universe set

Examples

Expand
>>> let f x = if x == 1 then 0.8 else 0.3
>>> let set = fromFunction f [1, 2, 3] :: LSet Int UILukasiewicz
>>> toPairs set
[(1,0.8),(2,0.3),(3,0.3)]

toPairs :: (ResiduatedLattice l, Eq a) => LSet a l -> [(a, l)] Source #

Convert fuzzy set to list of pairs

mkEmptySet :: ResiduatedLattice l => LSet a l Source #

Construct an empty fuzzy set

Examples

Expand
>>> let emptySet = mkEmptySet :: LSet Int UILukasiewicz
>>> toPairs emptySet
[]

mkSingletonSet :: (ResiduatedLattice l, Eq a) => [a] -> (a, l) -> LSet a l Source #

Construct a singleton fuzzy set

Examples

Expand
>>> let singletonSet = mkSingletonSet [1, 2, 3] (2, 0.8) :: LSet Int UILukasiewicz
>>> toPairs singletonSet
[(1,0.0),(2,0.8),(3,0.0)]

mkUniversalSet :: (ResiduatedLattice l, Eq a) => [a] -> LSet a l Source #

Construct a universal fuzzy set

Examples

Expand
>>> let universalSet = mkUniversalSet [1, 2, 3] :: LSet Int UILukasiewicz
>>> toPairs universalSet
[(1,1.0),(2,1.0),(3,1.0)]