Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Fuzzy.Sets.LSet
Synopsis
- data ResiduatedLattice l => LSet a l = LSet (a -> l) ![a]
- class (ResiduatedLattice l, Eq a) => FuzzySet set a l | set -> a l where
- fromPairs :: (ResiduatedLattice l, Eq a) => [(a, l)] -> LSet a l
- fromFunction :: ResiduatedLattice l => (a -> l) -> [a] -> LSet a l
- toPairs :: (ResiduatedLattice l, Eq a) => LSet a l -> [(a, l)]
- mkEmptySet :: ResiduatedLattice l => LSet a l
- mkSingletonSet :: (ResiduatedLattice l, Eq a) => [a] -> (a, l) -> LSet a l
- mkUniversalSet :: (ResiduatedLattice l, Eq a) => [a] -> LSet a l
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
(Eq a, Show a, Show l, ResiduatedLattice l) => Show (LSet a l) Source # | |
(ResiduatedLattice l, Eq a) => FuzzySet (LSet a l) a l 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
Instances
(ResiduatedLattice l, Eq a) => FuzzySet (LSet a l) a l Source # | |
(Eq a, ResiduatedLattice l) => FuzzySet (LRelation a l) (a, a) l 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
>>>
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
>>>
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
>>>
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
>>>
let universalSet = mkUniversalSet [1, 2, 3] :: LSet Int UILukasiewicz
>>>
toPairs universalSet
[(1,1.0),(2,1.0),(3,1.0)]