140 likes | 153 Views
Exploring the concepts, architectures, and applications of computational reflection, including reflective systems, use of reflection for debugging, reasoning, and self-modification, existing reflective architectures like 3-LISP, FOL, and TEIRESIAS, declarative reflection, and the motivations for reflection in OOL. This text presents examples of reflective architecture in Object-Oriented Languages (OOL), such as SMALLTALK-72, SMALLTALK-80, and the architecture in 3-KRS, showcasing how self-representation and reflective capabilities are utilized in various contexts.
E N D
Concepts and Experiments in Computational Reflection Pattie Maes
Computational Reflection • Activity performed by a computational system when doing computations about its own computation.
Reflective system • Incorporates structures representing (aspects of) itself. • The self representation is causally connected to the aspects of the system it represents: • The system has always an accurate representation of itself. • The status and computation of the system are always in compliance with this representation.
Use of reflection • Keep performance statistics • Debugging purposes • Stepping and tracing facilities • Interfacing • Reasoning about control • Self-optimisation • Self-modification • Self-activation
Reflective architecture • Provides tools for handling reflective computations explicitly. • Access to data representing the system itself. • Guarantee the causal connection between these data and the aspects of the system.
Existing reflective architectures • 3-LISP and BROWN: • Introduces the concepts of a reflective function that specifies computation about the currently ongoing computation. • FOL and META-PROLOG: • Uses Meta-theories about the deduction of other theories. • TEIRESIAS and SOAR: • Incorporates Meta-rules that specify computation about ongoing computation.
Existing reflective architectures (cont.) • These languages use a meta-circular interpreter: • A representation of the interpretation of the language which is also used to run the language. • A procedural reflection; a representation of the system in terms of the programs that implements the system. • Procedural reflection has to be designed to provide a good vasis to reason about the system, and it has to be effective and efficient (often contradicting requirements).
Declarative reflection • Self-representation merely consisting of statements about the system. • Does not have to be a complete procedural representation. • Causal connection requirement is more difficult to realise. Interpreter must translate declarative representations into the interpretation-process.
Concepts • The concepts of reflection fits most naturally in the spirit of object orientation. • An important issue is abstraction, an object is free to realise its role in the overall system in whatever way it wants to. • An object not only performs computation about its domain, but also about how it can realize this computation.
Motivations for reflection in OOL • A reflective architecture can be used to create local specialiezd interpreters. • Reflective information can be used to provide documentation, history and explantation facilities. • Keeps track of relation among representations. • Encapsulates value of the data-item. • Guards its status and behaviour.
SMALLTALK-72 and FLAVORS • Ad-hoc reflective facilities in OOL. • Two problems: • Only a fixed set of reflective facilities are supported. • Mixed object-level and reflection-level, which may lead to obscurity. • SMALLTALK-80 introduces meta-classes, but classes still mix information about domain and implementation.
Reflective architecture in OOL • Architecture introduced in KRS, 3-KRS. • Every object has a meta-object. • Structures in an object exclusively represents information about the domain entity that is represented by the object. • The structures in the meta-object contains all the reflective information that is availbale about the object.
Reflective architecture in OOL (cont.) • Self-representation of an OO system is uniform. Every entity is an object, so every aspect of the system can be reflected upon. • 3-KRS proveds a complete self-representation. • Self-representation in a 3-KRS system is consistent. • Self-representation can be modified at run-time, and this has an impact on the run-time computation.
Examples of use of 3-KRS • Tracing • One can temporarily associate a meta-object with a program such that during its evalutation various tracing or stepping utilities are performed. • Local deviating interpreter • Multiple inheritance (not supported by 3-KRS) can be realized by a specialized meta-object.