Inferensi pada Kalkulus Predikat Orde 1

Slides:



Advertisements
Presentasi serupa
Penyelesaian Masalah Dengan AI
Advertisements

God... When I find joy in a friend Remind me that there would be an end So I stay with the One who has no end.
TEKNIK PENCARIAN (SEARCHING)
Love comes to those who still hope although they’ve been disappointed,to those who still believe although they’ve been betrayed,to those who still love.
KALKULUS PREDIKAT PENDAHULUAN DEFINISI SIMBOL DEFINISI TERM
Pengantar Intelijensia buatan
Kalkulus Predikat (First Order Logic / FOL)
Algoritma dan Pemrograman 2C
INFERENSI.
SISTEM BERBASIS PENGETAHUAN (Minggu 4)
ILMU KOM PUTER FAK MIPA UGM GP DALIYO.
Pengantar Intelijensia Buatan
Logic & Learning Method
Oleh: Mardiyana Jurusan Pendidikan Matematika
DASAR – DASAR LOGIKA INFORMATIKA
REPRESENTASI PENGETAHUAN
Pengenalan Prolog Teny Handhayani Referensi:
Logika Matematika Bab 3: Kalkulus Predikat
Latihan Kalkulus Predikat
Presented By : Group 2. A solution of an equation in two variables of the form. Ax + By = C and Ax + By + C = 0 A and B are not both zero, is an ordered.
PENGETAHUAN BERDASARKAN RULES PERTEMUAN MINGGU KE-6.
REPRESENTASI PENGETAHUAN
Greeting and birthday card mukti suvi subarkah
ARIFIANTO RIFKI KEUNGGULAN AMERIKA SERIKAT: “DARI SOFT POWER HINGGA DEMOCRATIC REALISM Politik dan Pemerintahan Amerika Serikat (2012)
What is conjunction ?? CONJUNCTION
The first reason Sebab yang pertama. skills ketrampilan.
1 Pertemuan 8 JARINGAN COMPETITIVE Matakuliah: H0434/Jaringan Syaraf Tiruan Tahun: 2005 Versi: 1.
Representasi Pengetahuan
RELATIVE CLAUSE Relative Pronoun Use Who Which Whose Whom That Subject or Object pronoun for people Subject or Object pronoun for thing Possession for.
KECERDASAN BUATAN PERTEMUAN 10.
REPRESENTASI PENGETAHUAN
REPRESENTASI PENGETAHUAN
Kecerdasan buatan Nelly Indriani Widiastuti S.Si.,M.T.
Logika informatika 4.
INFERENCE Artificial Intelligence
REPRESENTASI PENGETAHUAN DENGAN TEKNIK LOGIKA
Induksi Matematika.
Pertemuan 3 Predicate Logic
Inferensi pada FOL (First Order Logic)
Mata Kuliah Logika Informatika Teknik Informatika SKS
INFERENSI.
ATURAN PENENTUAN KESIMPULAN (Rule of Inference)
Recurrence relations.
REPRESENTASI PENGETAHUAN
Pendekatan Inferensi dalam Sistem Pakar
TRADISI BESAR TRADISI BARU PENGUASAAN HUKUM POSITIF “THEORY BUILDING”
Bab III : Standard Axiom Schemata
The first reason Sebab yang pertama.
Bab III : Standard Axiom Schemata
A. Bentuk Klausul Resolusi Proposional hanya dapat digunakan jika ekspresi yang diketahui dalam bentuk Klausul Klausul adalah himpunan yang berisi literal.
SYMPATHY AND ENCOURAGIMENT (UNGKAPAN RASA SIMPATI DAN DORONGAN)
RELATIVE CLAUSE Relative Pronoun Use Who Which Whose Whom That
KECERDASAN BUATAN PERTEMUAN 10.
Reasoning : Propositional Logic
As If/As Though.
By : Diana Septi Purnama Universitas Negeri Yogyakarta
Metode Inferensi.
MATERI PERKULIAHAN KECERDASAN BUATAN
Pertemuan #1 The Sentence
JENIS KALIMAT PADA PROLOG
Pertemuan 10 REASONING (PENALARAN)
Representasi Pengetahuan Logika Proposisi
GAUSS-QUADRATURE himawat.lecture.ub.ac.id/files/2010/03/Lecture-6-integral.ppt.
Simultaneous Linear Equations
THE INFORMATION ABOUT HEALTH INSURANCE IN AUSTRALIA.
Persamaan Schroedinger II Erwin Schrödinger ( ) A careful analysis of the process of observation in atomic physics has shown that the subatomic.
Lesson 2-1 Conditional Statements 1 Lesson 2-1 Conditional Statements.
PEMROGRAMAN BERBASIS AI (PROLOG)
Bab III : Standard Axiom Schemata
Wednesday/ September,  There are lots of problems with trade ◦ There may be some ways that some governments can make things better by intervening.
Transcript presentasi:

Inferensi pada Kalkulus Predikat Orde 1

Instansiasi Universal (IU) Instansiasi untuk quantifier universal: v α Subst({v/g}, α) dimana v variabel dan g mensubstitusi v. Contoh: x King(x)  Greedy(x)  Evil(x) menghasilkan: King(John)  Greedy(John)  Evil(John) King(Richard)  Greedy(Richard)  Evil(Richard) King(Father(John))  Greedy(Father(John))  Evil(Father(John)) .

Instansiasi Eksistensial (IE) Untuk kalimat α, variabel v, dan simbol konstanta k yang tidak muncul dimana pun pada basis pengetahuan: v α Subst({v/k}, α) Contoh: x Crown(x)  OnHead(x,John) menghasilkan: Crown(C1)  OnHead(C1,John) C1 adalah simbol konstanta baru, disebut Skolem constant

Reduksi ke Inferensi Proposional Misalkan BP berisi: x King(x)  Greedy(x)  Evil(x) King(John) Greedy(John) Brother(Richard,John) Instansiasi kalimat universal, didapatkan: King(John)  Greedy(John)  Evil(John) King(Richard)  Greedy(Richard)  Evil(Richard) Setelah mengalami proposionalisasi, KB berisi simbol proposisi: King(John), Greedy(John), Evil(John), King(Richard), dll Problem proposionalisasi: menciptakan kalimat2 yang tidak relevan.

Unifikasi Inferensi dilakukan dengan mencari substitusi θ, misalnya King(x) dan Greedy(x) cocok dengan King(John) and Greedy(y) θ = {x/John,y/John} Unify(α,β) = θ if αθ = βθ p q θ Knows(John,x) Knows(John,Jane) {x/Jane} Knows(John,x) Knows(y,OJ) {y/John,x/OJ} Knows(John,x) Knows(y,Mother(y)) {y/John,x/Mother(y)} Knows(John,x) Knows(x,OJ) fail Problem: lebih dari 1 kalimat menggunakan variabel yang sama Solusi: mengganti nama variabel contohnya Knows(z17,OJ)

Unifikasi Unifikasi Knows(John,x) dan Knows(y,z) menghasilkan substitusi θ = {y/John, x/z } atau θ = {y/John, x/John, z/John} Unifier pertama lebih general dari unifier kedua Ada 1 most general unifier (MGU), pada contoh di atas: MGU = { y/John, x/z }

Algoritma Unifikasi

Algoritma Unifikasi

Generalized Modus Ponens (GMP) p1', p2', … , pn', ( p1  p2  …  pn q) qθ p1' = King(John) p1 = King(x) p2' = Greedy(y) p2 = Greedy(x) θ = {x/John,y/John} q = Evil(x) q θ = Evil(John) GMP digunakan pada BP yang berisi definite clauses (hanya 1 literal positif) Asumsi: quantifier universal untuk semua variabel dimana pi'θ = pi θ untuk semua i

Contoh Basis Pengetahuan The law says that it is a crime for an American to sell weapons to hostile nations. The country Nono, an enemy of America, has some missiles, and all of its missiles were sold to it by Colonel West, who is American Buktikan bahwa Colonel West adalah seorang kriminal

Contoh BP ... it is a crime for an American to sell weapons to hostile nations: American(x)  Weapon(y)  Sells(x,y,z)  Hostile(z)  Criminal(x) Nono … has some missiles, i.e., x Owns(Nono,x)  Missile(x): Owns(Nono,M1) and Missile(M1) … all of its missiles were sold to it by Colonel West Missile(x)  Owns(Nono,x)  Sells(West,x,Nono) Missiles are weapons: Missile(x)  Weapon(x) An enemy of America counts as "hostile“: Enemy(x,America)  Hostile(x) West, who is American … American(West) The country Nono, an enemy of America … Enemy(Nono,America)

Algoritma Forward chaining

Pembuktian Forward Chaining

Pembuktian Forward Chaining

Pembuktian Forward Chaining

Algoritma Backward Chaining Algoritma ini menerapkan prinsip DFS

Contoh Backward chaining State awal: goals = Criminal (West) θ = { }

Contoh Backward chaining First(goals) = Criminal(West) {First(goals) : literal yang akan diproses} Subst(θ, First(goals)) menghasilkan Criminal(West) Rule American(x)  Weapon(y)  Sells(x,y,z)  Hostile(z)  Criminal(x) fired Unify(Criminal(x), Criminal(West)) menghasilkan θ’={x/West} shg θ = { x/West } New goals = [American(x), Weapon(y), Sells(x,y,z), Hostile(z)]

Contoh Backward chaining First(goals) = American(x) Subst(θ, First(goals)) menghasilkan American(West) Rule American(West) fired Unify(American(West), American(West)) menghasilkan θ’={ } shg θ = { x/West } New goals = [Weapon(y), Sells(x,y,z), Hostile(z)]

Contoh Backward chaining First(goals) = Weapon(y) Subst(θ, First(goals)) menghasilkan Weapon(y) Rule Missile(y)  Weapon(y) fired Unify(Weapon(y), Weapon(y)) menghasilkan θ’={ } shg θ = { x/West } New goals = [Missile(y), Sells(x,y,z), Hostile(z)]

Contoh Backward chaining First(goals) = Missile(y) Subst(θ, First(goals)) menghasilkan Missile(y) Rule Missile(M1) fired Unify(Missile(M1), Missile(y)) menghasilkan θ’={y/M1} shg θ={ x/West, y/M1} New goals = [Sells(x,y,z), Hostile(z)]

Contoh Backward chaining First(goals) = Sells(x,y,z) Subst(θ, First(goals)) menghasilkan Sells(West,M1,z) Rule Missile(M1)  Owns(Nono,M1)  Sells(West,M1,Nono) fired Unify(Sells(West,M1,Nono), Sells(West,M1,z)) mhasilkan θ’={z/Nono} shg θ={ x/West, y/M1, z/Nono} New goals = [Missile(M1), Owns(Nono,M1), Hostile(z)]

Contoh Backward chaining Proses seterusnya, dicoba sendiri yah…

Resolusi Versi first-order: l 1  ···  l k, m 1  ···  m n (l 1  ···  l i-1  l i+1  ···  l k  m1  ···  m j-1  m j+1  ···  m n)θ dimana Unify(l i, mj) = θ. Dua klausa yang diasumsikan standardized apart maka mereka tidak menggunakan variabel yang sama Contoh: Rich(x)  Unhappy(x) Rich(Ken) Unhappy(Ken) dimana θ = {x/Ken} Lakukan langkah-langkah resolusi pada CNF (BP  α), α adalah pernyataan yang harus dibuktikan

Konversi ke CNF (CNF=conjunctive normal form) Everyone who loves all animals is loved by someone: x [y Animal(y)  Loves(x,y)]  [y Loves(y,x)] 1. Eliminasi bikondisional dan implikasi x [y Animal(y)  Loves(x,y)]  [y Loves(y,x)] 2. Hapus  di depan quantifier: x p ≡ x p,  x p ≡ x p x [y (Animal(y)  Loves(x,y))]  [y Loves(y,x)] x [y Animal(y)  Loves(x,y)]  [y Loves(y,x)] x [y Animal(y)  Loves(x,y)]  [y Loves(y,x)]

Konversi ke CNF (CNF=conjunctive normal form) Standarkan variabel: setiap quantifier harus menggunakan variabel yang berbeda x [y Animal(y)  Loves(x,y)]  [z Loves(z,x)] Skolemisasi: bentuk yang lebih general dari instansiasi eksistensial Setiap variabel eksistensial diganti dengan fungsi Skolem dari variabel dengan quantifier universal: x [Animal(F(x))  Loves(x,F(x))]  Loves(G(x),x) Hapus quantifier universal : [Animal(F(x))  Loves(x,F(x))]  Loves(G(x),x) Distribusi : [Animal(F(x))  Loves(G(x),x)]  [Loves(x,F(x))  Loves(G(x),x)]

Resolusi - Refutasi Resolusi adalah teknik untuk membuktikan sebuah pernyataan pada logika proposional atau kalkulus predikat Refutasi=resolusi, membuktikan teorema dengan menegasikan pernyataan yang harus dibuktikan dan menambahkannya ke kumpulan aksioma yang diketahui benar Semua aksioma dalam bentuk normal yaitu sebuah kalimat atau disjungsi beberapa kalimat Pernyataan terbukti benar jika refutasi menghasilkan kalimat kosong

Contoh Refutasi (1)

Contoh Refutasi (2) All people who are not poor and are smart are happy. Those people who read are not stupid. John can read and is wealthy. Happy people have exciting lives. Can anyone be found with an exciting life? x (Poor(x)  Smart(x)  Happy(x)) y (Read(y)  Smart(y)) Read(John)  Wealthy(John) z (Happy(z)  Exciting(z)) Goal: Exciting(w)

Refutasi - Kasus Transformasi kalkulus predikat ke disjungsi kalimat: Poor(x)   Smart(x)  Happy(x)  Read(y)  Smart(y) Read(John)  Poor(John)  Happy(z)  Exciting(z))  Exciting(w) {z/w} pada contoh ini berarti z mensubstitusi w

Contoh Refutasi (3) Anyone passing his history exam and winning the lottery is happy. But anyone who studies or is lucky can pass all his exams. John did not study but he is lucky. Anyone who is lucky wins the lottery. Is John happy? x (Pass(x, History)  Win(x, Lottery)  Happy(x)) 1 x y (Study(x)  Lucky(x)  Pass(x,y)) 2 3  Study(John)  Lucky(John) 4 5 x (Lucky(x)  Win(x, Lottery)) 6 Goal: Happy(John) 7