Oxford2023: Difference between revisions

From ifipwg21
 
Line 271: Line 271:
</blockquote>
</blockquote>


_Analysis of random generators for structured and constrained data_, proposed by Janis Voiglaender.
''Analysis of random generators for structured and constrained data'', proposed by Janis Voiglaender.
<blockquote>
<blockquote>
The motivating example was a Haskell data type encoding (a superset of the
The motivating example was a Haskell data type encoding (a superset of the

Latest revision as of 02:27, 26 November 2024

Meeting Information

The 80th meeting will be organised by Jeremy Gibbons.

Location: Oxford, UK.

For practical information, go to Oxford (practical).

Dates

Monday 2023-07-17 to Friday 2023-07-21. (Meeting starts on Monday morning.)

Participants

Name *Function*
Jeremy Gibbons Organizer
Tom Schrijvers Secretary
Nicolas Wu
Patrik Jansson
Lambert Meertens 🃏
Shin-Cheng Mu
Niki Vazou
Peter Hoefner Chair
Walter Guttmann
Janis Voigtlander
Fritz Henglein
Sam Lindley
Matija Pretnar
Brijesh Dongol
Tarmo Uustalu
Bernhard Moeller
Marcos Viera
Florian Rabe
Annie Liu
James McKinna
Marcos Viera
Alberto Pardo

See also the table of participants on the “practical” page for detailed practical information

Organizational and administrative matters

Friday morning, July 21, 2023.

Membership

These private matters are not recorded in the public version of the minutes.

Formal resolution

The members and observers of IFIP WG2.1 present at Meeting #80 in Oxford in England would like to thank Jeremy Gibbons, Oisin Kidney, Oliver Goldstein, and Juuso Haavisto for organising a wonderful in meeting in sunny Oxford.

We have learnt that Oxford does not only claim ownership of the (asymmetric) comma, but also the equal sign. The group was staggered by the fact that the ordered set of pubs and colleges have more than one smallest (oldest) element; and then there were Ket's Bra and Einstein's Zipper (Punt intended). <verbatim> We are an Ifip Working Group, Discussing programs in a loop. We talk in logic, math and syntax style, when we meet at Kellogg once awhile.</verbatim>

Next meetings:

  • M81 (Apr 2024) Germany.
  • M82 (Dec 2024) Australia.

Technical presentations in scheduled order

Conor !McBride, Types for bricks (Monday, July 17 2023, 11:51 -- 12:35)

TBD

Jeremy Gibbons, Multi-Phase Computation and Choreography (Monday, July 17 2023, 14:01 -- 15:02)

This talk is a follow-up to presentations at online meetings #O07 and #O09. At the first of these, I talked about Richard Bird's circular repmin program and Alberto Pettorossi's non-circular but higher-order variation. At the second, Tom Schrijvers showed an explanation in terms of a construction related to free applicative functors, which provide a model of multi-phase computations. This turned into a at MPC2022 with Oisin Kidney and Nick Wu. I'll summarize that story, and conclude with some speculations about applying a similar technique to choreographic programming. (slides)

Fritz Henglein, Bra-ket notation (Monday, July 17 2023, 15:03 -- 15:29)

TBD

Sam Lindley, Encoding products (Monday, July 17 2023, 16:01 -- 16:28)

Can product types be encoded in simply-typed lambda calculus with base types and function types? I'll show that the answer to this apparently simple question is more nuanced than we might expect.

Niki Vazou, Towards a translation from Liquid Haskell to Coq (Monday, July 17 2023, 16:29 -- 16:57)

Liquid Haskell is a refinement type checker for Haskell programs that can also be used as a theorem prover to mechanically check user-provided proofs. But, theorem proving in Liquid Haskell has two main disadvantages. First, the foundations of Liquid Haskell as a theorem prover have neither been well studied nor formalized. Second, although Liquid Haskell can check proofs, it does not assist in their development. Both these disadvantages will be addressed if Liquid Haskell proofs are translated to Coq. To understand this translation, we started by encoding the ackermann function and related arithmetic theorems in Liquid Haskell and in (to-be-automatically-derived) Coq. In this abstract, we present how we aim to translate 1. types, 2. functions, 3. subtyping, and 4. the refinement logic of Liquid Haskell in Coq.

Annie Liu, Integrating logic rules with everything else, seamlessly (Monday, July 17 2023, 16:59 -- 17:49)

This paper presents a language, Alda, that supports all of logic rules, sets, functions, updates, and objects as seamlessly integrated built-ins. The key idea is to support predicates in rules as set-valued variables that can be used and updated in any scope, and support queries using rules as either explicit or implicit automatic calls to an inference function. We have defined a formal semantics of the language, implemented a prototype compiler that builds on an object-oriented language that supports concurrent and distributed programming and on an efficient logic rule system, and successfully used the language and implementation on benchmarks and problems from a wide variety of application domains. We describe the compilation method and results of experimental evaluation.

Tom Schrijvers, Deriving compilers systematically (Tuesday, July 18 2023, 9:02 -- 9:42)

This work follows up on earlier work by Jeremy Gibbons on systematically deriving a compiler from an interpreter. His work emphasises the role of associativity in the process. Unfortunately the systematic approach behind the appeal to associativity is not presented. We show that we can systematically appeal to associativity using the established Cayley representation approach, but applied to the generalised graded monoid of (n+1)-parameter functions. By generalization to n-parameter functions, we can drop the unit of the monoid but still use the Cayley representation and complete the derivation.

(slides)

Patrik Jansson, Tensors: where linear transformations meet linear types (Tuesday, July 18 2023, 9:42 -- 11:25)

Tensor calculus uses a terse but effective language for expressing physical laws. The tensors are coordinate- independent, geometric objects in multi-linear spaces yet the calculus works with (abstract) coordinates and indices. We use category theory, linear types, and algebraic simplifications to implement two tensor DSLs embedded in Haskell, and the conversions between them. We also provide helper functions to view the tensors in Einstein index notation and as diagrams. Joint work with Jean-Philippe Bernardy.

(slides)

Alberto Pardo, Tabulation with zippers (Tuesday, July 18 2023, 11:25 -- 12:15)

Tabulation is a well-known technique for improving the efficiency of recursive functions with overlapping function calls. A key point in the application of this technique is to find a suitable representation of the table. In this work, we propose the use of zippers as memo tables. To that end we develop a function zipWithZipper that traverses two zippers and can be circular in one of them. The technique turns out to be particularly useful when the arguments to the recursive calls are close to each other in the function domain. We have also defined generic instances of the needed ingredients, in order to avoid the implementation of boilerplate code. This delves, for example, to a concise and efficient zipper-based embedding of attribute grammars.

(slides)

Nicolas Wu, A call for Algol 2030 (Tuesday, July 18 2023, 12:16 -- 12:32)

This talk briefly covers a sketchy history of programming languages, as motivation towards a possible direction for Algol 2030, inspired by Landin's "denotative programming" ideas from his paper on "The Next 700 Programming Languages".

(slides)

Matija Pretnar, Simplifying explicit subtyping (Tuesday, July 18 2023, 16:13 -- 16:57)

Our recent work (Karachalias et al., OOPSLA 2021) has shown that code written using the full flexibility of handlers can be transformed into a pure one that matches the performance of a conventional handcrafted one. However, to do so, the compiler tracks effect information through explicit subtyping coercions, and for polymorphic functions, these need to be passed around as additional parameters. Since subtyping coercions are inferred automatically, their number grows with the size of the program, which drastically reduces the performance. To avoid this, all polymorphic functions need to be annotated with particular types, or monomorphised by the compiler, neither of which is a satisfactory solution. In the talk, I will describe a simple algorithm that drastically, yet soundly, reduces (and often completely eliminates) redundant coercion parameters, leading to a performance comparable to monomorphic code.

(notes)

Shin-cheng Mu, Bottom-up construction of sublist trees (Tuesday, July 18 2023, 17:01 -- 17:39)

Some top-down problem specifications, if executed, may end up computing some sub-problems repeatedly. For such problems we may want a bottom-up algorithm that stores solutions of sub-problems in some table, so they can be reused. How the table should be represented and maintained, however, varies from problems to problems.

In Richard Bird's paper "Zippy tabulations of recursive functions" in MPC 2008, he talked about proving, in general, that a bottom-up algorithm is equivalent to a top-down specification. In the penultimate section, he considered he considered computing a function f :: [A] -> B such that f xs is defined in terms of all immediate sublists of xs. In the bottom-up algorithm he represented the table as a tree and simply presented a function that extends the tree to the next level. I failed to see why the function works, or, what it actually does at all. Therefore I tried to give it a specification, and a derivation. It turns out that the tree it builds corresponds to the ways of choosing k elements from a list of length n, where n and k determine the shape of the tree. And the sizes along the left spine of the tree is a diagonal in Pascal's triangle.

(slides)

Florian Rabe, Theorem proving in dependently-typed higher-order logic (Wednesday, July 19 2023, 9:02 -- 10:12)

Higher-order logic HOL offers a very simple syntax and semantics for representing and reasoning about typed data structures.
But its type system lacks advanced features where types may depend on terms.
Dependent type theory offers such a rich type system, but has rather substantial conceptual differences to HOL, as well as comparatively poor proof automation support.

We introduce a dependently-typed extension DHOL of HOL that retains the style and conceptual framework of HOL.
Moreover, we build a translation from DHOL to HOL and implement it as a preprocessor to a HOL theorem prover, thereby obtaining a theorem prover for DHOL.

talk.pdf

Brijesh Dongol, Correctly Making Linearizable Concurrent Objects Durably Linearizable (Wednesday, July 19 2023, 10:46 -- 11:48)

(slides)

Tarmo Uustalu, Sweedler theory of monads (Wednesday, July 19 2023, 11:50 -- 12:42)

Monad-comonad interaction laws by Katsumata et al. describe communication protocols between effectful computations and environments providing the requested effects. The notions of interacting computations and environments are modelled by a monad T resp. a comonad D. An interaction yields a computation possibly containing residual (unserved) effect requests; this notion of computation is modelled by another monad R.

I will discuss how one can determine the final T interacting with a given D R-residually, the final D interacting with a given T R-residually and the initial R that given T and D can interact residually with. This is relies primarily on an analysis called Sweedler theory for duoidal categories by Lopez Franco and Vasilakopoulou, which is about monoid-comonoid interaction, but also depends on a (co)algebraic perspective on monad-comonad interaction specifically.

This is joint work with Dylan McDermott and [[1][Exequiel Rivas]]. (Paper from FoSSaCS '22.)

Bernhard Moeller, Generalized infix notation and accumulating associativity (Wednesday, July 20 2023, 11:09 -- 11:45)

This work arose in the context of programming animated graphics in Haskell/GLOSS. The task there was to present an existing larger program in a more structured way. The essential notational tool is a more liberal form of infix notation than is available in standard Haskell. To some extent this is covered by Agda mixfix operators. However, we want to use operators of the form `E` where E is an arbitrary expression and not just a simple identifier as in standard Haskell. This admits associative-like laws which can be used, e.g., in transforming functions into tail-recursive form using an accumulator. We show this in an instance for graphics programs. After that, other instances, a.o. from functional treatments of hardware description or Hoare's conditional operator, are briefly mentioned. The convenience of such notations suggests that they should be included in future languages such as the envisaged ALGOL 2030.

(slides)

James !McKinna, Automatic Differentiation (AD): An algebraic, intensional/extensional approach (Wednesday, July 20 2023, 11:47 -- 12:31)

Automatic differentiation (AD) has been a topic of interest for researchers in many disciplines, with increased popularity since its application to machine learning and neural networks. Although many researchers appreciate and know how to apply AD, it remains a challenge to truly understand the underlying processes. From an algebraic point of view, however, AD appears surprisingly natural: it originates from the differentiation laws. In this work we use Algebra of Programming techniques to reason about different AD variants, leveraging Haskell to illustrate our observations. Our findings stem from three fundamental algebraic abstractions: (1) the notion of module over a semiring, (2) Nagata's construction of the 'idealization of a module', and (3) Kronecker's delta function, that together allow us to write a single-line abstract definition of AD. From this single-line definition, and by instantiating our algebraic structures in various ways, we derive different AD variants, that have the same extensional behaviour, but different intensional properties, mainly in terms of (asymptotic) computational complexity. We show the different variants equivalent by means of Kronecker isomorphisms, a further elaboration of our Haskell infrastructure which guarantees correctness by construction. With this framework in place, we seek to make AD variants more comprehensible, taking an algebraic perspective on the matter.

(slides)(paper)

Marcos Viera, Past, Present and Future of MateFun: Functional Programming and Math with Teenagers (Wednesday, July 20 2023, 14:00 -- 15:06)

TBD

Donnacha Oisin Kidney, Algebras for weighted search (Wednesday, July 20 2023, 15:08 -- 16;29)

Weighted search is an essential component of many fundamental and useful algorithms. Despite this, it is relatively under explored as a computational effect, receiving not nearly as much attention as either depth- or breadth-first search. This paper explores the algebraic underpinning of weighted search, and demonstrates how to implement it as a monad transformer. The development first explores breadth-first search, which can be expressed as a polynomial over semirings. These polynomials are generalised to the free semimodule monad to capture a wide range of applications, including probability monads, polynomial monads, and monads for weighted search. Finally, a monad trans- former based on the free semimodule monad is introduced. Applying optimisations to this type yields an implementation of pairing heaps, which is then used to implement Dijkstra’s algorithm and efficient proba- bilistic sampling. The construction is formalised in Cubical Agda and implemented in Haskell.

(slides)

Shin-cheng Mu, Guabao: A programming environment for developing programs hand-in-hand with proofs (Wednesday, July 20 2023, 16:30 -- TBD)

Guabao is a programming environment encouraging the methodology that a program and its correctness proof should be developed hand in hand, and that how a program should be proved could sometimes give hints how the program can be written. Currently it is under major rewrite, but nevertheless I would like to give a demo showing you what I hope to achieve, and listen to your feedbacks.

(slides)

Fritz Henglein, Monadic machines (Wednesday, July 21 2023, 11:27 -- 11:54)

TBD

Problem Solving Sessions

Algol 2030, proposed by Nicolas Wu

The session began with a retrospective look at past discussions on the topic. There had been two prior sessions, both in different meetings in 2012, where Meertens presented "ALGOL X and ALGOL Y," while Fritz Henglein discussed "Towards Algol 2020".

The primary focus of the session was to determine the success criteria for the future language. Participants engaged in an analysis of existing programming languages, identifying and discussing their deficiencies.

Automatically translating from extrinsically-typed terms and judgements to intrinsically-typed ones, proposed by Matija Pretnar

The Schorr-Waite algorithm, proposed by Lambert Meertens.

SchorrWaite.pdf See also Richard Bird's Unfolding Pointer Algorithms, revised as Ch26 of PoFAD.

Analysis of random generators for structured and constrained data, proposed by Janis Voiglaender.

The motivating example was a Haskell data type encoding (a superset of the set of) certain diagrams for an exercise task scenario, and an ad hoc QuickCheck generator for populating the data type. The question being whether the generator produces "all interesting" specimens. We talked about some existing approaches, such as the FEAT library presented by Patrik at an earlier meeting. The example at hand has a different notion of "completeness", since we are not dealing with the free algebra of all terms. Encoding the relevant constraints into (a dependently typed version of) the data type might be possible. But even then, this has more to do with ensuring that only correct values are produced, not with ensuring that each correct value will be produced. We considered whether the motivating example really requires that kind of "sampling completeness", or whether completely different generator approaches might be appropriate, such as based on template filling. That might well be the case. But we settled on nevertheless discussing the abstract question of getting insight into what set of values a given QuickCheck generator actually produces. An obvious idea is to give a new semantics to the generator primitives, so that generators could be analysed via membership or inclusion queries. Starting from a list-based semantics, we discussed a few alternatives. One lead was to investigate first-class nondeterminism in a functional-logic language. Another idea that came up, for compactly representing the set of all produced values, while also allowing filtering of such sets, was to use something akin to discriminators and/or symbolic products from Fritz's past work. Other possibly related work was also brought up and might be explored further.

Schedule

Sessions will start at 9:00 on Monday and finish at noon on Friday.

Monday, Tuesday, and Thursday, the schedule is as follows:

  • session – 9:00 to 10:30
  • coffee break – 10:30 to 11:00
  • session – 11:00 to 12:30
  • lunch – 12:30 to 14:00
  • session – 14:00 to 15:30
  • coffee break – 15:30 to 16:00
  • session – 16:00 to 18:00
  • dinner – starts at 19:00

Wednesday and Friday we will have sessions only in the morning:

  • session – 9:00 to 10:30
  • coffee break – 10:30 to 11:00
  • session – 11:00 to 12:30
  • lunch – 12:30 to 14:00

The Friday-morning session before the 10:30 coffee break is attended by members only.