arXiv.itsnick.co

an independent field guide to 23 million papers from arXiv & OpenAlex — not affiliated with arXiv.org

Author

Jan Midtgaard

22 papers · 2003–2025

2003: 42004: 02005: 02006: 02007: 12008: 02009: 32010: 02011: 22012: 12013: 42014: 22015: 02016: 12017: 32018: 02019: 02020: 02021: 02022: 02023: 02024: 02025: 1
2003peak 4 in 20032025

Frequent co-authors

Papers

showing 1–22 of 22 RSS

A functional correspondence between evaluators and abstract machines

Mads Sig Ager, Dariusz Biernacki, Olivier Danvy +1 more

Artificial Intelligence · · cited 142× · DOI ↗ · more like this ·

We bridge the gap between functional evaluators and abstract machines for the λ-calculus, using closure conversion, transformation into continuation-passing style, and defunctionalization.We illustrate this approach by deriving Krivine's abstract machine from an ordinary call-by-name evaluator and by deriving an ordinary call-by-value evaluator from Felleisen et al.'s CEK machine. The first derivation is strikingly simpler than what can be found in the literature. The second one is new. Together, they show that Krivine's abstract machine and the CEK machine correspond to the call-by-name and call-by-value facets of an ordinary evaluator for the λ-calculus.We then reveal the denotational content of Hannan and Miller's CLS machine and of Landin's SECD machine. We formally compare the corresponding evaluators and we illustrate some degrees of freedom in the design spaces of evaluators and…

From Interpreter to Compiler and Virtual Machine: A Functional Derivation

Mads Sig Ager, Dariusz Biernacki, Olivier Danvy +1 more

Information Systems · BRICS Report Series · · cited 63× · DOI ↗ · more like this ·

We show how to derive a compiler and a virtual machine from a compositional interpreter. We first illustrate the derivation with two evaluation functions and two normalization functions. We obtain Krivine's machine, Felleisen et al.'s CEK machine, and a generalization of these machines performing strong normalization, which is new. We observe that several existing compilers and virtual machines--e.g., the Categorical Abstract Machine (CAM), Schmidt's VEC machine, and Leroy's Zinc abstract machine--are already in derived form and we present the corresponding interpreter for the CAM and the VEC machine. We also consider Hannan and Miller's CLS machine and Landin's SECD machine.<br /> <br />We derived Krivine's machine via a call-by-name CPS transformation and the CEK machine via a call-by-value CPS transformation. These two derivations hold both for an evaluation function and…

Control-flow analysis of function calls and returns by abstract interpretation

Jan Midtgaard, Thomas Wiben Jensen

Artificial Intelligence · HAL (Le Centre pour la Communication Scientifique Directe) · · cited 32× · DOI ↗ · more like this ·

We derive a control-flow analysis that approximates the interprocedural control-flow of both function calls and returns in the presence of first-class functions and tail-call optimization. In addition to an abstract environment, our analysis computes for each expression an abstract control stack, effectively approximating where function calls return across optimized tail calls. The analysis is systematically calculated by abstract interpretation of the stack-based CaEK abstract machine of Flanagan et al. using a series of Galois connections. Abstract interpretation provides a unifying setting in which we 1) prove the analysis equivalent to the composition of a continuation-passing style (CPS) transformation followed by an abstract interpretation of a stack-less CPS machine, and 2) extract an equivalent constraint-based formulation, thereby providing a rational reconstruction of a…

Effect-driven QuickChecking of compilers

Jan Midtgaard, Mathias Nygaard Justesen, Patrick Kasting +2 more

Software · Proceedings of the ACM on Programming Languages · · cited 29× · DOI ↗ · more like this ·

How does one test a language implementation with QuickCheck (aka. property-based testing)? One approach is to generate programs following the grammar of the language. But in a statically-typed language such as OCaml too many of these candidate programs will be rejected as ill-typed by the type checker. As a refinement Pałka et al. propose to generate programs in a goal-directed, bottom-up reading up of the typing relation. We have written such a generator. However many of the generated programs has output that depend on the evaluation order, which is commonly under-specified in languages such as OCaml, Scheme, C, C++, etc. In this paper we develop a type and effect system for conservatively detecting evaluation-order dependence and propose its goal-directed reading as a generator of programs that are independent of evaluation order. We illustrate the approach by generating programs to…

Monadic abstract interpreters

Ilya Sergey, Dominique Devriese, Matthew Might +4 more

Artificial Intelligence · UCL Discovery (University College London) · · cited 28× · DOI ↗ · more like this ·

Recent developments in the systematic construction of abstract interpreters hinted at the possibility of a broad unification of concepts in static analysis. We deliver that unification by showing context-sensitivity, polyvariance, flow-sensitivity, reachability-pruning, heap-cloning and cardinality-bounding to be independent of any particular semantics. Monads become the unifying agent between these concepts and between semantics. For instance, by plugging the same "context-insensitivity monad" into a monadically-parameterized semantics for Java or for the lambda calculus, it yields the expected context-insensitive analysis.

QuickChecking static analysis properties

Jan Midtgaard, Anders Møller

Software · Software Testing Verification and Reliability · · cited 20× · DOI ↗ · more like this ·

Summary A static analysis can check programs for potential errors. A natural question that arises is therefore: who checks the checker? Researchers have given this question varying attention, ranging from basic testing techniques, informal monotonicity arguments, thorough pen‐and‐paper soundness proofs, to verified fixed point checking. In this paper, we demonstrate how quickchecking can be useful to test a range of static analysis properties with limited effort. We show how to check a range of algebraic lattice properties, to help ensure that an implementation follows the formal specification of a lattice. Moreover, we offer a number of generic, type‐safe combinators to check transfer functions and operators on lattices, to help ensure that these are, eg, monotone, strict, or invariant. We substantiate our claims by quickchecking a type analysis for the Lua programming language.

Systematic derivation of static analyses for software product lines

Jan Midtgaard, Claus Brabrand, Andrzej Wąsowski

Artificial Intelligence · IT University Of Copenhagen (IT University of Copenhagen) · · cited 18× · DOI ↗ · more like this ·

A recent line of work lifts particular verification and analysis methods to Software Product Lines (SPL). In an effort to generalize such case-by-case approaches, we develop a systematic methodology for lifting program analyses to SPLs using abstract interpretation. Abstract interpretation is a classical framework for deriving static analyses in a compositional, step-by-step manner. We show how to take an analysis expressed as an abstract interpretation and lift each of the abstract interpretation steps to a family of programs. This includes schemes for lifting domain types, and combinators for lifting analyses and Galois connections. We prove that for analyses developed using our method, the soundness of lifting follows by construction. Finally, we discuss approximating variability in an analysis and we derive variational data-flow equations for an example analysis, a constant…

A Functional Correspondence between Monadic Evaluators and Abstract Machines for Languages with Computational Effects

Mads Sig Ager, Olivier Danvy, Jan Midtgaard

Artificial Intelligence · BRICS Report Series · · cited 18× · DOI ↗ · more like this ·

We extend our correspondence between evaluators and abstract machines from the pure setting of the lambda-calculus to the impure setting of the computational lambda-calculus. Specifically, we show how to derive new abstract machines from monadic evaluators for the computational lambda-calculus. Starting from a monadic evaluator and a given monad, we inline the components of the monad in the evaluator and we derive the corresponding abstract machine by closure-converting, CPS-transforming, and defunctionalizing this inlined interpreter. We illustrate the construction first with the identity monad, obtaining yet again the CEK machine, and then with a state monad, an exception monad, and a combination of both.<br /> <br />In addition, we characterize the tail-recursive stack inspection presented by Clements and Felleisen at ESOP 2003 as a canonical state monad. Combining this…

Control-Flow Analysis of Functional Programs

Jan Midtgaard

Artificial Intelligence · BRICS Report Series · · cited 13× · DOI ↗ · more like this ·

We present a survey of control-flow analysis of functional programs, which has been the subject of extensive investigation throughout the past 25 years. Analyses of the control flow of functional programs have been formulated in multiple settings and have led to many different approximations, starting with the seminal works of Jones, Shivers, and Sestoft. In this paper we survey control-flow analysis of functional programs by structuring the multitude of formulations and approximations and comparing them.

Subcubic Control Flow Analysis Algorithms

Jan Midtgaard, David Van Horn

Artificial Intelligence · · cited 12× · OpenAlex ↗ · more like this ·

We give the first direct subcubic algorithm for performing control flow analysis of higher-order functional programs. Despite the long held belief that inclusion-based flow analysis could not surpass the “cubic bottleneck,” we apply known set compression techniques to obtain an algorithm that runs in time O(n/ log n) on a unit cost random-access memory model machine. Moreover, we refine the initial flow analysis into two more precise analyses incorporating notions of reachability. We give subcubic algorithms for these more precise analyses and relate them to an existing analysis from the literature. 1 History and Motivation Control flow analysis (CFA) is a fundamental static analysis of higher-order programming languages and forms the basis of a range of other analyses. It determines for each call site of a program a set of functions which may be applied when the program is run. Over a…

Flow-sensitive type recovery in linear-log time

Michael D. Adams, Andrew W. Keep, Jan Midtgaard +3 more

Artificial Intelligence · · cited 11× · DOI ↗ · more like this ·

The flexibility of dynamically typed languages such as JavaScript, Python, Ruby, and Scheme comes at the cost of run-time type checks. Some of these checks can be eliminated via control-flow analysis. However, traditional control-flow analysis (CFA) is not ideal for this task as it ignores flow-sensitive information that can be gained from dynamic type predicates, such as JavaScript's 'instanceof' and Scheme's 'pair?', and from type-restricted operators, such as Scheme's 'car'. Yet, adding flow-sensitivity to a traditional CFA worsens the already significant compile-time cost of traditional CFA. This makes it unsuitable for use in just-in-time compilers. In response, we have developed a fast, flow-sensitive type-recovery algorithm based on the linear-time, flow-insensitive sub-0CFA. The algorithm has been implemented as an experimental optimization for the commercial Chez Scheme…

A Functional Correspondence between Call-by-Need Evaluators and Lazy Abstract Machines

Mads Sig Ager, Olivier Danvy, Jan Midtgaard

Artificial Intelligence · BRICS Report Series · · cited 10× · DOI ↗ · more like this ·

<p>We bridge the gap between compositional evaluators and abstract machines for the lambda-calculus, using closure conversion, transformation into continuation-passing style, and defunctionalization of continuations. This article is a spin-off of our article at PPDP 2003, where we consider call by name and call by value. Here, however, we consider call by need.<br /> <br />We derive a lazy abstract machine from an ordinary call-by-need evaluator that threads a heap of updatable cells. In this resulting abstract machine, the continuation fragment for updating a heap cell naturally appears as an `update marker', an implementation technique that was invented for the Three Instruction Machine and subsequently used to construct lazy variants of Krivine's abstract machine. Tuning the evaluator leads to other implementation techniques such as unboxed values and the push-enter…

Engineering definitional interpreters

Jan Midtgaard, Norman F. Ramsey, Bradford Larsen

Artificial Intelligence · · cited 5× · DOI ↗ · more like this ·

A definitional interpreter should be clear and easy to write, but it may run 4--10 times slower than a well-crafted bytecode interpreter. In a case study focused on implementation choices, we explore ways of making definitional interpreters faster without expending much programming effort. We implement, in OCaml, interpreters based on three semantics for a simple subset of Lua. We compile the OCaml to x86 native code, and we systematically investigate hundreds of combinations of algorithms and data structures. In this experimental context, our fastest interpreters are based on natural semantics; good algorithms and data structures make them 2--3 times faster than naïve interpreters. Our best interpreter, created using only modest effort, runs only 1.5 times slower than a mature bytecode interpreter implemented in C.

Iterated process analysis over lattice-valued regular expressions

Jan Midtgaard, Flemming Nielson, Hanne Riis Nielson

Computational Theory and Mathematics · Technical University of Denmark, DTU Orbit (Technical University of Denmark, DTU) · · cited 4× · DOI ↗ · more like this ·

We present an iterated approach to statically analyze programs of two processes communicating by message passing. Our analysis operates over a domain of lattice-valued regular expressions, and computes increasingly better approximations of each process's communication behavior. Overall the work extends traditional semantics-based program analysis techniques to automatically reason about message passing in a manner that can simultaneously analyze both values of variables as well as message order, message content, and their interdependencies.

Dynamic Verification of OCaml Software with Gospel and Ortac/QCheck-STM

Nikolaus Huber, Naomi Spargo, Nicolas Osborne +2 more

Artificial Intelligence · Lecture notes in computer science · · cited 0× · DOI ↗ · more like this ·

Abstract This paper introduces the QCheck-STM plugin for Ortac, a framework for dynamic verification of OCaml code. Ortac/QCheck-STM consumes OCaml module signatures annotated with behavioural specification contracts expressed in the Gospel language, extracts a functional model of a mutable data structure from it, and generates code for automated runtime assertion checking. We report on the implementation of the tool, the structure of the generated code, and on errors found in established OCaml libraries.

Developments in property-based testing (invited talk)

Jan Midtgaard

Software · University of Southern Denmark Research Portal (University of Southern Denmark) · · cited 0× · DOI ↗ · more like this ·

Property-based testing (aka. QuickCheck) is a successful au- tomated testing approach originating in the programming language community (Claessen-Hughes:ICFP00). It unites the well-known idea of randomized testing with that of en- suring program-specific properties akin to those encoun- tered within verification and theorem proving. Starting as a Haskell library the approach has grown to become language independent with ports to over 30 different programming languages. Over the years property-based testing has been used to pinpoint an impressive amount of software errors in a multitude of settings, initially within academia but more and more so also in the software industry. In this talk I will first recall the basic concepts of property- based testing and then cover a couple of recent applications, while sharing some of the folklore and community know- how. This includes quite a bit of…

A Structural Soundness Proof for Shivers’s Escape Technique A Case for Galois Connections

Jan Midtgaard, Michael D. Adams, Matthew Might

Artificial Intelligence · · cited 0× · OpenAlex ↗ · more like this ·

Abstract. Shivers’s escape technique enables one to analyse the con-trol flow of higher-order program fragments. It is widely used, but its soundness has never been proven. In this paper, we present the first soundness proof for the technique. Our proof is structured as a composi-interpretation. 1

Engineering Definitional Interpreters (Extended Version)

Jan Midtgaard, Norman F. Ramsey, Bradford Larsen

Artificial Intelligence · · cited 0× · OpenAlex ↗ · more like this ·

A definitional interpreter should be clear and easy to write, but it may run 4–10 times slower than a well-crafted bytecode interpreter. In a case study focused on implementation choices, we explore ways of making definitional interpreters faster without expending much programming effort. We implement, in OCaml, interpreters based on three semantics for a simple subset of Lua. We compile the OCaml to x86 native code, and we systematically investigate hundreds of combinations of algorithms and data structures. In this experimental context, our fastest interpreters are based on natural semantics; good algorithms and data structures make them

Calculating Graph Algorithms by Abstract Interpretation

Ilya Sergey, Jan Midtgaard, Dave Clarke

Artificial Intelligence · · cited 0× · OpenAlex ↗ · more like this ·

We present a technique to calculate iterative, polynomial-time graph algorithms directly from the definition of the properties. We do this by fixed-point fusion of (1) a least fixed point expressing all finite paths through a directed graph and (2) Galois connections that capture the properties of interest. We demonstrate the technique by constructing three algorithms from the literature: a transitive closure algorithm, a dominance algorithm and an algorithm for the single-source shortest path problem. Furthermore we show how the transitive closure algorithm can be understood as an abstraction of a fourth iterative all-pairs shortest path algorithm. The approach illustrates that reasoning in the style of fixed-point calculus extends gracefully to the domain of graph algorithms. We thereby bridge common practice from the school of program calculation with common practice from the school…

Handling Overflow in MLton

Hansen, Alexander Bjerremand, Jan Midtgaard

Artificial Intelligence · · cited 0× · OpenAlex ↗ · more like this ·

The definition of Standard ML dictates that overflow in integer arithmetic raises an overflow exception. As a consequence standard-conforming implementations of the language have to check for overflow which can be costly.We examine the possibility of further optimizing the code generated by the industrial-strength compiler MLton. By studying the code generated for integer arithmetic we identify dead code where overflow cannot happen. We propose a flow-sensitive integer interval analysis that detects and removes such needless overflow checks on integer arithmetic. We have implemented an analysis prototype in Standard ML and integrated it into MLton as an additional optimization pass. It is able to remove 22% of the overflow checks in the MLton benchmark suite. The binary size of the programs decrease up to 10% and the run time of arithmetic heavy programs decrease significantly - in some…

Ownership Types and Abstract Interpretation

Ilya Sergey, Dave Clarke, Ilya Sergey +4 more

Sociology and Political Science · · cited 0× · OpenAlex ↗ · more like this ·

Ownership types provide a declarative way to statically structure the topology of the heap and control aliasing in object-oriented programs. However, the relation between systematically derived static program analyses by abstract interpretation and semantic properties enforced by ownership types has not yet been investigated. In object dominance tree, based on the information provided by ownership types in the context of the owners-as-dominators policy. We develop a series of concrete and abstract domains that enable us to abstract a tree-like structure in a way that respects the ancestor relation between particular nodes of the tree and prove them to be Galois connections. We then plug the developed domains into a traditional abstract interpretation-based points-to analysis. The resulting abstract semantics is derived systematically from the concrete transition relation instrumented…

IS

Jan Midtgaard, Thomas P. Jensen, Hal Id Inria

Computer Networks and Communications · · cited 0× · OpenAlex ↗ · more like this ·

HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci-entific research documents, whether they are pub-lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers. L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et a ̀ la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés. appor t de r ech er ch e