Introducing Type Properties

06/15/2021
by   Aziz Akhmedkhodjaev, et al.
0

In type theory, we can express many practical ideas by attributing some additional data to expressions we operate on during compilation. For instance, some substructural type theories augment variables' typing judgments with the information of their usage. That is, they allow one to explicitly state how many times - 0, 1, or many - a variable can be used. This solves the problem of resource usage control and allows us to treat variables as resources. What's more, it often happens that this attributed information is interpreted (used) during the same compilation and erased before we run a program. A case in the point is that in the same substructural type theories, their type checkers use these 0, 1, or many, to ensure that all variables are used as many times as these attributions say them to be. Yet, there wasn't any programming language concept whose concern would be to allow a programmer to express these attributions in the language itself. That is, to let the programmer express which data the one wants to attribute to what expressions and, most importantly, the meaning of the attributed data in their program. As it turned out, the presence of such a concept allows us to express many practical ideas in the language itself. For instance, with appropriate means for assigning the meaning of these attributions, this concept would allow one to express linear types as functionality in a separate program module, without the need to refine the whole type system to add them. In this paper, we present such a concept - we propose type properties. It allows a programmer to express these attributions while fulfilling the requirement of being fully on the static level. That is, it allows one to express how to interpret these attributions during compilation and erases them before a program is passed to the runtime.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/01/2021

Idris 2: Quantitative Type Theory in Practice

Dependent types allow us to express precisely what a function is intende...
research
02/01/2019

Quantum Hoare Logic with Ghost Variables

Quantum Hoare logic allows us to reason about quantum programs. We prese...
research
07/02/2022

Sikkel: Multimode Simple Type Theory as an Agda Library

Many variants of type theory extend a basic theory with additional primi...
research
05/26/2019

Programming with Applicative-like expressions

The fact that Applicative type class allows one to express simple parser...
research
08/02/2019

The meaning of a program change is a change to the program's meaning

Programming is the activity of modifying a program in order to bring abo...
research
10/15/2021

Zipping Strategies and Attribute Grammars

Strategic term rewriting and attribute grammars are two powerful program...
research
03/23/2021

Row-Polymorphic Types for Strategic Rewriting

We present a type system for strategy languages that express program tra...

Please sign up or login with your details

Forgot password? Click here to reset