
Understanding Reasoning and Logic in Artificial Intelligence
Delve into the world of reasoning and logic in artificial intelligence with an exploration of concepts, techniques, and types of logic used. Understand how problems are solved through knowledge representation and formal languages, and learn about different types of logic such as propositional, first-order, fuzzy logic, and more.
Uploaded on | 0 Views
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
E N D
Presentation Transcript
Pengantar Kecerdasan Buatan --------------------------- REASONING Sri Supatmi, S.Kom., M.T., D.Sc. Nelly Indriani Widiastuti S.Si., M.T
Tujuan : Memahami konsep dan teknik Reasoning Rencana kegiatan : materi, latihan & tugas Cakupan materi : objektif Teknik reasoning Reasoning dalam Knowledge Base
Cara penyelesaian masalah dengan cara merepresentasikan masalah ke dalam basis pengetahuan menggunakan logic atau bahasa formal. Teknik Reasoning Pendekatan Logika pasti (propotitional, first order/predicate) Logika tidak pasti (fuzzy logic)
Searching vs Reasoning SEARCHING REASONING Representasi : State dan ruang masalah Basis pengetahuan Teknik : strategi pencarian Penalaran Tujuan : Menemukan nilai tertentu Menghasilkan kesimpulan Masalah : Kelengkapan representasi state Kelengkapan aturan
Jenis logic Jenis-jenis yang digunakan untuk merepresentasikan basis pengetahuan dan melakukan penalaran Jenis Logic Yang ada di dunia nyata Apa yg dipercaya agent tentang nyata Propositional logic fakta Benar/salah/tidak diketahui First order logic Fakta,objek, relasi Benar/salah/tidak diketahui Temporary logic Fakta,objek, relasi, waktu Benar/salah/tidak diketahui Probability theory Fakta Derajat kebenaran [1,0] Fuzzy logic Derajat kebenaran Derajat kebenaran [1,0]
Syntax symbols sentences logical constants True, False constructed from simple sentences propositional symbols P, Q, conjunction, disjunction, implication, equivalence, negation logical connectives conjunction , disjunction , negation , implication , equivalence parentheses (, )
AtomicSentence Sentence | ComplexSentence AtomicSentence True | False | P | Q | R | ... (Sentence ) ComplexSentence Sentence Connective Sentence | Sentence BNF Grammar Propositional Logic | | | Connective ambiguities are resolved through precedence or parentheses e.g. P Q R S is equivalent to ( P) (Q R)) S
Reasoning in Knowledge- Based Systems
shallow and deep reasoning forward and backward chaining alternative inference methods metaknowledge
Shallow and Deep Reasoning Nama lain dari experiential reasoning Bertujuan untuk mendeskripsikan aspek- aspek lingkungan secara heuristically shallow reasoning Short inference chains Memungkinkan aturan yang kompleks Disebut juga causal reasoning Bertujuan membangun model lingkungan yang berlaku seperti hal nyata. deep reasoning Long inference chains Simple rules yang mendeskripsikan hubungan sebab dan akibat
Contoh Shallow dan Deep Reasoning IF a car has IF the battery is good THEN there is electricity shallow reasoning a good battery deep reasoning IF there is electricity AND good spark plugs THEN the spark plugs will fire good spark plugs gas good tires IF the spark plugs fire AND there is gas THEN the engine will run THEN the car can move IF the engine runs AND there are good tires THEN the car can move
Forward Chaining
Diberikan sejumlah fakta dasar, bagaimana menghasilkan kesimpulan ? Contoh : What can we conjecture about Clyde? IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant (Clyde) modus ponens: IF p THEN q p unification: find compatible values for variables q
Forward Chaining Example unification: find compatible values for variables IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) modus ponens: IF p THEN q p q IF elephant( x ) THEN mammal( x ) elephant (Clyde)
Forward Chaining Example unification: find compatible values for variables IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) modus ponens: IF p THEN q p q IF elephant(Clyde) THEN mammal(Clyde) elephant (Clyde)
Forward Chaining Example IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) modus ponens: IF p THEN q p unification: find compatible values for variables q IF mammal( x ) THEN animal( x ) IF elephant(Clyde) THEN mammal(Clyde) elephant (Clyde)
Forward Chaining Example IF elephant(x) THEN mammal(x) unification: find compatible values for variables IF mammal(x) THEN animal(x) elephant(Clyde) modus ponens: IF p THEN q p q IF mammal(Clyde) THEN animal(Clyde) IF elephant(Clyde) THEN mammal(Clyde) elephant (Clyde)
Forward Chaining Example unification: find compatible values for variables IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) modus ponens: IF p THEN q p q animal( x ) IF mammal(Clyde) THEN animal(Clyde) IF elephant(Clyde) THEN mammal(Clyde) elephant (Clyde)
Forward Chaining Example unification: find compatible values for variables IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) modus ponens: IF p THEN q p animal(Clyde) q IF mammal(Clyde) THEN animal(Clyde) IF elephant(Clyde) THEN mammal(Clyde) elephant (Clyde)
Backward Chaining
Mencoba menemukan bukti pendukung (i.e. facts) untuk suatu hypothesis Contoh : apakah ada bukti bahwa Clyde adalah seekor binatang IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant (Clyde) modus ponens: IF p THEN q p unification: find compatible values for variables q
Backward Chaining Example unification: find compatible values for variables IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) modus ponens: IF p THEN q p ? animal(Clyde) q IF mammal( x ) THEN animal( x )
Backward Chaining Example unification: find compatible values for variables IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) modus ponens: IF p THEN q p ? animal(Clyde) q IF mammal(Clyde) THEN animal(Clyde)
Backward Chaining Example unification: find compatible values for variables IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) modus ponens: IF p THEN q p ? animal(Clyde) q ? IF mammal(Clyde) THEN animal(Clyde) IF elephant( x ) THEN mammal( x )
Backward Chaining Example unification: find compatible values for variables IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) modus ponens: IF p THEN q p ? animal(Clyde) q ? IF mammal(Clyde) THEN animal(Clyde) IF elephant(Clyde) THEN mammal(Clyde)
Backward Chaining Example unification: find compatible values for variables IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) modus ponens: IF p THEN q p ? animal(Clyde) q ? IF mammal(Clyde) THEN animal(Clyde) IF elephant(Clyde) THEN mammal(Clyde) ? elephant ( x )
Backward Chaining Example unification: find compatible values for variables IF elephant(x) THEN mammal(x) IF mammal(x) THEN animal(x) elephant(Clyde) modus ponens: IF p THEN q p q animal(Clyde) IF mammal(Clyde) THEN animal(Clyde) IF elephant(Clyde) THEN mammal(Clyde) elephant (Clyde)
Forward Chaining planning, control Backward Chaining diagnosis goal-driven (hypothesis) top-down reasoning Forward vs. Backward Chaining data-driven bottom-up reasoning find possible conclusions supported by given facts find facts that support a given hypothesis similar to breadth-first search similar to depth-first search antecedents (LHS) control evaluation consequents (RHS) control evaluation
Motor Inferensi (contd) No. Aturan Contoh: Ada 10 aturan yang tersimpan dalam basis pengetahuan. Fakta awal yang diberikan hanya: A & E (artinya: A dan E bernilai benar). Ingin dibuktikan apakah K bernilai benar (hipotesis: K)? R-1 IF A & B THEN C R-2 IF C THEN D R-3 IF A & E THEN F R-4 IF A THEN G R-5 IF F & G THEN D R-6 IF G & E THEN H R-7 IF C & H THEN I R-8 IF I & A THEN J R-9 IF G THEN J R-10 IF J THEN K
Motor Inferensi (contd) Alur inferensi: R-10 R-9 J K R-4 Fakta G A R-5 D R-3 F R-6 H E Fakta
Motor Inferensi (cont d) Forward Chaining Munculnya fakta baru pada saat inferensi: Aturan Fakta Baru R-3 F R-4 G R-5 D R-6 H R-9 J R-10 K
Motor Inferensi (contd) Backward Chaining Alur inferensi: R-10 Fakta A C J I K R-1 R-7 R-8 B H A Tidak diketahui (a) Pertama: Gagal Fakta R-10 R-9 R-4 J G A K (b) Kedua: Sukses
KAIDAH INFERENSI
Mengubah bentuk proposisi -> formula Contoh : Jika ada daya listrik, komputer akan bekerja Ada daya komputer akan bekerja Jika : A = ada daya listrik B = komputer akan bekerja Sehingga dapat ditulis : A B A B Bentuk tersebut valid karena dapat ditunjukan sebagai tautologi
Inferensi (penarikan kesimpulan) dengan penalaran dari yang umum ke yang khusus Misal : Modus Ponen Contoh 1: A = Udara Cerah B = Kita akan pergi ke pantai A B = Jika udara cerah, maka kita pergi ke pantai Dengan menggunakan Modus Ponen, kesimpulan adalah Kita akan pergi ke Pantai Deduksi Contoh 2: Semua kucing merupakan anggota feline Bootsy adalah seekor kucing Kesimpulan : Bootsy merupakan anggota feline
Inferensi dengan penalaran dari yang khusus (fakta-fakta) ke yang umum Menebak dari yang sudah ada dan dari gejala yang terjadi Formatnya: X = {a,b,c,d,...}, if property P is true for a, and if P is true for b, and if P is true for c,..., then P is true for all X Contoh: Semua kucing Siamese pada pertunjukan kucing 1986 mempunyai mata biru Semua kucing Siamese pada pertunjukan kucing 1987 mempunyai mata biru Kesimpulan : Semua kucing Siamese pada pertunjukan kucing mempunyai mata biru Induksi
Bentuk deduksi yang hanya menghasikan inferensi yang masuk akal (plausible inference) Plausible berarti bahwa konklusi mungkin bisa mengikuti informasi yang tersedia, tetapi juga bisa salah. Formatnya: if Y is true and X implies Y , then X is true ? Abduksi Contoh: Implikasi : Tanah menjadi basah jika terjadi hujan (rule) Aksioma : Tanah menjadi basah (fact) Konklusi : Apakah terjadi hujan? (result)
Contoh : Jika tidak ada kesalahan program dapat mengkompile Program dapat mengkompile Tidak ada kesalahan Tentukan validitasnya !