artificial intelligence part 2 (logic ai)

Jul 12th, 2009 | Posted by

Logic merupakan jantung dari program, para pemrogram mempunyai keyakinan jika sebuah komputer dapat dibuat mengerti  logika, maka  komputer  dapat dibuat untuk berpikir, karena logika  kelihatannya menjadi inti dari kecerdasan.

Sejarah Singkat Logika

Syllogistic atau classical logic. Aristotle( 384-322 BC)
Syllogistic logic pada dasarnya bertransaksi dengan  penurunan kebenaran (atau yang bersifat salah) dari argumen seorang filosofi.
Contoh:
John is a man
All men used to the boys
Therefore, John used to be a boy
Contoh diatas dikonversikan ke Syllogistic logic:
J —> M
all M —> B
hence:     J —> B

Symbolic logic dimulai dengan G.W. Leibniz(1646-1717) and George Boole(1815-1864) yang logikanya dikenal denganBoolean Logic.
Symbolic logic berinteraksi  dengan konsep abstraksi ke dalam simbol-simbol dan interkoneksi  simbol-simbol oleh operator tertentu.
Contoh:
if P is true, Q is false
Then P or Q is true, P and Q is false

JENIS Symbolic Logic ada 2 Yaitu:
Propotional Logic : bertransaksi dengan kebenaran atau kesalahan dari sebuah proposition.
Predicate Logic : memasukkan hubungan antara obyek-obyek dan kelas-kelas dari obyek.

“if  it  is  raining  then  the road  are wet”

The Truth Table

The Truth Table

Propotional Logic
Beberapa  facts  sederhana  dalam propositional  logic :
It is  raining
Raining
It is  sunny
Sunny
It is  windy
Windy
If it is raining, then it is  not  sunny
Raining –> – sunny

Predicate Logic

Example of Predicate Logic 1

Example of Predicate Logic 1

Example of Predicate Logic 2

Example of Predicate Logic 2

Logical Evidence

Logical Evidence

source code @ prolog :
Bila pengetahuan di atas dan untuk membuktikan bahwa marcus tidak loyal kepada caesar dituangkan dalam bahasa Turbo Prolog, sebagai berikut:

Domains
     Simbol = string
Predicates
     man(Simbol)
     ruler(Simbol)
     tryassassinate(Simbol, Simbol)
     person(Simbol)
     notloyalto(Simbol., Simbol )
Clauses
     man(marcus).
     ruler(caesar).
     tryassassinate(marcus, caesar).
     person(X)    :-    man(X).
     notloyalto(X, Y) :-     person(X),
     ruler(Y),
     tryassassinate(X, Y).

setelah itu tekan tombol ALT + R untuk RUN , sehingga muncul menu dialogue sebagai berikut:

Goal: notloyalto(A,B).
      A=marcus;
      B=caesar;
      No
Goal: notloyalto(P, caesar).
      P=marcus;
      No

Related posts:

  1. artificial intelligence part 1
  2. organisasi file part 2
  3. organisasi file part 1
Tags:
No comments yet.
*