Application Center - Maplesoft

App Preview:

Lukasiewicz's Many-Valued Logic - Arithmetic Semantic

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application




 

 

 

 

 

Lukasiewicz's Many-Valued Logic - Arithmetic Semantic

 

Kahtan H. Alzubaidy

 

 

 

Introduction

  Procedures are presented to evaluate propositions and to check tautologies in Lukasiewicz's n-valued logic. Atomic propositions are represented

by numerical variables x,y,z,w and logical connectives by suitable functions. Evaluations and checking are done for compound propositions consisting of at most four atomic propositions.

 

 

restart

with(ListTools):

NULL

cartesian*product*of*two*lists

 

cp2:=proc(K,L)

[seq(seq([x,y],y in L),x in K)];

end proc;

proc (K, L) [seq(seq([x, y], `in`(y, L)), `in`(x, K))] end proc

(1)

``

NULL

cartesian*product*of*three*lists

 

cp3:=proc(K,L,M)

local G;

G:=cp2(cp2(K, L), M);

[seq(Flatten(J), `in`(J, G))];

end proc;

proc (K, L, M) local G; G := cp2(cp2(K, L), M); [seq(ListTools:-Flatten(J), `in`(J, G))] end proc

(2)

cartesian*product*of*four*lists

 

cp4:=proc(K,L,M,N)

local G;

G:=cp2(cp3(K, L, M),N);

[seq(Flatten(J), `in`(J, G))];

end proc;

proc (K, L, M, N) local G; G := cp2(cp3(K, L, M), N); [seq(ListTools:-Flatten(J), `in`(J, G))] end proc

(3)

NULL

NULL

NULL

n*truth*values

 

V:=proc(n)

[seq(r/(n-1),r=0..n-1)];

end proc;

proc (n) [seq(r/(n-1), r = 0 .. n-1)] end proc

(4)

V(6);

[0, 1/5, 2/5, 3/5, 4/5, 1]

(5)

cp2(V(3), V(3));

[[0, 0], [0, 1/2], [0, 1], [1/2, 0], [1/2, 1/2], [1/2, 1], [1, 0], [1, 1/2], [1, 1]]

(6)

cp3(V(3), V(3), V(3));

[[0, 0, 0], [0, 0, 1/2], [0, 0, 1], [0, 1/2, 0], [0, 1/2, 1/2], [0, 1/2, 1], [0, 1, 0], [0, 1, 1/2], [0, 1, 1], [1/2, 0, 0], [1/2, 0, 1/2], [1/2, 0, 1], [1/2, 1/2, 0], [1/2, 1/2, 1/2], [1/2, 1/2, 1], [1/2, 1, 0], [1/2, 1, 1/2], [1/2, 1, 1], [1, 0, 0], [1, 0, 1/2], [1, 0, 1], [1, 1/2, 0], [1, 1/2, 1/2], [1, 1/2, 1], [1, 1, 0], [1, 1, 1/2], [1, 1, 1]]

(7)

cp4(V(2), V(2), V(2), V(2));

[[0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0], [0, 0, 1, 1], [0, 1, 0, 0], [0, 1, 0, 1], [0, 1, 1, 0], [0, 1, 1, 1], [1, 0, 0, 0], [1, 0, 0, 1], [1, 0, 1, 0], [1, 0, 1, 1], [1, 1, 0, 0], [1, 1, 0, 1], [1, 1, 1, 0], [1, 1, 1, 1]]

(8)

 

minimum function

 

m:=proc(x,y)

(x+y)/2 -abs(x-y)/2;

end proc;

proc (x, y) (1/2)*x+(1/2)*y-(1/2)*abs(x-y) end proc

(9)

NULL

maximum function

 

M:=proc(x,y)

(x+y)/2 +abs(x-y)/2;

end proc;

proc (x, y) (1/2)*x+(1/2)*y+(1/2)*abs(x-y) end proc

(10)

NULL

   logical connectives

 

negation

NULL

n:=proc(x)

1-x;

end proc;

proc (x) 1-x end proc

(11)

NULL

   conditional

 

i:=proc(x,y)

 m(1,1-x+y);

end proc;

proc (x, y) m(1, 1-x+y) end proc

(12)

NULL

disjunction

 

o:=proc(x,y)

 M(x,y);

end proc;

proc (x, y) M(x, y) end proc

(13)

NULL

conjunction

 

a:=proc(x,y)

 m(x,y);

end proc;

proc (x, y) m(x, y) end proc

(14)

NULL

  biconditional

 

e:=proc(x,y)

 1-abs(x-y);

end proc;

proc (x, y) 1-abs(x-y) end proc

(15)

NULL

valuation*of*a*proposition*involving*one*atomic*proposition

   n is the number of truth values.

 

val1:=proc(n,f)

local W;

W:=V(n);

seq([[x],f(x)],x in W);

 

end proc;

proc (n, f) local W; W := V(n); seq([[x], f(x)], `in`(x, W)) end proc

(16)

``

     An¬A

 

f := proc (x) options operator, arrow; o(x, n(x)) end proc;

proc (x) options operator, arrow; o(x, n(x)) end proc

(17)

val1(2, f);

[[0], 1], [[1], 1]

(18)

val1(3, f);

[[0], 1], [[1/2], 1/2], [[1], 1]

(19)

NULL

valuation*of*a*proposition*involving*two*atomic*propositions

 

val2:=proc(n,f)

local W,VV;

W:=V(n);

VV:=cp2(W,W);

seq([z,f(z[1],z[2])],z in VV);

 

end proc;

proc (n, f) local W, VV; W := V(n); VV := cp2(W, W); seq([z, f(z[1], z[2])], `in`(z, VV)) end proc

(20)

``

   (A→ B) n (B → A)

 

g := proc (x, y) options operator, arrow; o(i(x, y), i(y, x)) end proc;

proc (x, y) options operator, arrow; o(i(x, y), i(y, x)) end proc

(21)

val2(3, g);

[[0, 0], 1], [[0, 1/2], 1], [[0, 1], 1], [[1/2, 0], 1], [[1/2, 1/2], 1], [[1/2, 1], 1], [[1, 0], 1], [[1, 1/2], 1], [[1, 1], 1]

(22)

NULL

valuation*of*a*proposition*involving*three*atomic*propositions

 

val3:=proc(n,f)

local W,VVV,K;

W:=V(n);

K := cp3(W, W, W);

VVV:=[seq(Flatten(J), `in`(J, K))];

seq([z,f(z[1],z[2],z[3])],z in VVV);

end proc;

proc (n, f) local W, VVV, K; W := V(n); K := cp3(W, W, W); VVV := [seq(ListTools:-Flatten(J), `in`(J, K))]; seq([z, f(z[1], z[2], z[3])], `in`(z, VVV)) end proc

(23)

NULL

NULL

     A→(B→C) ≡ (AoB)→C

 

h := proc (x, y, z) options operator, arrow; e(i(x, i(y, z)), i(a(x, y), z)) end proc;

proc (x, y, z) options operator, arrow; e(i(x, i(y, z)), i(a(x, y), z)) end proc

(24)

val3(2, h);

[[0, 0, 0], 1], [[0, 0, 1], 1], [[0, 1, 0], 1], [[0, 1, 1], 1], [[1, 0, 0], 1], [[1, 0, 1], 1], [[1, 1, 0], 1], [[1, 1, 1], 1]

(25)

val3(3, h);

[[0, 0, 0], 1], [[0, 0, 1/2], 1], [[0, 0, 1], 1], [[0, 1/2, 0], 1], [[0, 1/2, 1/2], 1], [[0, 1/2, 1], 1], [[0, 1, 0], 1], [[0, 1, 1/2], 1], [[0, 1, 1], 1], [[1/2, 0, 0], 1], [[1/2, 0, 1/2], 1], [[1/2, 0, 1], 1], [[1/2, 1/2, 0], 1/2], [[1/2, 1/2, 1/2], 1], [[1/2, 1/2, 1], 1], [[1/2, 1, 0], 1], [[1/2, 1, 1/2], 1], [[1/2, 1, 1], 1], [[1, 0, 0], 1], [[1, 0, 1/2], 1], [[1, 0, 1], 1], [[1, 1/2, 0], 1], [[1, 1/2, 1/2], 1], [[1, 1/2, 1], 1], [[1, 1, 0], 1], [[1, 1, 1/2], 1], [[1, 1, 1], 1]

(26)

NULL

valuation*of*a*proposition*involving*four*atomic*propositions

 

val4:=proc(n,f)

local W,VVVV,K;

W:=V(n);

K := cp4(W, W, W,W);

VVVV:=[seq(Flatten(J), `in`(J, K))];

seq([z,f(z[1],z[2],z[3],z[4])],z in VVVV);

end proc;

proc (n, f) local W, VVVV, K; W := V(n); K := cp4(W, W, W, W); VVVV := [seq(ListTools:-Flatten(J), `in`(J, K))]; seq([z, f(z[1], z[2], z[3], z[4])], `in`(z, VVVV)) end proc

(27)

 

   (AoB ) →(CnD)

  

hh := proc (x, y, z, w) options operator, arrow; i(a(x, y), o(z, w)) end proc;

proc (x, y, z, w) options operator, arrow; i(a(x, y), o(z, w)) end proc

(28)

val4(2, hh);

[[0, 0, 0, 0], 1], [[0, 0, 0, 1], 1], [[0, 0, 1, 0], 1], [[0, 0, 1, 1], 1], [[0, 1, 0, 0], 1], [[0, 1, 0, 1], 1], [[0, 1, 1, 0], 1], [[0, 1, 1, 1], 1], [[1, 0, 0, 0], 1], [[1, 0, 0, 1], 1], [[1, 0, 1, 0], 1], [[1, 0, 1, 1], 1], [[1, 1, 0, 0], 0], [[1, 1, 0, 1], 1], [[1, 1, 1, 0], 1], [[1, 1, 1, 1], 1]

(29)

NULL

tautology*involving*one*proposition

 

tau1:=proc(n,f)

local W,L,c,x;

W:=V(n);

L:=[seq(f(x),x in W)];

c:=0;

for x in L do if x=1 then c:=c+1 fi;od;

if c=nops(L) then print(tautology); else print(NO)fi;

end proc;

proc (n, f) local W, L, c, x; W := V(n); L := [seq(f(x), `in`(x, W))]; c := 0; for x in L do if x = 1 then c := c+1 end if end do; if c = nops(L) then print(tautology) else print(NO) end if end proc

(30)

NULL

``

     An¬A

 

f := proc (x) options operator, arrow; o(x, n(x)) end proc;

proc (x) options operator, arrow; o(x, n(x)) end proc

(31)

tau1(2, f);

tautology

(32)

tau1(3, f);

NO

(33)

    A→A

 

g := proc (x) options operator, arrow; i(x, x) end proc;

proc (x) options operator, arrow; i(x, x) end proc

(34)

tau1(3, g);

tautology

(35)

``

NULL

tautology*involving*two*propositions

 

tau2:=proc(n,f)

local W,VV,L,c,x;

W:=V(n);

VV:=cp2(W,W);

L:=[seq(f(z[1],z[2]),z in VV)];

c:=0;

for x in L do if x=1 then c:=c+1 fi;od;

if c=nops(L) then print(tautology); else print(NO)fi;

end proc;

proc (n, f) local W, VV, L, c, x; W := V(n); VV := cp2(W, W); L := [seq(f(z[1], z[2]), `in`(z, VV))]; c := 0; for x in L do if x = 1 then c := c+1 end if end do; if c = nops(L) then print(tautology) else print(NO) end if end proc

(36)

``

     (A→ B) n (B → A)

 

g := proc (x, y) options operator, arrow; o(i(x, y), i(y, x)) end proc;

proc (x, y) options operator, arrow; o(i(x, y), i(y, x)) end proc

(37)

tau2(3, g);

tautology

(38)

   {A→B, ¬B}~¬A

 

k := proc (x, y) options operator, arrow; i(a(o(x, y), n(y)), x) end proc;

proc (x, y) options operator, arrow; i(a(o(x, y), n(y)), x) end proc

(39)

tau2(2, k);

tautology

(40)

tau2(3, k);

NO

(41)

tau2(4, k);

NO

(42)

NULL

NULL

tautology*involving*three*propositions

 

tau3:=proc(n,f)

local W,VVV,K,L,c,x;

W:=V(n);

K := cp3(W, W,W);VVV:=[seq(Flatten(J), `in`(J, K))];

L:=[seq(f(w[1],w[2],w[3]),w in VVV)];

c:=0;

for x in L do if x=1 then c:=c+1 fi;od;

if c=nops(L) then print(tautology); else print(NO)fi;

end proc;

proc (n, f) local W, VVV, K, L, c, x; W := V(n); K := cp3(W, W, W); VVV := [seq(ListTools:-Flatten(J), `in`(J, K))]; L := [seq(f(w[1], w[2], w[3]), `in`(w, VVV))]; c := 0; for x in L do if x = 1 then c := c+1 end if end do; if c = nops(L) then print(tautology) else print(NO) end if end proc

(43)

NULL

     {A→B,B→C}~A→C

 

t := proc (x, y, z) options operator, arrow; i(i(x, y), i(i(y, z), i(x, z))) end proc;

proc (x, y, z) options operator, arrow; i(i(x, y), i(i(y, z), i(x, z))) end proc

(44)

tau3(3, t);

tautology

(45)

NULL

tautology*involving*four*propositions

 

tau4:=proc(n,f)

local W,VVVV,K,L,c,x;

W:=V(n);

K := cp4(W, W,W,W);VVVV:=[seq(Flatten(J), `in`(J, K))];

L:=[seq(f(w[1],w[2],w[3],w[4]),w in VVVV)];

c:=0;

for x in L do if x=1 then c:=c+1 fi;od;

if c=nops(L) then print(tautology); else print(NO)fi;

end proc;

proc (n, f) local W, VVVV, K, L, c, x; W := V(n); K := cp4(W, W, W, W); VVVV := [seq(ListTools:-Flatten(J), `in`(J, K))]; L := [seq(f(w[1], w[2], w[3], w[4]), `in`(w, VVVV))]; c := 0; for x in L do if x = 1 then c := c+1 end if end do; if c = nops(L) then print(tautology) else print(NO) end if end proc

(46)

``

   {A→B,C→D}~(AnC)→(BnD)

 

NULL

s := proc (x, y, z, w) options operator, arrow; i(a(i(x, y), i(z, w)), i(o(x, z), o(y, w))) end proc;

proc (x, y, z, w) options operator, arrow; i(a(i(x, y), i(z, w)), i(o(x, z), o(y, w))) end proc

(47)

tau4(2, s);

tautology

(48)

tau4(3, s);

tautology

(49)

tau4(4, s);

tautology

(50)

``

u := proc (x, y) options operator, arrow; i(x, y)*x end proc;

proc (x, y) options operator, arrow; i(x, y)*x end proc

(51)

uu := proc (x, y) options operator, arrow; i(u(x, y), y) end proc;

proc (x, y) options operator, arrow; i(u(x, y), y) end proc

(52)

tau2(2, uu);

tautology

(53)

tau2(3, uu);

NO

(54)

 

 References

 1) M. Bergmann, Many-Valued and Fuzzy Logic

     Cambridge 2008.

 2) G.Malinowski, Many-Valued Logics

     Clarendon- Oxford  1993.

 

NULL