ייצוג מידע ודרכי החלטה. Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the.

Slides:



Advertisements
Similar presentations
First-Order Logic Chapter 8.
Advertisements

First-Order Logic.
TRUTH TABLES The general truth tables for each of the connectives tell you the value of any possible statement for each of the connectives. Negation.
Logic.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
Two-Player Zero-Sum Games
Part 3: The Minimax Theorem
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
First-Order Logic. Limitations of propositional logic Suppose you want to say “All humans are mortal” –In propositional logic, you would need ~6.7 billion.
Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language.
Logic. Propositional Logic Logic as a Knowledge Representation Language A Logic is a formal language, with precisely defined syntax and semantics, which.
CS 561, Session Midterm format Date: 10/10/2002 from 11:00am – 12:20 pm Location: THH 101 Credits: 35% of overall grade Approx. 4 problems, several.
1 Problem Solving CS 331 Dr M M Awais Representational Methods Formal Methods Propositional Logic Predicate Logic.
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.
An introduction to game theory Today: The fundamentals of game theory, including Nash equilibrium.
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
Methods of Proof Chapter 7, second half.
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
Predicate Calculus.
An introduction to game theory Today: The fundamentals of game theory, including Nash equilibrium.
Chapter 1 Section 1.5 Analyzing Arguments. Syllogisms A syllogism is a type of deductive reasoning that draws a logical conclusion from two statements.
Intro to Discrete Structures
Logical Agents. Knowledge bases Knowledge base = set of sentences in a formal language Declarative approach to building an agent (or other system): 
Normal Forms, Tautology and Satisfiability 2/3/121.
Fall 2002CMSC Discrete Structures1 Let’s get started with... Logic !
Pattern-directed inference systems
1 Last time: Logic and Reasoning Knowledge Base (KB): contains a set of sentences expressed using a knowledge representation language TELL: operator to.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
© Copyright 2008 STI INNSBRUCK Intelligent Systems Predicate Logic.
Limitation of propositional logic  Propositional logic has very limited expressive power –(unlike natural language) –E.g., cannot say "pits cause breezes.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
S P Vimal, Department of CSIS, BITS, Pilani
Chapter 3: Introduction to Logic. Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math.
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.:
1 Logical Agents Chapter 7. 2 A simple knowledge-based agent The agent must be able to: –Represent states, actions, etc. –Incorporate new percepts –Update.
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
How do I show that two compound propositions are logically equivalent?
Artificial Intelligence First-Order Logic (FOL). Outline of this Chapter The need for FOL? What is a FOL? Syntax and semantics of FOL Using FOL.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 11 Jim Martin.
First-Order Logic Chapter 8 (not 8.1). Outline Why FOL? Why FOL? Syntax and semantics of FOL Syntax and semantics of FOL Using FOL Using FOL Wumpus world.
First-Order Logic. Outline Why FOL? Syntax and semantics of FOL Using FOL Knowledge engineering in FOL.
LOGIC. Logic in general  Logics are formal languages for representing information such that conclusions can be drawn  Syntax defines the sentences in.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Methods of Proof – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Methods of Proof Reading: Kolman, Section 2.3.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
TRUTH TABLES Edited from the original by: Mimi Opkins CECS 100 Fall 2011 Thanks for the ppt.
Logical Agents Chapter 7 Part I. 2 Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic.
Lecture 10 Methods of Proof CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Logic and Truth Tables Winter 2012 COMP 1380 Discrete Structures I Computing Science Thompson Rivers University.
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
Chapter 1 Logic and proofs
Logical Agents. Inference : Example 1 How many variables? 3 variables A,B,C How many models? 2 3 = 8 models.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Chapter 7. Propositional and Predicate Logic
COMP 1380 Discrete Structures I Thompson Rivers University
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 20
Logical Agents Chapter 7.
Logical Agents Chapter 7.
Chapter 7. Propositional and Predicate Logic
Chapter 1: Propositional and First-Order Logic
COMP 1380 Discrete Structures I Thompson Rivers University
Presentation transcript:

ייצוג מידע ודרכי החלטה

Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language Semantics define the “meaning” of sentences; – i.e., define truth of a sentence in a world E.g., the language of arithmetic – x+2 ≥ y is a sentence; x2+y > is not a sentence 2 Logic in general

Propositional logic is the simplest logic – illustrates basic ideas The proposition symbols P 1, P 2, etc. are sentences – If S is a sentence,  S is a sentence (negation) – If S 1 and S 2 are sentences, S 1  S 2 is a sentence (conjunction) – If S 1 and S 2 are sentences, S 1  S 2 is a sentence (disjunction) – If S 1 and S 2 are sentences, S 1  S 2 is a sentence (implication) Implication also is Not S 1  S 2 – If S 1 and S 2 are sentences, S 1  S 2 is a sentence (biconditional) 3 Propositional logic: Syntax

Rules for evaluating truth with respect to a model m:  S is true iff S is false S 1  S 2 is true iff S 1 is true and S 2 is true S 1  S 2 is true iff S 1 is true or S 2 is true S 1  S 2 is true iffS 1 is false or S 2 is true i.e., is false iffS 1 is true and S 2 is false S 1  S 2 is true iffS 1  S 2 is true and S 2  S 1 is true Simple recursive process evaluates an arbitrary sentence, e.g.,  P 1,2  (P 2,2  P 3,1 ) = true  (false  true) = true  true = true 4 Propositional logic: Semantics

5 Truth tables for connectives

More examples Show that A  B ≡ (A → B) Λ (B → A) t → w) Λ ~ w] → ~ t Show that: [(t → w) Λ ~ w] → ~ t p → q) Λ q → r)] → p → r) Show that: [(p → q) Λ (q → r) ] → (p → r)

Law of Modus Tollens Given: t → w t → w  w ~ w Prove:  t  ~ t t → w) Λ ~ w] → ~ t or [(t → w) Λ ~ w] → ~ t Set up a truth table to prove!

t → w) Λ ~ w] → ~ t] Prove [(t → w) Λ ~ w] → ~ t] tw~t~w t → w t → w) Λ ~ w (t → w) Λ ~ w t → w) Λ ~ w ] → ~ t [(t → w) Λ ~ w ] → ~ t

t → w) Λ ~ w] → ~ t Prove [(t → w) Λ ~ w] → ~ t tw~t~w t → w t → w) Λ ~ w (t → w) Λ ~ w t → w) Λ ~ w → ~ t (t → w) Λ ~ w → ~ t TTFFTFT TFFTFFT FTTFTFT FFTTTTT t → w) Λ ~ w] → ~ t is a Tautology therefore a valid argument! [(t → w) Λ ~ w] → ~ t is a Tautology therefore a valid argument!

p → q) Λ q → r)] → p → r) [(p → q) Λ (q → r) ] → (p → r) Chain Rule (Law of Syllogism) pqr p → q q → r p → q) Λ q → r) (p → q) Λ (q → r) p → r See above

p → q) Λ q → r)] → p → r) [(p → q) Λ (q → r) ] → (p → r) Chain Rule ( Law of Syllogism) pqr p → q q → r p → q) Λ q → r) (p → q) Λ (q → r) p → r See above TTT TTF TFT TFF FTT FTF FFT FFF

p → q) Λ q → r)] → p → r) [(p → q) Λ (q → r) ] → (p → r) Chain Rule (Law of Syllogism) pqr p → q q → r p → q) Λ q → r) (p → q) Λ (q → r) p → r See above TTTTTTTT TTFTFFFT TFTFTFTT TFFFTFFT FTTTTTTT FTFTFFTT FFTTTTTT FFFTTTTT

Chain Rule Example p : You study q  r q : You pass r : You get a surprise p  q P 1: P 2: If you study, then you will pass. If you pass, then you will get a surprise.

Two sentences are logically equivalent iff true in same models: α ≡ β iff α ╞ β and β ╞ α 14 Logical equivalence

A sentence is satisfiable if it is true in some model e.g., A  B, C A sentence is unsatisfiable if it is true in no models e.g., A  A Disjunction normal form (DNF) : Only “Or” between Logic statements – ( A 1  B 1 )  (A 2  B 2 )  (A 3  B 3 ) Conjunction normal form (CNF) : Only “And” between Logic statements – ( A 1  B 1 )  (A 2  B 2 )  (A 3  B 3 ) 15 Satisfiability

Consider random 3-CNF sentences (randomly selected 3 distinct symbols, each negated with 50% probability), e.g., (  D   B  C)  (B   A   C)  (  C   B  E)  (E   D  B)  (B  E   C) m = number of clauses n = number of symbols (overall, in the KB) – Hard problems seem to cluster near m/n = 4.3 (critical point) – Lower ratio is less constrained, higher ratio is more constrained 16 Hard satisfiability problems

17 Hard satisfiability problems Graph showing probability that a random 3-CNF sentence with n=50 symbols is satisfiable, as a function of the clause/symbol ratio m/n

18 Other Logics…

ConstantsKingJohn, 2, HU,... PredicatesBrother, >,... FunctionsSqrt, LeftLegOf,... Variablesx, y, a, b,... Connectives , , , ,  Equality= Quantifiers ,  19 First Order Logic

 Everyone at HU is smart:  x At(x, HU)  Smart(x)  x P is true in a model m iff P is true with x being each possible object in the model Roughly speaking, equivalent to the conjunction of instantiations of P At(KingJohn, HU)  Smart(KingJohn)  At(Richard, HU)  Smart(Richard)  At(HU, HU)  Smart(HU)  Universal quantification

 Someone at TAU is smart:  x At(x, TAU)  Smart(x)  x P is true in a model m iff P is true with x being some possible object in the model Roughly speaking, equivalent to the disjunction of instantiations of P At(KingJohn, TAU)  Smart(KingJohn)  At(Richard, TAU)  Smart(Richard)  At(TAU, TAU)  Smart(TAU)  Existential quantification

Brothers are siblings  x  y Brother(x, y)  Sibling(x, y) “Sibling” is symmetric  x  y Sibling(x, y)  Sibling(y, x) One’s mother is one’s female parent  x  y Mother(x, y)  (Female(x)  Parent(x, y)) A first cousin is a child of a parent’s sibling  x  y FirstCousin(x, y)   p  ps Parent(p, x)  Sibling(ps, p)  Parent(ps, y) 22 Fun with sentences

The set domain:  s Set(s)  (s = {} )  (  x,s 2 Set(s 2 )  s = {x|s 2 })  x,s {x|s} = {}  x,s x  s  s = {x|s}  x,s x  s  [  y,s 2 } (s = {y|s 2 }  (x = y  x  s 2 ))]  s 1,s 2 s 1  s 2  (  x x  s 1  x  s 2 )  s 1,s 2 (s 1 = s 2 )  (s 1  s 2  s 2  s 1 )  x,s 1,s 2 x  (s 1  s 2 )  (x  s 1  x  s 2 )  x,s 1,s 2 x  (s 1  s 2 )  (x  s 1  x  s 2 ) 23 Using FOL

Examples ore%20Answers%20for%20Practice%20in%20 Logic%20and%20HW%201.pdf ore%20Answers%20for%20Practice%20in%20 Logic%20and%20HW%201.pdf

The set domain:  s Set(s)  (s = {} )  (  x,s 2 Set(s 2 )  s = {x|s 2 })  x,s {x|s} = {}  x,s x  s  s = {x|s}  x,s x  s  [  y,s 2 } (s = {y|s 2 }  (x = y  x  s 2 ))]  s 1,s 2 s 1  s 2  (  x x  s 1  x  s 2 )  s 1,s 2 (s 1 = s 2 )  (s 1  s 2  s 2  s 1 )  x,s 1,s 2 x  (s 1  s 2 )  (x  s 1  x  s 2 )  x,s 1,s 2 x  (s 1  s 2 )  (x  s 1  x  s 2 ) 25 Using FOL

דרכים להחליט בפועל Fuzzy Logic MDP Game Theory

Copyright © 2002, 2004, Andrew W. Moore Applications of MDPs This extends the search algorithms of your first lectures to the case of probabilistic next states. Many important problems are MDPs…. … Robot path planning … Travel route planning … Elevator scheduling … Bank customer retention … Autonomous aircraft navigation … Manufacturing processes … Network switching & routing

The “Standard” Approach – MDP MDP model is a 4-tuple where: S is the set of all possible environment states. N is a group of agents. A i is the set of all possible joint actions applicable in the environment by agent i. Pr models dynamics – S x A x S  [0, 1] with Pr(s i, a, s j ) denotes the probability that action a executed in state s i, will transition to state s j. R is the reward function for agents’ possible actions.

Copyright © 2002, 2004, Andrew W. Moore Markov Decision Processes An MDP has… A set of states {s 1 ··· s N } A set of actions {a 1 ··· a M } A set of rewards {r 1 ··· r N } (one for each state) A transition probability function At each step: 0. Call current state S i 1. Receive reward r i 2. Choose action  {a 1 ··· a M } 3. If you choose action a k you’ll move to state S j with probability 4. All future rewards are discounted by 

John Nash, the person portrayed in “A Beautiful Mind”

Game theory: Payoff matrix A payoff matrix shows the payout to each player, given the decision of each player Action CAction D Action A10, 28, 3 Action B12, 410, 1 Person 1 Person 2

How do we find Nash equilibrium (NE)? Step 1: Pretend you are one of the players Step 2: Assume that your “opponent” picks a particular action Step 3: Determine your best strategy (strategies), given your opponent’s action – Underline any best choice in the payoff matrix Step 4: Repeat Steps 2 & 3 for any other opponent strategies Step 5: Repeat Steps 1 through 4 for the other player Step 6: Any entry with all numbers underlined is NE

Decision tree in a sequential game: Person 1 chooses first A B C Person 1 chooses yes Person 1 chooses no Person 2 chooses yes Person 2 chooses no 20, 20 5, 10 10, 5 10, 10

Slide 34 2 player zero-sum finite NONdeterministic games of perfect information The search tree now includes states where neither player makes a choice, but instead a random decision is made according to a known set of outcome probabilities. Game theory value of a state is the expected final value if both players are optimal. Let’s compute a matrix form of this! ( )-a ( )-chance ( )-b ( )-b ( )-chance +3 ( )-a +10 ( )-a -5 ( )-a p=0.8p=0.2 p=0.5

Slide 35 Minimax with Matrix Forms A can decide from this matrix which strategy is “best”. For each strategy, A considers the worst-case counter strategy by B. A chooses the row with the maximum minimum value. For A, the value of the game is this value. In this example A chooses A-II, and says game has value 3. When B decides which strategy is best, B searches for which column has the minimum maximum value. In this example, B chooses B-II, and says game has value 3. B-IB-IIB-III A-I73 A-II734 A-III222 A-IV222 Fundamental game theory result (proved by von Neumann): In a 2-player, zero-sum game of perfect information, Maximin==Minimax. And there always exists an optimal pure strategy for each player.

Fuzzy Logic  What is Fuzzy Logic?  Problem-solving control system methodology  Linguistic or "fuzzy" variables  Example: IF (process is too hot) AND (process is heating rapidly) THEN (cool the process quickly)

Approach  The Rule Matrix  Error (Columns)  Error-dot (Rows)  Input conditions (Error and Error-dot)  Output Response Conclusion (Intersection of Row and Column) -ve Error Zero Error +ve Error -ve Error- dot Zero Error- dot No change +ve Error- dot