Knowledge Representation Ai Unit 3
Knowledge Representation Ai Unit 3
Procedural Knowledge
A representation in which the control information, to use the knowledge, embedded in the knowledge
itself. For example, computer programs, directions, and recipes; these indicate specific use or
implementation;
Moreover, Knowledge encoded in some procedures, small programs that know how to do specific
things, how to proceed.
Advantages:
Heuristic or domain-specific knowledge can represent.
Moreover, Extended logical inferences, such as default reasoning facilitated.
Also, Side effects of actions may model. Some rules may become false in time. Keeping track of
this in large systems may be tricky.
Disadvantages:
Completeness — not all cases may represent.
Consistency — not all deductions may be correct. e.g If we know that Fred is a bird we might
deduce that Fred can fly. Later we might discover that Fred is an emu.
Modularity sacrificed. Changes in knowledge base might have far-reaching effects.
Cumbersome control information.
Declarative Knowledge
A statement in which knowledge specified, but the use to which that knowledge is to be put is not
given.
For example, laws, people’s name; these are the facts which can stand alone, not dependent on
other knowledge;
So to use declarative representation, we must have a program that explains what is to do with the
knowledge and how.
For example, a set of logical assertions can combine with a resolution theorem prover to give a
complete program for solving problems but in some cases, the logical assertions can view as a
program rather than data to a program.
Hence the implication statements define the legitimate reasoning paths and automatic assertions
provide the starting points of those paths.
These paths define the execution paths which is similar to the ‘if then else “in traditional
programming.
We have discussed various search techniques in previous units. Now we would consider a set of rules
that represent,
2. Knowledge about how to solve the problem using the content of the rules.
Procedural Knowledge
A representation in which the control information that is necessary to use the knowledge is embedded
in the knowledge itself for e.g. computer programs, directions, and recipes; these indicate specific use
or implementation;
The real difference between declarative and procedural views of knowledge lies in where control
information reside.
For example, consider the following
If only one value needed, then the answer to the question will depend on the order in which
the assertions examined during the search for a response.
If the assertions declarative then they do not themselves say anything about how they will be
examined. In case of procedural representation, they say how they will examine.
Declarative Knowledge
A statement in which knowledge specified, but the use to which that knowledge is to be put is
not given.
For example, laws, people’s name; these are the facts which can stand alone, not dependent
on other knowledge;
So to use declarative representation, we must have a program that explains what is to do with
the knowledge and how.
For example, a set of logical assertions can combine with a resolution theorem prover to give a
complete program for solving problems but in some cases, the logical assertions can view as a
program rather than data to a program.
Hence the implication statements define the legitimate reasoning paths and automatic
assertions provide the starting points of those paths.
These paths define the execution paths which is similar to the ‘if then else “in traditional
programming.
Explicit knowledge
It is embedded.
A variety of ways of representing knowledge have been exploited in AI programs.
2. Moreover, The symbol level, at which representation of objects defined in terms of symbols
that can manipulate by programs
Framework of Knowledge Representation
The computer requires a well-defined problem description to process and provide a well-
defined acceptable solution.
Moreover, To collect fragments of knowledge we need first to formulate a description in our
spoken language and then represent it in formal language so that computer can understand.
Fig: Knowledge Representation Framework
The steps are:
The informal formalism of the problem takes place first.
It then represented formally and the computer produces an output.
This output can then represented in an informally described solution that user understands or checks
for consistency.
The Problem solving requires,
Formal knowledge representation, and
Moreover, Conversion of informal knowledge to a formal knowledge that is the conversion of
implicit knowledge to explicit knowledge.
Mapping between Facts and Representation
Moreover, Normal English is insufficient, too hard currently for a computer program to draw
inferences in natural languages.
A good knowledge representation enables fast and accurate access to knowledge and understanding of the
content.
1. Representational Adequacy
The ability to represent all kinds of knowledge that are needed in that domain.
2. Inferential Adequacy
Also, The ability to manipulate the representational structures to derive new structures
corresponding to new knowledge inferred from old.
3.Inferential Efficiency
The ability to incorporate additional information into the knowledge structure that can be used to
focus the attention of the inference mechanisms in the most promising direction.
4.Acquisitional Efficiency
Moreover, The ability to acquire new knowledge using automatic methods wherever possible
rather than reliance on human intervention.
Knowledge Representation Schemes Relational Knowledge
The simplest way to represent declarative facts is a set of relations of the same sort used in the
database system.
Provides a framework to compare two objects based on equivalent attributes. o Any instance in
which two different objects are compared is a relational type of knowledge.
Also, The facts about a set of objects are put systematically in columns.
This representation provides little opportunity for inference
Given the facts, it is not possible to answer a simple question such as: “Who
is the heaviest player?”
Also, But if a procedure for finding the heaviest player is provided, then these
facts will enable that procedure to compute an answer.
Moreover, We can ask things like who “bats – left” and “throws – right”.
Inheritable Knowledge
The knowledge 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 prescribed to the child elements.
Moreover, The basic KR (Knowledge Representation) needs to augment with inference mechanism.
Property inheritance: The objects or elements of specific classes inherit attributes and values from
more general classes.
4. Also, Go to that node and find a value for the attribute and then report it
5. Otherwise, search through using is until a value is found for the attribute.
This new information does not require further data gathering form source but does require analysis of the
Example: given a set of relations and values, one may infer other values or relations. A predicate logic (a
mathematical deduction) used to infer from a set of attributes. Moreover, Inference through predicate logic
Represent knowledge as formal logic: All dogs have tails ∀x: dog(x) → hastail(x)
Advantages:
Guaranteed correctness.
So, Many inference procedures available to implement standard rules of logic popular in AI systems. e.g
Ex : P, P V Q, P → Q
Also, The first two differences are the fact that PROLOG programs are actually sets of Horn clause that have
been transformed as follows:-
2. Also, Otherwise rewrite the Horn clauses as an implication, combining all of the negative literals into the
antecedent of the implications and the single positive literal into the consequent.
Moreover, This procedure causes a clause which originally consisted of a disjunction
of literals (one of them was positive) to be transformed into a single implication
whose antecedent is a conjunction universally quantified.
But when we apply this transformation, any variables that occurred in negative literals
and so now occur in the antecedent become existentially quantified, while the
variables in the consequent are still universally quantified.
For example the PROLOG clause P(x): – Q(x, y) is equal to logical expression ∀x:
∃y: Q (x, y) → P(x).
The difference between the logic and PROLOG representation is that the PROLOG
interpretation has a fixed control strategy. And so, the assertions in the PROLOG
program define a particular search path to answer any question.
But, the logical assertions define only the set of answers but not about how to choose
among those answers if there is more than one.
Consider the following example:
1. Logical representation
∀x : pet(x) ۸ small (x) → apartmentpet(x)
1. Prolog representation
A search procedure must find a path between initial and goal states. There are
two directions in which a search process could proceed. The two types of
search are:
The production system views the forward and backward as symmetric processes.
Consider a game of playing 8 puzzles. The rules defined are
Also, Square 2 empty and square 1 contains the tile n. Square 1 empty
Square 4 contains tile n. →
Step 1. Begin building a tree of move sequences by starting with the initial configuration at the root
of the tree.
Step 2. Generate the next level of the tree by finding all rules whose left-hand side matches
against the root node. The right-hand side is used to create new configurations.
Step 3. Generate the next level by considering the nodes in the previous level and applying it
to all rules whose left-hand side match.
Step 2. Generate the next level of the tree by finding all rules whose right-hand side matches
against the root node. The left-hand side used to create new configurations.
Step 3. Generate the next level by considering the nodes in the previous level and applying it
to all rules whose right-hand side match.
So, The same rules can use in both cases.
Also, In forwarding reasoning, the left-hand sides of the rules matched against the current state and
right sides used to generate the new state.
Moreover, In backward reasoning, the right-hand sides of the rules matched against the current
state and left sides are used to generate the new state.
There are four factors influencing the type of reasoning. They are,
1. Are there more possible start or goal state? We move from smaller set of sets to the length.
2. In what direction is the branching factor greater? We proceed in the direction with the lower
branching factor.
3. Will the program be asked to justify its reasoning process to a user? If, so then it is selected since it
is very close to the way in which the user thinks.
4. What kind of event is going to trigger a problem-solving episode? If it is the arrival of a new factor, the
forward reasoning makes sense. If it is a query to which a response is desired, backward reasoning is
more natural.
Example 1 of Forward versus Backward Reasoning
It is easier to drive from an unfamiliar place to home, rather than from home
to an unfamiliar place. Also, If you consider a home as starting place an
unfamiliar place as a goal then we have to backtrack from unfamiliar place to
home.
Unification tries to find a set of bindings for variables to equate a sub-goal with
the head of some rule. Rules in the Prolog program matched in the order in which
they appear.
Combining Forward and Backward Reasoning
Instead of searching either forward or backward, you can search both simultaneously.
Also, That is, start forward from a starting state and backward from a goal
state simultaneously until the paths meet.
This strategy called Bi-directional search. The following figure shows the reason
for a Bidirectional search to be ineffective
Forward versus Backward Reasoning
Also, The two searches may pass each other resulting in more work.
Based on the form of the rules one can decide whether the same rules can
apply to both forward and backward reasoning.
Moreover, If left-hand side and right of the rule contain pure assertions then the
rule can reverse.
And so the same rule can apply to both types of reasoning.
If the right side of the rule contains an arbitrary procedure then the rule cannot
reverse.
So, In this case, while writing the rule the commitment to a direction of
reasoning must make.