


















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Different techniques for Knowledge representations in AI
Typology: Lecture notes
1 / 26
This page cannot be seen from the preview
Don't miss anything!
Knowledge Representation: Approaches and issues in knowledge representation- Propositional Logic –Predicate logic-Forward and backward reasoning - Unification- Resolution- Weak slot-filler structure – Strong slot-filler structure- Knowledge- Based Agent
Knowledge Representation Knowledge representation (KR) is the study of how knowledge about the world can be represented and what kinds of reasoning can be done with that knowledge. Knowledge Representation is the method used to encode knowledge in Intelligent Systems.
Since knowledge is used to achieve intelligent behaviour, the fundamental goal of knowledge representation is to represent knowledge in a manner as to facilitate inferencing (i.e. drawing conclusions) from knowledge. A successful representation of some knowledge must, then, be in a form that is understandable by humans, and must cause the system using the knowledge to behave as if it knows it.
Issues in knowledge representation from an AI perspective:
Fig: Two entities in knowledge representation
For example: English or natural language is an obvious way of representing and handling facts. Logic enables us to consider the following fact: spot is a dog as dog(spot) We could then infer that all dogs have tails with: ꓯx: dog(x)–> hasatail(x).
We can then deduce: hasatail(Spot) Using an appropriate backward mapping function the English sentence Spot has a tail can be generated.
Representation and Mapping F 0D 8 Problem solving requires large amount of knowledge and some mechanism for
manipulating that knowledge. F 0D 8 The Knowledge and the Representation are distinct entities, play a central but
distinguishable roles in intelligent system. F 0B 7 Knowledge is a description of the world; it determines a system's competence by what it
knows. F 0B 7 Representation is the way knowledge is encoded; it defines the system's performance in
doing something. F 0B 7 Facts Truths about the real world and what we represent. This can be regarded as the
knowledge level F 0D 8 In simple words, we :
Thus, knowledge representation can be considered at two levels : F 0D 8 Knowledge level at which facts are described, and F 0D 8 symbol level at which the representations of the objects, defined in terms of symbols, can
be manipulated in the programs. Note: A good representation enables fast and accurate access to knowledge and understanding of the content. Mapping between Facts and Representation F 0D 8 Knowledge is a collection of “ facts” from some domain.
F 0B 7provides a framework to compare two objects based on equivalent attributes. F 0B 7any instance in which two different objects are compared is a relational type of knowledge. F 0D 8 Inheritable Knowledge F 0B 7is obtained from associated objects. F 0B 7 it prescribes a structure in which new objects are created which may inherit all or a subset
of attributes from existing objects. F 0D 8 Inferential Knowledge F 0B 7is inferred from objects through relations among objects. F 0B 7 e.g., a word alone is a simple syntax, but with the help of other words in phrase the reader
may infer more from a word; this inference within linguistic is called semantics. F 0D 8 Declarative Knowledge F 0B 7 a statement in which knowledge is specified, but the use to which that knowledge is to be
put is not given. F 0B 7 e.g. laws, people's name; these are facts which can stand alone, not dependent on other
knowledge; F 0D 8 Procedural Knowledge F 0B 7 a representation in which the control information, to use the knowledge, is embedded in
the knowledge itself. F 0B 7 e.g. computer programs, directions, and recipes; these indicate specific use or
implementation; Relational Knowledge This knowledge associates elements of one domain with another domain. F 02 D Relational knowledge is made up of objects consisting of attributes and their
corresponding associated values. F 02 D The results of this knowledge type is a mapping of elements among different domains.
The table below shows a simple way to store facts. F 02 D The facts about a set of objects are put systematically in columns. F 02 D This representation provides little opportunity for inference.
F 0F C Given the facts it is not possible to answer simple question such as :
" Who is the heaviest player? ". but if a procedure for finding heaviest player is provided, then these facts will enable that procedure to compute an answer.
F 0F C We can ask things like who "bats – left" and "throws – right".
Inheritable Knowledge F 0D 8 Here the knowledge elements inherit attributes from their parents. F 0D 8 The knowledge is embodied in the design hierarchies found in the functional, physical and
process domains. Within the hierarchy, elements inherit attributes from their parents, but in many cases not all attributes of the parent elements be prescribed to the child elements. F 0D 8 The inheritance is a powerful form of inference, but not adequate. The basic KR needs to
be augmented with inference mechanism. F 0D 8 The KR in hierarchical structure, shown below, is called “semantic network” or a
collection of “frames” or “slot-and-filler structure". The structure shows property inheritance and way for insertion of additional knowledge. F 0D 8 Property inheritance: The objects or elements of specific classes inherit attributes and
values from more general classes. The classes are organized in a generalized hierarchy.
F 0F C The directed arrows represent attributes ( isa, instance, team ) originates at objectbeing
described and terminates at object or its value. F 0F C The box nodes represents objects and values of the attributes. F 0D 8 Viewing a node as a frame
Example : Baseball-player isa : Adult-Male Bats : EQUAL handed Height : 6. Batting-average : 0. F 0D 8Algorithm : Property Inheritance
Retrieve a value V for an attribute A of an instance object O Steps to follow:
Here, the knowledge is a mapping process between domains that specify “what to do when” and the representation is of “how to make it” rather than “what it is”. The procedural knowledge F 0F C may have inferential efficiency, but no inferential adequacy and acquisition efficiency. F 0F C are represented as small programs that know how to do specific things, how to proceed.
Example : A parser in a natural language has the knowledge that a noun phrase may contain articles, adjectives and nouns. It thus accordingly call routines that know how to process articles, adjectives and nouns. Issues in Knowledge Representation F 0D 8 The fundamental goal of Knowledge Representationis to facilitate inference (conclusions)
from knowledge. F 0D 8 The issues that arise while using KR techniques are many. Some of these are explained
below. F 0F C Important Attributes:
Any attribute of objects so basic that they occur in almost every problem domain? F 0F C Relationship among attributes:
Any important relationship that exists among object attributes? F 0F C Choosing Granularity :
At what level of detail should the knowledge be represented? F 0F CSet of objects :
How sets of objects be represented? F 0F C Finding Right structure :
Given a large amount of knowledge stored, how can relevant parts be accessed? F 0D 8 Important Attributes F 0F C There are attributes that are of general significance. F 0F C There are two attributes "instance" and "isa", that are of general importance. These
attributes are important because they support property inheritance. F 0D 8 Relationship among Attributes
Knowledge Representation using predicate logic 2.4 Representing Simple Facts in Logic
4.Caesar was a ruler. ruler(Caesar) Since many people share the same name, the fact that proper names are often not references to unique individuals, overlooked here. Occasionally deciding which of several people of the same name is being referred to in a particular statement may require a somewhat more amount of knowledge and logic. But that fails to capture the relationship between any individual being a man and that individual being a mortal. To do that, we really need variables and quantification unless we are willing to write separate statements about the mortality of every known man. Let's now explore the use of predicate logic as a way of representing knowledge by looking at a specific example. Consider the following set of sentences:
Marcus was a man.
Marcus was a Pompeian.
All Pompeians were Romans.
Caesar was a ruler.
All Romans were either loyal to Caesar or hated him.
Everyone is loyal to someone.
4.Caesar was a ruler. ruler(Caesar) Since many people share the same name, the fact that proper names are often not references to unique individuals, overlooked here. Occasionally deciding which of several people of the same name is being referred to in a particular statement may require a somewhat more amount of knowledge and logic.
8.Like the previous one this sentence too is ambiguous which may lead to more than one conclusion. The usage of “try to assassinate” as a single predicate gives us a fairly simple representation with which we can reason about trying to assassinate. But there might be connections as try to assassinate and not actually assassinate could not be made easily.
F 0D 8 Some of the computational predicates like Less than, Greater than used in knowledge
representation. F 0D 8 It generally return true or false for the inputs. Examples: Computable predicates gt(1,0) or lt(0,1) gt(5,4) or gt(4,5) Computable functions: gt(2+4, 5) Consider the following set of facts, again involving Marcus:
Two things should be clear from the proofs we have just shown: F 0B 7 Even very simple conclusions can require many steps to prove. F 0B 7A variety of processes, such as matching, substitution, and application of modus ponens are
involved in the production of a proof, This is true even for the simple statements we are using, It would be worse if we had implications with more than a single term on the right or with complicated expressions involving ands and ors on the left. Disadvantage: F 0D 8 Many steps required to prove simple conclusions F 0D 8 Variety of processes such as matching and substitution used to prove simple conclusions
2.5 Resolution F 0D 8 Resolution is a proof procedure by refutation. F 0D 8 To prove a statement using resolution it attempt to show that the negation of that statement.
Algorithm: Convert to Clause Form
minimum number of substitutions that must be made to preserve the truth value of the system. After applying this entire procedure to a set of wff's, we will have a set of clauses, each of which is a disjunction of literals. These clauses can now be exploited by the resolution procedure to generate proofs.
2.5.1 Resolution in Propositional Logic In propositional logic, the procedure for producing a proof by resolution of proposition P with respect to a set of axioms F is the following.
ALGORITHM: PROPOSITIONAL RESOLUTION
a) Select two clauses. Call these the parent clauses. b) Resolve them together. The resulting clause, called the resolvent, will be the disjunction of all of the literals of both of the parent clauses with the following exception: If there are any pairs of literals L and ¬L such that one of the parent clauses contains L and the other contains ¬L, then select one such pair and eliminate both L and ¬L from the resolvent. c) If the resolvent is the empty clause, then a contradiction has been found. If it is not then add it to the set of clauses available to the procedure.
Suppose we are given the axioms shown in the first column of Table 1 and we want to prove R. First we convert the axioms to clause which is already in clause form. Then we begin selecting pairs of clauses to resolve together. Although any pair of clauses can be resolved, only those pairs that contain complementary literals will produce a resolvent that is likely to lead to the goal of sequence of resolvents shown in figure 1.
We begin by resolving with the clause 2 C7 7R since that is one of the clauses that must be involved in the contradiction we are trying to find.
ii) A variable can match another variable, any constant or a function or predicate expression, subject to the condition that the function or [predicate expression must not contain any instance of the variable being matched (otherwise it will lead to infinite recursion). iii) The substitution must be consistent. Substituting y for x now and then z for x later is inconsistent. (a substitution y for x written as y/x) The Unification algorithm is listed below as a procedure UNIFY (L1, L2). It returns a list representing the composition of the substitutions that were performed during the match. An empty list NIL indicates that a match was found without any substitutions. If the list contains a single value F, it indicates that the unification procedure failed. The empty list, NIL, indicates that a match was found without any substitutions. The list consisting of the single value FAIL indicates that the unification procedure failed.
Algorithm: Unify(L1, L2) I. If L1 or L2 are either variables or constants, then: (a) If L1 and L2 are identical, then return NIL. (b) Else if L1 is a variable, then if L1 occurs in L2 then return {FAIL}, else return (L2/L1). (c) Else if L2 is a variable, then if L2 occurs in L1 then return {FAIL} , else return (L1/L2). (d) Else return {FAIL}.
If the initial predicate symbols in L1 and L2 are not identical, then return {FAIL}.
If LI and L2 have a different number of arguments, then return {FAIL}.
Set SUBST to NIL. (At the end of this procedure, SUBST will contain all the substitutions used to unify L1 and L2.)
For i ← 1 to number of arguments in L1 : (a) Call Unify with the ith argument of L1 and the ith argument of L2, putting result in S. (b) If S contains FAIL then return {FAIL}. (c) If S is not equal to NIL then: (i) Apply S to the remainder of both L1 and L2. (ii) SUBST: = APPEND(S, SUBST).
Return SUBST. 2.5.4 Resolution in Predicate Logic ALGORITHM: RESOLUTION IN PREDICATE LOGIC
Convert all the statements of F to clause form
Negate P and convert the result to clause form. Add it to the set of clauses obtained in step
Repeat until either a contradiction is found or no progress can be made or a predetermined amount of effort has been expended: a) Select two clauses. Call these the parent clauses. b) Resolve them together. The resulting clause, called the resolvent, will be the disjunction of all of the literals of both the parent clauses with appropriate substitutions performed and with the following exception: If there is one pair of literals T1 and T2 such that one of the parent clauses contains T1 and the other contains T2 and if T1 and T2 are unifiable, then neither T nor T2 should appear in the resolvent. We call T1 and T2 complementary literals. Use the substitution produced by the unification to create the resolvent. If there is one pair of complementary literals, only one such pair should be omitted from the resolvent. c) If the resolvent is the empty clause, then a contradiction has been found. If it is not then add it to the set of clauses available to the procedure. If the choice of clauses to resolve together at each step is made in certain systematic ways, then the resolution procedure will find a contradiction if one exists. However, it may take a very long time. There exist strategies for making the choice that can speed up the process considerably as given below.
persecute(x, y) F 0E 0hate(y, x)
hate(x,y) F 0E 0persecute(y, x) Converting to clause form, we get
F 0D 8persecute(x5,y2) F 0D Ahate(y2,x5)
F 0D 8hate(x6,y3) F 0D Apersecute(y3,x6)
2.5.5 Procedural v/s Declarative Knowledge F 0D 8 A Declarative representation is one in which knowledge is specified but the use to which
that knowledge is to be put in, is not given. F 0D 8A Procedural representation is one in which the control information that is necessary to use
the knowledge is considered to be embedded in the knowledge itself. F 0D 8 To use a procedural representation, we need to augment it with an interpreter that follows
the instructions given in the knowledge.