# Handlers in Action. Ohad Kammar. Sam Lindley. Nicolas Oury. Abstract. 1. Introduction. University of Cambridge

Save this PDF as:

Size: px
Start display at page:

## Transcription

7 (values) A, B ::= 1 A 1 A 2 0 A 1 + A 2 U E C (computations) C ::= F A A C C 1 & C 2 (effect signatures) E ::= {op : A B} E (handlers) R ::= A E E C (environments) Γ ::= x 1 : A 1,..., x n : A n Figure 1. Types and Effects of λ eff (values) V, W ::= x () (V 1, V 2) inj i V {M} (computations) M, N ::= split(v, x 1.x 2.M) case 0(V ) case(v, x 1.M 1, x 2.M 2) V! return V let x M in N λx.m M V M 1, M 2 prj i M op V (λx.m) handle M with H (handlers) H ::= {return x M} H {op p k N} Figure 2. Syntax of λ eff Terms guage puts it (personal communication, 2012): effects + handlers : delimited continuations = while : goto Folds over free monads. As we shall see in Section 4, we can define an algebraic data type for a collection of operations, and a handler is exactly a fold (otherwise known as catamorphism) over that data type. 3. The λ eff -calculus In this section, we present a small-step operational semantics and a sound type and effect system for λ eff, a higher-order calculus of effect handlers. Following related work on effect operations [19], effect handlers [36], and monadic reflection [11], which takes Levy s call-by-push-value [24] as the underlying paradigm, we extend Levy s calculus with effect operations and effect handlers. For our purposes, the important features of call-by-push-value are that it makes an explicit distinction between values and computations, and that thunks are first-class objects distinct from functions. 3.1 Syntax and Static Semantics The types and effects of λ eff are given in Figure 1, the terms are given in Figure 2, and the typing rules are given in Figure 3. In all figures, the interesting parts are highlighted in grey. The unhighlighted parts are standard. Call-by-push-value makes a syntactic distinction between values and computations. Only value terms may be passed to functions, and only computation terms may compute. Value types (Figure 1) comprise the value unit type (1), value products (A 1 A 2), the empty type (0), sums (A 1 + A 2), and thunks (U EC). The latter is the type of suspended computations. The effect signature E describes the effects that such computations are allowed to cause. Computation types comprise value-returning computations (F A), functions (A C), the computation unit type ( ), and computation product types (C 1 & C 2). Call-by-push-value includes two kinds of products: computation products, which are eliminated by projection, and value products, which are eliminated by binding. An effect signature is a mapping from operations to pairs of value types, written as a set of type assignments. Each type assignment op : A B, specifies the parameter type A and return type B of operation op. A handler type A E E C has a input value type A, output computation type C, input effect signature E, and output effect signature E. A handler of this type handles value-returning computations of type F A that can only perform operations in E. The body of the handler itself may only perform operations in E, and its computation type is C. Type environments are standard. Value terms (Figure 2) include variables and value introduction forms. We write {M} for the thunk that represents the suspended computation M as a value. All elimination occurs in computation terms, as is standard for call-by-push-value. We write split(v, x 1.x 2.M) for the elimination form for value products, which binds the components of the product value V to the variables x 1 and x 2 in the computation M. We write M 1, M 2 for a computation pair and prj i M for the i-th projection of M. We write V! for the computation that forces the thunk V, that is, runs the computation suspended in V. A lambda-abstraction λx.m is not a value, so must be suspended to be passed as an argument. Function application, products, and projections are standard. In λ eff operation applications are in continuation-passing-style. An operation application op V (λx.m) takes a parameter V and a continuation λx.m. The intuition is that the operation op is applied to the parameter V, returning a value that is bound to x in the continuation computation M. We restrict the continuation to be a lambda abstraction in order to simplify the operational semantics. While programming with effects, it is more convenient to work with direct-style operation application. Direct-style application can be defined in terms of continuation-passing-style application: ôp V = op V (λx.return x), and vice versa: op V (λx.m) = let x ôp V in M. Plotkin and Power call the function λx.ôp x underlying a direct-style application the generic effect of op [35]. A handled computation handle M with H runs the computation M with the handler H. A handler H consists of a return clause return x M, and a set of operation clauses of the form op p k N. The return clause return x M specifies how to handle a return value. The returned value is bound to x in M. Each operation clause op p k N specifies how to handle applications of the distinct operation name op. The parameter is bound to p and the continuation is bound to k in N. The body of the continuation continues to be handled by the same handler. The typing rules are given in Figure 3. The computation typing judgement Γ E M : C states that in type environment Γ the computation M has type C and effect signature E. Only operations in the current effect signature can be applied. Handling a computation changes the current effect signature to the output effect signature of the handler. The effect signature and type of the handled computation must match up exactly with the input type and effect signature of the handler. In the handler typing judgement Γ H : R, all clauses must have the same output type and effect signature. The input type is determined by the return clause. The effect annotation on the thunked continuation parameter k in an operation clause op p k N is annotated with the output effect rather than the input effect. The reason for this is that when handling an operation, the handler is automatically wrapped around the continuation. Syntactic Sugar For convenience, we define syntactic sugar for projecting out the return clause and operation clauses of a handler. For any handler we write {return x M} {op i p k N i} i H return λx.m H op i λp i k i.n i

8 Value typing Γ V : A (x : A) Γ Γ x : A Γ () : 1 Γ V : A i Γ inj i V : A 1 + A 2 Computation typing Γ E M : C Γ V 1 : A 1 Γ V 2 : A 2 Γ (V 1, V 2) : A 1 A 2 Γ E M : C Γ {M} : U EC Γ V : A 1 A 2 Γ, x 1 : A 1, x 2 : A 2 E M : C Γ E split(v, x 1.x 2.M) : C Γ V : 0 Γ E case 0(V ) : C Γ V : A 1 + A 2 Γ, x 1 : A 1 E M 1 : C Γ, x 2 : A 2 E M 2 : C Γ E case(v, x 1.M 1, x 2.M 2) : C Γ V : U EC Γ E V! : C Γ, x : A E M : C Γ E λx.m : A C Γ E : Γ V : A Γ E return V : F A Γ E M : F A Γ, x : A E N : C Γ E let x M in N : C Γ E M : A C Γ V : A Γ E M V : C Γ E M 1 : C 1 Γ E M 2 : C 2 Γ E M 1, M 2 : C 1 & C 2 Γ E M : C 1 & C 2 Γ E prj i M : C i (op : A B) E Γ V : A Γ, x : B E M : C Γ E op V (λx.m) : C Handler typing Γ E M : F A Γ H : A E E C Γ E handle M with H : C Γ H : A E E C E = {op i : A i B i} i H = {return x M} {op i p k N i} i [Γ, p : A i, k : U E (B i C) E N i : C] i Γ, x : A E M : C 3.2 Operational Semantics Γ H : A E E C Figure 3. Typing Rules for λ eff The reduction relation ( ) for λ eff is defined in Figure 4. We use reduction frames as an auxiliary notion to simplify our presentation. The β-rules are standard: each β-redex arises as an introduction followed by an elimination. The first three β-rules eliminate value terms; the last three eliminate computation terms. The hoist.op-rule hoists operation applications through hoisting frames. Its purpose is to forward operation applications up to the nearest enclosing handler, so that they can be handled by the handle.op-rule. The handle.f -rule returns a value from a handled computation. It substitutes the returned value into the return clause of a handler Reduction frames (hoisting frames) H ::= let x [ ] in N [ ] V prj i [ ] (computation frames) C ::= H handle [ ] with H Reduction M M (β. ) split((v 1, V 2), x 1.x 2.M 1) M[V 1/x 1, V 2/x 2] (β.+) case(inj i V, x 1.M 1, x 2.M 2) M i[v/x i] (β.u) {M}! M (β.f ) (β. ) (β.&) let x return V in M M[V/x] (λx.m) V M[V/x] prj i M 1, M 2 M i (hoist.op) x / FV (H) H[op V (λx.m)] op V (λx.h[m]) (handle.f ) H return = λx.m handle (return V ) with H M[V/x] (handle.op) H op = λp k.n x / FV (H) handle op V (λx.m) with H N[V/p, {λx.handle M with H}/k] (frame) M M C[M] C[M ] Figure 4. Operational Semantics for λ eff in exactly the same way that β.f -reduction substitutes a returned value into the body of a let binding. The handle.op-rule is the most involved of the reduction rules. A handled operation application handle op V (λx.m) with H reduces to the body of the operation clause H op = λp k.n with the parameter V substituted for p and the continuation λx.m substituted for k. Any further operation applications should be handled by the same handler H. Thus, we wrap H around M. The frame-rule allows reduction to take place within any stack of computation frames, that is, inside any evaluation context. The semantics is deterministic, as any term has at most one redex. Furthermore, reduction on well-typed terms always terminates. Theorem 1 (Termination). If Γ E M : C then reduction on M terminates. Proof sketch: The proof is by a relatively straightforward adaptation of Lindley s proof of strong normalisation for sums [26]. The interesting rule is handle.op, which reinvokes the handler, possibly many times, but always on a subterm of the original computation. As with Ariola et al. s normalisation result for delimited continuations [1], termination depends crucially on the effect type system. Theorem 2 (Type soundness). If {} M : F A then M reduces to a returned value return V of type A. Proof sketch: Define a canonical term to be any computation term of the form: return V, λx.n,, V, W, or op V (λx.m). Induction on typing derivations shows progress: if E M : C then, either there exists M such that M M, or M is canonical. By appeal to a substitution lemma, induction on typing

### Handlers in Action. Ohad Kammar. Sam Lindley. Nicolas Oury. Abstract. 1. Introduction. University of Cambridge ohad.kammar@cl.cam.ac.

Handlers in Action Ohad Kammar University of Cambridge ohad.kammar@cl.cam.ac.uk Sam Lindley University of Strathclyde Sam.Lindley@ed.ac.uk Nicolas Oury nicolas.oury@gmail.com Abstract Plotkin and Pretnar

Ohad Kammar Higher-Order Programming and Effects (HOPE) September 8, 2012 joint with Sam Lindley and Nicolas Oury Isaac Newton Trust Computer Laboratory Exception handlers handle

### Simulation-Based Security with Inexhaustible Interactive Turing Machines

Simulation-Based Security with Inexhaustible Interactive Turing Machines Ralf Küsters Institut für Informatik Christian-Albrechts-Universität zu Kiel 24098 Kiel, Germany kuesters@ti.informatik.uni-kiel.de

### Regular Expressions and Automata using Haskell

Regular Expressions and Automata using Haskell Simon Thompson Computing Laboratory University of Kent at Canterbury January 2000 Contents 1 Introduction 2 2 Regular Expressions 2 3 Matching regular expressions

### Chapter 7: Functional Programming Languages

Chapter 7: Functional Programming Languages Aarne Ranta Slides for the book Implementing Programming Languages. An Introduction to Compilers and Interpreters, College Publications, 2012. Fun: a language

### Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic

Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic Lars Birkedal Rasmus Ejlers Møgelberg Rasmus Lerchedahl Petersen IT University Technical Report Series TR-00-7 ISSN 600 600 February 00

### Moving from CS 61A Scheme to CS 61B Java

Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you

Chalmers Göteborgs Universitet Alejandro Russo, Computer Science and Engineering Advanced Functional Programming TDA342/DIT260 Tuesday, March 15, 2016, Hörsalsvägen (yellow brick building), 8:30-12:30.

### Type Classes with Functional Dependencies

Appears in Proceedings of the 9th European Symposium on Programming, ESOP 2000, Berlin, Germany, March 2000, Springer-Verlag LNCS 1782. Type Classes with Functional Dependencies Mark P. Jones Department

### [Refer Slide Time: 05:10]

Principles of Programming Languages Prof: S. Arun Kumar Department of Computer Science and Engineering Indian Institute of Technology Delhi Lecture no 7 Lecture Title: Syntactic Classes Welcome to lecture

### Functional Programming

FP 2005 1.1 3 Functional Programming WOLFRAM KAHL kahl@mcmaster.ca Department of Computing and Software McMaster University FP 2005 1.2 4 What Kinds of Programming Languages are There? Imperative telling

### Programming and Reasoning with Algebraic Effects and Dependent Types

Programming and Reasoning with Algebraic Effects and Dependent Types Edwin C. Brady School of Computer Science, University of St Andrews, St Andrews, Scotland. Email: ecb10@st-andrews.ac.uk Abstract One

### POLYTYPIC PROGRAMMING OR: Programming Language Theory is Helpful

POLYTYPIC PROGRAMMING OR: Programming Language Theory is Helpful RALF HINZE Institute of Information and Computing Sciences Utrecht University Email: ralf@cs.uu.nl Homepage: http://www.cs.uu.nl/~ralf/

### Functional Programming. Functional Programming Languages. Chapter 14. Introduction

Functional Programming Languages Chapter 14 Introduction Functional programming paradigm History Features and concepts Examples: Lisp ML 1 2 Functional Programming Functional Programming Languages The

### KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

KITES TECHNOLOGY 360 Degree Solution www.kitestechnology.com/academy.php info@kitestechnology.com technologykites@gmail.com Contact: - 8961334776 9433759247 9830639522.NET JAVA WEB DESIGN PHP SQL, PL/SQL

### 05 Case Study: C Programming Language

CS 2SC3 and SE 2S03 Fall 2009 05 Case Study: C Programming Language William M. Farmer Department of Computing and Software McMaster University 18 November 2009 The C Programming Language Developed by Dennis

### The countdown problem

JFP 12 (6): 609 616, November 2002. c 2002 Cambridge University Press DOI: 10.1017/S0956796801004300 Printed in the United Kingdom 609 F U N C T I O N A L P E A R L The countdown problem GRAHAM HUTTON

### 13 Variables, Datatypes, and Search

13 Variables, Datatypes, and Search Chapter Objectives Chapter Contents Variables introduced Basic support for type systems Fundamental to search Creating and binding variables set let Depth-first search

### ML for the Working Programmer

ML for the Working Programmer 2nd edition Lawrence C. Paulson University of Cambridge CAMBRIDGE UNIVERSITY PRESS CONTENTS Preface to the Second Edition Preface xiii xv 1 Standard ML 1 Functional Programming

### Fun with Phantom Types

1 Fun with Phantom Types RALF HINZE Institut für Informatik III, Universität Bonn Römerstraße 164, 53117 Bonn, Germany Email: ralf@informatik.uni-bonn.de Homepage: http://www.informatik.uni-bonn.de/~ralf

### Introduction to Java A First Look

Introduction to Java A First Look Java is a second or third generation object language Integrates many of best features Smalltalk C++ Like Smalltalk Everything is an object Interpreted or just in time

### Advanced Functional Programming (9) Domain Specific Embedded Languages

Advanced Functional Programming (9) Domain Specific Embedded Languages Advanced Functional Programming (9) Domain Specific Embedded Languages, Universiteit Utrecht http://www.cs.uu.nl/groups/st/ February

### Deterministic Discrete Modeling

Deterministic Discrete Modeling Formal Semantics of Firewalls in Isabelle/HOL Cornelius Diekmann, M.Sc. Dr. Heiko Niedermayer Prof. Dr.-Ing. Georg Carle Lehrstuhl für Netzarchitekturen und Netzdienste

### Product types are finite labeled products of types. They are a generalization of cartesian product. Elements of product types are called records.

Chapter 6 User-defined types The user is allowed to define his/her own data types. With this facility, there is no need to encode the data structures that must be manipulated by a program into lists (as

### Testing LTL Formula Translation into Büchi Automata

Testing LTL Formula Translation into Büchi Automata Heikki Tauriainen and Keijo Heljanko Helsinki University of Technology, Laboratory for Theoretical Computer Science, P. O. Box 5400, FIN-02015 HUT, Finland

### An Introduction to Algebraic Effects and Handlers

MFPS 2015 An Introduction to Algebraic Effects and Handlers Invited tutorial paper Matija Pretnar 1 Faculty of Mathematics and Physics University of Ljubljana Slovenia Abstract This paper is a tutorial

### The Clean programming language. Group 25, Jingui Li, Daren Tuzi

The Clean programming language Group 25, Jingui Li, Daren Tuzi The Clean programming language Overview The Clean programming language first appeared in 1987 and is still being further developed. It was

### Summary. Pre requisition. Content Details: 1. Basics in C++

Summary C++ Language is one of the approaches to provide object-oriented functionality with C like syntax. C++ adds greater typing strength, scoping and other tools useful in object-oriented programming

### Overview. Elements of Programming Languages. Advanced constructs. Motivating inner class example

Overview Elements of Programming Languages Lecture 12: Object-oriented functional programming James Cheney University of Edinburgh November 6, 2015 We ve now covered: basics of functional and imperative

Monads for functional programming Philip Wadler, University of Glasgow Department of Computing Science, University of Glasgow, G12 8QQ, Scotland (wadler@dcs.glasgow.ac.uk) Abstract. The use of monads to

### + addition - subtraction and unary minus * multiplication / division mod modulo

Chapter 4 Basic types We examine in this chapter the Caml basic types. 4.1 Numbers Caml Light provides two numeric types: integers (type int) and floating-point numbers (type float). Integers are limited

### Introducing Formal Methods. Software Engineering and Formal Methods

Introducing Formal Methods Formal Methods for Software Specification and Analysis: An Overview 1 Software Engineering and Formal Methods Every Software engineering methodology is based on a recommended

### Ralf Hinze Generic Programs and Proofs

Ralf Hinze Generic Programs and Proofs Bonn, 2000 Für Anja, Lisa und Florian Brief contents 1 Introduction 1 2 Background 15 3 Generic programs 53 4 Generic proofs 87 5 Examples 107 6 Generic Haskell 147

### Productive Coprogramming with Guarded Recursion

Productive Coprogramming with Guarded Recursion Robert Atkey bob.atkey@gmail.com Conor McBride University of Strathclyde Conor.McBride@strath.ac.uk Abstract Total functional programming offers the beguiling

### Glossary of Object Oriented Terms

Appendix E Glossary of Object Oriented Terms abstract class: A class primarily intended to define an instance, but can not be instantiated without additional methods. abstract data type: An abstraction

### Extensible Effects An Alternative to Monad Transformers

Extensible Effects An Alternative to Monad Transformers Oleg Kiselyov Amr Sabry Cameron Swords Haskell Symposium 2013 Boston, MA Sep 23, 2013 We design and implement a library that solves the long-standing

### Course: Introduction to Java Using Eclipse Training

Course: Introduction to Java Using Eclipse Training Course Length: Duration: 5 days Course Code: WA1278 DESCRIPTION: This course introduces the Java programming language and how to develop Java applications

### The IC Language Specification. Spring 2006 Cornell University

The IC Language Specification Spring 2006 Cornell University The IC language is a simple object-oriented language that we will use in the CS413 project. The goal is to build a complete optimizing compiler

### Advanced compiler construction. General course information. Teacher & assistant. Course goals. Evaluation. Grading scheme. Michel Schinz 2007 03 16

Advanced compiler construction Michel Schinz 2007 03 16 General course information Teacher & assistant Course goals Teacher: Michel Schinz Michel.Schinz@epfl.ch Assistant: Iulian Dragos INR 321, 368 64

### Chapter 15 Functional Programming Languages

Chapter 15 Functional Programming Languages Introduction - The design of the imperative languages is based directly on the von Neumann architecture Efficiency (at least at first) is the primary concern,

### Theory of Computation Lecture Notes

Theory of Computation Lecture Notes Abhijat Vichare August 2005 Contents 1 Introduction 2 What is Computation? 3 The λ Calculus 3.1 Conversions: 3.2 The calculus in use 3.3 Few Important Theorems 3.4 Worked

### Types, Polymorphism, and Type Reconstruction

Types, Polymorphism, and Type Reconstruction Sources This material is based on the following sources: Pierce, B.C., Types and Programming Languages. MIT Press, 2002. Kanellakis, P.C., Mairson, H.G. and

### Generating Web Applications from Process Models

Generating Web Applications from Process Models Jan Schulz-Hofen, Silvan Golega Hasso-Plattner-Institute for Software Systems Engineering Prof.-Dr.-Helmert-Str. 2-3 D-14482 Potsdam, Germany {jan.schulz-hofen,

### CMSC 858T: Randomized Algorithms Spring 2003 Handout 8: The Local Lemma

CMSC 858T: Randomized Algorithms Spring 2003 Handout 8: The Local Lemma Please Note: The references at the end are given for extra reading if you are interested in exploring these ideas further. You are

### A Propositional Dynamic Logic for CCS Programs

A Propositional Dynamic Logic for CCS Programs Mario R. F. Benevides and L. Menasché Schechter {mario,luis}@cos.ufrj.br Abstract This work presents a Propositional Dynamic Logic in which the programs are

### Java (12 Weeks) Introduction to Java Programming Language

Java (12 Weeks) Topic Lecture No. Introduction to Java Programming Language 1 An Introduction to Java o Java as a Programming Platform, The Java "White Paper" Buzzwords, Java and the Internet, A Short

### Pretty-big-step semantics

Pretty-big-step semantics Arthur Charguéraud INRIA October 2012 1 / 34 Motivation Formalization of JavaScript with Sergio Maeis, Daniele Filaretti, Alan Schmitt, Martin Bodin. Previous work: Semi-formal

### Embedded Software Development with MPS

Embedded Software Development with MPS Markus Voelter independent/itemis The Limitations of C and Modeling Tools Embedded software is usually implemented in C. The language is relatively close to the hardware,

### The Import & Export of Data from a Database

The Import & Export of Data from a Database Introduction The aim of these notes is to investigate a conceptually simple model for importing and exporting data into and out of an object-relational database,

### Integrating Formal Models into the Programming Languages Course

Integrating Formal Models into the Programming Languages Course Allen B. Tucker Robert E. Noonan Computer Science Department Computer Science Department Bowdoin College College of William and Mary Brunswick,

### New Generation of Software Development

New Generation of Software Development Terry Hon University of British Columbia 201-2366 Main Mall Vancouver B.C. V6T 1Z4 tyehon@cs.ubc.ca ABSTRACT In this paper, I present a picture of what software development

### 1 Introduction. 2 An Interpreter. 2.1 Handling Source Code

1 Introduction The purpose of this assignment is to write an interpreter for a small subset of the Lisp programming language. The interpreter should be able to perform simple arithmetic and comparisons

### Curriculum Map. Discipline: Computer Science Course: C++

Curriculum Map Discipline: Computer Science Course: C++ August/September: How can computer programs make problem solving easier and more efficient? In what order does a computer execute the lines of code

### Seeing the wood through the trees

Seeing the wood through the trees A DIY guide to reasoning about effects Graham Hutton and Diana Fulger University of Nottingham December 16, 2007 Graham Hutton and Diana Fulger (University of Nottingham)

### A single minimal complement for the c.e. degrees

A single minimal complement for the c.e. degrees Andrew Lewis Leeds University, April 2002 Abstract We show that there exists a single minimal (Turing) degree b < 0 s.t. for all c.e. degrees 0 < a < 0,

### 2. Names, Scopes, and Bindings

2. Names, Scopes, and Bindings Binding, Lifetime, Static Scope, Encapsulation and Modules, Dynamic Scope Copyright 2010 by John S. Mallozzi Names Variables Bindings Binding time Language design issues

### Probabilities and Random Variables

Probabilities and Random Variables This is an elementary overview of the basic concepts of probability theory. 1 The Probability Space The purpose of probability theory is to model random experiments so

### AURA: A language with authorization and audit

AURA: A language with authorization and audit Steve Zdancewic University of Pennsylvania WG 2.8 2008 Security-oriented Languages Limin Jia, Karl Mazurak, Jeff Vaughan, Jianzhou Zhao Joey Schorr and Luke

### Magic Tutorial #S-1: The scheme command-line interpreter

Magic Tutorial #S-1: The scheme command-line interpreter Rajit Manohar Department of Computer Science California Institute of Technology Pasadena, CA 91125 This tutorial corresponds to Magic version 7.

### Data Structure Reverse Engineering

Data Structure Reverse Engineering Digging for Data Structures Polymorphic Software with DSLR Scott Hand October 28 th, 2011 Outline 1 Digging for Data Structures Motivations Introduction Laika Details

### Asymptotic Improvement of Computations over Free Monads

Asymptotic Improvement of Computations over Free Monads Janis Voigtländer Institut für Theoretische Informatik Technische Universität Dresden 01062 Dresden, Germany janis.voigtlaender@acm.org Abstract.

### Formal Engineering for Industrial Software Development

Shaoying Liu Formal Engineering for Industrial Software Development Using the SOFL Method With 90 Figures and 30 Tables Springer Contents Introduction 1 1.1 Software Life Cycle... 2 1.2 The Problem 4 1.3

### Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters

Interpreters and virtual machines Michel Schinz 2007 03 23 Interpreters Interpreters Why interpreters? An interpreter is a program that executes another program, represented as some kind of data-structure.

### Categorical Monads and Computer Programming

London Mathematical Society Impact150 Stories 1 (2015) 9 14 C 2015 Author(s) doi:10.1112/i150lms/t.0002 Categorical Monads and Computer Programming Nick Benton Abstract The categorical notion of monad

### INF5140: Specification and Verification of Parallel Systems

INF5140: Specification and Verification of Parallel Systems Lecture 7 LTL into Automata and Introduction to Promela Gerardo Schneider Department of Informatics University of Oslo INF5140, Spring 2007 Gerardo

### Programming Languages in Artificial Intelligence

Programming Languages in Artificial Intelligence Günter Neumann, German Research Center for Artificial Intelligence (LT Lab, DFKI) I. AI programming languages II. Functional programming III. Functional

### OutsideIn(X) Modular type inference with local assumptions

Under consideration for publication in J. Functional Programming 1 OutsideIn(X) Modular type inference with local assumptions 11 April 2011 Dimitrios Vytiniotis Microsoft Research Simon Peyton Jones Microsoft

### Fundamentals of Java Programming

Fundamentals of Java Programming This document is exclusive property of Cisco Systems, Inc. Permission is granted to print and copy this document for non-commercial distribution and exclusive use by instructors

### CS 2112 Spring 2014. 0 Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions

CS 2112 Spring 2014 Assignment 3 Data Structures and Web Filtering Due: March 4, 2014 11:59 PM Implementing spam blacklists and web filters requires matching candidate domain names and URLs very rapidly

### Syntax Check of Embedded SQL in C++ with Proto

Proceedings of the 8 th International Conference on Applied Informatics Eger, Hungary, January 27 30, 2010. Vol. 2. pp. 383 390. Syntax Check of Embedded SQL in C++ with Proto Zalán Szűgyi, Zoltán Porkoláb

### Data Abstraction and Hierarchy

Data Abstraction and Hierarchy * This research was supported by the NEC Professorship of Software Science and Engineering. Barbara Liskov Affiliation: MIT Laboratory for Computer Science Cambridge, MA,

### Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Samarjit Chakraborty Computer Engineering and Networks Laboratory Swiss Federal Institute of Technology (ETH) Zürich March

### Programming and Reasoning with Side-Effects in IDRIS

Programming and Reasoning with Side-Effects in IDRIS Edwin Brady 19th October 2014 Contents 1 Introduction 3 1.1 Hello world............................................. 3 1.2 Outline................................................

### Verified Networking using Dependent Types

Verified Networking using Dependent Types CS4099: Major Software Project Simon Fowler 2014-04-04 Supervisor: Dr Edwin Brady Abstract Strongly, statically typed functional programming languages have found

### Chapter 2: Problem Solving Using C++

Chapter 2: Problem Solving Using C++ 1 Objectives In this chapter, you will learn about: Modular programs Programming style Data types Arithmetic operations Variables and declaration statements Common

### Detecting Pattern-Match Failures in Haskell. Neil Mitchell and Colin Runciman York University www.cs.york.ac.uk/~ndm/catch

Detecting Pattern-Match Failures in Haskell Neil Mitchell and Colin Runciman York University www.cs.york.ac.uk/~ndm/catch Does this code crash? risers [] = [] risers [x] = [[x]] risers (x:y:etc) = if x

### Observational Program Calculi and the Correctness of Translations

Observational Program Calculi and the Correctness of Translations Manfred Schmidt-Schauss 1, David Sabel 1, Joachim Niehren 2, and Jan Schwinghammer 1 Goethe-University, Frankfurt, Germany 2 INRIA Lille,

### The PCAT Programming Language Reference Manual

The PCAT Programming Language Reference Manual Andrew Tolmach and Jingke Li Dept. of Computer Science Portland State University (revised October 8, 2004) 1 Introduction The PCAT language (Pascal Clone

### Andrew Pitts chapter for D. Sangorgi and J. Rutten (eds), Advanced Topics in Bisimulation and Coinduction, Cambridge Tracts in Theoretical Computer

Andrew Pitts chapter for D. Sangorgi and J. Rutten (eds), Advanced Topics in Bisimulation and Coinduction, Cambridge Tracts in Theoretical Computer Science No. 52, chapter 5, pages 197 232 ( c 2011 CUP)

### The Classes P and NP

The Classes P and NP We now shift gears slightly and restrict our attention to the examination of two families of problems which are very important to computer scientists. These families constitute the

### OPERATIONAL TYPE THEORY by Adam Petcher Prepared under the direction of Professor Aaron Stump A thesis presented to the School of Engineering of

WASHINGTON NIVERSITY SCHOOL OF ENGINEERING AND APPLIED SCIENCE DEPARTMENT OF COMPTER SCIENCE AND ENGINEERING DECIDING JOINABILITY MODLO GROND EQATIONS IN OPERATIONAL TYPE THEORY by Adam Petcher Prepared

### (Refer Slide Time: 1:41)

Discrete Mathematical Structures Dr. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture # 10 Sets Today we shall learn about sets. You must

### Object-Oriented Software Specification in Programming Language Design and Implementation

Object-Oriented Software Specification in Programming Language Design and Implementation Barrett R. Bryant and Viswanathan Vaidyanathan Department of Computer and Information Sciences University of Alabama

### Making Standard ML a Practical Database Programming Language

Making Standard ML a Practical Database Programming Language Atsushi Ohori Katsuhiro Ueno Research Institute of Electrical Communication Tohoku University {ohori, katsu}@riec.tohoku.ac.jp Abstract Integrating

### CHAPTER 7 GENERAL PROOF SYSTEMS

CHAPTER 7 GENERAL PROOF SYSTEMS 1 Introduction Proof systems are built to prove statements. They can be thought as an inference machine with special statements, called provable statements, or sometimes

### HiDb: A Haskell In-Memory Relational Database

HiDb: A Haskell In-Memory Relational Database Rohan Puttagunta Arun Debray Susan Tu CS240H rohanp adebray sctu @stanford.edu June 11, 2014 Abstract We describe our experience implementing an in-memory

### 09336863931 : provid.ir

provid.ir 09336863931 : NET Architecture Core CSharp o Variable o Variable Scope o Type Inference o Namespaces o Preprocessor Directives Statements and Flow of Execution o If Statement o Switch Statement

### Domain Theory: An Introduction

Domain Theory: An Introduction Robert Cartwright Rebecca Parsons Rice University This monograph is an unauthorized revision of Lectures On A Mathematical Theory of Computation by Dana Scott [3]. Scott

### Resurrecting Ada s Rendez-Vous in Java

Resurrecting Ada s Rendez-Vous in Java Luis Mateu, José M. Piquer and Juan León DCC - Universidad de Chile Casilla 2777, Santiago, Chile lmateu@dcc.uchile.cl Abstract Java is a programming language designed

### 4 Domain Relational Calculus

4 Domain Relational Calculus We now present two relational calculi that we will compare to RA. First, what is the difference between an algebra and a calculus? The usual story is that the algebra RA is

### Unboxed Polymorphic Objects for Functional Numerical Programming

Unboxed Polymorphic Objects for Functional Numerical Programming Christopher Rodrigues cirodrig@illinois.edu Wen-Mei Hwu w-hwu@illinois.edu IMPACT Technical Report IMPACT-12-02 University of Illinois at

### Functional Programming in C++11

Functional Programming in C++11 science + computing ag IT-Dienstleistungen und Software für anspruchsvolle Rechnernetze Tübingen München Berlin Düsseldorf An Overview Programming in a functional style

### 6.080/6.089 GITCS Feb 12, 2008. Lecture 3

6.8/6.89 GITCS Feb 2, 28 Lecturer: Scott Aaronson Lecture 3 Scribe: Adam Rogal Administrivia. Scribe notes The purpose of scribe notes is to transcribe our lectures. Although I have formal notes of my

### Towards a Framework for Generating Tests to Satisfy Complex Code Coverage in Java Pathfinder

Towards a Framework for Generating Tests to Satisfy Complex Code Coverage in Java Pathfinder Matt Department of Computer Science and Engineering University of Minnesota staats@cs.umn.edu Abstract We present

### Chapter 7 Application Protocol Reference Architecture

Application Protocol Reference Architecture Chapter 7 Application Protocol Reference Architecture This chapter proposes an alternative reference architecture for application protocols. The proposed reference

### Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff

D80198GC10 Oracle Database 12c SQL and Fundamentals Summary Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff Level Professional Delivery Method Instructor-led

### Modeling Guidelines Manual

Modeling Guidelines Manual [Insert company name here] July 2014 Author: John Doe john.doe@johnydoe.com Page 1 of 22 Table of Contents 1. Introduction... 3 2. Business Process Management (BPM)... 4 2.1.

### Keywords: Regression testing, database applications, and impact analysis. Abstract. 1 Introduction

Regression Testing of Database Applications Bassel Daou, Ramzi A. Haraty, Nash at Mansour Lebanese American University P.O. Box 13-5053 Beirut, Lebanon Email: rharaty, nmansour@lau.edu.lb Keywords: Regression

### A Value Transmission Method for Abstract Data Types

A Value Transmission Method for Abstract Data Types M. HERLIHY and B. LISKOV Massachusetts Institute of Technology Abstract data types have proved to be a useful technique for structuring systems. In large