Towards refinement types for time-dependent data-flow networks

The concept of liquid clocks introduced in this paper is a significant step towards a more precise compile-time framework for the analysis of synchronous and polychromous languages. Compiling languages such as Lustre or Signal indeed involves a number of static analyses of programs before they can be synthesized into executable code, e.g., synchronicity class characterization, clock assignment, static scheduling or causality analysis. These analyses are often equivalent to undecidable problems, necessitating abstracting such programs to provide sound yet incomplete analyses. Such abstractions unfortunately often lead to the rejection of programs that could very well be synthesized into deterministic code, provided abstraction refinement steps could be applied for more accurate analysis. To reduce the number of false negatives occurring during the compilation process, we leverage recent advances in type theory - with the definition of decidable classes of value-dependent type systems - and formal verification, linked to the development of efficient SAT/SMT solvers, to provide a type-theoretic approach that considers all the above analyses as type inference problems. To simplify the exposition of our new approach in this paper, we define a refinement type system for a minimalistic, synchronous, stream-processing language to concisely represent, analyze, and verify logical and quantitative properties of programs expressed as stream-processing data-flow networks. Our type system provides a new framework for representing logical time (clocks) and scheduling properties, and to describe their relations with stream values and, possibly, other quantas. We show how to analyze synchronous stream processing programs (à la Lustre, Signal) to enable previously described analyses involved in compiling such programs. We also prove the soundness of our type system and elaborate on the adaptability of this core framework by outlining its extensibility to specific models of computations and other quantas.

[1]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.

[2]  Rupak Majumdar,et al.  Asynchronous Liquid Separation Types , 2015, ECOOP.

[3]  Marc Pouzet,et al.  A Type-based Analysis of Causality Loops in Hybrid Systems Modelers , 2017 .

[4]  Gilles Kahn,et al.  The Semantics of a Simple Language for Parallel Programming , 1974, IFIP Congress.

[5]  Robert de Simone,et al.  From Concurrent Multi-clock Programs to Deterministic Asynchronous Implementations , 2009, ACSD.

[6]  Anna Philippou,et al.  Tools and Algorithms for the Construction and Analysis of Systems , 2018, Lecture Notes in Computer Science.

[7]  Paul Le Guernic,et al.  Implementation of the data-flow synchronous language SIGNAL , 1995, PLDI '95.

[8]  E.A. Lee,et al.  Synchronous data flow , 1987, Proceedings of the IEEE.

[9]  Alberto L. Sangiovanni-Vincentelli,et al.  Theory of latency-insensitive design , 2001, IEEE Trans. Comput. Aided Des. Integr. Circuits Syst..

[10]  Sandeep K. Shukla,et al.  Liquid Clocks - Refinement Types for Time-Dependent Stream Functions , 2015 .

[11]  Stephan Merz,et al.  Refinement Types for tla + , 2014, NASA Formal Methods.

[12]  Ranjit Jhala,et al.  Refinement types for Haskell , 2014, ICFP.

[13]  Patrick Maxim Rondon,et al.  Liquid types , 2008, PLDI '08.

[14]  Pascal Raymond,et al.  The synchronous data flow programming language LUSTRE , 1991, Proc. IEEE.

[15]  Marc Pouzet,et al.  Static scheduling of Latency Insensitive Designs with Lucy-n , 2011, 2011 Formal Methods in Computer-Aided Design (FMCAD).

[16]  Thierry Gautier,et al.  Precise deadlock detection for polychronous data-flow specifications , 2014, Proceedings of the 2014 Electronic System Level Synthesis Conference (ESLsyn).

[17]  Marc Pouzet,et al.  Modular static scheduling of synchronous data-flow networks: an efficient symbolic representation , 2009, EMSOFT '09.

[18]  Paul Feautrier,et al.  Enhancing the Compilation of Synchronous Dataflow Programs with a Combined Numerical-Boolean Abstraction , 2013 .

[19]  Jean-Pierre Talpin,et al.  Polyhedral Analysis for Synchronous Languages , 1999, SAS.

[20]  Paul Le Guernic,et al.  Validation of Mixed SIGNAL-ALPHA Real-Time Systems through Affine Calculus on Clock Synchronisation Constraints , 1999, World Congress on Formal Methods.

[21]  Sandeep K. Shukla,et al.  Constructive polychronous systems , 2013, Sci. Comput. Program..

[22]  Joaquín Aguado,et al.  Grounding Synchronous Deterministic Concurrency in Sequential Programming , 2014, ESOP.

[23]  Amir Pnueli,et al.  Translation Validation , 1998, TACAS.

[24]  Jean-Christophe Le Lann,et al.  POLYCHRONY for System Design , 2003, J. Circuits Syst. Comput..

[25]  Albert Benveniste,et al.  programmi language and its , 2001 .

[26]  JhalaRanjit,et al.  Refinement types for Haskell , 2014 .

[27]  Joaquín Aguado,et al.  SCCharts: sequentially constructive statecharts for safety-critical applications: HW/SW-synthesis for a conservative extension of synchronous statecharts , 2014, PLDI.

[28]  Ranjit Jhala,et al.  Abstract Refinement Types , 2013, ESOP.

[29]  Jean-Pierre Talpin,et al.  A Synchronous Semantics of Higher-Order Processes for Modeling Reconfigurable Reactive Systems , 1998, FSTTCS.

[30]  Marc Pouzet,et al.  Towards a higher-order synchronous data-flow language , 2004, EMSOFT '04.

[31]  Jean-Pierre Talpin,et al.  Buffer minimization in earliest-deadline first scheduling of dataflow graphs , 2013, LCTES '13.

[32]  Paul Le Guernic,et al.  Distributed Implementation of SIGNAL: Scheduling & Graph Clustering , 1994, FTRTFT.

[33]  MendlerMichael,et al.  SCCharts: sequentially constructive statecharts for safety-critical applications , 2014 .

[34]  Frédéric Boniol,et al.  A real-time architecture design language for multi-rate embedded control systems , 2010, SAC '10.