Matching logic explained

Matching logic was recently proposed as a unifying logic for specifying and reasoning about static structure and dynamic behavior of programs. In matching logic, patterns and specifications are used to uniformly represent mathematical domains (such as numbers and Boolean values), datatypes, and transition systems, whose properties can be reasoned about using one fixed matching logic proof system. In this paper we give a tutorial to matching logic. We use a suite of examples to explain the basic concepts of matching logic and show how to capture many important mathematical domains, datatypes, and transition systems using patterns and specifications. We put special emphasis on the general principles of induction and coinduction in matching logic and show how to do inductive and coinductive reasoning about datatypes and codatatypes. To encourage the development of the future tools for matching logic, we propose and use throughout the paper a human-readable formal syntax to write specifications in a modular and compact way. Keywords— matching logic, program logics, (co)inductive data types, dependent types, specification of transition systems, (co)monad specification

[1]  Grigore Rosu,et al.  A Language-Independent Program Verification Framework , 2018, ISoLA.

[2]  Dominic A. Orchard Should I use a Monad or a Comonad ? , 2012 .

[3]  Frank Pfenning,et al.  Higher-order abstract syntax , 1988, PLDI '88.

[4]  Robin Milner,et al.  A Calculus of Communicating Systems , 1980, Lecture Notes in Computer Science.

[5]  Grigore Roşu,et al.  SETSS’19 Lecture Notes on K , 2019 .

[6]  Jos C. M. Baeten,et al.  Process Algebra , 2007, Handbook of Dynamic System Modeling.

[7]  A. Tarski A LATTICE-THEORETICAL FIXPOINT THEOREM AND ITS APPLICATIONS , 1955 .

[8]  Grigore Rosu,et al.  Circular Coinduction: A Proof Theoretical Foundation , 2009, CALCO.

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

[10]  Robin Milner,et al.  Communicating and mobile systems - the Pi-calculus , 1999 .

[11]  Andrew M. Pitts,et al.  A First Order Theory of Names and Binding , 2001 .

[12]  Milad Niqui,et al.  Stream processing coalgebraically , 2013, Sci. Comput. Program..

[13]  Wan Fokkink,et al.  Introduction to Process Algebra , 1999, Texts in Theoretical Computer Science. An EATCS Series.

[14]  Geert Bouckaert,et al.  Defining the concepts , 2010 .

[15]  Grigore Rosu,et al.  A general approach to define binders using matching logic , 2020, Proc. ACM Program. Lang..

[16]  Dorel Lucanu,et al.  Unification in Matching Logic , 2019, FM.

[17]  Xiaohong Chen,et al.  Applicative matching logic , 2019 .

[18]  Dorel Lucanu,et al.  Initial Algebra Semantics in Matching Logic , 2020 .

[19]  Grigore Rosu,et al.  Matching μ-Logic , 2017, 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[20]  Colin Stirling,et al.  Modal Mu-Calculi , 2001 .

[21]  Tarmo Uustalu,et al.  Comonadic Notions of Computation , 2008, CMCS.