[comp.object] Reflective Languages

morrison@cs.ubc.ca (Rick Morrison) (07/21/90)

There have been several references to reflective languages here recently
including at least one posting claiming to provide a definition.
Now, I'm hardly prepared to admit the existence of programs that can
"reason" about gray elephants or birds that don't fly, let alone themselves.
Would someone please provide a concrete example of the application of
reflective capabilities in a language that supports such. In particular,
it would be useful to highlight why the task cannot be accomplished
in a "conventional" language.

If I squint my eyes and don't look too closely the idea sounds interesting,
but at the moment I have the uneasy feeling that reflection is yet 
another AI boondoggle for attracting research bucks.
------------------------------
Rick Morrison		 | {alberta,uw-beaver,uunet}!ubc-cs!morrison
Dept. of Computer Science| morrison@cs.ubc.ca
Univ. of British Columbia| morrison%ubc.csnet@csnet-relay.arpa
Vancouver, B.C. V6T 1W5  | morrison@ubc.csnet (ubc-csgrads=137.82.8.20)
(604) 228-5010

oz@yunexus.yorku.ca (Ozan Yigit) (07/21/90)

In article <8800@ubc-cs.UUCP> morrison@cs.ubc.ca (Rick Morrison) writes:
>There have been several references to reflective languages here recently
>including at least one posting claiming to provide a definition.

There has been quite a bit of work on this by some folks at Indiana U:
Wand, Friedman etc. The last ref may be especially of interest: it is
a whole book of papers on the topic. enjoy..	oz

%A Daniel P. Friedman
%A Mitchell Wand
%T Reification: reflection without metaphysics
%J Conference Record of the 1984 ACM Symposium on LISP and Functional
Programming
%C Austin, TX.
%P 348-355
%D August 1984

%A Mitchell Wand
%A Daniel P. Friedman
%T The Mystery of the Tower Revealed: A Non-Reflective
Description of the Reflective Tower
%B Meta-Level Architectures and Reflection
%E P. Maes and D. Nardi
%I Elsevier Sci. Publishers B.V. (North Holland)
%P 111-134
%D 1988
%O Also to appear in Lisp and Symbolic Computation

mhi@edsdrd.eds.com (Mamdouh Ibrahim) (07/26/90)

In article <8800@ubc-cs.UUCP>, morrison@cs.ubc.ca (Rick Morrison) writes:
> There have been several references to reflective languages here recently
> including at least one posting claiming to provide a definition.
> Now, I'm hardly prepared to admit the existence of programs that can
> "reason" about gray elephants or birds that don't fly, let alone themselves.
> Would someone please provide a concrete example of the application of
> reflective capabilities in a language that supports such. In particular,
> it would be useful to highlight why the task cannot be accomplished
> in a "conventional" language.
 

Although reflective languages are not fully matured yet, the research in this 
area has provided interesting results. For example, meta-rules [1,5] in rule-
based languages have knowledge about the structure of problem-domain rules 
that constitute the program code. The interpreter of these languages can 
invoke the meta-rules to control the execution of rules or generate new ones 
during computation. The same approach is applicable to object-oriented 
languages. Metalevel structures-- metaobjects and metaclasses in object-
oriented languages--provide reflective capabilities that can monitor the 
activities of problem-domain objects and control their behavior [2,6,7].


Another application of reflective capabilities of a language is to facilitate 
language extensions to support other programming paradigms [3,4]. Reflection in
this language is the result of representing both the language constructs and 
their evaluation behaviors as objects. The language was then easily extended 
to add rule-based and logic programming by defining new constructs and 
their corresponding behavior objects. Extensibility of non-reflective 
languages, though possible, requires modification of the language internals 
by the language designer and not the user of the language.

In addition, reflective languages provide natural debugging and tracing 
facilities as part of the language and not as facilities supplied by the 
external environment as is the case with non-reflective languages. 

However, the most important impact of reflective languages has not yet been 
explored. Research in machine learning must eventually take advantage of the 
reflective capabilities of programming languages in order to allow programs 
to modify themselves dynamically as they learn.


> If I squint my eyes and don't look too closely the idea sounds interesting,
> but at the moment I have the uneasy feeling that reflection is yet 
> another AI boondoggle for attracting research bucks.


If the idea is interesting we should not stop researching it just because it 
seems difficult to achieve. After all, not long ago the idea of putting a man 
on the moon was considered an unrealistic dream.


[1] Davis, R. and Lenat, D., Knowledge-Based systems in Artificial
Intelligence,
    McGraw-Hill, NY,1982.
    
[2] Ibrahim, M. H. and Cummins, F. A., "KSL: A Reflective Object-Oriented
    Programming Language," Proceedings of the IEEE Computer Society 
    International Conference on Computer Languages, 1988, pp. 186-193.

[3] Ibrahim, M. H. and Cummins, F. A., "KSL/Logic: Integration of Logic with
    Objects," Proceedings of the IEEE Computer Society International Conference

    on Computer Languages, 1990, pp. 228-235.

[4] Ibrahim, M. H. and Woyak, S. W., "An Object-Oriented Environment for 
    Multiple AI Paradigms," To appear in the Second IEEE Computer Society 
    International Conference on Tools for Artificial Intelligence, Washington
    DC, November, 1990.

[5] Laird, J., Rosenbloom, P., and Newell, A., "Chunking in SOAR: The Anatomy
    of General Learning Mechanism," Machine Learning, Vol. 1, No. 1, Kluwer
    Academic Publishers, 1986.

[6] Maes, P., "Concepts and Experiments in Computational Reflection,"
    Proccedings of OOPSLA '87, 1987, pp. 147-155.

[7] Watanabe, T. and Yonezawa, A., "Reflection in an Object-Oriented Concurrent

    Language," Proceedings of OOPSLA '88, 1988, pp. 306-315.


Mamdouh H. Ibrahim - EDS Research & Development
                     3551 Hamlin Rd., 4th Floor
                     Auburn Hills, MI 48057
                     (313) 370-1629
	             mhi@edsdrd.eds.com