LogicBased Systems AI Lecture Prof Carolina Ruiz Worcester
Logic-Based Systems AI Lecture Prof. Carolina Ruiz Worcester Polytechnic Institute AI Lecture - Prof. Carolina Ruiz
Using Theorem Provers AS REASONING SYSTEMS – to implement independent agents that make decisions and act on their own. AS ASSISTANTS tool for mathemathicians • Proof-Checkers: – mathematician provides a sketch of the proof and TP checks it and fills in the details. • Socratic Reasoners: – (e. g. ONTIC). Mathematician and TP construct proof together. AI Lecture - Prof. Carolina Ruiz 2
Practical uses of Theorem Provers (TPs) AI Lecture - Prof. Carolina Ruiz 3
CS/ECE: Verification of Systems • SOFTWARE procedure swap(x, y) var t; {Pre: x = C 1, y = C 2} t : = x; x: = y; y: = t {Post: x = C 2, y = C 1} • HARDWARE x y w z w = ( x OR y) and ~z AI Lecture - Prof. Carolina Ruiz 4
CS/ECE: Verification of Systems • SOFTWARE • HARDWARE – Boyer & Moore: • verified the RSA public key encryption algorithm • verified the Boyer & Moore string matching algorithm – Aura: • Verifies design of a 10 -bit adder – MRS: • performs diagnosis of computer systems AI Lecture - Prof. Carolina Ruiz 5
CS/ECE: Synthesis of Systems • SOFTWARE procedure swap(x, y) {Pre: x = C 1, y = C 2} ? {Post: x = C 2, y = C 1} Prove that there exists a program satisfying the specification. If the proof is constructed, a program can be extracted. • HARDWARE x y ? z w w = ( x OR y) and ~z AURA: used to design circuits more compact than before AI Lecture - Prof. Carolina Ruiz 6
Inside a Logic-based System Knowledge Representation First order logic Problem Solving Strategy Refutation using resolution AI Lecture - Prof. Carolina Ruiz 7
Knowledge representation 1 st order logic • Everybody who can read is literate A – x, r(x) -> l(x) • Dolphins are not literate A – x, d(x) -> !l(x) • Some dolphins are intelligent – Э x, [d(x) & i(x) ] • Some who are intelligent cannot read – Э x, [i(x) & !r(x)] AI Lecture - Prof. Carolina Ruiz 8
Problem Solving Problem Statement • A 1: Everybody who can read is literate A – x, r(x) -> l(x) • A 2: Dolphins are not literate A – x, d(x) -> !l(x) • A 3: Some dolphins are intelligent – Э x, [d(x) & i(x) ] • Conclusion: Some who are intelligent cannot read – Э x, [i(x) & !r(x)] AI Lecture - Prof. Carolina Ruiz 9
Problem Solving Proof by Refutation • A 1: Everybody who can read is literate A – x, r(x) -> l(x) • A 2: Dolphins are not literate A – x, d(x) -> !l(x) • A 3: Some dolphins are intelligent – Э x, [d(x) & i(x) ] • ! Conclusion: it is not the case that some who are intelligent cannot read A A – !Э x, [i(x) & !r(x)] = x, [!i(x) || !!r(x)] = x, [!i(x) || r(x)] AI Lecture - Prof. Carolina Ruiz 10
Problem Solving Proof by Refutation using Resolution translating formulas into clausal form A 1: x, !r(x) || l(x) A 2: x, !d(x) || !l(x) A 3: Э x, [d(x) & i(x)] !C: x, [!i(x) || r(x)] AI Lecture - Prof. Carolina Ruiz A • • A A 1: x, r(x) -> l(x) A 2: x, d(x) -> !l(x) A 3: Э x, [d(x) & i(x)] !C: x, [!i(x) || r(x)] A A • • 11
Problem Solving Proof by Refutation using Resolution translating formulas into clausal form – done! • A 1: x, !r(x) || l(x) • A 2: x, !d(x) || !l(x) • A 3: Э x, [d(x) & i(x) ] A A A • !C: x, [!i(x) || r(x)] • • • A 1: !r(x) || l(x) A 2: !d(x) || !l(x) A 3. 1: d(a) A 3. 2: i(a) !C: !i(x) || r(x) AI Lecture - Prof. Carolina Ruiz 12
Problem Solving Resolution • A 1: !r(x) || l(x) • A 2: !d(x) || !l(x) • • • A 1: !r(x) || l(x) A 2: !d(x) || !l(x) A 3. 1: d(a) A 3. 2: i(a) !C: !i(x) || r(x) • A 4: !r(x) || !d(x) • A 3. 1: d(a) • A 5: !r(a) • !C: !i(x) || r(x) • A 6: !i(a) • A 3. 2: i(a) • A 7: Hence C is a logical consequence of A 1, A 2, A 3 Contradiction!!! AI Lecture - Prof. Carolina Ruiz 13
- Slides: 13