{"title":"验证基于效果处理程序的逐运行定义反向模式AD库","authors":"Paulo Emílio de Vilhena, François Pottier","doi":"10.46298/lmcs-19(4:5)2023","DOIUrl":null,"url":null,"abstract":"We apply program verification technology to the problem of specifying and verifying automatic differentiation (AD) algorithms. We focus on define-by-run, a style of AD where the program that must be differentiated is executed and monitored by the automatic differentiation algorithm. We begin by asking, \"what is an implementation of AD?\" and \"what does it mean for an implementation of AD to be correct?\" We answer these questions both at an informal level, in precise English prose, and at a formal level, using types and logical assertions. After answering these broad questions, we focus on a specific implementation of AD, which involves a number of subtle programming-language features, including dynamically allocated mutable state, first-class functions, and effect handlers. We present a machine-checked proof, expressed in a modern variant of Separation Logic, of its correctness. We view this result as an advanced exercise in program verification, with potential future applications to the verification of more realistic automatic differentiation systems and of other software components that exploit delimited-control effects.","PeriodicalId":49904,"journal":{"name":"Logical Methods in Computer Science","volume":"33 3","pages":"0"},"PeriodicalIF":0.6000,"publicationDate":"2023-10-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":"{\"title\":\"Verifying an Effect-Handler-Based Define-By-Run Reverse-Mode AD Library\",\"authors\":\"Paulo Emílio de Vilhena, François Pottier\",\"doi\":\"10.46298/lmcs-19(4:5)2023\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"We apply program verification technology to the problem of specifying and verifying automatic differentiation (AD) algorithms. We focus on define-by-run, a style of AD where the program that must be differentiated is executed and monitored by the automatic differentiation algorithm. We begin by asking, \\\"what is an implementation of AD?\\\" and \\\"what does it mean for an implementation of AD to be correct?\\\" We answer these questions both at an informal level, in precise English prose, and at a formal level, using types and logical assertions. After answering these broad questions, we focus on a specific implementation of AD, which involves a number of subtle programming-language features, including dynamically allocated mutable state, first-class functions, and effect handlers. We present a machine-checked proof, expressed in a modern variant of Separation Logic, of its correctness. We view this result as an advanced exercise in program verification, with potential future applications to the verification of more realistic automatic differentiation systems and of other software components that exploit delimited-control effects.\",\"PeriodicalId\":49904,\"journal\":{\"name\":\"Logical Methods in Computer Science\",\"volume\":\"33 3\",\"pages\":\"0\"},\"PeriodicalIF\":0.6000,\"publicationDate\":\"2023-10-23\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"1\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Logical Methods in Computer Science\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.46298/lmcs-19(4:5)2023\",\"RegionNum\":4,\"RegionCategory\":\"数学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q4\",\"JCRName\":\"COMPUTER SCIENCE, THEORY & METHODS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Logical Methods in Computer Science","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.46298/lmcs-19(4:5)2023","RegionNum":4,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
Verifying an Effect-Handler-Based Define-By-Run Reverse-Mode AD Library
We apply program verification technology to the problem of specifying and verifying automatic differentiation (AD) algorithms. We focus on define-by-run, a style of AD where the program that must be differentiated is executed and monitored by the automatic differentiation algorithm. We begin by asking, "what is an implementation of AD?" and "what does it mean for an implementation of AD to be correct?" We answer these questions both at an informal level, in precise English prose, and at a formal level, using types and logical assertions. After answering these broad questions, we focus on a specific implementation of AD, which involves a number of subtle programming-language features, including dynamically allocated mutable state, first-class functions, and effect handlers. We present a machine-checked proof, expressed in a modern variant of Separation Logic, of its correctness. We view this result as an advanced exercise in program verification, with potential future applications to the verification of more realistic automatic differentiation systems and of other software components that exploit delimited-control effects.
期刊介绍:
Logical Methods in Computer Science is a fully refereed, open access, free, electronic journal. It welcomes papers on theoretical and practical areas in computer science involving logical methods, taken in a broad sense; some particular areas within its scope are listed below. Papers are refereed in the traditional way, with two or more referees per paper. Copyright is retained by the author.
Topics of Logical Methods in Computer Science:
Algebraic methods
Automata and logic
Automated deduction
Categorical models and logic
Coalgebraic methods
Computability and Logic
Computer-aided verification
Concurrency theory
Constraint programming
Cyber-physical systems
Database theory
Defeasible reasoning
Domain theory
Emerging topics: Computational systems in biology
Emerging topics: Quantum computation and logic
Finite model theory
Formalized mathematics
Functional programming and lambda calculus
Inductive logic and learning
Interactive proof checking
Logic and algorithms
Logic and complexity
Logic and games
Logic and probability
Logic for knowledge representation
Logic programming
Logics of programs
Modal and temporal logics
Program analysis and type checking
Program development and specification
Proof complexity
Real time and hybrid systems
Reasoning about actions and planning
Satisfiability
Security
Semantics of programming languages
Term rewriting and equational logic
Type theory and constructive mathematics.