Efficient Dual-Numbers Reverse AD via Well-Known Program Transformations
نویسندگان
چکیده
Where dual-numbers forward-mode automatic differentiation (AD) pairs each scalar value with its tangent value, /reverse-mode/ AD attempts to achieve reverse using a similarly simple idea: by pairing backpropagator function. Its correctness and efficiency on higher-order input languages have been analysed Brunel, Mazza Pagani, but this analysis used custom operational semantics for which it is unclear whether can be implemented efficiently. We take inspiration from their use of /linear factoring/ optimise reverse-mode an algorithm that has the correct complexity enjoys efficient implementation in standard functional language support mutable arrays, such as Haskell. Aside linear factoring ingredient, our optimisation steps consist well-known ideas programming community. demonstrate practical technique providing performant differentiates most Haskell98.
منابع مشابه
Reverse Engineering from Assembler to Formal Specifications via Program Transformations
The FermaT transformation system, based on research carried out over the last sixteen years at Durham University, De Montfort University and Software Migrations Ltd., is an industrial-strength formal transformation engine with many applications in program comprehension and language migration. This paper is a case study which uses automated plus manually-directed transformations and abstractions...
متن کاملTotally correct logic program transformations via well-founded annotations
We address the problem of proving the total correctness of transformations of definite logic programs. We consider a general transformation rule, called clause replacement, which consists in transforming a program P into a new program Q by replacing a set Γ1 of clauses occurring in P by a new set Γ2 of clauses, provided that Γ1 and Γ2 are equivalent in the least Herbrand model M(P) of the progr...
متن کاملDo Program Transformations Help Reverse Engineering?
Program transformations have been advocated as a method for accomplishing reverse engineering. The hypothesis is that the original source code can be progressively transformed into alternative forms, but with the same semantics. At the end of the process, an equivalent program is acquired, but one which is much easier to understand and more maintainable. We have been undertaking an extensive pr...
متن کاملProgram Slicing via FermaT Transformations
In this paper we give a brief introduction to the foundations of WSL transformation theory and describe how the concept of program slicing can be formalised in the theory. This formalism naturally lends itself to several generalisations including amorphous slicing and conditioned slicing. One novel generalisation is “semantic slicing” which combines slicing and abstraction to a specification. I...
متن کاملWell-founded Abduction via Tabled Dual Programs
Abductive Logic Programming ooers a formalism to declaratively express and solve problems in areas such as diagnosis, planning, belief revision and hypothetical reasoning. Tabled Logic Programming ooers a computational mechanism that provides a level of declarativity above that of Prolog, and which has supported successful applications in elds such as parsing, program analysis, and model checki...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
ژورنال
عنوان ژورنال: Proceedings of the ACM on programming languages
سال: 2023
ISSN: ['2475-1421']
DOI: https://doi.org/10.1145/3571247