{"title":"On the Fair Termination of Client-Server Sessions","authors":"L. Padovani","doi":"10.48550/arXiv.2212.05457","DOIUrl":"https://doi.org/10.48550/arXiv.2212.05457","url":null,"abstract":"Client-server sessions are based on a variation of the traditional interpretation of linear logic propositions as session types in which non-linear channels (those regulating the interaction between a pool of clients and a single server) are typed by coexponentials instead of the usual exponentials. Coexponentials enable the modeling of racing interactions, whereby clients compete to interact with a single server whose internal state (and thus the offered service) may change as the server processes requests sequentially. In this work we present a fair termination result for CSLL$^infty$, a core calculus of client-server sessions. We design a type system such that every well-typed term corresponds to a valid derivation in $mu$MALL$^infty$, the infinitary proof theory of linear logic with least and greatest fixed points. We then establish a correspondence between reductions in the calculus and principal reductions in $mu$MALL$^infty$. Fair termination in CSLL$^infty$ follows from cut elimination in $mu$MALL$^infty$.","PeriodicalId":131421,"journal":{"name":"Types for Proofs and Programs","volume":"272 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2022-12-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"116068506","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Type Theory with Explicit Universe Polymorphism","authors":"M. Bezem, T. Coquand, P. Dybjer, M. Escard'o","doi":"10.4230/LIPIcs.TYPES.2022.13","DOIUrl":"https://doi.org/10.4230/LIPIcs.TYPES.2022.13","url":null,"abstract":"The aim of this paper is to refine and extend proposals by Sozeau and Tabareau and by Voevodsky for universe polymorphism in type theory. In those systems judgments can depend on explicit constraints between universe levels. We here present a system where we also have products indexed by universe levels and by constraints. Our theory has judgments for internal universe levels, built up from level variables by a successor operation and a binary supremum operation, and also judgments for equality of universe levels.","PeriodicalId":131421,"journal":{"name":"Types for Proofs and Programs","volume":"22 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2022-12-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"123822866","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"A Univalent Formalization of Constructive Affine Schemes","authors":"Max Zeuner, Anders Mörtberg","doi":"10.4230/LIPIcs.TYPES.2022.14","DOIUrl":"https://doi.org/10.4230/LIPIcs.TYPES.2022.14","url":null,"abstract":"We present a formalization of constructive affine schemes in the Cubical Agda proof assistant. This development is not only fully constructive and predicative, it also makes crucial use of univalence. By now schemes have been formalized in various proof assistants. However, most existing formalizations follow the inherently non-constructive approach of Hartshorne's classic\"Algebraic Geometry\"textbook, for which the construction of the so-called structure sheaf is rather straightforwardly formalizable and works the same with or without univalence. We follow an alternative approach that uses a point-free description of the constructive counterpart of the Zariski spectrum called the Zariski lattice and proceeds by defining the structure sheaf on formal basic opens and then lift it to the whole lattice. This general strategy is used in a plethora of textbooks, but formalizing it has proved tricky. The main result of this paper is that with the help of the univalence principle we can make this\"lift from basis\"strategy formal and obtain a fully formalized account of constructive affine schemes.","PeriodicalId":131421,"journal":{"name":"Types for Proofs and Programs","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2022-12-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"121247283","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Fahad F. Alhabardi, A. Beckmann, B. Lazar, A. Setzer
{"title":"Verification of Bitcoin Script in Agda Using Weakest Preconditions for Access Control","authors":"Fahad F. Alhabardi, A. Beckmann, B. Lazar, A. Setzer","doi":"10.4230/LIPIcs.TYPES.2021.1","DOIUrl":"https://doi.org/10.4230/LIPIcs.TYPES.2021.1","url":null,"abstract":"This paper contributes to the verification of programs written in Bitcoin’s smart contract language script in the interactive theorem prover Agda. It focuses on the security property of access control for script programs that govern the distribution of Bitcoins. It advocates that weakest preconditions in the context of Hoare triples are the appropriate notion for verifying access control. It aims at obtaining human-readable descriptions of weakest preconditions in order to close the validation gap between user requirements and formal specification of smart contracts. As examples for the proposed approach, the paper focuses on two standard script programs that govern the distribution of Bitcoins, Pay to Public Key Hash (P2PKH) and Pay to Multisig (P2MS) . The paper introduces an operational semantics of the script commands used in P2PKH and P2MS, which is formalised in the Agda proof assistant and reasoned about using Hoare triples. Two methodologies for obtaining human-readable descriptions of weakest preconditions are discussed: (1) a step-by-step approach, which works backwards instruction by instruction through a script, sometimes grouping several instructions together; (2) symbolic execution of the code and translation into a nested case distinction, which allows to read off weakest preconditions as the disjunction of conjunctions of conditions along accepting paths. A syntax for equational reasoning with Hoare Triples is defined in order to formalise those approaches in Agda. Cryptocurrency, Bitcoin, Agda, Verification, Hoare Bitcoin","PeriodicalId":131421,"journal":{"name":"Types for Proofs and Programs","volume":"160 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2022-03-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"122838967","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"On Dynamic Lifting and Effect Typing in Circuit Description Languages (Extended Version)","authors":"Andrea Colledan, Ugo Dal Lago","doi":"10.4230/LIPIcs.TYPES.2022.3","DOIUrl":"https://doi.org/10.4230/LIPIcs.TYPES.2022.3","url":null,"abstract":"In the realm of quantum computing, circuit description languages represent a valid alternative to traditional QRAM-style languages. They indeed allow for finer control over the output circuit, without sacrificing flexibility nor modularity. We introduce a generalization of the paradigmatic lambda-calculus Proto-Quipper-M, itself modeling the core features of the quantum circuit description language Quipper. The extension, called Proto-Quipper-K, is meant to capture a very general form of dynamic lifting. This is made possible by the introduction of a rich type and effect system in which not only computations, but also the very types are effectful. The main results we give for the introduced language are the classic type soundness results, namely subject reduction and progress.","PeriodicalId":131421,"journal":{"name":"Types for Proofs and Programs","volume":"149 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2022-02-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"132551863","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Strictification of weakly stable type-theoretic structures using generic contexts","authors":"Rafael Bocquet","doi":"10.4230/LIPIcs.TYPES.2021.3","DOIUrl":"https://doi.org/10.4230/LIPIcs.TYPES.2021.3","url":null,"abstract":"We present a new strictification method for type-theoretic structures that are only weakly stable under substitution. Given weakly stable structures over some model of type theory, we construct equivalent strictly stable structures by evaluating the weakly stable structures at generic contexts. These generic contexts are specified using the categorical notion of familial representability. This generalizes the local universes method of Lumsdaine and Warren. We show that generic contexts can also be constructed in any category with families which is freely generated by collections of types and terms, without any definitional equality. This relies on the fact that they support first-order unification. These free models can only be equipped with weak type-theoretic structures, whose computation rules are given by typal equalities. Our main result is that any model of type theory with weakly stable weak type-theoretic structures admits an equivalent model with strictly stable weak type-theoretic structures.","PeriodicalId":131421,"journal":{"name":"Types for Proofs and Programs","volume":"69 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2021-11-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"127258135","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Encoding of Predicate Subtyping with Proof Irrelevance in the λΠ-Calculus Modulo Theory","authors":"Gabriel Hondet, F. Blanqui","doi":"10.4230/LIPIcs.TYPES.2020.6","DOIUrl":"https://doi.org/10.4230/LIPIcs.TYPES.2020.6","url":null,"abstract":"The $lambda$$Pi$-calculus modulo theory is a logical framework in which various logics and type systems can be encoded, thus helping the cross-verification and interoperability of proof systems based on those logics and type systems. In this paper, we show how to encode predicate subtyping and proof irrelevance, two important features of the PVS proof assistant. We prove that this encoding is correct and that encoded proofs can be mechanically checked by Dedukti, a type checker for the $lambda$$Pi$-calculus modulo theory using rewriting.","PeriodicalId":131421,"journal":{"name":"Types for Proofs and Programs","volume":"104 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2021-10-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"124672770","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"A Machine-Checked Proof of Birkhoff's Variety Theorem in Martin-Löf Type Theory","authors":"William DeMeo, J. Carette","doi":"10.4230/LIPIcs.TYPES.2021.4","DOIUrl":"https://doi.org/10.4230/LIPIcs.TYPES.2021.4","url":null,"abstract":"The Agda Universal Algebra Library is a project aimed at formalizing the foundations of universal algebra, equational logic and model theory in dependent type theory using Agda. In this paper we draw from many components of the library to present a self-contained, formal, constructive proof of Birkhoff’s HSP theorem in Martin-Löf dependent type theory. This achieves one of the project’s initial goals: to demonstrate the expressive power of inductive and dependent types for representing and reasoning about general algebraic and relational structures by using them to formalize a significant theorem in the field. Acknowledgements This work would not have been possible without the wonderful Agda language and the Agda Standard Library , developed and maintained by The Agda Team [21]. We thank the three anonymous referees for carefully reading the manuscript and offering many excellent suggestions which resulted in a vast improvement in the overall presentation. One referee went above and beyond and provided us with a simpler formalization of free algebras which led to simplifications of the proof of the main theorem. We are extremely grateful for this.","PeriodicalId":131421,"journal":{"name":"Types for Proofs and Programs","volume":"10 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2021-01-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114803550","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Extending Equational Monadic Reasoning with Monad Transformers","authors":"Reynald Affeldt, David Nowak","doi":"10.4230/LIPIcs.TYPES.2020.2","DOIUrl":"https://doi.org/10.4230/LIPIcs.TYPES.2020.2","url":null,"abstract":"There is a recent interest for the verification of monadic programs using proof assistants. This line of research raises the question of the integration of monad transformers, a standard technique to combine monads. In this paper, we extend Monae, a Coq library for monadic equational reasoning, with monad transformers and we explain the benefits of this extension. Our starting point is the existing theory of modular monad transformers, which provides a uniform treatment of operations. Using this theory, we simplify the formalization of models in Monae and we propose an approach to support monadic equational reasoning in the presence of monad transformers. We also use Monae to revisit the lifting theorems of modular monad transformers by providing equational proofs and explaining how to patch a known bug with a non-standard use of Coq that combines impredicative polymorphism and parametricity.","PeriodicalId":131421,"journal":{"name":"Types for Proofs and Programs","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2020-11-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114215593","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Coinductive Proof Search for Polarized Logic with Applications to Full Intuitionistic Propositional Logic","authors":"J. E. Santo, R. Matthes, L. Pinto","doi":"10.4230/LIPIcs.TYPES.2020.4","DOIUrl":"https://doi.org/10.4230/LIPIcs.TYPES.2020.4","url":null,"abstract":"The approach to proof search dubbed\"coinductive proof search\", and previously developed by the authors for implicational intuitionistic logic, is in this paper extended to LJP, a focused sequent-calculus presentation of polarized intuitionistic logic, including an array of positive and negative connectives. As before, this includes developing a coinductive description of the search space generated by a sequent, an equivalent inductive syntax describing the same space, and decision procedures for inhabitation problems in the form of predicates defined by recursion on the inductive syntax. We prove the decidability of existence of focused inhabitants, and of finiteness of the number of focused inhabitants for polarized intuitionistic logic, by means of such recursive procedures. Moreover, the polarized logic can be used as a platform from which proof search for other logics is understood. We illustrate the technique with LJT, a focused sequent calculus for full intuitionistic propositional logic (including disjunction). For that, we have to work out the\"negative translation\"of LJT into LJP (that sees all intuitionistic types as negative types), and verify that the translation gives a faithful representation of proof search in LJT as proof search in the polarized logic. We therefore inherit decidability of both problems studied for LJP and thus get new proofs of these results for LJT.","PeriodicalId":131421,"journal":{"name":"Types for Proofs and Programs","volume":"73 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2020-07-31","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"116702312","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}