{"title":"Refinement Types for Call-by-name Programs","authors":"Ryosuke Sato","doi":"10.2197/ipsjjip.31.708","DOIUrl":null,"url":null,"abstract":"A refinement type system can be used as a basis of a fully automated verification tool of higher-order functional programs. Most of existing refinement type systems are, however, designed for call-by-value programs, which are unsound for call-by-name programs. In this paper, we introduce a refinement type system for a call-by-name functional language. The most important difference between call-by-value and call-by-name for constructing a refinement type system is whether a variable can be treated as a value or not. The soundness of a typical refinement type systems depends on this fact. On the other hand, in a call-by-name program, since a variable is bound to a term, we cannot treat a variable as a value. To overcome this problem, we track when the term bound to a variable will be evaluated. If we found that a variable is already evaluated in some context, we can treat the variable as a value at the context. We also introduce a type inference algorithm and report on a prototype implementation and preliminary experiments.","PeriodicalId":16243,"journal":{"name":"Journal of Information Processing","volume":"6 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2023-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Information Processing","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.2197/ipsjjip.31.708","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"Computer Science","Score":null,"Total":0}
引用次数: 0
Abstract
A refinement type system can be used as a basis of a fully automated verification tool of higher-order functional programs. Most of existing refinement type systems are, however, designed for call-by-value programs, which are unsound for call-by-name programs. In this paper, we introduce a refinement type system for a call-by-name functional language. The most important difference between call-by-value and call-by-name for constructing a refinement type system is whether a variable can be treated as a value or not. The soundness of a typical refinement type systems depends on this fact. On the other hand, in a call-by-name program, since a variable is bound to a term, we cannot treat a variable as a value. To overcome this problem, we track when the term bound to a variable will be evaluated. If we found that a variable is already evaluated in some context, we can treat the variable as a value at the context. We also introduce a type inference algorithm and report on a prototype implementation and preliminary experiments.