You are on page 1of 17

Knowledge representation and rule based systems

Interviews Protocol analysis Repertory grid Induction etc Semantic/networks Influence diagrams Rule matrices etc

Knowledge representation
There are four basic techniques for representing the acquired knowledge in a knowledge base

logic. semantic networks. frames. production rules.

see course readings p52-75 In particular the sections on Logic [5.2], semantic networks [5.3] production rules [5.8] and frames [5.9].

Knowledge representation
Logic: Knowledge and reasoning could be represented using predicate logic. This is the basis of the programming language PROLOG.

Semantic networks: ('concept maps', 'conceptual graphs' are very similar concepts)
This approach has also been introduced as an example of an analysis representation technique. However a more formal approach can lead to a representation scheme which may be able to be implemented

Knowledge representation
Semantic networks can show natural relationships between objects/concepts be used to represent declarative/descriptive knowledge Semantic networks are constructed using nodes linked by directional lines called arcs A node can represent a fact description physical object concept event An arc (or link) represents relationships between nodes

Knowledge representation
Semantic networks There are some 'standard' relationship types 'Is-a' (instance relationship) 'Has-a' (part-subpart relationship) <will depend on the context> ( definitional link) < again will depend on context> (heuristic link)

Knowledge representation
An example

Knowledge representation
A semantic net can be represented as a set of triples from the above example (Olesek)(is-a)(Male) (Harding)(is-a)(Male) (Male)(is-a)(Person) (Person)(wears)(Apparel) (Uniform)(is-a)(Apparel) (Uniform)(has-a)(Shirt Sleeve) etc

A knowledge base (storing facts/relationship) can be built up using this scheme. In a semantic network inferencing involves search and deductive reasoning.

Knowledge representation
Disadvantages of a semantic network [table 5.1, p60 readings]

incomplete (no explicit operational/procedural knowledge) lack of standards, ambiguity in node/link descriptions not temporal (i.e. doesn't represent time or sequence)

Finally semantic networks are mainly used as an aid to analysis to visually represent parts of the problem domain. The `knowledge' can be transformed into rules or frames for implementation

Knowledge representation
A Frame-Based Approach [sec 5.9, course readings p68] A frame is a data structure containing typical knowledge about a concept or object (Marvin Minsky (mid 1970s)) A frame can encompass both semantic and procedural knowledge. A frame represents knowledge about real world things (or entities). A frame contains both descriptions of attributes and procedural details Expert (or knowledge base) systems that use frames as their fundamental knowledge representation scheme are referred to as frame-based systems frames are an application of the object-oriented approach to knowledgebased systems

Knowledge representation
A Frame-Based Approach
A frame contains two key elements slot set of attributes for specific object being described facet extended knowledge about the attribute in a frame This knowledge may be expressed in many ways

value [ a simple attribute value, can be symbolic, numeric, boolean etc] default [the value taken if the attribute is not otherwise described] a range [describes what type of information can appear in the attribute] if-added [procedural knowledge i.e. what action to take when a value is added to the attribute] if needed [procedural knowledge i.e. attribute is empty, but a value is needed --- so a procedure runs to obtain a value] .............................. ...............................

Knowledge representation
A Frame-Based Approach Note: if-changed, if-needed are examples of demons In general a demon has an IF -THEN structure they allow procedural knowledge to be combined with the declarative knowledge stored in the frame. instantiation --- an instance of a frame is created [see figure 5-16, course readings] For some general examples of frames see figure 5.13, 5.16 p 70 course readings

Knowledge representation
Advantages and Disadvantages of a Frame-Based Approach [see table 5.6, course notes p. 74 ] Disadvantages complex reasoning (inferencing) is difficult explanation is difficult

Advantages knowledge domain can be naturally structured [a similar motivation as for the O-O approach]. handles both semantic/procedural knowledge. easy to include the idea of default values, detect missing values, include specialised procedures and to add further slots to the frames

Knowledge representation
Production Rules [sec 5.8, course readings]

a representation scheme implementable by many ES shells. they consist of conditional statements. expresses relationships b/w parameters and variables. easy to understand (ie `knowledge' is visible). can express heuristic knowledge. can incorporate uncertainty and can be expressed in modules. Expert systems that use a knowledge base consisting of production rules are called rule-based systems [see course readings p 76 - 95]

Knowledge representation
syntax IF <premise> THEN <action> <premise> is boolean. The AND, and to a lesser degree OR and NOT, logical connectives are possible. <action> a series of statements Notes: The rule premise can consist of a series of clauses and is sometimes referred to as the antecedent The actions are sometimes referred to as the consequent A rule that contains two clauses in the antecedent connected by logical OR can re-written as two rules IF weather is hot OR temperature is high THEN ice-cream sales are high could be re-written as IF weather is hot THEN ice-cream sales are high IF temperature is high THEN ice-cream sales are high

[see table 5-3, course readings for some rule characteristics]

Knowledge representation
Differences b/w production rules and the conditional statements found in conventional programming languages Production rules are relatively independent of one another. Production rules can be based on heuristics or experiential reasoning. Production rules can accept uncertainty in the reasoning process. Conditional statements combine the `knowledge' and the `reasoning' in the one structure. Production rules simply represent the knowledge --- the inferencing or reasoning is separate. A simple example: part of a small KBS to help in weather prediction R1 IF the ambient temperature is above 35 C THEN the weather is hot R2 IF the relative humidity is greater than 65% THEN the atmosphere is humid R3 IF the weather is hot AND the atmosphere is humid THEN thunderstorms are likely (CF = 9/10) an alternative is to write one rule (R1 & R2 are placed directly in the premise of R3). However we may wish use the statements, the weather is hot and the atmosphere is humid, for other purposes in the knowledge base.

Knowledge representation
Advantages and disadvantages of a rule-based approach Advantages easy to understand the knowledge `content'. explanation for the reasoning is easily shown i.e. a list of which rules fired (and in which order) during reasoning. maintenance (or modification) is easy, provided the rule base structured well. uncertainty can incorporated into the knowledge base. Disadvantages (or limitations) rule bases can be very large (thousands of rules) rules may not reflect the actual decision making the only structure in the KB is through the rule chaining

Next time
A visualisation of the rule base [the AND/OR graph] Reasoning with a rule base

Forward chaining Backward chaining

You might also like