Transcript Document

Extending the Knowledge
Representation Model
Based on
Flexible Inference Engine
By: Shahriar Pourazin
Supervisor: Dr. Ahmad Abdollahzadeh
AmirKabir University of Technology
July 2005
1
Overview
•
•
•
•
•
•
•
•
2
Project Goals
Introduction
Definitions
Characteristics
Implementation
Achievements
Possible Applications
Conclusion
Overview
Project Goals
• Design of Flexible Inference Engine
– Modifiable Inference (Manual)
– Modifying the Inference by Inference (Automatic)
– Modifying the Learning by Learning (Recursive Learning)
• Managing the Inference Modules
– Modifying the Existing Inferences: New Inference
– Organizing the Inference Modules: Runtime Ranking
– Selecting the Best or Most Freq. Used Inferences
• Layered Architecture of a Softbot
– Just in Time Response (Bounded Resource: Time)
– Meta-level Management of Playing Football (Soccer)
3
Project Goals
Making Inference Flexible
Flexible
?
Inference
Engine
4
Knowledge
Base
Introduction
Upward Reflection for Inference
• An Extremely Simple Knowledgebase K1:
K1 = { P1, P2 }
P1: (Age Ali 18)
P2: (Family Ali Tavana)
K1: ((Age Ali 18) (Family Ali Tavana))
• An Extremely Simple Inference F1:
F1: x, y, Age( x, y)  ( y  40)  Young( x)
F1(K1) = K2 = ((Age Ali 18) (Family Ali Tavana) (Young Ali))
R(F1) Ξ (defun F1 (Ki) (push (list Young (second (find-if #'(lambda
(fact) (And (eql `Age (first fact)) (< (third fact) 40)) Ki))) Ki)
•
•
R(F1) is the Reified or Structural Name of F1
R(F1) is Reflected Up F1
5
Introduction
Reflecting up and Down for Inference
Dereification (Reflect Down)
?
Flexible
Inference
Engine
Knowledge
Base
(Family Ali Tavana)
0000 1001 0011 1101
(defun F1 (p1 p2) (…))
1100 1000 0010 1111
Reification (Reflect UP)
6
Definitions
The Flexible Engine (FlEng)
• Traditional Inference:
F1: K1 → K2
• Flexible Inference:
F1: K1 U {R(F1)} → K2 U {R(F2 )}
F2: K2 U {R(F2)} → K3 U {R(F3 )}
( (A (3 A1 (p1 p2) (…))
F3: …
(2 A2 (p1 p2) (…))
* Requires unique knowledge representation language
(4 A3 (p1 p2) (…)))
• Flexible Inference
Alternate Sets:
(B (1 Bwith
1 (q1) (…))
F1: K1 U {R(F1)} → K2 U {R(F1)} U {R(F2 )}
(5 B2 (q1) (…)))
F2: K2 U {R(F1)} U {R(F2)} → K3 U {R(F1)} U {R(F2)} U {R(F3 )}
(F (4 F1 (X1 X2) (…))
* Requires limiting the number of alternates to be safe
(7 F2 (X1 X2) (…))
• Alternate Set for
(5 F:
F3 (X1 X2) (…))) )
{R(F1)} U {R(F2)} U {R(F3)}
7
Definitions
Generating Alternatives
Consider the following Alternatives:
( (A (3 A1 (p1 p2) (…))
(2 A2 (p1 p2) (…))
(4 A3 (p1 p2) (…)))
(B (1 B1 (q1) (…))
(5 B2 (q1) (…))) )
Given the function C which calls A and B:
(defun C (m n) (+ (A m n) (B m)))
We can Generate Six Alternatives for C:
8
(C (w1 C1 (y1 y2) (+ (A1 m n) (B1 m)))
(w2 C2 (y1 y2) (+ (A1 m n) (B2 m)))
(w3 C3 (y1 y2) (+ (A2 m n) (B1 m)))
(w4 C4 (y1 y2) (+ (A2 m n) (B2 m)))
(w5 C5 (y1 y2) (+ (A3 m n) (B1 m)))
(w6 C6 (y1 y2) (+ (A3 m n) (B2 m))) )
Definitions
Managing Alternates
• Combinatorial Explosion
– Limiting the Number of Alternates
– Running Engine in “First Alternate” Mode
– Removing the non-Qualified Alternates
• Reserving the Quality of Reasoning (Soundness)
–
–
–
–
–
9
Manual Alternate Generation
Combination of Alternates in Caller Functions
Sharing the Sound Functions Among Agents
Rolling Back the Addition of an Alternate
Using the Qualified Alternates
Characteristics
Alternate Qualification
• New Alternates Activated after Qualification
• We do Post-Qualification (Metareasoning)
• Will New Alternate Give the same Output?
– Sorting the Lists
– Selecting a Member from a Limited Set
– True/False Answers
• Evaluation (Post-Qualification) Function: Voting
• Do Existing Alternates Generate Unique Result?
– Navigation
– Estimation
– Self-Localization
• Post-Qualification Function: Average? History?
10
Characteristics
The Test Bed
•
•
•
•
•
•
•
Target: Post-Qualification for Self-Localization
A Softbot in Lisp to Play Simulated Soccer
KB and Process both as Lists
Synchronization With Server
Alternate Sets: A List of Lists in Lisp
Pose Estimation: Alternates for Localization
Playing Skill: Alternates of Playing Paths
11
Implementation
The Softbot Architecture
12
Alternate Skills
Alternate Pose Calculations
Implementation
The Timing Problem
13
Implementation
The Timing Solution
14
Implementation
Meta-level Processes in Softbot
• Managing the Pose Manipulations
– Multiple Self-localization Modules
– Selecting the Best by Post-Metareasoning
• Generating Alternatives of Functions
– Combinatorial Selection of Multiple Alternatives
– Special Purpose Alternatives
• Managing Skills
– Skills: strings of snapshots in actions
– Choosing the Skills
– Switching in between Skills
15
Implementation
Pose Estimation
•
•
•
•
•
•
Five Self-Localization Algorithms
Not Always Possible to Predict the Best
None of Them Too bad to be Ignored
Failed/Inexact Outputs Found at the End
Different Answers Most of the Time
Post-Qualification of Answers Possible
16
Implementation
The Selection Algorithm
17
Implementation
Selecting the Best Among the Results
18
Implementation
The Accumulation of Error
19
Implementation
Averages, History, and Best
20
Implementation
Achievements
• Design of Flexible Inference Engine
– Modifiable Inference (Manual)
– Modifying the Inference by Inference (Automatic)
– Modifying the Evaluation by Evaluation (Meta-Evaluation)
• Alternate Sets of Inference Modules
–
–
–
–
–
New Alternate Inference: Modified Existing Inference
Weighted Alternate Inference Modules
Weights as the Best or Most Freq. Used Inferences
Runtime Inference Module Ranking/Weighting
Selecting Alternates Before/During/After Running
• Layered Architecture of a Softbot
–
–
–
–
21
Just in Time Response to Environment (Bounded Resource: Time)
Alternate Skills of Playing Football (Soccer)
Alternate Pose Estimation Modules
Choosing the Best Pose Estimation Alternate by Post-Metareasoning
Achievements
Possible Applications
•
•
•
•
•
•
•
•
•
Automatic Debugging in Software Engineering
Creativity in Design by Modifiable Alternates
Alternate Embedding and Random Call for Games
Partial Alternate Settling to Locate Insanity
Opponent Modeling with Faulty Alternates
Static, Dynamic and Now Revocable Libraries
Processors Calling Multiple Functions at Once
User Modeling by Group Empty Alternate Templates
Safe Random Reactions in Commanding War
22
Possible Applications
Conclusion
•
•
•
•
Safe Metareasoning by Alternate Sets
Classes: Pre/Para/Post Metareasoning
Parallel Metareasoning
The Followings are Now Possible:
–
–
–
–
–
–
–
–
23
Late Debugging by Metareasoning
Alternate Functions to deal with Alternates
Global Libraries of Alternate Processors
Agents that Share Inference Mechanisms
Group Function Call in Parallel Processing
Web Services Approach to Reasoning
Keeping Away From the Blind Program Modification
Dynamic Libraries which are Replaced at Runtime
Conclusion
Publications
•
•
•
•
•
•
•
•
•
Barforoush A. A., Pourazin S., Shamsfard M., “A Design for Knowledge Partitioning: Introducing an
Intermediate Reflective Model”, Proceedings of the 4th Annual International CSI Computer Conference
(CSICC’98), Sharif University of Technology, Tehran, pp. 100–109, 1999.
Barforoush A. A., Shamsfard M., Pourazin S., The Relation of Knowledge, Inference and
Representation Models, Amir-Kabir Journal of Science and Technology, Vol. 12, No. 46, pp. 177-187:
Amir-Kabir University Press, Tehran, Iran, Spring 2001.
Shahriar Pourazin, et al, “Pardis, Our team in RoboCup Simulation League”, Team Descriptions
Simulation League, Linkoping University Electronic Press, pp. 95-97, 1999 (PDF)
Shahriar Pourazin: Pardis. 614-617 in Manuela M. Veloso, Enrico Pagello, Hiroaki Kitano (Eds.):
RoboCup-99: Robot Soccer World Cup III. Lecture Notes in Computer Science 1856 Springer 2000,
ISBN 3-540-41043-0 (URL: http://www.informatik.unitrier.de/~ley/db/conf/robocup/robocup1999.html#Pourazin99) (PDF)
Shahriar Pourazin: Simulated Soccer Robot: Toward Being on Time; Proceedings of Eighteenth
IASTED International Conference: Applied Informatics, February 14-17, 2000, in Insbruck, Austria.
Editor: M.H. Hamza; 2000, 877 pages, ISBN: 0-88986-280-X (307); ISSN: 1027-2666 (PDF)
Shahriar Pourazin, Ahmad Abdollah Zadeh Barforoush: FlEng: The Flexible Inference Engine;
Proceedings of Eighteenth IASTED International Conference: Applied Informatics, February 14-17,
2000, in Insbruck, Austria. Editor: M.H. Hamza; 2000, 877 pages, ISBN: 0-88986-280-X (307); ISSN:
1027-2666 (PDF)
Shahriar Pourazin: A Portable Architecture for RoboCup Agents; Fourth International Conference on
AUTONOMOUS AGENTS (Agents 2000) Barcelona, Catalonia, Spain. June 3 - June 7 (PDF)
Shahriar Pourazin, Ahmad Abdollahzadeh Barforoush: Concurrent Metareasoning; Journal of
Supercomputing, Kluwer; Accepted. (PDF)
Shahriar Pourazin, Ahmad Abdollahzadeh Barforoush: Going Meta: Back to the Expectations; CSI
Journal of Computer Science and Engineering, Accepted subject to changes. (PDF)
24
Publications
Questions
25
Submitted Papers
•
Shahriar Pourazin, Ahmad Abdollahzadeh Barforoush: Learning FlEng:
The Implementation Notes; Journal of Artificial Intelligence, Elsevier
Science,
– Submission Date: July 13 2002. (PDF)
•
Shahriar Pourazin, Ahmad Abdollahzadeh Barforoush: The Soccer Softbot
in Lisp; International Journal on Artificial Intelligence tools, World Scientific
Publishing Company,
– Submission Date: February, 28, 2003. (PDF)
•
Shahriar Pourazin, Ahmad Abdollahzadeh Barforoush: Dynamic Selection
of Algorithms by Flexible Inference; Amir-Kabir Journal, Amir-Kabir
University of Technology,
– Submission Date: March 12, 2003. (PDF)
•
Shahriar Pourazin, Ahmad Abdollahzadeh Barforoush: MetaReasoning in
Artificial Intelligent Systems; Computer Society of Iran Journal;
– Submission Date: January 22, 2005. (PDF)
•
Shahriar Pourazin, Ahmad Abdollahzadeh Barforoush: Classifying the
Types of Metareasoning; Mashad Ferdowsi University Journal,
– Submission Date: January 21, 2005. (PDF)
26
Arrangement: The Snapshot
( WF
<Simulation-Cycle>
( B <X-ball> (Y-Ball> <Direction> <Speed> )
( <Team-of-us> <Score>
( 1 <X> <Y> <Body-dir> <Velocity> <Neck-dir> <Stamina> )
( 2 <X> <Y> <Body-dir> <Velocity> <Neck-dir> <Stamina> )
( 3 <X> <Y> <Body-dir> <Velocity> <Neck-dir> <Stamina> )
( 4 <X> <Y> <Body-dir> <Velocity> <Neck-dir> <Stamina> )
<Player5> ... <Payer11>
)
( <Team-of-Them> <Score> <Player1> <Player2> ... <Payer11> )
)
27
Implementation
Playing Skills:
String of Snapshots
28
(skills 1.0
(tactic1
( wf 1 (b 0 0)
(myteam nil (P1 (gt -2) 0) )
(opponent nil ) )
( wf 2 (b 0 0)
(myteam nil (P1 0 0) )
(opponent nil ) )
( wf 3 (b 3 0)
(myteam nil (P1 3 0) )
(opponent nil ) )
( wf 4 (b 7 0)
(myteam nil (P1 7 0 0) )
(opponent nil ) )
( wf 5 (b xb yb)
(myteam nil (P1 xb yb 0) )
(opponent nil ) )
( wf 6 (b (+ xb 3) yb)
(myteam nil (P1 (+ xb 3) yb 0) )
(opponent nil ) )
)
)
Implementation