R&S HUI wrote:
> Please elaborate on benefit 3:
>
>    3. There is some prospect of being able to do symbolic
>    calculations efficiently.
>

One type of problem memoization solves easily is recognition of common
subexpressions as in symbolic computation and compiler design.  In the
simplest form of this, we want to replace the binary tree

       *
     /   \
    +     +
   / \   / \
  a   b a   b

by the directed acyclic subgraph

       *
      / \
      \ /
       +
      / \
     a   b

This is traditionally achieved by the "value number" method, pioneered
by Cocke and Schwartz, where the value at a node corresponds to a hash
table index.  Memoization provides a more transparent
interface.

Please note that I am not criticizing J, nor suggesting that this kind
of thing cannot be done within the existing implementation.  I am also
talking about symbolic calculations in the sense of languages like
Maple, not the symbolic calculations that J already does.


Best wishes,

John

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to