Sat Mar 23 12:02:54 EDT 2013

Problem in ai-freq.rkt

All linear nodes need to be z-dependent, so should be implemented as
functions.  Looks like the current implementation is wrong.

It can probably be fixed, but needs a little bit of rewrite.  It would
be best to separate the type inference, since that could take into
account some global information.  However, this requires to solve the
annotation problem: the language is pretty much functional (input ->
output), so it's not clear how to make it into something that is
(input, input-type, output-type -> output).  It is like a
transformation of prog into (environ -> prog).  EDIT: no, it's
probably enough to type-analyze the whole program and then just feed
the correct type into the new ai-freq.

EDIT: The trick is to indeed represent linear variables as z->amp, and
use some memoization to avoid having to evaluate all matrices whenever
z changes.

EDIT: I also removed the dependency on the linpar type inference.
This can still be used separately as a whole-program analysis, to
automatically determine L/P distinction.  For ai-freq it now needs to
be passed in correctly or it will trigger a type error.