gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Looking for a good type propagation algorithm


From: Camm Maguire
Subject: [Gcl-devel] Looking for a good type propagation algorithm
Date: 14 Sep 2005 16:24:09 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!  As many may know, GCL autodeclares constant let bindings,
and this allows for many optimizations to proceed.  We could also
autodeclare bindings which are changed, but changed to a subtype of
the original type, let alone autodeclaring loop counters after
checking loop bounds, etc.  

The problem is that I cannot think of a decent algorithm which is not
exponential in the let form nesting.  I.e., start by setting the
variable types to the type of the initializing form in the outermost
let, then using these settings, do likewise for all sub-lets, until
one hits the setq, at which point one can determine whether the setq
preserves the type.  Otherwise, mark the type as t (could
alternatively iterate with `(or ,type ,setq-type)), and then process
the outer let for real.  The outermost let is processed twice, the
next innermost four times, etc.

Anyone know of a better algorithm?  I was thinking about just one
pass, and building up a network of linked type-setter functions as you
go, but this appears too ambitious at present.

Take care,
-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]