1.11 Łukasiewicz Sets and Logic
The goal of this notebook is to demonstrate how Fuzzy Logic can be used to perform ukasiewicz logic. ukasiewicz sets are very similar to fuzzy sets, but elements in ukasiewicz sets take on one of n-values, where n is a natural number greater than or equal to 2. ukasiewicz fuzzy sets are often referred to as Ln sets, where n represents the number of values allowed for membership grades. For performing three valued logic, you would be using L3 sets. In this notebook we will demonstrate the functions contained in Fuzzy Logic that deal with ukasiewicz sets and n-valued logic.
This loads the package.
1.11.2 Creating ukasiewicz Sets
Functions for creating ukasiewicz sets.
DigitalSet[a, b, c, d, h, Levels -> n] returns a digital fuzzy set with the number of levels equal to n. The universal space and the value of n may be defined using the UniversalSpace and the n option, otherwise the default universal space and default n will be given. The values of the membership grades increase linearly from a to b, then are equal to the closest possible value of h from b to c, and linearly decrease from c to d. Arguments a, b, c, and d should be in increasing order, and h must be a value between 0 and 1, inclusive. If a value for h is not given, it defaults to 1. In the following example, we create a fuzzy set with a default universal space and default value of n. This means we will get a L3 fuzzy set or a digital fuzzy set with three possible membership grades.
We see from the plot that the fuzzy set above contains only three membership grades—0, 0.5, or 1. As another example, we can use the same specifications as the previous example, but this time let's set n to be 6.
This time we see that there are six membership grade levels. From this example, you can see that as n gets larger, the ukasiewicz sets look more and more like typical fuzzy sets. As you might expect, as n goes to infinity, ukasiewicz logic becomes fuzzy logic.
ToDigitalSet[A, n] takes a fuzzy set and an integer as input, and it returns a ukasiewicz set using n-valued logic. Let's look at an example.
Here we create a digital fuzzy set with four membership level grades from a discrete fuzzy set and plot two sets together.
1.11.3 Operations on Ln Sets
Operations on Ln sets.
ukasiewicz logic is a form of n-valued logic. We demonstrate some of the logic operations using four valued logic in the following examples. Since the Ln set is created as a fuzzy set with n membership values, operations may be performed using the standard operations defined in the Fuzzy Logic manual. One additional function, which has been added to the package, is the implication function. Original ukasiewicz logic operations were all based on the operations of the negation and implication primitives. To demonstrate some of the operations, we start by creating two L4 sets.
We can now perform some of the various logic operations on our ukasiewicz sets.
The Union operation takes the max(a, b), where a and b are the membership grades of corresponding elements of two n-valued sets. The result will also be a n-valued set.
The Intersection operation takes the min(a, b), where a and b are the membership grades of corresponding elements of two n-valued sets. The result will also be a n-valued set.
The Implication operation is defined as min(1, 1 + b - a), where a and b are the membership grades of corresponding elements of two n-valued sets.
The Complement operation returns the complement of an n-valued set, which is also an n-valued set.
PrimitiveMatrix[n, op] returns a logic table that shows the results of the operation op for n-valued logic sets.