Syntax-Directed Derivative Code (Part I: Tangent-Linear Code)
Uwe Naumann
This is the first instance in a series of papers on single-pass generation
of various types of derivative code by syntax-directed translation.
We consider the automatic generation of tangent-linear code by forward
mode automatic differentiation implemented as the bottom-up propagation
of synthesized attributes on the abstract syntax tree. A proof-of-concept
implementation is presented based on a simple LALR(1) parser generated
by the parser generator bison. The proposed technique can be generalized
easily to provide a method for computing directional derivatives of
mathematical vector functions that are implemented as computer programs
in the context of computer algebra systems and compilers for scientific
computing. The main advantage of the syntax-directed approach to automatic
differentiation is its elegance in terms of the implementation.