What you havealready learnt? • What is intelligence? • What is artificial intelligence? • What is the difference between AI and conventional computing? • How to designate some software to be artificially intelligent? • What is Chinese room analogy? • What are the different applications of AI? 04/28/25 2
3.
You are goingto learn… • Knowledge Representation • Knowledge base • Inference engine • Knowledge representation schemes • Declarative • Procedural • Logic-based system • Deductive reasoning • Inductive reasoning • Computational logic • Types of computational logic • Propositional logic • Predicate logic
4.
Knowledge representation •AI system= knowledge base + inference mechanism •Most of the time knowledge already exist in the form of human mind, books, articles etc. •Knowledge must be collected and codified 04/28/25 4
5.
Knowledge representation Knowledge Base:Set of sentences represented in a knowledge representation language and represents assertions about the world. Inference rule: when one ASKs questions from the KB, the answer should follow from what has been TELLed (told) to the KB, previously. KR schemes have two things in common, 1) being programmed in existing computer languages; 2) can be manipulated by inference system tell tell ask ask
6.
Knowledge base • Itcontains facts, theories, concepts, practical procedures and the relationship between them • Knowledge is collected using the process called knowledge engineering • Knowledge base need some data structure to store the knowledge
7.
Inferencing mechanism • Isa set of procedures that are used to examine the knowledge base in an orderly manner to answer questions, solve problems, or make decisions within the domain • Uses searching and pattern matching
8.
Knowledge representation schemes •Mainly divided into • Declarative • Used to represent facts and assertions. • It includes: • logic based systems • semantic networks • frame-based systems • scripts • Procedural • Used to represent action and procedures. • It includes: • procedures/subroutines • Rules
9.
Logic-based system •Logic isconsidered to be a sub division of philosophy •It is the oldest model of knowledge representation •The general form of a logic process is shown in the following diagram Inputs/premises /information Output inferences/conclusions Logical process
Deductive reasoning • Fromgeneral principal to specific conclusion • The general premises are used to obtain a specific inference • Consists of three parts • Major premise • e.g. I do not run when the temperature exceeds 30 degree • Minor premise • Today the temperature is 35 degree • Conclusion • Therefore, I will not run today • Also consider the following example
12.
Inductive reasoning • Fromspecific and established facts to general conclusion •Example: • Premise: • A defective hard disk results in failure of opening documents data • Premise: • A scratched DVD results in failure of playing the video • Conclusion: • A faulty storage device may results in a failure of retrieving of data • The conclusion is never final or absolute >> may change with new discovery • There is always an uncertainty >> unless all facts are included not possible • The more knowledge you have, the more conclusive your inference can be
13.
Computational logic In orderto apply deductive/inductive reasoning to be manipulated by computer, the result is symbolic or mathematical logic. It is the system of rules and procedures that permit the drawing of inferences from various premises using a variety of logical techniques called computational logic The process of performing reasoning using logic methods is generally called computational logic
Propositional calculus •Proposition • Aproposition is an assertion or premises or statement which is either true or false. • They are usually represented by symbols i.e. • A= Today is raining • B= Aslam will not come •Proposition logic • Propositional logic is a language made up from a set of sentences that can be used to carry out logical reasoning about the world.
16.
Prepositional calculus •Types ofpropositions • Simple proposition • Which consists of only one proposition • Example • A = The postman comes Monday to Saturday • B= Today is Sunday • C=The postman will not come today • Complex proposition • Which consists of multiple proposition connected through logical operators • Logical operators are • AND(&^U), OR(+Uv), NOT(~), IMPLIES(), EQUIVALENT(≡) • Example • D= the car is black • E= the car has a 6 cylinder engine • C= D & E
17.
Propositional Logic: SyntaxI Vocabulary A set of propositional symbols P, Q, R, …. A set of logical connectives , , , , (and) (or) (not) (implication) (equivalence) Parenthesis (for grouping) ( ) Logical constants True, False
18.
Sample Sentences inpropositional logic P (P Q) R True (P Q) (Q P) (P Q) (P R ) What do the sentences mean? The meaning depends on user defined semantics. If P is defined as “it is hot” and Q is defined as “it is raining”, then P means it is hot P Q means either it is hot or it is raining (or both) Q means that it is not raining
19.
The following aresentences in propositional language: The following are sentences in propositional language: a. a. Today is Sunday (S). Today is Sunday (S). b. b. It is raining (R). It is raining (R). c. c. Today is Sunday or Monday (S Today is Sunday or Monday (S M). M). d. d. It is not raining (¬ R). It is not raining (¬ R).
20.
Example: propositional calculus •Ifit is sunny today, then the sun shines on the screen. If the sun shines on the screen, the blinds are brought down. The blinds are not down. •Is it sunny today? •P: It is sunny today. •Q: The sun shines on the screen. •R: The blinds are down. •Premises: PQ, QR, R •Conclusion: P
21.
Predicate logic (calculus) •It is sophisticated than propositional but using the same concepts as that of the propositional logic • It adds more ability to propositional logic, that is, it divides the premises to parts and objects which makes the representation more easier • It also uses variables and functions which make it a powerful representation method
22.
Predicate logic (calculus) •Each proposition is divided into two parts • Predicate or assertion • It would be the verb or part of the verb • Argument • It is the individual or object about which the assertion is made. It is noun • Its general form is • PREDICATE (ob1, ob2) • For example • the car is in the garage. It would be stated as • IN ( car, garage ) • Ali is a friend of Jamal • FRIEND(Ali, Jamal)
In predicate logic,a sentence is divided into a predicate and arguments. For example, each of the following propositions can be written as predicates with two arguments: The relationship of motherhood in each of the above sentences is defined by the predicate mother. If the object Mary in both sentences refers to the same person, we can infer a new relation between Linda and Anne: grandmother grandmother (Linda, Anne) (Linda, Anne)
25.
Example 1. 1. The sentence“John works for Ann’s sister” can be written as: The sentence “John works for Ann’s sister” can be written as: Works [John, sister(Ann)] Works [John, sister(Ann)] in which the function sister(Ann) in which the function sister(Ann) is used as an argument. is used as an argument. 2. 2. The sentence “John’s father calls Ann’s sister” can be written The sentence “John’s father calls Ann’s sister” can be written as: as: Calls[father(John), sister(Ann)] Calls[father(John), sister(Ann)]
26.
Quantifiers Predicate logic allowsus to use quantifiers. Two quantifiers are common in predicate logic: 1. The first, which is read as “for all”, is called the universal quantifier: it states that something is true for every object that its variable represents. 2. The second, which is read as “there exists”, is called the existential quantifier: it states that something is true for one or more objects that its variable represents.
27.
Example 1. The sentence“All men are mortals” can be written as: 2. The sentence “Frogs are green” can be written as: 3. The sentence “Some flowers are red” can be written as:
28.
Example 4. The sentence“John has a book” can be written as: 5. The sentence “No frog is yellow” can be written as: Continued or 6. Every human being wants to be successful.
30.
04/28/25 30 No onein this class is wearing Coat and Cap. •Domain of x is persons in this class •Coat(x): x is wearing coat • Cap(x): x is wearing a cap • ¬ x(Coat(x) Cap(x)) ∃ ∧ •Domain of x is all persons •Class(x): x belongs to the class • ¬ x(Class(x) Coat(x) Cap(x)) ∃ ∧ ∧ Example
31.
04/28/25 31 Every computerscience student must take a discrete mathematics course”. Express the statement “Everybody must take a discrete mathematics course or be a computer science student”. Let P(x) be the predicate “x must take a discrete mathematics course” and let Q(x) be the predicate “x is a computer science student”. Express the statement “Every computer science student must take a discrete mathematics course”. ∀x(Q(x) → P(x)) Example
32.
04/28/25 32 Express thestatement “for every x and for every y, x + y > 10” Let P(x, y) be the statement x + y > 10 where the universe of discourse for x, y is the set of integers. Express the statement “for every x and for every y, x + y > 10” Let P(x, y) be the statement x + y > 10 where the universe of discourse for x, y is the set of integers. Answer: x yP(x, y) ∀ ∀
33.
04/28/25 33 1. xblue(x) ∃ Examples There exist objects that are blue" Some objects are blue" 2. There is somebody who knows everyone ∃ x y K(x, y). ∀ 3. Everybody has somebody who is his or her mother ∀ y x M(x, y). ∃ 4. Nobody is perfect ¬ x P(x). ∃ 5. All dogs are mammals ∀ x(dog(x) → mammal(x)). 6. Some dogs are brown This statement means that there are some animals that are dogs and that are brown ∃ x(dog(x) brown(x)) ∧ 7. All new cars must be registered. 8. Some of the CS graduates graduate with honor.
34.
04/28/25 34 All computerscience students are smart. ∀ x student(x) ∧ at (x,CS) → Smart(x) For some humans failure is important, and for others success is important.
35.
04/28/25 35 Assignment 2 Notall integers are even Some integers are not even Some birds don't fly Some cars are not expensive Tom is taller than John Some integers are even and some are odd No integer is even If an integer is not even, then it is odd All integers are even A number is even only if it is integer All Americans eat cheeseburgers. All lions are fierce. Some lions do not drink coffee. Someone at computer science is smart. There is a person who helps everybody. Everybody loves Raymond. There is somebody whom no one helps Deadline. : Handwritten
36.
1- Louis. E.Prenzil. Jr, Crash course in Artificial Intelligence and Expert System, Chapter No.2 Reference
Editor's Notes
#13 For a computer to perform reasoning using logic, some method must be used to convert syllogisms and the deductive or inductive reasoning into a form suitable for manipulation by a computer. The result is what is known as symbolic logic or mathematical logic. It is a system of rules and procedures that permit the drawing of inferences from various premises using a variety of logical techniques. These methods are generally known as computational logic.