1.11 Łukasiewicz Sets and Logic
1.11.1 Introduction
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 nvalues, 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 nvalued logic.
This loads the package.
In[1]:=
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.
In[2]:=
Out[2]=
In[3]:=
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.
In[4]:=
Out[4]=
In[5]:=
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 nvalued logic. Let's look at an example.
In[6]:=FS1=FuzzyGaussian[5,3,ChopValue>0.01, UniversalSpace>{0,15,0.5}];
Here we create a digital fuzzy set with four membership level grades from a discrete fuzzy set and plot two sets together.
In[7]:=LS1=ToDigital[FS1,4];
In[8]:=FuzzyPlot[FS1,LS1,ShowDots>True];
1.11.3 Operations on Ln Sets
Operations on Ln sets.
ukasiewicz logic is a form of nvalued 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.
In[9]:=
In[10]:=
In[11]:=
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 nvalued sets. The result will also be a nvalued set.
In[12]:=
In[13]:=
The Intersection operation takes the min(a, b), where a and b are the membership grades of corresponding elements of two nvalued sets. The result will also be a nvalued set.
In[14]:=
In[15]:=
The Implication operation is defined as min(1, 1 + b  a), where a and b are the membership grades of corresponding elements of two nvalued sets.
In[16]:=
Out[16]=
In[17]:=
The Complement operation returns the complement of an nvalued set, which is also an nvalued set.
In[18]:=
In[19]:=
PrimitiveMatrix[n, op] returns a logic table that shows the results of the operation op for nvalued logic sets.
In[20]:=PrimitiveMatrix[3]
Out[20]//DisplayForm=
