Reasoning about Knowledge 1 INF02511: Knowledge Engineering Reasoning about Knowledge (a very short introduction) Iyad Rahwan.

Slides:



Advertisements
Similar presentations
Completeness and Expressiveness
Advertisements

1 First order theories (Chapter 1, Sections 1.4 – 1.5)
Logic Puzzles and Modal Logic. Closure properties in modal logic.
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Artificial Intelligence Chapter 13 The Propositional Calculus Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
Now, knowing classical logic we move to model checking and modal logic Muddy Children Problem.
Possible World Semantics for Modal Logic
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
Logic.
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
GEB class notes jan 18 A Logic Puzzle Classification Problems, Equivalence Relations, and Disjoint Unions Logic and Set Theory.
LDK R Logics for Data and Knowledge Representation Modal Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Artificial Intelligence Modal Logic
CPSC 322 Introduction to Artificial Intelligence September 20, 2004.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 9 Jim Martin.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
Logical and Rule-Based Reasoning Part I. Logical Models and Reasoning Big Question: Do people think logically?
Induction and recursion
First Order Logic. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about first order.
Induction and recursion
Inference is a process of building a proof of a sentence, or put it differently inference is an implementation of the entailment relation between sentences.
LDK R Logics for Data and Knowledge Representation Context Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Automaten und Formale Sprachen Epilog
Theoretical basis of GUHA Definition 1. A (simplified) observational predicate language L n consists of (i) (unary) predicates P 1,…,P n, and an infinite.
Math 3121 Abstract Algebra I Section 0: Sets. The axiomatic approach to Mathematics The notion of definition - from the text: "It is impossible to define.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: More Proofs.
1 Chapter 7 Propositional and Predicate Logic. 2 Chapter 7 Contents (1) l What is Logic? l Logical Operators l Translating between English and Logic l.
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
Reasoning About the Knowledge of Multiple Agents Ashker Ibne Mujib Andrew Reinders 1.
Formal Models in AGI Research Pei Wang Temple University Philadelphia, USA.
Pattern-directed inference systems
Of 33 lecture 12: propositional logic – part I. of 33 propositions and connectives … two-valued logic – every sentence is either true or false some sentences.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
0 What logic is or should be Propositions Boolean operations The language of classical propositional logic Interpretation and truth Validity (tautologicity)
LDK R Logics for Data and Knowledge Representation Modal Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
LDK R Logics for Data and Knowledge Representation PL of Classes.
Simultaneously Learning and Filtering Juan F. Mancilla-Caceres CS498EA - Fall 2011 Some slides from Connecting Learning and Logic, Eyal Amir 2006.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
A Logic of Partially Satisfied Constraints Nic Wilson Cork Constraint Computation Centre Computer Science, UCC.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
CS6133 Software Specification and Verification
Artificial Intelligence “Introduction to Formal Logic” Jennifer J. Burg Department of Mathematics and Computer Science.
Computer Science CPSC 322 Lecture 22 Logical Consequences, Proof Procedures (Ch 5.2.2)
First Order Logic Lecture 3: Sep 13 (chapter 2 of the book)
1 First order theories (Chapter 1, Sections 1.4 – 1.5) From the slides for the book “Decision procedures” by D.Kroening and O.Strichman.
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
Mathematical Induction Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If.
Logic: Proof procedures, soundness and correctness CPSC 322 – Logic 2 Textbook §5.2 March 7, 2011.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Artificial Intelligence Chapter 23 Multiple Agents Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
Presented by: Belgi Amir Seminar in Distributed Algorithms Designing correct concurrent algorithms Spring 2013.
An Introduction to Classical Logic (propositional and Predicate Logic)
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Artificial Intelligence Logical Agents Chapter 7.
The Propositional Calculus
EPISTEMIC LOGIC.
Logical Agents Chapter 7.
Knowledge and reasoning – second part
Back to “Serious” Topics…
MA/CSSE 474 More Math Review Theory of Computation
Computer Security: Art and Science, 2nd Edition
Logical Agents Chapter 7.
Logical Entailment Computational Logic Lecture 3
ece 720 intelligent web: ontology and beyond
Representations & Reasoning Systems (RRS) (2.2)
Presentation transcript:

Reasoning about Knowledge 1 INF02511: Knowledge Engineering Reasoning about Knowledge (a very short introduction) Iyad Rahwan

Reasoning about Knowledge 2 Overview The partition model of knowledge Introduction to modal logic The S5 axioms Common knowledge Applications to robotics Knowledge and belief

Reasoning about Knowledge 3 The Muddy Children Puzzle n children meet their father after playing in the mud. The father notices that k of the children have mud on their foreheads. Each child sees everybody else’s foreheads, but not his own. The father says: “At least one of you has mud on his forehead.” The father then says: “Do any of you know that you have mud on your forehead? If you do, raise your hand now.” No one raises his hand. The father repeats the question, and again no one moves. After exactly k repetitions, all children with muddy foreheads raise their hands simultaneously.

Reasoning about Knowledge 4 Muddy Children (cont.) Suppose k = 1 The muddy child knows the others are clean When the father says at least one is muddy, he concludes that it’s him

Reasoning about Knowledge 5 Muddy Children (cont.) Suppose k = 2 Suppose you are muddy After the first announcement, you see another muddy child, so you think perhaps he’s the only muddy one. But you note that this child did not raise his hand, and you realise you are also muddy. So you raise your hand in the next round, and so does the other muddy child

Reasoning about Knowledge 6 The Partition Model of Knowledge An n-agent a partition model over language  is A=(W, , I 1, …, I n ) where – W is a set of possible worlds –  :  2 W is an interpretation function that determines which sentences are true in which worlds – Each I i is a partition of W for agent i Remember: a partition chops a set into disjoint sets I i (w) includes all the worlds in the partition of world w

Reasoning about Knowledge 7 Partition Model (cont.) What? – Each I i is a partition of W for agent i Remember: a partition chops a set into disjoint sets I i (w) includes all the worlds in the partition of world w Intuition: – if the actual world is w, then I i (w) is the set of worlds that agent i cannot distinguish from w – i.e. all worlds in I i (w) all possible as far as i knows

Reasoning about Knowledge 8 Partition Model (cont.) Suppose there are two propositions p and q There are 4 possible worlds: – w 1 : p  q – w 2 : p   q – w 3 :  p  q – w 4 :  p   q Suppose the real world is w 1, and that in w 1 agent i cannot distinguish between w 1 and w 2 We say that I i (w 1 )={w 1, w 2 }

Reasoning about Knowledge 9 The Knowledge Operator Let K i  mean that “agent i knows that  ” Let A=(W, , I 1, …, I n ) be a partition model over language  and let w  W We define logical entailment |= as follows: – For    we say (A,w |=  ) if and only if w   (  ) – We say A,w |= K i  if and only if  w’, if w’  I i (w), then A,w |= 

Reasoning about Knowledge 10 The Knowledge Operator (cont.) What? – We say A,w |= K i  if and only if  w’, if w’  I i (w), then A,w |=  Intuition: in partition model A, if the actual world is w, agent i knows  if and only if  is true in all worlds he cannot distinguish from w

Reasoning about Knowledge 11 Muddy Children Revisited n children meet their father after playing in the mud. The father notices that k of the children have mud on their foreheads. Each child sees everybody else’s foreheads, but not his own.

Reasoning about Knowledge 12 Muddy Children Revisited (cont.) Suppose n = k = 2 (two children, both muddy) Possible worlds: – w 1 : muddy1  muddy2 (actual world) – w 2 : muddy1   muddy2 – w 3 :  muddy1  muddy2 – w 4 :  muddy1   muddy2 At the start, no one sees or hears anything, so all worlds are possible for each child After seeing each other, each child can tell apart worlds in which the other child’s state is different

Reasoning about Knowledge 13 Muddy Children Revisited (cont.) Bold oval = actual world Solid boxes = equivalence classes in I 1 Dotted boxes = equivalence classes in I 2 Note: in w 1 we have: K 1 muddy2 K 2 muddy1 K 1  K 2 muddy2 … But we don’t have: K 1 muddy1

Reasoning about Knowledge 14 Muddy Children Revisited (cont.) The father says: “At least one of you has mud on his forehead.” – This eliminates the world: w 4 :  muddy1   muddy2

Reasoning about Knowledge 15 Muddy Children Revisited (cont.) Bold oval = actual world Solid boxes = equivalence classes in I 1 Dotted boxes = equivalence classes in I 2

Reasoning about Knowledge 16 Muddy Children Revisited (cont.) The father then says: “Do any of you know that you have mud on your forehead? If you do, raise your hand now.” – Here, no one raises his hand. – But by observing that the other did not raise his hand (i.e. does not know whether he’s muddy), each child concludes the true world state. – So, at the second announcement, they both raise their hands.

Reasoning about Knowledge 17 Muddy Children Revisited (cont.) Bold oval = actual world Solid boxes = equivalence classes in I 1 Dotted boxes = equivalence classes in I 2 Note: in w 1 we have: K 1 muddy1 K 2 muddy2 K 1 K 2 muddy2 …

Reasoning about Knowledge 18 Modal Logic Can be built on top of any language Two modal operators: –   reads “  is necessarily true” –  reads “  is possibly true” Equivalence: –      –     So we can use only one of the two operators

Reasoning about Knowledge 19 Modal Logic: Syntax Let P be a set of propositional symbols We define modal language L as follows: If p  P and ,   L then: – p  L –   L –     L –    L Remember that     , and     (   ) and      

Reasoning about Knowledge 20 Modal Logic: Semantics Semantics is given in terms of Kripke Structures (also known as possible worlds structures) Due to American logician Saul Kripke, City University of NY A Kripke Structure is (W, R) – W is a set of possible worlds – R : W  W is an binary accessibility relation over W

Reasoning about Knowledge 21 Modal Logic: Semantics (cont.) A Kripke model is a pair M,w where – M = (W, R) is a Kripke structure and – w  W is a world The entailment relation is defined as follows: – M,w |=  if  is true in w – M,w |=    if M,w |=  and M,w |=  – M,w |=  if and only if we do not have M,w |=  – M,w |=   if and only if  w’  W such that R(w,w’) we have M,w’ |= 

Reasoning about Knowledge 22 Modal Logic: Semantics (cont.) As in classical logic: – Any formula  is valid (written |=  ) if and only if  is true in all Kripke models E.g.       is valid – Any formula  is satisfiable if and only if  is true in some Kripke models We write M, |=  if  is true in all worlds of M

Reasoning about Knowledge 23 Modal Logic: Axiomatics Is there a set of minimal axioms that allows us to derive precisely all the valid sentences? Some well-known axioms: – Axiom(Classical) All propositional tautologies are valid – Axiom (K) (     (   ))    is valid – Rule (Modus Ponens) if  and   are valid, infer that  is valid – Rule (Necessitation) if  is valid, infer that   is valid

Reasoning about Knowledge 24 Modal Logic: Axiomatics Refresher: remember that – A set of inference rules (i.e. an inference procedure) is sound if everything it concludes is true – A set of inference rules (i.e. an inference procedure) is complete if it can find all true sentences Theorem: System K is sound and complete for the class of all Kripke models.

Reasoning about Knowledge 25 Multiple Modal Operators We can define a modal logic with n modal operators  1, …,  n as follows: – We would have a single set of worlds W – n accessibility relations R 1, …, R n – Semantics of each  i is defined in terms of R i

Reasoning about Knowledge 26 Axiomatic theory of the partition model Objective: Come up with a sound and complete axiom system for the partition model of knowledge. Note: This corresponds to a more restricted set of models than the set of all Kripke models. In other words, we will need more axioms.

Reasoning about Knowledge 27 Axiomatic theory of the partition model The modal operator  i becomes K i Worlds accessible from w according to R i are those indistinguishable to agent i from world w K i means “agent i knows that” Start with the simple axioms: – (Classical) All propositional tautologies are valid – (Modus Ponens) if  and   are valid, infer that  is valid

Reasoning about Knowledge 28 Axiomatic theory of the partition model (More Axioms) (K) From (K i   K i (   )) infer K i  – Means that the agent knows all the consequences of his knowledge – This is also known as logical omniscience (Necessitation) From , infer that K i  – Means that the agent knows all propositional tautologies

Reasoning about Knowledge 29 Axiomatic theory of the partition model (More Axioms) Axiom (D)  K i (    ) – This is called the axiom of consistency Axiom (T) (K i  )   – This is called the veridity axiom – Means that if an agent cannot know something that is not true. – Corresponds to assuming that R i is reflexive

Reasoning about Knowledge 30 Axiomatic theory of the partition model (More Axioms) Axiom (4) K i   K i K i  – Called the positive introspection axiom – Corresponds to assuming that R i is transitive Axiom (5)  K i   K i  K i  – Called the negative introspection axiom – Corresponds to assuming that R i is Euclidian Refresher: Binary relation R over domain Y is Euclidian if and only if  y, y’, y’’  Y, if (y,y’)  R and (y,y’’)  R then (y’,y’’)  R

Reasoning about Knowledge 31 Axiomatic theory of the partition model (Overview of Axioms) Proposition: a binary relation is an equivalence relation if and only if it is reflexive, transitive and Euclidean Proposition: a binary relation is an equivalence relation if and only if it is reflexive, transitive and symmetric

Reasoning about Knowledge 32 Axiomatic theory of the partition model (back to the partition model) System KT45 exactly captures the properties of knowledge defined in the partition model System KT45 is also known as S5 S5 is sound and complete for the class of all partition models

Reasoning about Knowledge 33 The Coordinated Attack Problem (aka, Two Generals’ or Warring Generals Problem) Two generals standing on opposite hilltops, trying to coordinate an attack on a third general in a valley between them. Communication is via messengers who must travel across enemy lines (possibly get caught). If a general attacks on his own, he loses. If both attack simultaneously, they win. What protocol can ensure simultaneous attack?

Reasoning about Knowledge 34 The Coordinated Attack Problem

Reasoning about Knowledge 35 The Coordinated Attack Problem (A Naive Protocols) Let us call the generals: – S (sender) – R (receiver) Protocol for general S: – Send an “attack” message to R – Keeps sending until acknowledgement is received Protocol for general R: – Do nothing until he receives a message “attack” from S – If you receive a message, send an acknowledgement to S

Reasoning about Knowledge 36 The Coordinated Attack Problem (States) State of general S: – A pair (msg S, ack S ) where msg  {0,1}, ack  {0,1} – msg S = 1 means a message “attack” was sent – ack S = 1 means an acknowledgement was received State of general R: – A pair (msg R, ack R ) where msg  {0,1}, ack  {0,1} – msg R = 1 means a message “attack” was received – ack R = 1 means an acknowledgement was sent Global state: 4 possible local states per general &16 global states

Reasoning about Knowledge 37 The Coordinated Attack Problem (Possible Worlds) Initial global state: State changes as a result of: – Protocol events – Nondeterministic effects of nature Change in states captured in a history Example: – S sends a message to R, R receives it and sends an acknowledges, which is then received by S –,, In our model: possible world = possible history

Reasoning about Knowledge 38 The Coordinated Attack Problem (Indistinguishable Worlds) Defining the accessibility relation R i : – Two histories are indistinguishable to agent i if their final global states have identical local states for agent i Example: world,, is indistinguishable to general S from this world:,, – In words: S sends a message to R, but does not get an acknowledgement. This could be because R never received the message, or because he did but his acknowledgement did not make reach S

Reasoning about Knowledge 39 The Coordinated Attack Problem (What do generals know?) Suppose the actual world is: –,, In this world, the following hold: – K S attack – K R attack – K S K R attack Unfortunately, this also holds: –  K R K S K R attack R does not known that S knows that R knows that S intends to attack. Why? Because, from R’s perspective, the message could have been lost

Reasoning about Knowledge 40 The Coordinated Attack Problem (What do generals know?) Possible solution: – S acknowledges R’s acknowledgement Then we have: – K R K S K R attack Unfortunately, we also have: –  K S K R K S K R attack Is there a way out of this?

Reasoning about Knowledge 41 The “Everyone Knows” Operator E G  denotes that everyone in group G knows  Semantics of “everyone knows”: Let: – M be a Kripke structure – w be a possible world in M – G be a group of agents –  be a sentence of modal logic M,w |= E G  if and only if  i  G we have M,w |= K i 

Reasoning about Knowledge 42 The “Common Knowledge” Operator When we say something is common knowledge, we mean that any fool knows it! If any fool knows , we can assume that everyone knows it, and everyone knows that everyone knows that everyone knows it, and so on (infinitely).

Reasoning about Knowledge 43 The “Common Knowledge” Operator (formal definition) C G  denotes that  is common knowledge among G Semantics of “common knowledge”: Let: – M be a Kripke structure – w be a possible world in M – G be a group of agents –  be a sentence of modal logic M,w |= C G  if and only if M,w |= E G (   C i  ) Notice the recursion in the definition.

Reasoning about Knowledge 44 The “Common Knowledge” Operator (Axiomatization) All we need is S5 plus the following: Axiom (A3) E G  (K 1   …  K n  ) – given G={1,…,n} Axiom (A4) C G   E G (   C i  ) Rule (R3) From   E G (    ) infer   C G  – This is called the induction rule.

Reasoning about Knowledge 45 Back to Coordinated Attack Whenever any communication protocol guarantees a coordinated attack in a particular history, in that history we must have common knowledge between the two generals that an attack is about to happen. No finite exchange of acknowledgements will ever lead to such common knowledge. There is no communication protocol that solves the Coordinated Attack problem.

Reasoning about Knowledge 46 Reading Logics for Knowledge and Belief. Chapter 13 of Multiagent Systems: Algorithmic, Game-Theoretic, and Logical Foundations. Y. Shoham, K. Leyton-Brown. Cambridge University Press, 2009.