{'fraction_non_alphanumeric': 0.0700280112044818, 'fraction_numerical': 0.006535947712418301, 'mean_word_length': 4.702127659574468, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Syntax-Directed Derivative Code (Part II: Intraprocedural Adjoint Code)

This is the second instance in a series of papers on single-pass generation of derivative codes by syntax-directed translation. We consider the automatic generation of adjoint code by reverse 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 approach offers all advantages of adjoint codes while exhibiting the highly desirable ease of implementation. 1 Motivation and Summary of Results In this paper we present a method for generating adjoint versions of numerical simulation programs that implement vector functions F : IR → IR, y = F (x), x = (xk)k=1,...,n, y = (yl)l=1,...,m, (1) automatically by syntax-directed translation. The resulting adjoint programs F̄ = F̄ (x, ȳ) compute adjoints x̄, that is, products of the transposed of the Jacobian matrix F ′ = (f ′ l,k) l=1,...,m k=1,...,n ≡ (