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

Fuzzy.Sets.Properties

Synopsis

Standard predicates

isEmpty :: FuzzySet set a l => set -> Bool Source #

True if fuzzySet is empty, meaning for each u in universe, member u == bot.

Examples

Expand
>>> let emptySet = mkEmptySet :: LSet Int UILukasiewicz
>>> isEmpty emptySet
True
>>> let nonEmptySet = fromPairs [(1, 0.2), (2, 0.0)] :: LSet Int UILukasiewicz
>>> isEmpty nonEmptySet
False

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

Expand
>>> 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

Expand
>>> 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

Expand
>>> 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

Expand
>>> 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

Expand
>>> 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

Expand
>>> 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

Expand
>>> 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