{"title":"通过还原到终止验证来验证功能程序的生产率","authors":"Ren Fukaishi, Naoki Kobayashi, Ryosuke Sato","doi":"10.1145/3635800.3636963","DOIUrl":null,"url":null,"abstract":"A program generating a co-inductive data structure is called productive if the program eventually generates all the elements of the data structure. We propose a new method for verifying the productivity, which transforms a co-inductive data structure into a function that takes a path as an argument and returns the corresponding element. For example, an infinite binary tree is converted to a function that takes a sequence consisting of 0 (left) and 1 (right), and returns the element in the specified position, and a stream is converted into a function that takes a sequence of the form 0^n (or, simply a natural number n) and returns the n-th element of the stream. A stream-generating program is then productive just if the function terminates for every n. The transformation allows us to reduce the productivity verification problem to the termination problem for call-by-name higher-order functional programs without co-inductive data structures. We formalize the transformation and prove its correctness. We have implemented an automated productivity checker based on the proposed method, by extending an automated HFL(Z) validity checker, which can be used as a termination checker.","PeriodicalId":516782,"journal":{"name":"Proceedings of the 2024 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation","volume":"53 2","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-01-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Productivity Verification for Functional Programs by Reduction to Termination Verification\",\"authors\":\"Ren Fukaishi, Naoki Kobayashi, Ryosuke Sato\",\"doi\":\"10.1145/3635800.3636963\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"A program generating a co-inductive data structure is called productive if the program eventually generates all the elements of the data structure. We propose a new method for verifying the productivity, which transforms a co-inductive data structure into a function that takes a path as an argument and returns the corresponding element. For example, an infinite binary tree is converted to a function that takes a sequence consisting of 0 (left) and 1 (right), and returns the element in the specified position, and a stream is converted into a function that takes a sequence of the form 0^n (or, simply a natural number n) and returns the n-th element of the stream. A stream-generating program is then productive just if the function terminates for every n. The transformation allows us to reduce the productivity verification problem to the termination problem for call-by-name higher-order functional programs without co-inductive data structures. We formalize the transformation and prove its correctness. We have implemented an automated productivity checker based on the proposed method, by extending an automated HFL(Z) validity checker, which can be used as a termination checker.\",\"PeriodicalId\":516782,\"journal\":{\"name\":\"Proceedings of the 2024 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation\",\"volume\":\"53 2\",\"pages\":\"\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-01-11\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Proceedings of the 2024 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/3635800.3636963\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 2024 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3635800.3636963","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
摘要
如果生成共线性数据结构的程序最终生成了该数据结构的所有元素,那么该程序就被称为有生产力的程序。我们提出了一种验证生产率的新方法,它将共归纳数据结构转换为一个函数,该函数以路径为参数,并返回相应的元素。例如,将一棵无限二叉树转换为一个函数,该函数接收一个由 0(左)和 1(右)组成的序列,并返回指定位置上的元素;将一个流转换为一个函数,该函数接收一个形式为 0^n 的序列(或简单地接收一个自然数 n),并返回流中的第 n 个元素。通过这种转换,我们可以将生产率验证问题简化为没有共归纳数据结构的逐名调用高阶函数式程序的终止问题。我们形式化了这种转换,并证明了它的正确性。我们基于所提出的方法,通过扩展自动 HFL(Z) 有效性检查器,实现了一个自动生产率检查器,它可以用作终止检查器。
Productivity Verification for Functional Programs by Reduction to Termination Verification
A program generating a co-inductive data structure is called productive if the program eventually generates all the elements of the data structure. We propose a new method for verifying the productivity, which transforms a co-inductive data structure into a function that takes a path as an argument and returns the corresponding element. For example, an infinite binary tree is converted to a function that takes a sequence consisting of 0 (left) and 1 (right), and returns the element in the specified position, and a stream is converted into a function that takes a sequence of the form 0^n (or, simply a natural number n) and returns the n-th element of the stream. A stream-generating program is then productive just if the function terminates for every n. The transformation allows us to reduce the productivity verification problem to the termination problem for call-by-name higher-order functional programs without co-inductive data structures. We formalize the transformation and prove its correctness. We have implemented an automated productivity checker based on the proposed method, by extending an automated HFL(Z) validity checker, which can be used as a termination checker.