TopHat: A formal foundation for task-oriented programming

Software that models how people work is omnipresent in today's society. Current languages and frameworks often focus on usability by non-programmers, sacrificing flexibility and high level abstraction. Task-oriented programming (TOP) is a programming paradigm that aims to provide the desired level of abstraction while still being expressive enough to describe real world collaboration. It prescribes a declarative programming style to specify multi-user workflows. Workflows can be higher-order. They communicate through typed values on a local and global level. Such specifications can be turned into interactive applications for different platforms, supporting collaboration during execution. TOP has been around for more than a decade, in the forms of iTasks and mTasks, which are tailored for real-world usability. So far, it has not been given a formalisation which is suitable for formal reasoning. In this paper we give a description of the TOP paradigm and then decompose its rich features into elementary language elements, which makes them suitable for formal treatment. We use the simply typed lambda-calculus, extended with pairs and references, as a base language. On top of this language, we develop TopHat, a language for modular interactive workflows. We describe TopHat by means of a layered semantics. These layers consist of multiple big-step evaluations on expressions, and two labelled transition systems, handling user inputs. With TopHat we prepare a way to formally reason about TOP languages and programs. This approach allows for comparison with other work in the field. We have implemented the semantic rules of TopHat in Haskell, and the task layer on top of the iTasks framework. This shows that our approach is feasible, and lets us demonstrate the concepts by means of illustrative case studies. TOP has been applied in projects with the Dutch coast guard, tax office, and navy. Our work matters because formal program verification is important for mission-critical software, especially for systems with concurrency.

[1]  Wil M. P. van der Aalst,et al.  Workflow Patterns , 2003, Distributed and Parallel Databases.

[2]  Allen B. Downey,et al.  The Little Book of Semaphores , 2009 .

[3]  Manuel Serrano,et al.  Hiphop: a synchronous reactive extension for hop , 2011, PLASTIC '11.

[4]  Paul Hudak,et al.  Functional reactive animation , 1997, ICFP '97.

[5]  Robin Milner,et al.  Communication and concurrency , 1989, PHI Series in computer science.

[6]  Pieter Koopman,et al.  A Task-Based DSL for Microcomputers , 2018, RWDSL2018.

[7]  Wouter Swierstra,et al.  Data types à la carte , 2008, Journal of Functional Programming.

[8]  Marinus J. Plasmeijer,et al.  Tonic: An Infrastructure to Graphically Represent the Definition and Behaviour of Tasks , 2014, Trends in Functional Programming.

[9]  W. M. P. V. D. Aalsta,et al.  YAWL : yet another workflow language , 2015 .

[10]  Frédéric Boussinot,et al.  The ESTEREL language , 1991, Proc. IEEE.

[11]  Jan Martin Jansen,et al.  The Sky is the Limit: Analysing Resource Consumption Over Time Using Skylines , 2017, IFL.

[12]  Gérard Berry,et al.  The Esterel Synchronous Programming Language: Design, Semantics, Implementation , 1992, Sci. Comput. Program..

[13]  Wil M. P. van der Aalst,et al.  The Application of Petri Nets to Workflow Management , 1998, J. Circuits Syst. Comput..

[14]  Simon Peyton Jones,et al.  Tackling the Awkward Squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell , 2005 .

[15]  Rinus Plasmeijer,et al.  Incidone: A Task-Oriented Incident Coordination Tool , 2012 .

[16]  Bas Lijnse,et al.  Task-oriented programming in a pure functional language , 2012, PPDP.

[17]  Johan Jeuring,et al.  Building a Generic Feedback System for Rule-Based Problems , 2016, TFP.

[18]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[19]  Marinus J. Plasmeijer,et al.  An Executable and Testable Semantics for iTasks , 2008, IFL.

[20]  Marinus J. Plasmeijer,et al.  Maintaining Separation of Concerns Through Task Oriented Software Development , 2017, TFP.

[21]  Graham Hutton,et al.  Modularity and Implementation of Mathematical Operational Semantics , 2011, Electron. Notes Theor. Comput. Sci..

[22]  C. A. R. Hoare,et al.  Communicating sequential processes , 1978, CACM.

[23]  Manuel Serrano,et al.  Hop and HipHop: Multitier Web Orchestration , 2013, ICDCIT.

[24]  Shriram Krishnamurthi,et al.  Flapjax: a programming language for Ajax applications , 2009, OOPSLA 2009.