Rule Based Systems
Rule Based Systems
Rule based systems / Knowledge based systems/ Expert Systems A rule means a structure which has an if component and a then component.
Systems that utilize reasoning capabilities and draw conclusions. Computer programs that contain some subject-specific knowledge of one or more human rule based Made up of a set of rules that analyze user supplied information about a specific class of problems.
Example The Edwin Smith papyrus Title: Instructions for treating a fracture of the cheekbone. Symptoms: If you examine a man with a fracture of the cheekbone, you will find a salient and red fluxion, bordering the wound.
Treatment:
You shall tend him with fresh meat the first day. The treatment shall last until the fluxion resorbs. Next you shall treat him with raspberry, honey, and bandages to be renewed each day, until he is cured.
The statement, or set of statements, after the word if represents some pattern which you may observe. The statement, or set of statements, after the word then represents some conclusion that you can draw, or some action that you should take.
A rule-based system, therefore, either identifies a pattern and draws conclusions about what it means, or identifies a pattern and advises what should be done about it, or identifies a pattern and takes appropriate action.
Problem-solving Models
Forward-chaining starts from a set of conditions and moves towards some conclusion Backward-chaining starts with a list of goals and the works backwards to see if there is any data that will allow it to conclude any of these goals. Both problem-solving methods are built into inference engines or inference procedures
Questions
Should I take an umbrella? What should I do if it is cloudy?
Backward Chaining
Rules
R1: IF may rain THEN should take umbrella R2: IF cloudy THEN may rain
Backward Chaining
Goal_2 Goal_3
rules
Question
Direction of reasoning
Goal_1 Goal_2
Question-andanswer
Menu driven
User
Natural language
Inference engine
Case-specific
data
Graphic
inteface
Expert system shell
Explanation subsystem
The output is in the form of a terse or verbose recommendation, the explanation of which is typically a trace of all the rules that fired.
Very useful to companies with a high-level of experience and rule basedise that cannot easily be transferred to other members. Solves problems that would normally be tackled by a medical or other professional. Currently used in fields such as accounting, medicine, process control, financial service, production, and human resources
Search Techniques
The process of the solution of AI problem searches the path from start sate to goal state Search techniques help in finding the most viable path to reach the goal state
Search techniques make the entire search process efficient and economical
Types of trees:
Searching techniques
Expand Root Node First Expand all nodes at level 1 before expanding level 2
OR
Breadth-first Search
A Successors: B,C,D B G C
Initial state
N O
Goal state
Visited:
Fringe: A (FIFO)
The fringe is the data structure we use to store all of the nodes that have been generated
Breadth-first Search
A
Next node
Successors: E,F E
B G
C H I
N O
Visited: A
Breadth-first Search
A
Next node
Successors: G,H
B G
C H I
N O
Visited: A, B
Breadth-first search
A
Successors: I,J
B G C H I
Next node
N O
U Visited: A, B, C
Breadth-first Search
A Successors: K,L B
Next node
C G H I
N O
Visited: A, B, C, D
Breadth-first Search
A
Successors: M
B
Next node
C G H I
N O
Visited: A, B, C, D, E
Breadth-first Search
A
Successors: N
B
Next node
C G H I
N O
Visited: A, B, C, D, E, F
Breadth-first Search
A
Successors: O
B G C
Next node
N O
Visited: A, B, C, D, E, F, G
Breadth-first Search
A Successors: P,Q B G C H I
D
Next node
N O
U Visited: A, B, C, D, E, F, G, H
Breadth-first Search
A Successors: R B G C H I
D
Next node
N O
Visited: A, B, C, D, E, F, U G, H, I
Breadth-first Search
A Successors: S B G C H I
E
Next node
N O
U Visited: A, B, C, D, E, F, G, H, I, J
Breadth-first Search
A
Successors: T
B G C H I
E
Next node
N O
U Visited: A, B, C, D, E, F, G, H, I, J, K
Breadth-first Search
A
Successors:
B G
C H I
M
Next node
N O
U Visited: A, B, C, D, E, F, G, H, I, J, K, L
Breadth-first Search
A Goal state achieved
Successors:
B G
C H I
N O
Next node
Visited: A, B, C, D, E, F, U G, H, I, J, K, L, M
Expand Root Node First Explore one branch of the tree before exploring another branch If a leaf node do not represent a goal state, search backtracks up to the next highest node that has an unexplored path
Depth-first search (DFS) is an algorithm for traversing or searching a tree, tree structure, or graph. One starts at the root (selecting some node as the root in the graph case) and explores as far as possible along each branch before backtracking.
Depth-First Search
A Successors: B,C,D B G C
Initial state
N O
Goal state
Visited:
Fringe: A (LIFO)
Depth-First Search
A Successors: E,F B G C H I
N O
Visited: A
Depth-First Search
A Successors: K,L B G C H I
N O
Visited: A, B
Depth-First Search
A
Successors: S
B G C H I
N O
Visited: A, B, E
Depth-First Search
A
Successors:
B G
C H I
N O
Visited: A, B, E, K
Depth-First Search
A
Successors: T
B G C H I
N O
Visited: A, B, E, K, S Backtracking
Depth-First Search
A
Successors:
B G
C H I
N O
Visited: A, B, E, K, S, L S T U
Depth-First Search
A Successors: M B G C H I
N O
Visited: A, B, E, K, S, L, T S T U Backtracking
Depth-First Search
A
Successors:
B G
C H I
N O
Visited: A, B, E, K, S, L, T, U F
Depth-First Search
A Successors: G,H B G C H I
N O
Visited: A, B, E, K, S, L, T, F, M Backtracking
Depth-First Search
A
Successors: N
B G
C H I
N O
Visited: A, B, E, K, S, L, T, F, M, C
Depth-First Search
A
Successors:
B G
C H I
N O
Visited: A, B, E, K, S, L, T, F, M, C, G
Time: If the solution is on a short path - breadth first is better, if the path is long - depth first is better.
Depth-first search requires less memory since only the nodes on the current path are stored.
By chance, depth-first search may find a solution without examining much of the search space at all.