“…However, the idea was popularized only more recently by Pierce and Turner [38]. The technique has shown great applicability-it has been used for dependent types [17], indexed refinement types [44,45], intersection and union types [21,25], higher-rank polymorphism [23,24,35], contextual modal types [37], algebraic effect handlers [30] and gradual typing [42]. Our approach is inspired by many of these papers, in particular DML [44,45], but departs in the technical design of the algorithmic type system due to new challenges offered by relational and modal types, and costs.…”