Download presentation

1
**Artificial Intelligence**

Dr. Eng. Ahmed Moustafa Elmahalawy Computer Science and Engineering Department

2
**Artificial Intelligence Chapter 4: Knowledge Representation**

4.5 Propositional Logic Propositional Logic is a formal system in which knowledge is represented as propositions. Further, these propositions can be joined in various ways using logical operators. These expressions can then be interpreted as truth-preserving inference rules that can be used to derive new knowledge from the old, or test the existing knowledge.

3
**Artificial Intelligence Chapter 4: Knowledge Representation**

First, let’s introduce the proposition. A proposition is a statement, or a simple declarative sentence. For example, “the book is expensive” is a proposition. Note that a definition of truth is not assigned to this proposition; it can be either true or false.

4
**Artificial Intelligence Chapter 4: Knowledge Representation**

In terms of binary logic, this proposition could be false in Cairo, but true in England. But a proposition always has a truth value. So, for any proposition, we can define the true-value based on a truth table (see the following figure). This simply says that for any given proposition, it can be either true or false.

5
**Artificial Intelligence Chapter 4: Knowledge Representation**

We can also negate our proposition to transform it into the opposite truth value. For example, if P (our proposition) is “the book is expensive,” then ~P is “the book is not expensive.”

6
**Artificial Intelligence Chapter 4: Knowledge Representation**

Propositions can also be combined to create compound propositions. The first, called a conjunction, is true only if both of the conjuncts are true (P and Q). The second called a disjunction, is true if at least one of the disjuncts are true (P or Q).

7
**Artificial Intelligence Chapter 4: Knowledge Representation**

The truth tables for these are shown in the following figure. These are obviously the AND and OR truth tables from Boolean logic.

8
**Artificial Intelligence Chapter 4: Knowledge Representation**

The power of propositional logic comes into play using the conditional forms. The two most basic forms are called 1- Modus Ponens. 2- Modus Tollens.

9
**Artificial Intelligence Chapter 4: Knowledge Representation**

1- Modus Ponens is defined as: P, (P->Q), infer Q which simply means that given two propositions (P and Q), if P is true then Q is true. In English, let’s say that P is the proposition “the light is on” and Q is the proposition “the switch is on.” The conditional here can be defined as: if “the light is on” then “the switch is on”

10
**Artificial Intelligence Chapter 4: Knowledge Representation**

The truth table for Modus Ponens is shown in the following Figure.

11
**Artificial Intelligence Chapter 4: Knowledge Representation**

Modus Tollens takes the contradictory approach of Modus Ponens. With Modus Tollens, we assume that Q is false and then infer that the P must be false. Modus Tollens is defined as: P, (P->Q), not Q, therefore not P.

12
**Artificial Intelligence Chapter 4: Knowledge Representation**

Returning to our switch and light example, we can say “the switch is not on,” therefore “the light is not on.” The formal name for this method is proof by contra positive. The truth table for Modus Tollens is provided in the following figure.

13
**Artificial Intelligence Chapter 4: Knowledge Representation**

14
**Artificial Intelligence Chapter 4: Knowledge Representation**

A famous inference rule from propositional logic is the hypothetical syllogism. This has the form: ((P->Q) ^ (Q->R), therefore (P->R) In this example, P is the major premise, Q is the minor premise. Both P and Q have one common term with the conclusion, P->R.

15
**Artificial Intelligence Chapter 4: Knowledge Representation**

Propositional logic includes a number of additional inference rules (beyond Modus Ponens and Modus Tollens). These inferences rules can be used to infer knowledge from existing knowledge (or deduce conclusions from an existing set of true premises).

16
**Artificial Intelligence Chapter 4: Knowledge Representation**

4.5.1 Deductive Reasoning with Propositional Logic In deductive reasoning, the conclusion is reached from a previously known set of premises. If the premises are true, then the conclusion must also be true.

17
**Artificial Intelligence Chapter 4: Knowledge Representation**

Let’s now explore a couple of examples of deductive reasoning using propositional logic. As deductive reasoning is dependent on the set of premises, let’s investigate these first. 1) If it’s raining, the ground is wet. 2) If the ground is wet, the ground is slippery.

18
**Artificial Intelligence Chapter 4: Knowledge Representation**

The two facts (knowledge about the environment) are Premise 1 and Premise 2. These are also inference rules that will be used in deduction. Now we introduce another premise that it is raining. 3) It’s raining.

19
**Artificial Intelligence Chapter 4: Knowledge Representation**

Now, let’s prove that it’s slippery. First, using Modus Ponens with Premise 1 and Premise 3, we can deduce that the ground is wet: 4) The ground is wet. (Modus Ponens: Premise 1, Premise 3) Again, using Modus Ponens with Premise 3 and 4, we can prove that it’s slippery: 5) The ground is slippery. (Modus Ponens: Premise 3, Premise 4)

20
**Artificial Intelligence Chapter 4: Knowledge Representation**

4.5.2 Limitations of Propositional Logic While propositional logic is useful, it cannot represent general-purpose logic in a compact and summary way. For example, a formula with N variables has 2^N different interpretations. It also doesn’t support changes in the knowledge base easily.

21
**Artificial Intelligence Chapter 4: Knowledge Representation**

Truth values of propositions can also be problematic, for example; consider the compound proposition below. This is considered true (using Modus Ponens where P -> Q is true when P is false and Q is false, see the truth table of Modus Ponens). If dogs can fly, then cats can fly.

22
**Artificial Intelligence Chapter 4: Knowledge Representation**

Both statements are obviously false, and further, there’s no connection between the two. But from the standpoint of propositional logic, they are syntactically correct. A major problem with propositional logic is that entire propositions are represented as a single symbol.

23
**Artificial Intelligence Chapter 4: Knowledge Representation**

4.6 First-Order Logic (Predicate Logic) One issue with propositional logic is that it’s not very expressive. For example, when we declare a proposition such as: _ The ground is wet.

24
**Artificial Intelligence Chapter 4: Knowledge Representation**

It’s not clear which ground we’re referring to. Nor can we determine what liquid is making the ground wet. Propositional logic lacks the ability to talk about specifics. In the other hand, we’ll explore predicate calculus (otherwise known as First-Order Logic, or FOL). Using FOL, we can use both predicates and variables to add greater expressiveness as well as more generalization to our knowledge.

25
**Artificial Intelligence Chapter 4: Knowledge Representation**

In FOL, knowledge is built up from 1- Constants (the objects of the knowledge) 2- A set of predicates (relationships between the knowledge) 3- Some number of functions (indirect references to other knowledge).

26
**Artificial Intelligence Chapter 4: Knowledge Representation**

4.6.1 Atomic Sentences A constant refers to a single object in our domain. A sample set of constants include: ali, mona, bicycle, scooter, the-stranger, colorado

27
**Artificial Intelligence Chapter 4: Knowledge Representation**

A predicate expresses a relationship between objects, or defines properties of those objects. A few examples of relationships and properties are defined below: owns, rides, knows, person, sunny, book, two-wheeled

28
**Artificial Intelligence Chapter 4: Knowledge Representation**

With our constants and predicates defined, we can now use the predicates to define relationships and properties of the constants (also called Atomic sentences). First, we define that both Ali and Mona are ‘Persons.’ The ‘Person’ is a property for the objects (Ali and Mona). _Person( ali) _Person( mona)

29
**Artificial Intelligence Chapter 4: Knowledge Representation**

The above may appear as a function, with Person as the function and Ali or Mona as the argument. But in this context, Person(x) is a unary relation that simply means that Ali and Mona fall under the category of Person. Now we define that Ali and Mona both know each other.

30
**Artificial Intelligence Chapter 4: Knowledge Representation**

We use the knows predicate to define this relationship. Note that predicates have arity, which refers to the number of arguments. The ‘Person’ predicate has an arity if one where the predicate ‘knows’ has an arity of two. _Knows( ali, mona ) _Knows( mona, ali )

31
**Artificial Intelligence Chapter 4: Knowledge Representation**

We can then extend our domain with a number of other atomic sentences, shown and defined below: _Rides( ali, bicycle ) - ali rides a bicycle. _Rides( mona, scooter ) - mona rides a scooter. _Two-Wheeled (bicycle)- A Bicycle is two-wheeled. _Book( the-stranger ) - The-Stranger is a book. _Owns( mona, Book(the-stranger) ) - mona owns a book called The Stranger.

32
**Artificial Intelligence Chapter 4: Knowledge Representation**

Finally, a function allows us to transform a constant into another constant. For example, the sister_of function is demonstrated below: _Knows( ali, sister_of( hassan ) ) -ali knows Hassan’s sister.

33
**Artificial Intelligence Chapter 4: Knowledge Representation**

4.6.2 Compound Sentences Recall from propositional logic that we can apply Boolean operators to build more complex sentences. In this way, we can take two or more atomic sentences and with connectives, build a compound sentence. A sample set of connectives is shown below:

34
**Artificial Intelligence Chapter 4: Knowledge Representation**

AND OR NOT Logical Conditional (then) Logical Biconditional

35
**Artificial Intelligence Chapter 4: Knowledge Representation**

Examples of compound sentences are shown below: - ali and mona know one another. Knows(ali, mona) Knows(mona, ali) - ali knows mona, and mona does not know ali. Knows( ali, mona ) Knows( mona, ali ) ali rides a scooter or ali rides a bicycle. Rides( ali, scooter) Rides( ali, bicycle)

36
**Artificial Intelligence Chapter 4: Knowledge Representation**

We can also build conditionals using the logical conditional connective, for example: - If ali knows mona, then mona knows ali. Knows( ali, mona ) Knows( mona, ali )

37
**Artificial Intelligence Chapter 4: Knowledge Representation**

This can also be written as a biconditional, which changes the meaning slightly. The biconditional, a b simply means “b if a and a if b,” or “b implies a and a implies b.” - ali knows mona if mona knows ali. Knows( ali, mona ) Knows( mona, ali )

38
**Artificial Intelligence Chapter 4: Knowledge Representation**

NOTE Another way to think about the biconditional is from the construction of two conditionals in the form of a conjunction, or: (a b) (b a) This implies that both are true or both are false.

39
**Artificial Intelligence Chapter 4: Knowledge Representation**

4.6.3 Variables So far, we’ve explored sentences where all of the information was present, but to be useful, we need the ability to construct abstract sentences that don’t specify specific objects. This can be done using variables.

40
**Artificial Intelligence Chapter 4: Knowledge Representation**

For example: - If x Knows mona, then x is a Person. Knows( x, mona ) Person( x ) If we also knew that: ‘Knows( ali, mona)’ then we could deduce that ali is a person (Person(ali)).

41
**Artificial Intelligence Chapter 4: Knowledge Representation**

4.6.4 Quantifiers A quantifier is used to determine the quantity of a variable. In first-order logic, there are two quantifiers, 1- The universal quantifier ( ) 2- The existential quantifier ( )

42
**Artificial Intelligence Chapter 4: Knowledge Representation**

The universal quantifier is used to indicate that a sentence should hold when anything is substituted for the variable. The existential quantifier indicates that there is something that can be substituted for the variable such that the sentence holds. Let’s look at an example of each.

43
**Artificial Intelligence Chapter 4: Knowledge Representation**

- There exists x, that is a Person. x. Person( x ) - For all people, there exists someone that Knows ali or mona. x. x. Person( x ) (Knows( x, mona) Knows (x, ali)) - For any x, if there is someone x that Knows mona, then x is a Person. x. x. Knows( x, mona ) Person( x )

Similar presentations

Presentation is loading. Please wait....

OK

Artificial Intelligence Logical Agents Chapter 7.

Artificial Intelligence Logical Agents Chapter 7.

© 2018 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Ppt on law against child marriage in africa Ppt on mhd power generation Ppt on wireless multimedia sensor networks Ppt on applied operations research Ppt on different types of food in india Ppt on regional trade agreements pdf Free ppt on cost accounting Ppt on history of indian cinema Ppt on 60 years of indian parliament videos Ppt on natural numbers example