Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Fuzzy.Sets.Properties
Contents
Synopsis
- isEmpty :: FuzzySet set a l => set -> Bool
- isSingleton :: FuzzySet set a l => set -> Bool
- isCrisp :: FuzzySet set a l => set -> Bool
- isUniversal :: FuzzySet set a l => set -> Bool
- strictSubsethood :: FuzzySet set a l => set -> set -> Bool
- strictEquality :: FuzzySet set a l => set -> set -> Bool
- gradedSubsethood :: FuzzySet set a l => set -> set -> l
- gradedEquality :: FuzzySet set a l => set -> set -> l
Standard predicates
isSingleton :: FuzzySet set a l => set -> Bool Source #
fuzzySet
is a singleton if and only if there is exactly
one u
in universe
for which member
u is greater than bot
.
Examples
>>>
let singletonSet = mkSingletonSet [1, 2, 3] (2, 0.8) :: LSet Int UILukasiewicz
>>>
isSingleton singletonSet
True
>>>
let nonSingletonSet = fromPairs [(1, 0.2), (2, 0.7)] :: LSet Int UILukasiewicz
>>>
isSingleton nonSingletonSet
False
isCrisp :: FuzzySet set a l => set -> Bool Source #
Check if fuzzy set is a crisp set (Truth value structure contains only two values: 0 and 1).
Examples
>>>
let crispSet = fromPairs [(1, 1.0), (2, 0.0)] :: LSet Int UILukasiewicz
>>>
isCrisp crispSet
True
>>>
let nonCrispSet = fromPairs [(1, 0.5), (2, 0.7)] :: LSet Int UILukasiewicz
>>>
isCrisp nonCrispSet
False
isUniversal :: FuzzySet set a l => set -> Bool Source #
Fuzzy set is universal if it returns top
for every value in its universe.
This means that the fuzzy set equals its universe.
Examples
>>>
let universalSet = mkUniversalSet [1, 2, 3] :: LSet Int UILukasiewicz
>>>
isUniversal universalSet
True
>>>
let nonUniversalSet = fromPairs [(1, 1.0), (2, 0.8)] :: LSet Int UILukasiewicz
>>>
isUniversal nonUniversalSet
False
strictSubsethood :: FuzzySet set a l => set -> set -> Bool Source #
Is FuzzySet
A a strict subset of FuzzySet
B?
Membership of values from A is smaller than B for every item of universe
Examples
>>>
let setA = fromPairs [(1, 0.2), (2, 0.5)] :: LSet Int UILukasiewicz
>>>
let setB = fromPairs [(1, 0.3), (2, 0.7)] :: LSet Int UILukasiewicz
>>>
strictSubsethood setA setB
True
>>>
strictSubsethood setB setA
False
strictEquality :: FuzzySet set a l => set -> set -> Bool Source #
Is FuzzySet
A strictly equal to FuzzySet
B?
Member of all values from universe in set A is equal to member of all values in set B.
Examples
>>>
let setA = fromPairs [(1, 0.2), (2, 0.5)] :: LSet Int UILukasiewicz
>>>
let setB = fromPairs [(1, 0.2), (2, 0.5)] :: LSet Int UILukasiewicz
>>>
strictEquality setA setB
True
>>>
let setC = fromPairs [(1, 0.3), (2, 0.5)] :: LSet Int UILukasiewicz
>>>
strictEquality setA setC
False
Graded predicates
gradedSubsethood :: FuzzySet set a l => set -> set -> l Source #
Degree to which set A is a subset of B. If the result is 1, we can conclude that A ⊆ B.
Examples
>>>
let setA = fromPairs [(1, 0.2), (2, 0.5)] :: LSet Int UILukasiewicz
>>>
let setB = fromPairs [(1, 0.3), (2, 0.7)] :: LSet Int UILukasiewicz
>>>
gradedSubsethood setA setB
1.0
>>>
gradedSubsethood setB setA
0.8
gradedEquality :: FuzzySet set a l => set -> set -> l Source #
Degree to which set A is equal to set B. If the result is 1, the fuzzy sets are equal.
Examples
>>>
let setA = fromPairs [(1, 0.2), (2, 0.5)] :: LSet Int UILukasiewicz
>>>
let setB = fromPairs [(1, 0.2), (2, 0.5)] :: LSet Int UILukasiewicz
>>>
gradedEquality setA setB
1.0
>>>
let setC = fromPairs [(1, 0.3), (2, 0.5)] :: LSet Int UILukasiewicz
>>>
gradedEquality setA setC
0.9