Journal of Information Processing
Online ISSN : 1882-6652
ISSN-L : 1882-6652
 
Conjuring Fusion Laws via Relational Calculus
Akimasa Morihata
Author information
JOURNAL FREE ACCESS

2023 Volume 31 Pages 21-32

Details
Abstract

Wadler demonstrated that several laws, called “free theorems”, about polymorphic functions can be derived from their types alone. Free theorems form the foundations of many program transformations, including function fusions particularly. Walder's approach requires systematic but cumbersome reasoning, which makes it difficult for non-experts to apply. To alleviate this problem, Voigtländer proposed a conjuring lemma. This lemma derives free theorems from an expression containing polymorphic functions but whose type does not contain polymorphic type variables. Unfortunately, it cannot derive function fusion laws. In this work, we generalize the conjuring lemma on the basis of Bird and de Moor's relational calculus. This calculus uses non-deterministic computations for uniformly describing and thereby relating specifications and implementations. To make the generalized conjuring lemma easier to use, we develop simpler corollaries by borrowing intuitions from the worker/wrapper transformations. The effectiveness of our approach is demonstrated through experiments with the derivation of three well-known fusion laws. While the original conjuring lemma cannot derive any of them, the generalization can systematically derive all.

Content from these authors
© 2023 by the Information Processing Society of Japan
Previous article Next article
feedback
Top