A modal typing system for self-referential programs and specifications

Hiroshi Nakano
DOI: https://doi.org/10.48550/arXiv.1703.09907
2017-03-29
Abstract:This paper proposes a modal typing system that enables us to handle self-referential formulae, including ones with negative self-references, which on one hand, would introduce a logical contradiction, namely Russell's paradox, in the conventional setting, while on the other hand, are necessary to capture a certain class of programs such as fixed-point combinators and objects with so-called binary methods in object-oriented programming. The proposed system provides a basis for axiomatic semantics of such a wider range of programs and a new framework for natural construction of recursive programs in the proofs-as-programs paradigm.
Logic in Computer Science
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: how to handle self - referential programs and specifications in formal systems, especially those formulas with negative self - references. On the one hand, such formulas may lead to logical contradictions (such as Russell's paradox), and on the other hand, they are necessary for representing certain types of programs (for example, fixed - point combinators and binary method objects in object - oriented programming). ### Specific description of the problem 1. **Challenges of recursion and self - reference**: - Recursion (or self - reference) plays an indispensable role in programs and their specifications, but at the same time, it also introduces serious difficulties, especially in the formal treatment of axiomatic semantics (such as formula - as - type construction). - Traditional treatment methods can only capture a very limited class of recursive programs (through inductive proofs), and cannot handle a wider range of programs containing negative self - references (such as fixed - point combinators and binary method objects in object - oriented programming). 2. **Limitations of existing systems**: - Existing type systems (such as λµ - calculus) allow any form of self - reference, including negative self - reference, but this will lead to logical inconsistency (such as Russell's paradox). Therefore, the form of self - reference must be restricted to maintain the soundness of the system. - In these systems, types can only be part of the specification of programs and cannot express the termination of programs, resulting in the loss of program compositionality. ### Goals of the paper The paper proposes a modal typing system, aiming at: - **Handling a wider range of self - referential programs**: including those with negative self - references, which cannot be handled in traditional systems. - **Providing a new framework**: providing a new framework for naturally constructing recursive programs, especially in the "proofs - as - programs" paradigm. - **Ensuring program convergence**: By introducing modal logic, enabling types themselves to express program convergence, thereby restoring program compositionality. ### Main contributions - Proposing a modal type system that allows handling formulas with negative self - references while avoiding logical contradictions. - Providing a new framework for naturally constructing recursive programs and ensuring the convergence of these programs. - Through the layered fixed - point induction scheme, gradually approximating the program specifications, ensuring that each step meets stronger convergence requirements. In summary, this paper attempts to extend existing type systems by introducing modal logic, enabling them to handle a wider range of self - referential programs while ensuring the correctness and convergence of these programs.