K K Knowledge Knowledge l d l d Representation Representation Representation Representation Chapter 3 Chapter 3 Dr Ahmed Rafea Dr Ahmed Rafea Dr Ahmed Rafea Dr Ahmed Rafea
Introduction Introduction Introduction Introduction � In this chapter we will explore some techniques In this chapter we will explore some techniques In this chapter we will explore some techniques In this chapter we will explore some techniques used to represent domain knowledge in AI used to represent domain knowledge in AI programs programs p p g g � We will describe : We will describe : � procedural and declarative knowledge representation procedural and declarative knowledge representation p p g g p p � propositional and predicate logic propositional and predicate logic � Frames, semantic Frames, semantic nets nets � Representing Uncertainty Representing Uncertainty � Building a Knowledge Base Building a Knowledge Base
Knowledge Representation Knowledge Representation � What is knowledge? What is knowledge? � Knowledge is the fact or condition of being aware of Knowledge is the fact or condition of being aware of g g g g something something � What is knowledge representation? What is knowledge representation? � It is the problem of storing knowledge in a computer It is the problem of storing knowledge in a computer � Programmers use symbols to represent knowledge in Programmers use symbols to represent knowledge in computers. This is called internal representation of the computers. This is called internal representation of the Thi i Thi i ll d i ll d i l l i i f h f h knowledge knowledge � Knowledge representation involves tradeoffs between K K Knowledge representation involves tradeoffs between l d l d i i i i l l d d ff b ff b the needs of people and computers. It must be easy to the needs of people and computers. It must be easy to use easy to understand modify and extend use easy to understand modify and extend use, easy to understand, modify, and extend use, easy to understand, modify, and extend
Procedural Representation Procedural Representation � It is the most common technique for representing It is the most common technique for representing knowledge in computers it encodes facts and knowledge in computers it encodes facts and knowledge in computers, it encodes facts and knowledge in computers, it encodes facts and defines the sequence of operations for manipulating defines the sequence of operations for manipulating these facts. these facts. these facts these facts � A program code is a natural way of encoding A program code is a natural way of encoding procedural knowledge. The program is essentially procedural knowledge. The program is essentially d d l k l k l d l d Th Th i i ti ll ti ll one big knowledge representation. one big knowledge representation. � Programs written in scripting languages such as Programs written in scripting languages such as Visual Basic and JavaScript are examples for Visual Basic and JavaScript are examples for procedural knowledge representation procedural knowledge representation
Declarative Representation Declarative Representation � However, in procedural code the knowledge and its However, in procedural code the knowledge and its manipulation are inextricably linked. This weakness is manipulation are inextricably linked. This weakness is overcome by the declarative approach. overcome by the declarative approach. � In declarative knowledge representation, a user states facts, In declarative knowledge representation, a user states facts, rules, and relationships. They stand by themselves and rules, and relationships. They stand by themselves and represent pure knowledge. represent pure knowledge. � Declarative representation became the most popular Declarative representation became the most popular knowledge representation approach because the knowledge knowledge representation approach because the knowledge is explicitly represented it can be easily modified and the is explicitly represented it can be easily modified and the is explicitly represented, it can be easily modified and the is explicitly represented, it can be easily modified and the separation of the control logic and the reasoning algorithm separation of the control logic and the reasoning algorithm from the knowledge allows us to write optimized and from the knowledge allows us to write optimized and from the knowledge allows us to write optimized and from the knowledge allows us to write optimized and reusable procedures reusable procedures
Relational Representation Relational Representation Relational Representation Relational Representation � Knowledge is represented in relational form, such Knowledge is represented in relational form, such as that used in relational database systems as that used in relational database systems � By storing a collection of information in a table we By storing a collection of information in a table we can use relational calculus to manipulate the data, can use relational calculus to manipulate the data, based on the relations defined, and query the based on the relations defined, and query the information stored in the table. i f information stored in the table. i f i i d i d i h h bl bl � However, the relational representation are not However, the relational representation are not good at representing complex relationships good at representing complex relationships d t d t ti ti l l l ti l ti hi hi between objects in the real world. This is where between objects in the real world. This is where network and hierarchical representations are strong network and hierarchical representations are strong network and hierarchical representations are strong network and hierarchical representations are strong
Hierarchical Representation Hierarchical Representation Hierarchical Representation Hierarchical Representation � It is the best to represent “isa” relationships, where a It is the best to represent “isa” relationships, where a p p p , p , general or abstract type is linked to more specific types general or abstract type is linked to more specific types which inherit the basic properties of the general type which inherit the basic properties of the general type � The strength of object inheritance allows for compact The strength of object inheritance allows for compact b representation of knowledge and allows processing at representation of knowledge and allows processing at different levels of abstraction and thus reducing different levels of abstraction and thus reducing different levels of abstraction and thus reducing different levels of abstraction and thus reducing complexity complexity � AI problem solving requires capturing knowledge about AI problem solving requires capturing knowledge about objects and about nonphysical measurements such as objects and about nonphysical measurements such as time time
Predicate Logic Predicate Logic Predicate Logic 1 Predicate Logic-1 � The most basic form of logic representation is called The most basic form of logic representation is called g g p p boolean or propositional logic, in which each boolean or propositional logic, in which each proposition is represented by a symbol that evaluates to proposition is represented by a symbol that evaluates to either True or False. either True or False. ith r Tr ith r Tr r F l r F l � Sentences are constructed using proposition symbols Sentences are constructed using proposition symbols (P,Q,R,…) and boolean connectives such as (and, or, (P,Q,R,…) and boolean connectives such as (and, or, (P,Q,R,…) and boolean connectives such as (and, or, (P,Q,R,…) and boolean connectives such as (and, or, implication, equivalence) to give us implications or rules implication, equivalence) to give us implications or rules � Predicate logic allows predicates on objects to define Predicate logic allows predicates on objects to define attributes and relations between objects. Using objects, attributes and relations between objects. Using objects, attributes, and relations we can represent any type of attributes, and relations we can represent any type of knowledge knowledge knowledge. knowledge.
Predicate Logic Predicate Logic-2 Predicate Logic Predicate Logic 2 � A statement such as “Minnesota is cold in winter” A statement such as “Minnesota is cold in winter” A statement such as Minnesota is cold in winter A statement such as Minnesota is cold in winter could be represented in predicate logic in several ways : could be represented in predicate logic in several ways : � We can use conjunction of functions: We can use conjunction of functions: � place (Minnesota) and temperature (cold) and season (winter) place (Minnesota) and temperature (cold) and season (winter) � We can use a single relation We can use a single relation � winter (Minnesota, cold) winter (Minnesota, cold) i t i t (Mi (Mi t t ld) ld) � There are two techniques called “ resolution” and There are two techniques called “ resolution” and ”unification” that are used to process predicate ”unification” that are used to process predicate unification that are used to process predicate unification that are used to process predicate statements to prove whether a particular statement is statements to prove whether a particular statement is true or not based on other known facts. true or not based on other known facts.
Recommend
More recommend