{"title":"Exception Handling and Classical Logic","authors":"S. V. Bakel","doi":"10.1145/3354166.3354186","DOIUrl":null,"url":null,"abstract":"We present λtry, an extension of the λ-calculus with named exception handling, via try, throw and catch, and present a basic notion of type assignment expressing recoverable exception handling and show that it is sound. We define an interpretation for λtry to Parigot's λμ-calculus, and show that reduction (both lazy and call by value) is preserved by the interpretation. We will show that also types assignable in the basic system are preserved by the interpretation. We will then add a notion of total failure through halt that escapes applicative contexts without being caught by a handler, and show that we can interpret this in λμ when adding top as destination. We will argue that introducing handlers for halt will break the relation with λμ. We will conclude the paper by showing that it is possible to add handlers for program failure by introducing panic and dedicated handlers to λtry. We will need to extend the language with a conditional construct that is typed in a non-traditional way, that cannot be expressed in λμ or logic. This will allow both recoverable exceptions and total failure, dealt with by handlers; we will show a non-standard soundness result for this system.","PeriodicalId":182058,"journal":{"name":"Proceedings of the 21st International Symposium on Principles and Practice of Declarative Programming","volume":"12 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-10-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 21st International Symposium on Principles and Practice of Declarative Programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3354166.3354186","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1
Abstract
We present λtry, an extension of the λ-calculus with named exception handling, via try, throw and catch, and present a basic notion of type assignment expressing recoverable exception handling and show that it is sound. We define an interpretation for λtry to Parigot's λμ-calculus, and show that reduction (both lazy and call by value) is preserved by the interpretation. We will show that also types assignable in the basic system are preserved by the interpretation. We will then add a notion of total failure through halt that escapes applicative contexts without being caught by a handler, and show that we can interpret this in λμ when adding top as destination. We will argue that introducing handlers for halt will break the relation with λμ. We will conclude the paper by showing that it is possible to add handlers for program failure by introducing panic and dedicated handlers to λtry. We will need to extend the language with a conditional construct that is typed in a non-traditional way, that cannot be expressed in λμ or logic. This will allow both recoverable exceptions and total failure, dealt with by handlers; we will show a non-standard soundness result for this system.