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

FuzzySet

Synopsis

Documentation

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

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

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

membership function

universe :: set -> [a] Source #

truthDegrees :: set -> [l] Source #

universeCardinality :: set -> Int 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 #

alphaCut :: FuzzySet set a l => l -> set -> [a] Source #

list of all values from universe that have (member u) >= alpha

Examples

Expand
>>> let set = fromPairs [(1, 0.1), (2, 0.2), (3. 0.4)]
>>> alphaCut 0.15 set
[2, 3]
>>> alphaCut 0.3 set
[3]
>>> alphaCut 0.5 set
[]
>>> alphaCut 1 (mkUniversalSet [1..10])
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 

union :: FuzzySet set a l => set -> set -> set Source #

Fuzzy set union A ∪ B. Universe of the new set is union of universes from A and B.

Examples

Expand
>>> let set1 = fromPairs [(1, 0.2), (2, 0.7), (3, 0.1)] :: LSet Int UILukasiewicz
>>> let set2 = fromPairs [(1, 0.3), (2, 0.4)] :: LSet Int UILukasiewicz
>>> let set3 = fromPairs [(1, 0.5), (2, 0.1), (4, 0.8)] :: LSet Int UILukasiewicz
>>> toPairs $ union set1 set2
[(1, 0.3),(2, 0.7), (3, 0.1)]
>>> toPairs $ union set1 set3
[(1, 0.5), (2, 0.7), (3, 0.1), (4, 0.8)]
>>> toPairs $ union set1 mkEmptySet
[(1, 0.2), (2, 0.7), (3, 0.1)]

unions :: (FuzzySet set a l, Eq a) => [set] -> set Source #

union over a list of sets

intersection :: FuzzySet set a l => set -> set -> set Source #

Fuzzy set intersection A ∩ B. Universe of the new set is intersection of universes from A and B.

Examples

Expand
>>> let set1 = fromPairs [(1, 0.2), (2, 0.7), (3, 0.1)]
>>> let set2 = fromPairs [(1, 0.3), (2, 0.4)]
>>> let set3 = fromPairs [(1, 0.5), (2, 0.1), (4, 0.8)] :: LSet Int UILukasiewicz
>>> toPairs $ intersection set1 set2
[(1, 0.2), (2, 0.4), (3, 0.0)]
>>> toPairs $ intersection set1 set3
[(1, 0.2), (2, 0.1), (3, 0.0), (4, 0.0)]
>>> toPairs $ intersection set1 mkEmptySet
[(1, 0.0), (2, 0.0), (3, 0.0)]

intersections :: (FuzzySet set a l, Eq a) => [set] -> set Source #

intersection over a list of sets

complement :: FuzzySet set a l => set -> set Source #

Complement of a fuzzy set A'

Examples

Expand
>>> let set1 = fromPairs [(1, 0.2), (2, 0.7)] :: LSet Int UILukasiewicz
>>> toPairs $ complement set1
[(1, 0.8),(2, 0.3)]
>>> let set2 = fromPairs [(1, 1), (2, 1)]
>>> toPairs $ complement set2
[(1, 0), (2, 0)]

setTnorm :: FuzzySet set a l => set -> set -> set Source #

Apply a t-norm operation over two fuzzy sets. Both sets should be defined on the same universe.

Examples

Expand
>>> let set1 = fromPairs [(1, 0.2), (2, 0.7)] :: LSet Int UILukasiewicz
>>> let set2 = fromPairs [(1, 0.3), (2, 0.4)] :: LSet Int UILukasiewicz
>>> toPairs $ setTnorm set1 set2
[(1,0.2), (2,0.4)]

setResiduum :: FuzzySet set a l => set -> set -> set Source #

Apply a residuum operation over two fuzzy sets. Both sets should be defined on the same universe.

Examples

Expand
>>> let set1 = fromPairs [(1, 0.2), (2, 0.7)] :: LSet Int UILukasiewicz
>>> let set2 = fromPairs [(1, 0.3), (2, 0.4)] :: LSet Int UILukasiewicz
>>> toPairs $ setResiduum set1 set2
[(1,1.0), (2,0.7)]