Analisis sifat matematis pada fuzzy set
-
Upload
rahmat-purwoko -
Category
Education
-
view
50 -
download
0
description
Transcript of Analisis sifat matematis pada fuzzy set
ANALISIS SIFAT MATEMATIS PADA FUZZY SET
Rahmat Purwoko, [email protected]
I. Pendahuluan
Tulisan ini membahas studi kasus untuk Fuzzy Set Membership Function dan
membuktikan apakah sifat-sifat matematis (dalam hal ini Set Theory) berlaku pada Fuzzy
Set tersebut. Pengujian dilakukan dengan cara membuat program untuk membuktikan
Set Thery dalam Scilab 5.5
No Set Theory Operation
1. Law of Contradiction A∩ A=∅
2. Law of The Excluded Middle A∪ A=X
3.Idempotency
A∩ A=A
A∪ A=A
4. Involution A=A
5.Commutativity
A∩B=B∩ A
A∪B=B∪A
6.Associativity
( A∪B )∪C=A∪ (B∪C )
( A∩B )∩C=A ∩ (B∩C )
7.Distibutivity
A∪ (B∩C )= (A∪B )∩ ( A∪C )
A∩ (B∪C )= (A∩B )∪ ( A∩C )
8.Absorption
A∪ ( A∩B )=A∪B
A∩ ( A∪B )=A∩B
9.Absorption of Complement
A∪ ( A∩B )=A∪B
A∩ ( A∪B )=A∩B
10.De Morgan’s Laws
A∪B=A∩B
A∩B=A∪B
Studi kasus yang diambil adalah masalah intensitas cahaya dalam ruangan dengan
satuan Luks. Dalam hal ini semesta pembicaraan (x) adalah 0 – 250. Pembentukan
membership function menggunakan triangular dengan parameter :
A = tri_mf(x,[-125,0,125]);
B = tri_mf(x,[0,125,250]);
C = tri_mf(x,[125,250,325]);
Hasil plot grafik dapat dilihat pada gambar berikut.
II. Analisis Sifat Matematis (Set Theory) pada Fuzzy Set
1. Law of Contradiction
A∩ A=∅
Analisis : Plot Grafik tidak sesuai antara ruas kiri dan ruas kanan persamaan.
2. Law of The Excluded Middle
A∪ A=X
2
Analisis : Plot Grafik tidak sesuai antara ruas kiri dan ruas kanan persamaan.
3. Idempotency
a. Persamaan 1 : A∩ A=A
b. Persamaan 2 : A∪ A=A
Analisis : Plot Grafik sesuai antara ruas kiri dan ruas kanan persamaan.
4. Involution
Persamaan : A=A
3
Analisis : Plot Grafik sesuai antara ruas kiri dan ruas kanan persamaan.
5. Commutativity
a. Persamaan 1 : A∪B=B∪A
b. Persamaan 2 :A∩B=B∩ A
Analisis : Plot Grafik sesuai antara ruas kiri dan ruas kanan persamaan.
6. Associativity
a. Persamaan 1: A∪ (B∪C )= (A∪B )∪C
4
b. Persamaan 2 :A∩ (B∩C )=(A ∩B )∩C
Analisis : Plot Grafik sesuai antara ruas kiri dan ruas kanan persamaan.
7. Distributivity
a. Persamaan 1 : A∪ (B∩C )= (A∪B )∩ ( A∪C )
5
b. Persamaan 2 :A∩ (B∪C )= (A∪B )∩ ( A∪C )
Analisis : Plot Grafik sesuai antara ruas kiri dan ruas kanan persamaan.
8. Absorption
a. Persamaan 1 : A∪ ( A∩B )=A
b. Persamaan 2 : A∩ ( A∪B )=A
Analisis : Plot Grafik sesuai antara ruas kiri dan ruas kanan persamaan.
9. Absorption of Complement
6
a. Persamaan 1 : A∪ ( A∩B )=A∪B
b. Persamaan 2 : A∩ ( A∪B )=A∩B
Analisis : Plot Grafik sesuai antara ruas kiri dan ruas kanan persamaan.
10. De Morgan’s Law
a. Persamaan 1 : A∪B=A∩B
b. Persamaan 2 : A∩B=A∪B
7
Analisis : Plot Grafik sesuai antara ruas kiri dan ruas kanan persamaan.
III. Summary
Hasil pengujian Set Theory dengan Plot grafik untuk Fuzzy Set diatas diperlihatkan dalam
tabel berikut :
No Set Theory Operation Result
1. Law of Contradiction A∩ A=∅ Tidak Sesuai
2. Law of The Excluded Middle A∪ A=X Tidak Sesuai
3.Idempotency
A∩ A=A
A∪ A=A
Sesuai
Sesuai
4. Involution A=A Sesuai
5.Commutativity
A∩B=B∩ A
A∪B=B∪A
Sesuai
Sesuai
6.Associativity
( A∪B )∪C=A∪ (B∪C )
( A∩B )∩C=A ∩ (B∩C )
Sesuai
Sesuai
7.Distibutivity
A∪ (B∩C )= (A∪B )∩ ( A∪C )
A∩ (B∪C )= (A∩B )∪ ( A∩C )
Sesuai
Sesuai
8.Absorption
A∪ ( A∩B )=A∪B
A∩ ( A∪B )=A∩B
Sesuai
Sesuai
9. Absorption of Complement A∪ ( A∩B )=A∪B Sesuai
8
A∩ ( A∪B )=A∩B Sesuai
10.De Morgan’s Laws
A∪B=A∩B
A∩B=A∪B
Sesuai
Sesuai
Sedangkan pengujian dengan cara membandingkan element matriks dari masing-masing
operasi Set Theory menghasilkan beberapa perbedaan, hal ini dikarenakan operasi yang
digunakan dalam orde 0 s/d 1. Sehingga terjadi pembulatan saat operasi complement (1-
A). Berikut log hasil pengujiannya :
-------------------------------------------------------------------------
Running Set Theory Analysis ...
Analysis Result :
------------------------------------------------------------------------
1. Law of Contradiction :
Plot tidak sesuai. Persamaan tidak terpenuhi
------------------------------------------------------------------------
2. Law of The Excluded Middle :
------------------------------------------------------------------------
Persamaan 1
Plot tidak sesuai. Persamaan tidak terpenuhi
------------------------------------------------------------------------
2. Law of The Excluded Middle :
------------------------------------------------------------------------
Persamaan 1
Plot tidak sesuai. Persamaan tidak terpenuhi
------------------------------------------------------------------------
3. Idempotency :
------------------------------------------------------------------------
Persamaan 1
Plot sesuai. Persamaan terpenuhi
Persamaan 2
Plot sesuai. Persamaan terpenuhi
------------------------------------------------------------------------
4. Involution :
------------------------------------------------------------------------
Plot tidak sesuai. Persamaan tidak terpenuhi
------------------------------------------------------------------------
5. Distributivity :
------------------------------------------------------------------------
Persamaan 1
Plot sesuai. Persamaan terpenuhi
Persamaan 2
Plot sesuai. Persamaan terpenuhi
9
------------------------------------------------------------------------
6. Associativity :
------------------------------------------------------------------------
Persamaan 1
Plot sesuai. Persamaan terpenuhi
Persamaan 2
Plot sesuai. Persamaan terpenuhi
------------------------------------------------------------------------
7. Distributivity :
------------------------------------------------------------------------
Persamaan 1
Plot sesuai. Persamaan terpenuhi
Persamaan 2
Plot sesuai. Persamaan terpenuhi
------------------------------------------------------------------------
8. Absorption :
------------------------------------------------------------------------
Persamaan 1
Plot sesuai. Persamaan terpenuhi
Persamaan 2
Plot sesuai. Persamaan terpenuhi
------------------------------------------------------------------------
9. Absorption of Complement :
------------------------------------------------------------------------
Persamaan 1
Plot tidak sesuai. Persamaan tidak terpenuhi
Persamaan 2
Plot tidak sesuai. Persamaan tidak terpenuhi
------------------------------------------------------------------------
10. Analysis De Morgans Laws :
------------------------------------------------------------------------
Persamaan 1
Plot sesuai. Persamaan terpenuhi
Persamaan 2
Plot sesuai. Persamaan terpenuhi
------------------------------------------------------------------------
IV. Source Code
A. tri_mf.sci
function [y] = tri_mf(x, parameter)
// TRI_MF Triangular membership function with three parameters.
// TRI_MF(x, [a, b, c]) returns a matrix y with the same size
10
// as x; each element of y is a grade of membership.
// Jyh-Shing Roger Jang, 6-28-93.
// Ported to Scilab by Rahmat Purwoko, 2014
a = parameter(1); b = parameter(2); c = parameter(3);
if a > b,
error('Illegal parameters: a > b');
elseif b > c,
error('Illegal parameters: b > c');
elseif a > c,
error('Illegal parameters: a > c');
end
y = max(min((x-a)/(b-a), (c-x)/(c-b)), 0);
endfunction
B. Tugas1.sce
// Tugas I
// Analisa Sifat Matematis (Set Theory) pada Fuzzy Set
// Mata Kuliah : Kendali dan Sistem Cerdas
// Dosen : Prof. Dr. Ir. Bambang Riyanto Trilaksono, M.Sc
// Software : Scilab 5.5 (Open Source)
// Close all opened figures and clear workspaces
xdel(winsid());
clear;
clc;
//change or run it first
exec('D:\ITB 2014\SKC\tugas 1\source code\tri_mf.sci', -1)
// Universe
x = 0:250
// Fuzzy Set Generation using Triangular Membership Function
A = tri_mf(x,[-125,0,125]);
B = tri_mf(x,[0,125,250]);
C = tri_mf(x,[125,250,325]);
// 0. Fuzzy Set membership function
subplot(2,2,1);
plot(x, A, x, B, x, C);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
11
a.parent.background=4;
a.background=4;
legend(["A", "B", "C"]);
xtitle("Triangular ABC MF", "Ilummination Level", "Membership Function");
// ------------------------------------------------------------------------- //
// 1. Law of Contradiction
// ------------------------------------------------------------------------- //
figure
// Left
mf1a1 = min(A,1-A);
subplot(2,2,1)
plot(x,mf1a1);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$ A\cap \overline{A}$");
xtitle("$Law\ of\ Contradiction - A\cap \overline{A}$", "Ilummination Level",
"Membership Function");
// Right
subplot(2,2,2)
a = gca();
a.axes_visible="on";
a.data_bounds=[0,250,-0.1,1.2,];
a.grid =[1 1];
a.box="on";
xtitle("$Law\ of\ Contradiction - \emptyset$", "Ilummination Level", "Membership
Function");
// ------------------------------------------------------------------------- //
// 2. Law of The Excluded Middle
// ------------------------------------------------------------------------- //
figure
// Left
mf2a1 = max(A,1-A);
subplot(2,2,1);
plot(x,mf2a1);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
12
a.background=4;
legend("$A\cup \overline{A}$");
xtitle("Law of The Excluded Middle", "Ilummination Level", "Membership Function");
// Right
mf2a2 = x;
subplot(2,2,2);
plot(x,mf2a2);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$X$");
xtitle("Law of The Excluded Middle", "Ilummination Level", "Membership Function");
// ------------------------------------------------------------------------- //
// 3. Idempotency
// ------------------------------------------------------------------------- //
figure
// Left
mf3a1 = min(A,A);
subplot(2,2,1);
plot(x,mf3a1);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A\cap A$");
xtitle("Idempotency(1)", "Ilummination Level", "Membership Function");
//Right
mf3a2 = A;
subplot(2,2,2);
plot(x,mf3a2);
a = gca();
a.grid =[1 1];
13
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A$");
xtitle("Idempotency(1)", "Ilummination Level", "Membership Function");
// Persamaan 2
// Left
mf3b1 = max(A,A);
subplot(2,2,3);
plot(x,mf3b1);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A\cup A$");
xtitle("Idempotency(2)", "Ilummination Level", "Membership Function");
// Persamaan 2
// Right
mf3b2 = A;
subplot(2,2,4);
plot(x,mf3b2);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A$");
xtitle("Idempotency(2)", "Ilummination Level", "Membership Function");
// ------------------------------------------------------------------------- //
// 4. Involution
// ------------------------------------------------------------------------- //
figure
// Left
mf4a1 = 1-(1-A);
subplot(2,2,1);
plot(x,mf4a1);
a = gca();
14
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$\overline{\overline{A}}$");
xtitle("Involution", "Ilummination Level", "Membership Function");
// Right
mf4a2 = A;
subplot(2,2,2);
plot(x,mf4a2);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A$");
xtitle("Involution", "Ilummination Level", "Membership Function");
// ------------------------------------------------------------------------- //
// 5. Commutativity
// ------------------------------------------------------------------------- //
figure
// Persamaan 1
// Left
mf5a1 = max(A,B);
subplot(2,2,1);
plot(x,mf5a1);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A\cup B$");
xtitle("Commutativity (1)", "Ilummination Level", "Membership Function");
// Persamaan 1
// Right
mf5a2 = max(B,A);
subplot(2,2,2);
plot(x,mf5a2);
15
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$B\cup A$");
xtitle("Commutativity (1)", "Ilummination Level", "Membership Function");
// Persamaan 2
// Left
mf5b1 = min(A,B);
subplot(2,2,3);
plot(x,mf5b1);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A\cap B$");
xtitle("Commutativity (2)", "Ilummination Level", "Membership Function");
// Persamaan 2
// Right
mf5b2 = min(B,A);
subplot(2,2,4);
plot(x,mf5b2);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$B\cap A$");
xtitle("Commutativity (2)", "Ilummination Level", "Membership Function");
// ------------------------------------------------------------------------- //
// 6. Associativity
// ------------------------------------------------------------------------- //
figure
// Persamaan 1
// Left
mf6a1 = max(A,max(B,C));
subplot(2,2,1);
plot(x,mf6a1);
16
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A\cup (B\cup C)$");
xtitle("Associativity (1)", "Ilummination Level", "Membership Function");
// Persamaan 1
// Right
mf6a2 = max(max(A,B),C);
subplot(2,2,2);
plot(x,mf6a2);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$(A\cup B)\cup C$");
xtitle("Associativity (1)", "Ilummination Level", "Membership Function");
// persamaan 2
// Left
mf6b1 = min(A,min(B,C));
subplot(2,2,3);
plot(x,mf6b1);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A\cap (B\cap C)$");
xtitle("Associativity (2)", "Ilummination Level", "Membership Function");
// Persamaan 2
// Right
mf6b2 = min(min(A,B),C);
subplot(2,2,4);
plot(x,mf6b2);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
17
a.background=4;
legend("$(A\cap B)\cap C$");
xtitle("Associativity (2)", "Ilummination Level", "Membership Function");
// ------------------------------------------------------------------------- //
// 7. Distributivity
// ------------------------------------------------------------------------- //
figure
// Persamaan 1
// Left
mf7a1 = max(A,min(B,C));
subplot(2,2,1);
plot(x,mf7a1);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A\cup (B\cap C)$");
xtitle("Distributivity (1)", "Ilummination Level", "Membership Function");
// Persamaan 1
// Right
mf7a2 = min(max(A,B),max(A,C));
subplot(2,2,2);
plot(x,mf7a2);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$(A\cup B)\cap (A\cup C)$");
xtitle("Distributivity (1)", "Ilummination Level", "Membership Function");
// persamaan 2
// Left
mf7b1 = min(A,max(B,C));
subplot(2,2,3);
plot(x,mf7b1);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
18
a.background=4;
legend("$A\cap (B\cup C)$");
xtitle("Distributivity (2)", "Ilummination Level", "Membership Function");
// Persamaan 2
// Right
mf7b2 = max(min(A,B),min(A,C));
subplot(2,2,4);
plot(x,mf7b2);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$(A\cap B)\cup (A\cap C)$");
xtitle("Distributivity (2)", "Ilummination Level", "Membership Function");
// ------------------------------------------------------------------------- //
// 8. Absorption
// ------------------------------------------------------------------------- //
figure
// Persamaan 1
// Left
mf8a1 = max(A,min(A,B));
subplot(2,2,1);
plot(x,mf8a1);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A\cup (A\cap B)$");
xtitle("Absorption (1)", "Ilummination Level", "Membership Function");
// Persamaan 1
// Right
mf8a2 = A;
subplot(2,2,2);
plot(x,mf8a2);
19
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A$");
xtitle("Absorption (1)", "Ilummination Level", "Membership Function");
// persamaan 2
// Left
mf8b1 = min(A,max(A,B));
subplot(2,2,3);
plot(x,mf8b1);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A\cap (A\cup B)$");
xtitle("Absorption (2)", "Ilummination Level", "Membership Function");
// Persamaan 2
// Right
mf8b2 = A;
subplot(2,2,4);
plot(x,mf8b2);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A$");
xtitle("Absorption (2)", "Ilummination Level", "Membership Function");
// ------------------------------------------------------------------------- //
// 9. Absorption of Complement
// ------------------------------------------------------------------------- //
figure
// Persamaan 1
// Left
mf9a1 = max(A,min(1-A,B));
subplot(2,2,1);
plot(x,mf9a1);
20
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A\cup (\overline{A}\cap B)$");
xtitle("Absorption of Complement (1)", "Ilummination Level", "Membership
Function");
// Persamaan 1
// Right
mf9a2 = max(A,B);
subplot(2,2,2);
plot(x,mf9a2);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$: A\cup B$");
xtitle("Absorption of Complement (1)", "Ilummination Level", "Membership
Function");
// persamaan 2
// Left
mf9b1 = min(A,max(1-A,B));
subplot(2,2,3);
plot(x,mf9b1);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$A\cap (A\cup B)$");
xtitle("Absorption of Complement (2)", "Ilummination Level", "Membership
Function");
// Persamaan 2
// Right
mf9b2 = min(A,B);
subplot(2,2,4);
plot(x,mf9b2);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
21
a.parent.background=4;
a.background=4;
legend("$: A\cap B$");
xtitle("Absorption of Complement (2)", "Ilummination Level", "Membership
Function");
// ------------------------------------------------------------------------- //
// 10. De Morgan's Laws
// ------------------------------------------------------------------------- //
figure
// Persamaan 1
// Left
mf10a1 = 1-max(A,B);
subplot(2,2,1);
plot(x,mf10a1);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$\overline{A\cup B$");
xtitle("De Morgan`s Laws (1)", "Ilummination Level", "Membership Function");
// Persamaan 1
// Right
mf10a2 = min(1-A,1-B);
subplot(2,2,2);
plot(x,mf10a2);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$\overline{A}\cap \overline{B}$");
xtitle("De Morgan`s Laws (1)", "Ilummination Level", "Membership Function");
// Persamaan 2
// Left
mf10b1 = 1-min(A,B);
subplot(2,2,3);
plot(x,mf10b1);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
22
a.background=4;
legend("$\overline{A\cap B$");
xtitle("De Morgan`s Laws (2)", "Ilummination Level", "Membership Function");
// Persamaan 2
// Right
mf10b2 = max(1-A,1-B);
subplot(2,2,4);
plot(x,mf10b2);
a = gca();
a.grid =[1 1];
a.data_bounds=[0,250,-0.1,1.2,];
a.parent.background=4;
a.background=4;
legend("$\overline{A}\cup \overline{B}$");
xtitle("De Morgan`s Laws (2)", "Ilummination Level", "Membership Function");
// ------------------------------------------------------------------------- //
// Simple Analisis Generator
// Generate True or False based on equivalencies matrix
// ------------------------------------------------------------------------- //
disp "------------------------------------------------------------------------"
disp "------------------------------------------------------------------------"
disp "Running Set Theory Analysis ..."
disp "Analysis Result : "
disp "------------------------------------------------------------------------"
disp "1. Law of Contradiction :"
if mf1a1 == [] then
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "------------------------------------------------------------------------"
disp "2. Law of The Excluded Middle :"
disp "------------------------------------------------------------------------"
disp "Persamaan 1 "
if mf2a1 == mf2a2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
23
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "------------------------------------------------------------------------"
disp "2. Law of The Excluded Middle :"
disp "------------------------------------------------------------------------"
disp "Persamaan 1"
if mf2a1 == mf2a2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "------------------------------------------------------------------------"
disp "3. Idempotency :"
disp "------------------------------------------------------------------------"
disp "Persamaan 1"
if mf3a1 == mf3a2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "Persamaan 2"
if mf3b1 == mf3b2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "------------------------------------------------------------------------"
disp "4. Involution :"
disp "------------------------------------------------------------------------"
if mf4a1 == mf4a2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "------------------------------------------------------------------------"
disp "5. Distributivity :"
disp "------------------------------------------------------------------------"
disp "Persamaan 1"
if mf5a1 == mf5a2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "Persamaan 2"
if mf5b1 == mf5b2 then
24
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "------------------------------------------------------------------------"
disp "6. Associativity :"
disp "------------------------------------------------------------------------"
disp "Persamaan 1"
if mf6a1 == mf6a2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "Persamaan 2"
if mf6b1 == mf6b2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "------------------------------------------------------------------------"
disp "7. Distributivity :"
disp "------------------------------------------------------------------------"
disp "Persamaan 1"
if mf7a1 == mf7a2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "Persamaan 2"
if mf7b1 == mf7b2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "------------------------------------------------------------------------"
disp "8. Absorption :"
disp "------------------------------------------------------------------------"
disp "Persamaan 1"
if mf8a1 == mf8a2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
25
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "Persamaan 2"
if mf8b1 == mf8b2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "------------------------------------------------------------------------"
disp "9. Absorption of Complement :"
disp "------------------------------------------------------------------------"
disp "Persamaan 1"
if mf9a1 == mf9a2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "Persamaan 2"
if mf9b1 == mf9b2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "------------------------------------------------------------------------"
disp "10. Analysis De Morgans Laws :"
disp "------------------------------------------------------------------------"
if mf10a1 == mf10a2 then
disp "Plot sesuai. Persamaan terpenuhi"
else
disp "Plot tidak sesuai. Persamaan tidak terpenuhi"
end
disp "------------------------------------------------------------------------"
// ------------------------------------------------------------------------- //
// Save Figgure to PNG file
// ------------------------------------------------------------------------- //
for i = 0:10
xs2png(i, sprintf("tugas1_%03d.png",i))
sleep(100);
end
26