Legacy Documentation

Fuzzy Logic (2004)

This is documentation for an obsolete product.
Current products and services

 Documentation /  Fuzzy Logic /  Manual /

Discrete Fuzzy ArithmeticFuzzy Clustering

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 CapitalLSlashukasiewicz logic. CapitalLSlashukasiewicz sets are very similar to fuzzy sets, but elements in CapitalLSlashukasiewicz sets take on one of n-values, where n is a natural number greater than or equal to 2. CapitalLSlashukasiewicz 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 CapitalLSlashukasiewicz sets and n-valued logic.

This loads the package.

In[1]:=

1.11.2 Creating CapitalLSlashukasiewicz Sets

Functions for creating CapitalLSlashukasiewicz 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 CapitalLSlashukasiewicz sets look more and more like typical fuzzy sets. As you might expect, as n goes to infinity, CapitalLSlashukasiewicz logic becomes fuzzy logic.

ToDigitalSet[A, n] takes a fuzzy set and an integer as input, and it returns a CapitalLSlashukasiewicz set using n-valued 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.

CapitalLSlashukasiewicz 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 CapitalLSlashukasiewicz 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 CapitalLSlashukasiewicz 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.

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 n-valued sets. The result will also be a n-valued 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 n-valued sets.

In[16]:=

Out[16]=

In[17]:=

The Complement operation returns the complement of an n-valued set, which is also an n-valued set.

In[18]:=

In[19]:=

PrimitiveMatrix[n, op] returns a logic table that shows the results of the operation op for n-valued logic sets.

In[20]:=PrimitiveMatrix[3]

Out[20]//DisplayForm=

Discrete Fuzzy ArithmeticFuzzy Clustering