AI CH3 Unit3
AI CH3 Unit3
. Implies A>B Implication / condition is equivaleny if and : i ae only if ASB Biconditional To define logical connectives truth tables are u: sed. Truth table 3.9.2 shows five 08 connectives. ifake an example, Where A AB, ie, Find the va seid row of the Table 3.9.2 shows ti nat luc of A AB where A is true and B is Condition, now see third i ipge,4 0B shows result as false, Similarly other logical porenl atime sine sdhuble. “ 492 Semantics fo Write syntax and semantics and example « sentences ae - World is set of facts which we want to represent to form propositional logic. In order to represent these facts propositional symbols can be used where each propositional symbol's interpretation can be mapped to the real world feature. Semantics of a sentence is meaning of a sentence. Semantics determine the interpretation of a sentence. For example : You can define semantics of each propositional symbol in following manner : 1. Ameans “It is hot” 2. B means “It is humid”, etc. Sentence is considered true when its interpretation in the real world is tue. Every , fA and B Sentence results from a finite number of usages of the rules. For example, af ee ‘entences then (A A B), (A VB), B > A) and (A B) are sentences 2 base is a set of sentences as we have seen in previous section. leds Thus we can say that real world is 4 model of the knowledge base when ve tae. i. asa base is true for that world. In other words @ ‘model can be thought o tee are given then it can be evaluated for truth values of all symbols in 2 sentence i.e. “ve can say iit is true oF) g its truth value (a BP arti Intolligonce (MU B.S, IT - Gem-V) 3-44 3.9.3 What Is Propositional Logic ? = AdBand BAA should have same meaning but in natural language Words ang may have different meanings, Say for an example, 1, Radha started feeling feverish and Radha went to the doctor, 2. Radha went to the doctor and Radha started feeling feverinh, Here, sentence | and sentence 2 have different meanings, ~ In attificial intelligence propositional logic isa relationship between the truth valu of statement to that of the truth value of other statement, Oe 3.9.4 PL Sentence - Example — Take example of a weather problem, ~ Semantics of each propositional symbol can be defined as follows : — Symbol A is a sentence which means “It is hot”, — Symbol B is a sentence which means “It is humid”, ~ Symbol C is a sentence which means “It is raining”. ~ We can also choose symbols which are easy to understand, like : - HT for “Itis hot”, — HM for “It is humia”, - RN for “Itis raining”, - Ifyou have HM — HT then that means « itis humid, then itis hot", ~ Tf you have (HT « HM) —> RN then it means “If tis hot and humid, then it sri’ and so on, ~ _ First we have to create the possible models for a knowledge base. To do this we need 10 Consider all the possible assignments of true or false values for Sentence A, B and C bo Werify the uth table for the validity, There can be total & possibilities as show? low : Not Valid pairs True Not Validaificial Intelligence (MU B.So.IT - Sem-V)_3-45 ‘Adversarial Search True False False Valid True False True Valid True True False Not Valid True True True Valid 3.9.! Now, if the knowledge base is [HM, HM > HT, (HT » HM) — RNIGe. [It is humid”, “{f it is humid, then it is hot” , “If it is hot and humid, then it is raining”) ), then “True -True - True” is the only possible valid model. Tautology and Contradiction Tautology means valid sentence. It is a sentence which is true for all the interpretations. For example: (A —A)(“‘Aor notA”) : “It is hot or It is not hot” Contradiction means an inconsistent sentence. It is a sentence which is false for all the interpretations. For example : A A 7A (“A and not A”) : “It is hot and it is not hot.” X entails Y, is shown as X |= Y. It means that whenever sentence X is True, sentence Y will be True. For Example : if, X= Priya is Pooja's Mother's Sister and Y = Priya is Pooja's Aunty. Then X = ¥ (X entails Y). 5 Inference Rules a. New sentences are formed with the logical inference. For example : If A = B and B = C then A = C. You must have come across this example many times it implies that if knowledge base has “A = B” and “B = C” then we can infer that “A = C”. © Explain the inference process in case of propositional logic with suitabl zs In short inference rule says that new sentence can be create by logically following the set of sentences of the knowledge base. Table 3.! erence Rules premis Modus Ponens X, XY Yy Substitution XZ&Y OZ X=Y Chain rule XY, YOZ X3Z AND introduction X,Y XAY Transposition XY ~X7-Ytailment is represented as : KB I= Q and Derivation ig Tepresenteg En a8 KB Le ‘There are two types of Inference rules : r 1e! Types of inference rules. | 1. Sound inference 2, Complete inference Fig, C35: Types of inference rules > 1. Sound inference - Soundness property of inference says that, if “X is derived from the knowledge bays using given set of protocols of inference, then ““X is entailed by knowledge bays Soundness property can be represented as: “If KB |- X then KB lex" ~ ForModus Ponens (MP) rule we assume that knowledge base has [A, A 5 Bl fing this we can conclude that knowledge base can have B, See following truth table : Pee TRUE | TRUE | TRUE Yes TRUE | FALSE FALSE Yes FALSE | TRUE TRUE Yes FALSE | FALSE TRUE, Yes In general, For atomic sentences pi, pi, and @ Where there is a substitution ® such that SUBST @pi) = SUBST (@, Pi’) for alli, SUBST (©, g) N+1 premises = Natomic Sentences + one i Example : A Baiflal nteligence (Mu IT-Sem-V)_3-47 Adversarlal Search Modus Tollens _ When B is known to be false, and if there is a rule “if A, then B,” it is valid to conclude that A is also false. Complete inference - Complete inference is converse of soundness. Completeness property of inference says that, if “X is entailed by knowledge base” then “X can be derived from the knowledge base” using the inference protocols. — Completeness property can be represented as : “ If KB Ix Q then KB I- Q”. 39.6 Horn Clause as See Clauses are generally written as sets of literals. Horn clause is also called as horn sentence. In a horn clause a conjunction of 0 or more symbols is to the left of “—>“ and 0 or 1 symbols to the right. See following formula : A1AA2AA3 ... AAn—Bm where n >= 0 and m is in range{0,1} ‘There can be following special cases in horn clause in the above mentioned formula : : A (This condition shows that assert A is true) For n>0 and m=0: A 4 B- (This constraint shows that both A and B cannot be true) For n = 0 and m=0 : (This condition shows empty clause) For n= 0 and m= Conjunctive normal form is a conjunction of clauses and by its set of clauses it is determined up to equivalence. For a horn clause conjunctive normal form can be used where, each sentence is a disjunction of literals with at most one non-negative literal as shown in the following formula: sAlv7A2v—A3 ... v>AnvB This can also be represented as : (A > B)= (A VB) Significance of horn logic Horn sentences can be used in first order logic. Reasoning processes is simpler with horn clauses. Satisfiability of a propositional knowledge base is NP complete. (Satisfiability means the process of finding values for symbols which will make it true). For restricting knowledge base to horn sentences, satisfiability is in A. Due to this reason, first order logic horn sentences are the basis for prolog and datalog languages. Let's take one example which gives entailment for horn formulas._—X~ (YT anole Intolll Find out if fol (aruc-> X) 0 KA Y KS from the above equation, we entail if the query atom is false, Baiatio, From Jauses which state that true 9X and true >Y, so we can assign x are claus (ive. tee 9X AY): ‘Then we can say that all premises of X A YZ are true, based on this inf. ak he s : ~ at we can see all premises of Z->W are true, ‘on assign Z to true. After thi aon a to true. ‘As now all premises of ZA W — false are true, from this we can entaij that atom is false. Therefore, the horn formula is not satisfiable. ‘Syllabus Topic : Propositional Theorem Proving a Propositional Theorem Proving lowing horn formula is satisfiable? PD AEIW AE AW false)» true sy, 2 shows and Youth aby ty 3.9.7 = Sequence of sentences form a “Proof”. A sentence can be premise or it can be a sentens derived from earlier sentences in the proof based on the inference rule. Whatever we vay to prove is called as a query or a goal. Query/goal is the last sentence of the theorem iy the proof, - Take Example of the “weather problem” which we have seen above. - HT for “It is hot”. - HM for “Itis humid”. = _ RN for “Itis raining”. 1. | HM Premise (initial sentence) “It’s humid” 2 vce(inits HM >HT. Premise(initial sentence) “Tf it’s humid, it’s hot” 3. [HT Modus ponens(1,2) (sentence derived | “It’s hot” from 1 and 2) 4. | (HT AHM)RN iseCiniti ) Premise(initial sentence) “Tf it’s hot and humid ela : it’s raining” AHM And introduction(1,3) id” 6 [RN “Tt’s hot and humi Modus ponens( 4,5) ; from 4 and 5) N(sentence derived | “t's raini 2”Q.) Write @ short note on: Drawbacks of propdallional loa fia Inollgonce (MU B.S0.IT-Somv) 9.4 19 Advorsarial Search 9% g Advantages of Propositional Logic Propositional logic is a simple knowledge rej It is sufficient and efficient techni problems. Propositional logic forms the foundation for hi ete, Propositional logic is NP Presentation language, que for solving some artificial intelligence based igher logics like First Order Logic (FOL), complete and reasoning is decidable. ‘The process of inference can be illustrated by PL. 3.9.9 Propositional logic is cannot express complex artifi Disadvantages of Propositional Logic cial intelligence problems. Propositional logic can be impractical for even small worlds, think about WUMPUS hunter problem. Even if we try to make use of propositional logic to express complex artificial intelligence problems, it can be very wordy and lengthy. PL is a weak knowledge representation language because : With PL it hard to identify if the used entity is “individual”. For example : If there are entities like : Priya, Mumbai, 123, etc. PL cannot directly represent properties of individual entities or relations between individual entiti For example, Pooja is tall. PL cannot express specialization, generalizations, or patterns, etc. For example : All rectangles have 4 sides. Syllabus Toplc : Effective Propositional Model Checking 3.10 Effective propositional model checking Lets understand the two families of efficient algorithms for general propositional inference based on model checking : 1, 2 Backtracking search, local hill-climbing search.cial Intelligence (MU B. =Sem-V) 3.53 Adversarial Search — Syllabus Topic : Agent Based on Propositional Logic 341 Agent Based on Propositional Logic __ In this section, we will learn how to construct wumpus world agents using propositional logic. In order to do the same we have to follow the steps: Step 1: Enable the agent to deduce the state of the world given its percept history. Step 2: Write down a complete logical model of “Action-Effect”. Step3 : Find out how the agent can keep track of the world efficiently without referring the percept history for each inference. Step 4: Develop logical inference to construct plans that are guaranteed to achieve goals. For example, In case of wumpus world, the starting square does not have pit, which can be represented as ~P,,, and also it does not have wumpus, which can be depicted as ~Wj,. Similarly the conditional statements like, A square is breezy if and only if, neighbouring squares have pit; and a square is smelly if and only if a neighbouring square has a Wumpus can be represented as shown below. — By =>@Pi2V Pr) : — Si4=> (Wiz V Wo) Similarly we can specify other facts about the Wumpus world. Q.1 Write a short notes on : {a) Game types (b) Zero-sum game (c) Relevant aspects of Al games (d) Features of Al game Q2 Explain minimax algorithm with an example and give it's properties. Q3° Give a-B pruning algorithm with an example and it's properties, also explain why is it called a-B pruning. Q4 Draw game tree of tic-tac-toe problem.