Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
FuzzySet
Synopsis
- class (ResiduatedLattice l, Eq a) => FuzzySet set a l | set -> a l where
- mkFuzzySet :: (a -> l) -> [a] -> set
- member :: set -> a -> l
- universe :: set -> [a]
- truthDegrees :: set -> [l]
- universeCardinality :: set -> Int
- alphaCut :: FuzzySet set a l => l -> set -> [a]
- union :: FuzzySet set a l => set -> set -> set
- unions :: (FuzzySet set a l, Eq a) => [set] -> set
- intersection :: FuzzySet set a l => set -> set -> set
- intersections :: (FuzzySet set a l, Eq a) => [set] -> set
- complement :: FuzzySet set a l => set -> set
- setTnorm :: FuzzySet set a l => set -> set -> set
- setResiduum :: FuzzySet set a l => set -> set -> set
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
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
(ResiduatedLattice l, Eq a) => FuzzySet (LSet a l) a l Source # | |
(Eq a, ResiduatedLattice l) => FuzzySet (LRelation a l) (a, a) l Source # | |
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
>>>
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)]
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
>>>
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
>>>
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
>>>
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
>>>
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)]