Details of rule based reasoning
This presentation is the property of its rightful owner.
Sponsored Links
1 / 73

Details of Rule Based Reasoning PowerPoint PPT Presentation


  • 89 Views
  • Uploaded on
  • Presentation posted in: General

Details of Rule Based Reasoning. Chapter 5 The Engineering of Knowledge Based Systems. Introduction. Traditionally pattern matching systems have been associated with forward reasoning while backward reasoning systems typically have been implemented as inference networks.

Download Presentation

Details of Rule Based Reasoning

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Details of rule based reasoning

Details of Rule Based Reasoning

Chapter 5

The Engineering of Knowledge Based Systems


Introduction

Introduction

  • Traditionally pattern matching systems have been associated with forward reasoning while backward reasoning systems typically have been implemented as inference networks.

  • This chapter presents examples to forward and backward reasoning and examines how these systems can be implemented.


Forward reasoning

Forward Reasoning

  • Forward reasoning is the process of working from a set of data to toward the conclusions that can be drawn from this data.

  • A rule is eligible for execution when its premises are satisfied.


Forward reasoning1

Forward Reasoning

  • Monitoring and diagnosing real-time process control systems where data are continuously being acquired, modified and updated are suitable for forward reasoning.

  • Other suitable applications can be listed as:

    • design

    • planning

    • scheduling

      The important characteristics of these applications are:

    • The need for a quick response to changes in data

    • Few predetermined relations existing between the input data and the conclusion drawn.


Forward reasoning2

Forward Reasoning

Implemented as Pattern matching

  • Where synthesis of new facts based on the rules’ conclusions occurs.

  • In these applications there are many potential solutions that can be derived from the input data. The rules express knowledge as general patterns and the precise connections (inference chain) between these rules can not be predetermined.

  • As a result these systems use forward reasoning pattern matching systems due to the implicit flexibility of the pattern matching approach.


Example 1 of forward reasoning

Example 1 of Forward Reasoning

Problem Statement.

  • It is discovered that the retirement village is under the threat of flooding of Suwannee River. An expert system to give alert when a flood warning or evacuation order should be given is required to be developed.

  • 10 rules and 18 parameters are set to solve this problem


Example 1 of forward reasoning1

Example 1 of Forward Reasoning

  • Parameters

    • monthany month of the year

    • upstream precipitationnone, light, heavy

    • weather forecastsunny, cloudy, stormy

    • river heightmeasurement in feet

    • seasondry, wet

    • local rainnone, light rain, heavy rain

    • river changenone, lower, higher

    • flood warningyes, no

    • evacuation orderyes, no


Example 1 of forward reasoning2

Example 1 of Forward Reasoning

R6IF upstream = heavy THEN change = higher

R7IF level = low THEN flood = no AND evac = no

R8IF change = none | lower AND level = normal | low THEN flood = no AND evac = no

R9IF change = higher AND level = normal AND rain = heavy

THEN flood = yes (CF = 0.4) AND evac = no

R1IF month = may … oct THEN season = wet

R2IF month = nov … april THEN season = dry

R3IF upstream = none AND season = dry THEN change = lower

R4IF upstream = none AND season = wet THEN change = none

R5IF upstream = light THEN change = none


Example 1 of forward reasoning3

Example 1 of Forward Reasoning

R13IF heigt <10 THEN level = low

R14IF heiht >=10 AND <=16 THEN level = normal

R15IF height > 16 THEN level = high

R16IF forecast = sunny

THEN rain = none

R17IF forecast = cloudy THEN rain = light

R18IF forecast = stormy

THEN rain = heavy

R10IF change = higher AND level = normal AND rain = light THEN flood = no AND evac = no

R11IF change = higher AND level = high AND rain = none | light THEN flood = yes (CF=0.5) AND evac = yes (CF=0.2)

R12IF change = higher AND level = high AND rain = heavy THEN flood = yes AND evac = yes (CF=0.8)


Inference network

Inference Network

Final conclusions

Intermediate conclusions

Input parameters


Details of rule based reasoning

  • The data used by this system can be gathered from a set of sensors, requiring no interaction with the users of the system.

  • The system must continually monitor the data collected by the sensors to determine if a warning should be given.


Implementation

Implementation

  • Because all the relations are predetermined an internal representation that exploits this explicitness is used. This internal representation details for each rule:

    • The rule number

    • Parameters used within the premises of the rule (called upstream elements)

    • Parameters used within the conclusions of the rule (called downstream elements)

    • The set of premises

    • The set of conclusions


Implementation1

Implementation

and for each parameter

  • The name of the parameter

  • A list of rules that derive a value for this parameter (called set-by)

  • A list of rules that use this parameter in their premises (called premise-for)

  • The value(s) of this parameter (and their associated confidence factors) if known


Implementation2

Implementation

For example, rule R1 and parameter change are described internally as

Rule:R1

Upstream-elements:month

Downstream-elements:season

Premises:month = may … oct

Conclusions:season = wet


Implementation3

Implementation

Parameter:change

Set-by:(R3 R4 R5 R6)

Premise-for:(R8 R9 R10 R11 R12)

Values-

Two additional lists (input data and conclusions) are needed for this approach

Input data:(month upstream forecast height)

Conclusions:(flood evac)


Implementation4

Implementation

Because all the interconnections among the rules can be stated explicitly, it is easy to determine what actions to take whenever some parameters are obtained.

The algorithm is basic breadth first search technique.


Forward reasoning inference network algorithm

Forward Reasoning Inference Network Algorithm

  • Assign values to all input nodes from the external sources providing information to the knowledge-based system.

  • Form a que containing rules that use the values of these input nodes in their premises.

  • Until there are no more rules in Q:

    • Examine the first rule in Q, comparing its premises with the values of the appropriate parameters to decide if the premises of the rules are satisfied.

    • If the premises of the rule are not satisfied, remove the rule from Q, and go back to a.

    • If the rule is matched:

    • Execute the rule, setting the rule’s downstream elements to the values specified by the rule.

    • Decide which rules use the downstream elements just set within their premises,

    • Add these rules as the last rules within Q if they are not already in Q, even if their premises are not fully satisfied.

    • Delete the original rule from the front of the Q, and return to step a.

  • Output the values of the hypotheses that have been identified as conclusion.

  • If this application involves a real time process control, go back to step 1 and start the process again.


Demonstration of the approach

Demonstration of the approach

  • Assume that the following values are obtained:

    month = may

    upstream = light

    forecast = cloudy

    height = 15

  • Step 2 requires that we build a queue of rules

    Q = ( R1 R2 R3 R4 R5 R6 R13 R 14 R15 R16 R17 R18)


Demonstration of the approach1

Demonstration of the approach

  • R1 is examined to see if its premises are satisfied. month = may is satisfied. New conclusion season = wet is derived.

  • Rules with season premise are R3 and R4 which are already in the queue.

  • R1 is removed from the queue

  • R2 is tried. Fails (month = nov…)

  • R3 R4 also fail


Demonstration of the approach2

Demonstration of the approach

  • R5 is tried. Its premise is satisfied deriving

    change = none

  • The value of the parameter change is used by

    (R8, R9, R10, R11, and R12).

    Q becomes

    Q = (R6 R13 R 14 R15 R16 R17 R18 R8 R9 R10 R11 R12)


Demonstration of the approach3

Demonstration of the approach

The known facts are

month = may

upstream = light

forecast = cloudy

height = 15

season = wet

change = none


Demonstration of the approach4

Demonstration of the approach

This process continues until Q is empty. At this time our database of known facts become:

month = may

upstream = light

forecast = cloudy

height = 15

season = wet

change = none

level = normal

rain = light

flood = no

evac = no


Demonstration of the approach5

Demonstration of the approach

  • If this is a real time application, the system repeats the process with new set of acquired input parameters.

  • Forward chaining systems implemented as inference networks are very good for applications involving monitoring and diagnosing real-time process control systems where data are continually being acquired, modified and updated automatically.


Example 2 of forward reasoning

Example 2 of Forward Reasoning

Statement of the problem:

Suppose that John is changing apartments and needs packing. Some items are much heavier than others, some occupy larger space, some are fragile and some are malleable.

John wants to ensure that all the items survive the move unbroken and is not interested in finding the optimal scheme for packing all the items.


Items to be packed by the boxer system

Items to be Packed by the Boxer System


Boxer system

Boxer System

  • This problem is one of synthesis, since there are many possible combinations to use in packing.

  • The process also requires a pattern matcher, since the objects and the boxes can be described by a list of values that detail the object’s (box’s)properties.


Boxer system1

Boxer System

John develops four primary steps in his BOXER system.

  • Box the fragile items first, taking care to pad each of these items.

  • Box the heavy weight items, ensuring that these items are not placed with the fragile ones.

  • Box the medium weight items, again ensuring that these items are not placed with the fragile ones.

  • Box the light weight items, putting them wherever there is room.

    John has collected enough boxes all of the same size (10 space units).


Boxer system2

Boxer System

R1 IFstep is box-fragile items

there is a fragile item to box

there is an empty box or a box

containing only fragile items

the fragile item has not been padded

THENpad the fragile item

R2IFstep is box-fragile items

there is a fragile item to box

there is an empty box or a box

containing only fragile items

the fragile item has been padded

the box’s free space >= the fragile item’s size

THENput the fragile item in the box

decrease the box’s free space by the fragile item’s size


Boxer system3

Boxer System

R3 IFstep is box-fragile items

there is a fragile item to box

THENstart a fresh box

R4IFstep is box-fragile items

THENdiscontinue box fragile items start box heavy items


Boxer system4

Boxer System

R5 IFstep is box-heavy-items

there is a heavy item there is an empty box or a box that does not

contain fragile items or a box that contains <4 heavy items

the box’s free space >= the item’s size THENput the heavy item in the box decrease the box’s free space by the heavy item’s size

R6 IFstep is box-heavy-items

there is a heavy item THENstart a fresh box

R7IFstep is box-heavy items

THENdiscontinue box-heavy-items start box-medium-items


Boxer system5

Boxer System

R8IFstep is box-medium-items

there is a medium item there is an empty box or a box that does not

contain fragile items or the box’s free space >= the medium item’s size THENput the medium item in the box decrease the box’s free space by the medium item’s size

R9 IFstep is box-medium-items

there is a medium item THENstart a fresh box

R10IFstep is box-medium items

THENdiscontinue box-medium-items start box-light-items


Boxer system6

Boxer System

R11IFstep is box-light-items

there is a light item there is a box whose free space >= the light item’s size THENput the light item in the box decrease the box’s free space by the light item’s size

R12 IFstep is box-light-items

there is a light item THENstart a fresh box

R13IFstep is box-light items

THENdiscontinue box-light-items halt


Boxer system7

Boxer System

Important characteristics of these rules are:

  • Each rule checks the currently active processing step.

  • By keeping track of the steps the system subdivides knowledge into smaller groups.

  • Only when all the objects of a certain group have been processed the system moves on to the next group.

  • The premises of some rules within subgroups are also premises of other rules. This means some conflict resolution must be employed to determine which actual rule to be executed.


Boxer system conflict resolution

Boxer System – Conflict Resolution

The selection is based on two ordered criteria:

  • Always select the rule instantiated with the largest number of premises

  • Should multiple instantiations still exist, select the rule instantiated with the data closest to the top of the database.


Boxer system conflict resolution1

Boxer System – Conflict Resolution


Boxer system conflict resolution2

Boxer System – Conflict Resolution

The system starts with box-fragile-items.

R3 and R4 are instantiated.

R3 has the larger number of premises and three instantiations (lamp, dishes, TV)

R3 forlamp 1

R3for dishes 1

R3for TV 1

R4


Details of rule based reasoning

Database after execution of R3 with Lamp 1


Boxer system conflict resolution3

Boxer System – Conflict Resolution

R1forlamp 1 and box 1

R1fordishes 1 and box 1

R1forTV 1 1 and box 1

R3 forlamp 1

R3for dishes 1

R3for TV 1

R4


Details of rule based reasoning

Database after execution of R1 with Lamp 1 and Box 1


Boxer system conflict resolution4

Boxer System – Conflict Resolution

R1fordishes 1 and box 1

R1forTV 1 1 and box 1

R2forlamp 1 and box 1

R3for dishes 1

R3for TV 1

R4


Details of rule based reasoning

Database after execution of R2 for Lamp 1 and Box 1


Details of rule based reasoning

Database after Boxing all Fragile Items


Details of rule based reasoning

Database after Boxing all Heavy Items


Details of rule based reasoning

Database after Boxing all light Items


The rete algorithm

The Rete Algorithm

  • As seen in the example, a pattern matcher, forward reasoning system is extremely inefficient.

  • The match, conflict resolution, and execute cycle implies that all of the rules are compared to all of the facts in the fact base to decide which rules belong in the conflict set.

    If we have

    • rrules in our knowledge base

    • ffacts in our database

    • An average of ppremises in each rule

      we will perform r*f * * p comparisons to our fact base on every cycle to determine which rules can be executed.


The rete algorithm1

The Rete Algorithm

  • The rules that can potentially execute on any cycle change very little.

  • Rather than comparing rules to facts to see which rules are satisfied we should instead maintain a list of satisfied rules and determine how this satisfaction list changes due to the addition and deletion of facts.

  • This approach is exploited by the Rete Algorithm.


The rete algorithm2

The Rete Algorithm

The Rete Algorithm involves the development of two networks:

  • a pattern network and

  • join network.

    Consider the following rule:

TEST 1:IF((cat ?c small ?h ?n1) (dog ?c ?q medium ?n2) (cat ?c large ?h ?n3) (dog ?c ?q long ?n4) ) THEN ( . . . )

(animal-type color size hair-length name)


Details of rule based reasoning

cat

dog

Match value to ?c

Match value to ?c

small

Match value to ?q

Match value to ?h

medium

Match value to ?n1

Match value to ?n2

The pattern network consists of a set of trees formed from all of the premises in all of the rules

TEST 1:IF((cat ?c small ?h ?n1) (dog ?c ?q medium ?n2) (cat ?c large ?h ?n3) (dog ?c ?q long ?n4) ) THEN ( . . . )

The root of each tree is the first item within each premise pattern


Details of rule based reasoning

The algorithm uses as much of the existing network as possible.It only creates a new path within the tree when the existing nodes do not correspond with the new item from the premise

TEST 1:IF((cat ?c small ?h ?n1) (dog ?c ?q medium ?n2) (cat ?c large ?h ?n3) (dog ?c ?q long ?n4) ) THEN ( . . .


Details of rule based reasoning

The join network connects the various leaf nodes of the trees together (in the order in which they occur as clauses) and compares similarly named values to ensure that they have the same values.

TEST 1:IF((cat ?c small ?h ?n1) (dog ?c ?q medium ?n2) (cat ?c large ?h ?n3) (dog ?c ?q long ?n4) ) THEN ( . . .

The Complete Joint and Pattern Network


Rete algorithm example

Rete Algorithm - Example

Consider the following database facts:

  • (catyellowlargeshortrebel)

  • (catcalicolargeshortrubble)

  • (catcalicosmallshortkitty)

  • (dogbrownmediumlongcharlie)

  • (catbrownsmall mediumprince)

  • (dogbrownsmallshortsam)

  • (dogcalicomediummediumbutch)

  • (dogbrownlargemediumstar)

  • (dogcalicomediumlongtramp)

    Each of these facts is first parsed through the pattern network.

    The 6th fact can not be completely parsed down the tree.


Details of rule based reasoning

If similar patterns exist with several rules, the algorithm reuses as much of the existing networks as is possible.

Facts parsed through the pattern network


Details of rule based reasoning

  • When a rule is executed, its actions can add, delete or modify facts on the fact list. Each of these actions changes the parsed and joined facts within the pattern and join networks. By merely updating these facts within the network, a forward reasoning system using the Rete Algorithm can quickly determine all rules that can execute.


Details of rule based reasoning

Results of passing facts through the joint network

TEST 1:IF((cat ?c small ?h ?n1) (dog ?c ?q medium ?n2) (cat ?c large ?h ?n3) (dog ?c ?q long ?n4) ) THEN ( . . .


Conflict resolution schemes

Conflict Resolution Schemes

Conflict resolution schemes can be divided into four broad categories based on the following criteria:

  • Number of rules to execute

  • Order of the rules

    • The lowest numbered rule

    • The first applicable rule following the last fired

  • Complexity of the rules

    • Refined rules (with many premises)

    • General rules (with few premises)

  • Order of the data

    • The rule that matches the oldest data

    • The rule that matches the newest data


Coding forward reasoning

Coding Forward Reasoning

  • Here, simple and concise routines implementing forward reasoning are presented.

  • These routines are more similar to the pattern matching algorithm because the relationships between the rules and the facts are not known beforehand.

  • Internal representation format for facts and rules are as follows:

fact::= (is attribute value) (numeric-op attribute value)

numeric-op::== | > | < | <= | >=

data base::= (fact *)

rule::=(name if (fact *) then (fact *))

knowledge base::=(rule +)


Coding forward reasoning1

Coding Forward Reasoning

  • Forward reasoning consists of sequentially examining each rule in a knowledge base to find the first one capable of deriving new facts that are currently not known.

  • Every time such a rule is found it is executed immediately and the cycle starts again.

  • Because this code stops searching for a rule to execute when it encounters the first satisfied rule that has not executed yet, there is never more than one eligible rule on the agenda hence there is no need for conflict resolution.

  • Execution price paid in return is all rules must be examined on each rule execution cycle.


Coding forward reasoning2

Coding Forward Reasoning

  • The Inference process is performed by the following five functions

    forward initiates the forward reasoning process

    execute-rule searches through the knowledge base looking for a rule that derives a new fact

    eval-rule-f examines an individual rule if it executes (all premises are satisfied and calling derive-new-fact?)

    derive-new-fact? examines the rule’s conclusions to see if there is a conclusion not in the database

    display-results prints a message every time a new fact is derived.


Coding forward reasoning3

Coding Forward Reasoning

forward initiates the forward reasoning process. It loops as long as new facts are being derived and returns T if any facts are derived.

( defun forward ( )

( let (derived-fact? )

(loop

(cond ( ( not (execute-rule) )

(return derived-fact?) )

(t (setq derived-fact? T) ) ))))

loop {form}

Controls no variables, simply executes its body repeatedly


Coding forward reasoning4

Coding Forward Reasoning

execute-rule searches through the knowledge base looking for a rule that derives a new fact

(do ((var1 init_value (iteration_form))

var1 init_value (iteration_form

var3

.)

((termination test) value_to_be_returned)

body)

  • ( defun execute-rule ( )

  • ( do ( ( rules rule-list (cdr rules) ) )

  • ( (null rules) nil) (if (eval-rule-f (car rules ) ) (return t) ) ))


Coding forward reasoning5

Coding Forward Reasoning

eval-rule-f examines an individual rule if it executes (all premises are satisfied and calling derive-new-fact?)

(defun eval-rule-f (rule)

(do ( ( ifs (caddr rule )

( if (member (car ifs)

fact-list :test #’equal )

( cdr ifs)

(return nil) ));; there is a premise not satisfied

( thens (caddr (cddr rule )) ) ) ;; then list of the rule

( ( null ifs) (derive-new-fact? thens ) ) )) ;; if all the premises are ;; satisfied look if new fact is going to be derived


Coding forward reasoning6

Coding Forward Reasoning

derive-new-fact? examines the rule’s conclusions to see if there is a conclusion not in the database.

( defun derive-new-fact? (facts)

(do ( (new-fact? nil) ;; initial value for new-fact is nil

(fact-arg facts (cdr facts-arg) ) );; initiate fact-arg to ; ; fact and iterate over cdr of fact-arg( ( null facts-arg) new-fact?)

( cond ( ( member (car facts-arg)

fact-list :test #’equal) return nill)

( t (display-results (car facts-arg) )

( setq new-fact? t)

( setq fact-list

(cons (car facts-arg ) fact_list) ) ))))


Coding forward reasoning7

Coding Forward Reasoning

display-results prints a message every time a new fact is derived

(defun display-results (derived-fact )

(terpri) ;; print new line

(princ “The value of “)

(princ (cadr derived-fact) ) ;; second element of a list

(princ “ is “ )

(princ (cadr drived-fact) ) )


Coding forward reasoning8

(setq rule-list

‘((R1a IF (( is shape long) (is color green )) THEN ((fruit = banana)) )

(R1b IF(( is shape long) (is color yellow)) THEN ( (is fruit banana)) )

(R2a IF ((is shape round) (> diameter 4)) THEN ((is fruitclass vine)) )

(R2b IF((shape = oblong ) (> diameter 4)) THEN ((is fruitclass vine)) )

R3 IF((is shape round ) (< diameter 4 )) THEN ((is fruitclass tree)) )

(R4IF(( = seedcount 1)) THEN((is seedclass stonefruit)) )

(R5IF(( > seedcount 1)) THEN((is seedclass multiple)) )

(R6 IF((is fruitclass vine ) (is color green )) THEN ( is fruit watermelon)) )

(R7IF((is fruitclass vine) (is surface smooth) (is color yellow )) THEN((fruit = honeydew)) )

…………………………….) )

Coding Forward Reasoning


Details of rule based reasoning

Consider the following fact base:

(setq fact-list

‘( ( is color red)

( is shape round)

( = seedcount 1)

( < diameter 4)

) )

This fact base causes the following execution results to be displayed:

The value of FRUITCLASS is TREE

The value of SEEDCLASS is STONEFRUIT

The value of FRUIT is CHERRY

T


Backward reasoning

Backward Reasoning

  • Backward chaining is more suited for applications having many more inputs than possible conclusions. The ability to trace the logic backwards from the few conclusions to the many inputs make it more efficient than forward chaining.

  • Diagnosis and classification problems are well suited for backward chaining.


Steps in backward reasoning

Steps in Backward Reasoning

  • Form a temporary stack initially set to the top level goals defined in the system.

  • Set the goal to be traced to the top of the stack. If the stack is empty halt and announce completion.

  • Gather all rules satisfying this goal.

  • Consider each of these rules in turn

    • If all premises are satisfied, then fire this rule to derive its conclusions. Do not consider any more rules for this goal. It’s value is now given by the current rule’s conclusion. If the goal being currently traced is a top level goal, remove it from the stack and go to step 2. If it is a sub goal remove it from the stack and continue with the suspended goal.

    • If a value in the database conflicts with the premise value fail the rule.

    • If a premise is not satisfied with the facts in the database look if it can be derived. If it can, consider this parameter as a sub-goal and go back to step 2.


Steps in backward reasoning1

Steps in Backward Reasoning

  • If step 4c fails then ask the user for its value and add it to the database; go to step 4a and consider the next premise of the rule.

  • If all rules that can satisfy the current goal have been attempted and all have failed to derive a value, then this goal remains undetermined. Remove it from the stack and go back to step 2.


  • Details of rule based reasoning

    R1 IFguest-age < 21

    THEN alcohol-indicated = no

    R2 IFguest-age >= 21

    THEN alcohol-indicated = yes

    R3 IFalcohol-indicated=yes, meal = formal THENdrink = wine

    R4 IFalcohol-indicated=yes, guest= boss THENdrink = wine

    R5 IFalcohol-indicated=yes, guest= neighbor THENdrink = beer

    R6 IFdrink = wine, dinner = fish THENwine-type = white

    R7 IFdrink = wine, dinner = red-meat THENwine-type = red

    R8 IFguest = boss day = friday THENdinner = fish

    R9IFguest = boss day <> friday THENdinner = red-meat

    R10 IFguest-age < 21

    THEN dinner = pizza

    R11 IFguest-age >=21

    THEN dinner = fish

    R12 IFalcohol-indicated = no THENdrink = soda

    Example - Backward ReasoningConsider the following knowledge base that helps us select beverage and main course for a meal.


    Example backward reasoning

    Example - Backward Reasoning

    The parameters and their acceptable values are:

    guest-age: positive integer between 15 – 100

    alcohol-indicated: yes/no

    meal: formal/informal

    drink: wine/beer/soda

    guest: boss/neighbor/friend

    dinner: fish/veal/red-meat/poultry/pizza

    day: monday/Tuesday/ . . . /Sunday


    Example backward reasoning1

    Example - Backward Reasoning

    In this approach the system takes the responsibility of questioning the user about the facts when they are needed for the reasoning process.

    The system starts with no data attached to any of the parameters:

    Known Fact Base: ( )

    A list of goals in the order the developer feels is best to pursue should be provided to guide the system.

    Goals: (drink wine-type dinner)


    Example backward reasoning2

    Example - Backward Reasoning

    Suppose that it is Tuesday and we have invited our 30-year-old neighbor for a casual meal.

    If the knowledge base is traced the database will include the following values:


    Example backward reasoning3

    Example - Backward Reasoning

    Database:

    ( ( dinner = fish )

    ( drink = beer)

    ( guest = neighbor)

    ( meal = casual)

    ( alcohol-indicated = yes)

    (guest-age = 30) )

    Note that the system is unable to derive a value for the parameter wine type. Also note that the system never asks a value for a day, since this premise is only used when the guest is determined to be the boss.


  • Login