Hector: An Equivalence Checker for a Higher-Order Fragment of ML

We present Hector, an observational equivalence checker for a higher-order fragment of ML. The input language is RML, the canonical restriction of standard ML to ground-type references. Hector accepts programs from a decidable fragment of RML identified by us at ICALP'11, which comprises programs of short-type (order at most 2 and arity at most 1) that may contain free variables whose arguments are also of short-type. This is an expressive fragment that contains complex higher-order types, and includes many examples from the literature which have proven challenging to verify using other methods. To our knowledge, Hector is the first fully-automated equivalence checker for higher-order, call-by-value programs. Both sound and complete, the tool relies on the fully abstract game semantics of RML to construct, on-the-fly, visibly pushdown automata which precisely capture program behaviour. These automata are then checked for language equivalence, and if they are inequivalent a counterexample (in the form of a separating context) is constructed.

[1]  Andrew M. Pitts,et al.  Higher order operational techniques in semantics , 1999 .

[2]  Lars Birkedal,et al.  The impact of higher-order state and control effects on local relational reasoning , 2012, J. Funct. Program..

[3]  Alex K. Simpson,et al.  Computational Adequacy in an Elementary Topos , 1998, CSL.

[4]  Rajeev Alur,et al.  A Temporal Logic of Nested Calls and Returns , 2004, TACAS.

[5]  Rajeev Alur,et al.  Visibly pushdown languages , 2004, STOC '04.

[6]  Dan R. Ghica,et al.  Compositional Predicate Abstraction from Game Semantics , 2009, TACAS.

[7]  Ian David Bede Stark,et al.  Names and higher-order functions , 1994 .

[8]  Dan R. Ghica,et al.  On-the-Fly Techniques for Game-Based Software Model Checking , 2008, TACAS.

[9]  Samson Abramsky,et al.  Call-by-Value Games , 1997, CSL.

[10]  C.-H. Luke Ong,et al.  Homer: A Higher-Order Observational Equivalence Model checkER , 2009, CAV.

[11]  Rupak Majumdar,et al.  HMC: Verifying Functional Programs Using Abstract Interpreters , 2011, CAV.

[12]  I. Stark,et al.  Operational reasoning for functions with local state , 1999 .

[13]  Naoki Kobayashi Model-checking higher-order functions , 2009, PPDP '09.

[14]  Andrzej S. Murawski,et al.  A Fragment of ML Decidable by Visibly Pushdown Automata , 2011, ICALP.

[15]  Swarat Chaudhuri,et al.  On-the-Fly Reachability and Cycle Detection for Recursive State Machines , 2005, TACAS.

[16]  Robin Milner,et al.  On Observing Nondeterminism and Concurrency , 1980, ICALP.