Eliminating the shortcomings of free datatype definitions

Size: px
Start display at page:

Download "Eliminating the shortcomings of free datatype definitions"

Transcription

1 Research Collection Report Eliminating the shortcomings of free datatype definitions Author(s): Missura, Stephan Albert Publication Date: Permanent Link: Rights / License: In Copyright - Non-Commercial Use Permitted This page was generated automatically upon download from the ETH Zurich Research Collection. For more information please consult the Terms of use. ETH Library

2 Eidgenossische Technische Hochschule Zurich Departement Informatik Institut fur Theoretische Informatik Stephan A. Missura Eliminating the Shortcomings of Free Datatype Denitions December

3 ETH Zurich Departement Informatik Institut fur Theoretische Informatik Prof. Dr. P. Widmayer Stephan A. Missura Institut fur Theoretische Informatik ETH Zentrum CH-8092 Zurich Switzerland This report is available via or as ftp://ftp.inf.ethz.ch/pub/publications/tech-reports/242.ps.gz c 1995 Departement Informatik, ETH Zurich

4 Eliminating the Shortcomings of Free Datatype Denitions Stephan A. Missura Abstract Free datatypes unify the concepts of enumeration types, disjoint unions and recursive types, and are used for dening new terms and operations on them. They correspond to the mathematical concept of term algebras and are a fundamental part of typed functional languages for representing dynamic data structures. But free datatypes are types and not algebras and this results in several drawbacks. The most important is the implicit binding of the constructors to identiers without any explicit binding statement. We discuss these drawbacks and propose an explicit language construct for creating term algebras. This is a small extension for languages that already include constructs for building structures and signatures, and brings us all the advantages of free datatypes without their shortcomings. Several examples are presented in this formalism. 1 Introduction Free datatypes { alsoknown as algebraic, freely generated, inductive, oruser-dened types [20, 22, 24] { are a fundamental part of typed functional languages such as Standard ML [11], Haskell [14], Miranda [23], Opal [7] or the Calculus of Inductive Constructions [15]. They allow the denition of tree-like 1 dynamic data structures without the explicit use of pointers and memory management operations [13] and unify enumeration types, disjoint unions (sum types) and recursive types into one uniform concept. Usually, the constructors can be used in patterns to decompose terms into their building components resulting in more readable function denitions [20, 24]. Furthermore, structural induction can be used as a proof technique [24]. Free datatypes can be compared with the mathematical notion of term algebras (also called free or word algebras) [22, 26] but with the dierence that they are used as types and not as algebraic structures. This results in several drawbacks: Constructor functions are bound \behind the scene", extending implicitly the current scope by new identiers. Only the dened type { the carrier of the term algebra { is bound explicitly to an identier. This results also in an unpleasant mixing of syntax and semantics. Furthermore, the construct can't be used anonymously (similar to functions in ordinary languages, which can'tbe dened anonymously). Research supported by the Swiss National Science Foundation. 1 Assuming eager evaluation of constructors. Languages that use lazy evaluation such as Haskell also allow the building of cyclic structures. 3

5 By extending a language that already includes constructs for building signatures and structures such as Standard ML with an explicit term algebra constructor, we show how the drawbacks of free datatypes can be eliminated. Several examples show the advantages of this term algebraic style of dening free algebras over the style provided by datatype denitions. 2 Free datatypes For discussing the possibilities of free datatypes and their shortcomings we use the syntax of the functional language Standard ML. 2 But in fact any other language with a similar construct could have been used, say Haskell or the Calculus of Inductive Constructions. The general form of a (free) datatype denition in Standard ML can be found in Figure 1. This construct generates n new types T i (1 i n) { the free datatypes { where the T jk (1 j n 1 k m j )aretypes which mayalsocontain T i. Additionally, the datatype construct binds the identier K jk to a new constant (nullary constructor) withtype T j (8j k :1 j n 1 k l j )and the identier C jk to a new function (constructor function) of type T jk -> T j which constructs compound terms of type T j (8j k : 1 j n 1 k m j ). The values denoted by K jk and C jk are called constructors because each value of the free datatype is constructed using the constants and constructor functions. We give now some examples of free datatypes, which should demonstrate the usefulness of them. They allow the denition of enumeration types. We simply enumerate all the constants of the type. For instance, the datatype of booleans is constructed as follows: datatype bool = true false The output of a common Standard ML interpreter 3 datatype bool con false : bool con true : bool would look like: This means that a new type bool is dened and bound to the identier bool. This binding is then inserted in the current scope, as are the bindings of the two nullary constructors true and false to the identiers true and false. 2 A formal semantics for datatypes in Standard ML can be found in [11]. 3 Standard ML of New Jersey, Version 0.93 in our case. 4

6 datatype T 1 = K 11 K 1l 1 C 11 of T 11 C 1m 1 of T 1m 1 and T i = and T n = K n1 K nln C n1 of T n1 C nmn of T nmn Figure 1: General form of free datatypes in Standard ML recursive types. Say, the natural numbers where the nullary constructor zero is the base case, and the constructor succ is used to build \new" natural numbers out of \old" ones: datatype nat = zero succ of nat datatype nat con zero :nat con succ :nat > nat parametrized types. The datatype can be parametrized by a type such as binary trees over an arbitrary type: 4 datatype 'a bintree = empty node of ('a bintree) * 'a * ('a bintree) datatype 'a bintree con empty : 'a bintree con node : 'a bintree 'a 'a bintree > 'a bintree 4 Denoted by thetype variable 'a. 5

7 mutually recursive types: datatype file = text of string dir of directory and directory = entries of file list datatype le con dir : directory > le con text : string > le datatype directory con entries : le list > directory In the next section we discuss several shortcomings of dening free datatypes in the style presented in this section. 3 Shortcomings of free datatypes The binding of the constructors to their corresponding identiers is not done with an explicit binding construct as opposed to the new dened types which are introduced explicitly. In other words: the current environment of bindings of identier to values is implicitly enlarged with new bindings. This unpleasant eect can be demonstrated with the following implementation of a stack using Standard ML's module system. The carrier of the structure is dened as a free datatype: structure Stack = struct datatype 'a stack = empty push of 'a * 'a stack fun pop (push (el, st)) = st fun top (push (el, st)) = el end The components of the structure are not only the type stack and the selectors pop and top, respectively, but also the stack constructors empty and push! Hence, we can't search for labels only on the left side of the binding constructs but we have to search also on the right side in case of a datatype denition. The same problem arises in Modula-2 [27] while importing an enumeration type from an implementation module: the constants of the enumeration type are implicitly imported without being mentioned in the import list. Syntax and semantics are intermixed: the same name is used for the identiers (i.e. syntax) denoting constructors as for the printed form of constructed terms (semantics). 6

8 Not usable anonymously: we have to bind the types in a datatype denition to identiers (the constructors are bound implicitly as seen above), also in cases where it wouldn't be necessary. Curried constructors are not possible because the return type of constructors is implicitly the type to be dened. 5 The needed ingredients for eliminating these shortcomings, namely structures, signatures and an explicit term algebra constructor, are presented in the next two sections. 4 Structures A denition is a binding of an identier { including an explicitly given type { to a value and a structure is a nite collection of denitions. Structures are called environments in MIT Scheme 6 [2], structures or modules in Standard ML and implementation modules in Modula-2. The syntax of structures { inspired by languages for records [4, 10] { is dened by the grammar in Figure 2. Ident represents some class of identiers and Type some class of types which consists at least of a type or kind Type { the type or kind of types [3, 18]. Structure! \< >" j Structure \+" Def inition Def inition! Ident \:" T ype \:=" Expr Figure 2: The syntax of structures < > represents the empty structure and the operator + allows to add further components to the structure. The syntactical form < x 1 :T 1 := e 1 x n :T n := e n > is simply an abbreviation for the structure <> + x 1 :T 1 := e x n :T n := e n 5 The Calculus of Inductive allows curried constructors because the return type is explicitly mentioned and hence can be a function type, too. 6 But not included in the denition of Scheme [1]. 7

9 We give now some examples of structures: Given the type bool for booleans and the constants true and false, we construct the structure Bool consisting of entry T for the carrier and entries t, f for the constants: Bool := < T : Type := bool t : bool := true f : bool := false > The structure of lexically ordered strings: LexString := < T : Type := string cmp : string * string -> bool := lex > The natural numbers with a partial order: PartiallyOrderedNat := < T : Type := nat cmp : nat * nat -> bool := divides > Important: Structures are not types, hence we can't have instances of them. 5 Signatures A declaration is a binding of an identier to a type. A signature is a nite collection of declarations. Standard ML provides this in form of signatures and Modula-2 in form of denition modules. Signatures describe structures and are their types. Because the type of an entry in a signature can depend on other preceding entries, signatures are syntactic sugar for dependent sum types [19]. This denition of a signature is an essential dierence from the usual presentation in algebraic specication [25], where a signature is a pair (S ) consisting of a set S of sorts and a family of operators indexed by non-empty strings of sorts. Hence, sort and operator declarations are handled dierently, as opposed to the more uniform denition we use. In fact, also properties can be modelled in this way [18]. The syntax of signatures { very similar to structures { is dened by the grammar in Figure 3. << represents the empty signature. The operator + allows to extend a given signature by new declarations. A formal treatment of those extensions which are valid, including further operations on signatures, can be found in [18]. 8

10 Signature! \<< " j Signature \+" Declaration Declaration! Ident \:" Type Figure 3: The syntax of signatures As in the case of structures, the syntactical form << x 1 :T 1 x n :T n stands for the signature << + x 1 :T x n :T n Some examples for signatures: A signature which isatype for the preceding example of the structure Bool: BoolSig := << T : Type t : T f : T As one can see the components t and f depend on the rst entry T. A signature for partial orders being a valid type for the structures LexString and PartiallyOrderedNat, respectively: PartialOrder := << T : Type cmp : T * T -> bool 6 Term algebras with free We propose the term algebra constructor free as an explicit language construct for eliminating the shortcomings of datatypes: Q If Sig is the type of signatures then free gets the type s:sig s. This type is a dependent product [24]. Hence, free is a function receiving a signature s as argument and producing a structure of type s, namely the term or free algebra of the signature s [25, 22]. Figure 4 shows how thedatatype declaration of Figure 1 can be transformed into a corresponding signature and what free produces if applied to that signature. 9

11 << T 1 T n :Type :Type K 11 : T 1 K nl1 : T n C 11 : T 11 -> T 1 C nm1 : T nmn -> T n free- < T 1 :Type := new type 1 T n :Type := new type n K 11 : T 1 := new constant 11 K nl1 : T n := new constant nl1 C 11 : T 11 -> T 1 := new constructor 11 C nm1 : T nmn -> T n := new constructor nm1 > Figure 4: The term algebra constructor free We translate now the examples of section 2 into a term algebraic style using free: enumeration types. The free algebra Bool of booleans: Bool := free << bool : Type true : bool false : bool bool := Bool.bool true := Bool.true false := Bool.false recursive types. The natural numbers: Nat := free << nat : Type zero : nat succ : nat -> nat nat := Nat.nat zero := Nat.zero succ := Nat.succ parametrized types. We need a type constructor tree as a component for simulating parametrized datatypes: Tree := free << tree : Type -> Type empty : tree 'a node : (tree 'a) * 'a * (tree 'a) -> (tree 'a) 10

12 tree := Tree.tree empty := Tree.empty node := Tree.node mutually recursive types: FileDir := free << file : Type directory : Type text : string -> file dir : directory -> file entries : list(file) -> directory filet := FileDir.file dirt := FileDir.directory textc := FileDir.text dirc := FileDir.dir entriesc := FileDir.entries We had to write more lines code than the corresponding datatype denition because all bindings are now explicit (clearly, it is not mandatory to have all bindings globally visible). Hence, no binding happens \behind the user's back". Helpful for dealing with free is an open construct, which adds all the bindings of a structure to the current environment (as in Standard ML). It eliminates the need for intermediate identiers. Hence, the example of booleans simply becomes: open (free << bool : Type true : bool false : bool ) As a last example we rewrite the stack structure mentioned in section 3 into the term algebraic style. The example shows also that the possibility of adding entries to a given structure is essential in this formalism: Stack := free << stack : Type -> Type empty : stack('a) push : 'a * stack('a) -> stack('a) + pop : stack('a) -> stack('a) :=... + top : stack('a) -> 'a :=... First, we construct the free algebra consisting of a type constructor stack, the constant empty and the constructor push. Afterwards, we extend this algebra by the selector functions pop and top (which implementations are omitted). 11

13 7 Conclusions The concept of term algebras including their construction is an often-used concept in the mathematical world, especially in logic, model theory and category theory [6, 21]. They are also well-known in computer science, say in algebraic specication for describing abstract datatypes [26] or recursive datatypes [22]. Despite this fact, no language is known to the author that uses an explicit language construct for creating term algebras from signatures: Neither in functional languages, in typed logic programming languages, say Godel [12], nor in logical environments such as IMPS [8] or Nuprl [5], which all use some form of datatypes for creating term algebras. The same situation can be found in specication systems such as OBJ3 [9], which creates term algebras implicitly from executable specications or Tecton [16] which does not provide both structures and signatures. Also in the literature about recursive datatypes the authors use sometimes the phrase \word algebra" for describing datatypes but do not use any explicit term algebra constructor [13, 22]. We rst discussed the shortcomings of using free datatypes for constructing free algebras. Then, we showed that all these drawbacks can be eliminated by introducing the term algebra constructor free as an explicit language construct. In particular, all identier{ value bindings are now explicit. The result is a simpler understanding of what is going on semantically than in the case of free datatypes. Hence, this term algebraic style of dening new types and constructors is also helpful in teaching the concept of free algebras which can be a rather cumbersome task using datatypes. A prototype implementation of free for a language with rst class structures and signatures was done by Gerard Milmeister [17]. Future work consists of integrating the free construct into a functional environment and providing an operational semantics. Acknowledgments. I would like to thank Manuel Bronstein, Georgios Grivas, Christian Luginbuhl, Roman Maeder, Niklaus Mannhart and Gerard Milmeister for reviewing draft versions of this paper. References [1] H. Abelson et al. Revised 4 Report on the Algorithmic Language Scheme. Technical report, Articial Intelligence Laboratory, Massachusetts Institute of Technology (MIT), Cambridge, Massachusetts, November [2] H. Abelson and G. J. Sussman. Structure and Interpretation of Computer Programs. The MIT Press, Cambridge, Mass., [3] L. Cardelli. Typeful Programming. Technical Report 45, DEC Systems Research Center, [4] L. Cardelli and J.C. Mitchell. Operations on Records. Mathematical Structures in Computer Science, 1(1):3{48, [5] R.L. Constable et al. Implementing Mathematics with the Nuprl Proof Development System. Prentice-Hall,

14 [6] John Barwise (ed.). Handbook of Mathematical Logic. North-Holland Publishing Company, [7] Jurgen Exner. The OPAL tutorial. Technical Report 94-9, TU Berlin, May [8] W. M. Farmer, J. D. Guttman, and F. J. Thayer. The imps user's manual. Technical Report M93-B138, The MITRE Corporation, 202 Burlington Road, Bedford, MA , USA, [9] Joseph A. Goguen et al. Introducing OBJ. Technical report, SRI International, March [10] Carl A. Gunter. Semantics of Programming Languages: Structures and Techniques. Foundations of Computing Series. The MIT Press, [11] Robert Harper, Robin Milner, and Mads Tofte. The Denition of Standard ML. The MIT Press, [12] Patricia Hill and John Lloyd. The Godel Programming Language. The MIT Press, [13] C.A.R. Hoare. Recursive data structures. International Journal of Computer and Information Sciences, June [14] P.R. Hudak et al. Report on the programming language Haskell, a non-strict purely functional language, Version 1.2. ACM SIGPLAN Notices, [15] Gerard Huet et al. The Coq Proof Assistant, User's Guide, Version Technical report, INRIA, [16] Deepak Kapur and David R. Musser. Tecton: a framework for specifying and verifying generic system components. Technical Report RPI{92{20, Department of Computer Science, Rensselaer Polytechnic Institute, Troy, New York 12180, July [17] Gerard Milmeister. Functional Kernel with Modules, Diploma Thesis, ETH Zurich. [18] Stephan A. Missura. Theories = Signatures + Propositions Used as Types. In Jacques Calmet and John A. Campbell, editors, Integrating Symbolic Mathematical Computation and Articial Intelligence (AISMC-2),volume 958 of Lecture Notes in Computer Science. Springer Verlag, August [19] J. Mitchell and R. Harper. The Essence of ML. In Conference Record ofacm Symposium on Principles of Programming Languages, pages 28{46, [20] Simon L. Peyton Jones. The Implementation of Functional Programming Languages. Prentice Hall International, [21] B. Pierce. Basic Category Theory for Computer Scientists. MIT Press, [22] C. Reade. Elements of Functional Programming. Addison-Wesley, [23] David A. Turner. An overview of Miranda. In David A. Turner, editor, Research topics in Functional Programming. Addison Wesley,

15 [24] Raymond Turner. Constructive Foundations for Functional Languages. McGraw-Hill, [25] Jan van Leeuwen, editor. Formal Models and Semantics, volume B of Handbook of Theoretical Computer Science. Elsevier, [26] Martin Wirsing. Algebraic specication. In Jan van Leeuwen, editor, Formal Models and Semantics, volume B of Handbook of Theoretical Computer Science, chapter 13, pages 675{788. Elsevier, [27] Niklaus Wirth. Programming in Modula-2. Springer,

Conclusions and further reading

Conclusions and further reading Chapter 18 Conclusions and further reading We have not been exhaustive in the description of the Caml Light features. We only introduced general concepts in functional programming, and we have insisted

More information

Higher-order + Polymorphic = Reusable

Higher-order + Polymorphic = Reusable Higher-order + Polymorphic = Reusable Simon Thompson Computing Laboratory, University of Kent Canterbury, CT2 7NF, U.K. Abstract This paper explores how certain ideas in object oriented languages have

More information

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine. 1. true / false By a compiler we mean a program that translates to code that will run natively on some machine. 2. true / false ML can be compiled. 3. true / false FORTRAN can reasonably be considered

More information

CIS24 Project #3. Student Name: Chun Chung Cheung Course Section: SA Date: 4/28/2003 Professor: Kopec. Subject: Functional Programming Language (ML)

CIS24 Project #3. Student Name: Chun Chung Cheung Course Section: SA Date: 4/28/2003 Professor: Kopec. Subject: Functional Programming Language (ML) CIS24 Project #3 Student Name: Chun Chung Cheung Course Section: SA Date: 4/28/2003 Professor: Kopec Subject: Functional Programming Language (ML) 1 Introduction ML Programming Language Functional programming

More information

CS 242. Fundamentals. Reading: See last slide

CS 242. Fundamentals. Reading: See last slide CS 242 Fundamentals Reading: See last slide Syntax and Semantics of Programs Syntax The symbols used to write a program Semantics The actions that occur when a program is executed Programming language

More information

Automata and Formal Languages - CM0081 Introduction to Agda

Automata and Formal Languages - CM0081 Introduction to Agda Automata and Formal Languages - CM0081 Introduction to Agda Andrés Sicard-Ramírez Universidad EAFIT Semester 2018-2 Introduction Curry-Howard correspondence Dependent types Constructivism Martin-Löf s

More information

Thunks (continued) Olivier Danvy, John Hatcli. Department of Computing and Information Sciences. Kansas State University. Manhattan, Kansas 66506, USA

Thunks (continued) Olivier Danvy, John Hatcli. Department of Computing and Information Sciences. Kansas State University. Manhattan, Kansas 66506, USA Thunks (continued) Olivier Danvy, John Hatcli Department of Computing and Information Sciences Kansas State University Manhattan, Kansas 66506, USA e-mail: (danvy, hatcli)@cis.ksu.edu Abstract: Call-by-name

More information

JOURNAL OF OBJECT TECHNOLOGY

JOURNAL OF OBJECT TECHNOLOGY JOURNAL OF OBJECT TECHNOLOGY Online at www.jot.fm. Published by ETH Zurich, Chair of Software Engineering JOT, 2002 Vol. 1, No. 2, July-August 2002 The Theory of Classification Part 2: The Scratch-Built

More information

Subtyping and Overloading in a Functional Programming Language. Wilhelm-Schickard-Institut, Universitat Tubingen, Sand 13. D Tubingen. matching.

Subtyping and Overloading in a Functional Programming Language. Wilhelm-Schickard-Institut, Universitat Tubingen, Sand 13. D Tubingen. matching. Subtyping and Overloading in a Functional Programming Language Martin Plumicke and Herbert Klaeren Wilhelm-Schickard-Institut, Universitat Tubingen, Sand 13 D-72076 Tubingen pluemick@informatik.uni-tuebingen.de

More information

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen COP4020 Programming Languages Functional Programming Prof. Robert van Engelen Overview What is functional programming? Historical origins of functional programming Functional programming today Concepts

More information

Lazy State Evaluation of Process Functional Programs

Lazy State Evaluation of Process Functional Programs Lazy State Evaluation of Process Functional Programs Ján Kollár Jan.Kollar@tuke.sk Jaroslav Porubän Jaroslav.Poruban@tuke.sk Peter Václavík Peter.Vaclavik@tuke.sk Miroslav Vidiščak Miroslav.Vidiscak@tuke.sk

More information

Programming Languages Third Edition. Chapter 7 Basic Semantics

Programming Languages Third Edition. Chapter 7 Basic Semantics Programming Languages Third Edition Chapter 7 Basic Semantics Objectives Understand attributes, binding, and semantic functions Understand declarations, blocks, and scope Learn how to construct a symbol

More information

Language. Institut fur Informatik, Technische Universitat Munchen. Abstract

Language. Institut fur Informatik, Technische Universitat Munchen.   Abstract Modelling Inheritance in an Algebraic Specication Language Dieter Nazareth Institut fur Informatik, Technische Universitat Munchen Postfach 20 24 20, D-8000 Munchen 2, Germany e-mail: nazareth@informatik.tu-muenchen.de

More information

when a process of the form if be then p else q is executed and also when an output action is performed. 1. Unnecessary substitution: Let p = c!25 c?x:

when a process of the form if be then p else q is executed and also when an output action is performed. 1. Unnecessary substitution: Let p = c!25 c?x: URL: http://www.elsevier.nl/locate/entcs/volume27.html 7 pages Towards Veried Lazy Implementation of Concurrent Value-Passing Languages (Abstract) Anna Ingolfsdottir (annai@cs.auc.dk) BRICS, Dept. of Computer

More information

Functional Programming. Big Picture. Design of Programming Languages

Functional Programming. Big Picture. Design of Programming Languages Functional Programming Big Picture What we ve learned so far: Imperative Programming Languages Variables, binding, scoping, reference environment, etc What s next: Functional Programming Languages Semantics

More information

Program Design in PVS. Eindhoven University of Technology. Abstract. Hoare triples (precondition, program, postcondition) have

Program Design in PVS. Eindhoven University of Technology. Abstract. Hoare triples (precondition, program, postcondition) have Program Design in PVS Jozef Hooman Dept. of Computing Science Eindhoven University of Technology P.O. Box 513, 5600 MB Eindhoven, The Netherlands e-mail: wsinjh@win.tue.nl Abstract. Hoare triples (precondition,

More information

Programming language design and analysis

Programming language design and analysis Programming language design and analysis Introduction Marius Minea 25 September 2017 Why this course? Programming languages are fundamental and one of the oldest CS fields Language design is an important

More information

Demonstrating Lambda Calculus Reduction

Demonstrating Lambda Calculus Reduction Electronic Notes in Theoretical Computer Science 45 (2001) URL: http://www.elsevier.nl/locate/entcs/volume45.html 9 pages Demonstrating Lambda Calculus Reduction Peter Sestoft 1 Department of Mathematics

More information

ABriefOverviewofAgda A Functional Language with Dependent Types

ABriefOverviewofAgda A Functional Language with Dependent Types ABriefOverviewofAgda A Functional Language with Dependent Types Ana Bove, Peter Dybjer, and Ulf Norell e-mail: {bove,peterd,ulfn}@chalmers.se Chalmers University of Technology, Gothenburg, Sweden Abstract.

More information

The Formal Semantics of Programming Languages An Introduction. Glynn Winskel. The MIT Press Cambridge, Massachusetts London, England

The Formal Semantics of Programming Languages An Introduction. Glynn Winskel. The MIT Press Cambridge, Massachusetts London, England The Formal Semantics of Programming Languages An Introduction Glynn Winskel The MIT Press Cambridge, Massachusetts London, England Series foreword Preface xiii xv 1 Basic set theory 1 1.1 Logical notation

More information

6.001 Notes: Section 8.1

6.001 Notes: Section 8.1 6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything

More information

RSL Reference Manual

RSL Reference Manual RSL Reference Manual Part No.: Date: April 6, 1990 Original Authors: Klaus Havelund, Anne Haxthausen Copyright c 1990 Computer Resources International A/S This document is issued on a restricted basis

More information

Martin-L f's Type Theory. B. Nordstr m, K. Petersson and J. M. Smith. Contents. 5.4 The set of functions (Cartesian product of a family of sets) 24

Martin-L f's Type Theory. B. Nordstr m, K. Petersson and J. M. Smith. Contents. 5.4 The set of functions (Cartesian product of a family of sets) 24 Martin-L f's Type Theory B. Nordstr m, K. Petersson and J. M. Smith Contents 1 Introduction : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 1.1 Dierent formulations of type theory : : : :

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

Topic IV. Parameters. Chapter 5 of Programming languages: Concepts & constructs by R. Sethi (2ND EDITION). Addison-Wesley, 1996.

Topic IV. Parameters. Chapter 5 of Programming languages: Concepts & constructs by R. Sethi (2ND EDITION). Addison-Wesley, 1996. References: Topic IV Block-structured procedural languages Algol and Pascal Chapters 5 and 7, of Concepts in programming languages by J. C. Mitchell. CUP, 2003. Chapter 5 of Programming languages: Concepts

More information

interpreted program is type correct. However, if the interpreted program has already been type checked and it is known to be type correct so using the

interpreted program is type correct. However, if the interpreted program has already been type checked and it is known to be type correct so using the An exercise in dependent types: A well-typed interpreter Lennart Augustsson Magnus Carlsson Department of Computing Sciences Chalmers University of Technology S-412 96 G teborg, Sweden Email: {augustss,magnus}@cs.chalmers.se

More information

CSCI-GA Scripting Languages

CSCI-GA Scripting Languages CSCI-GA.3033.003 Scripting Languages 12/02/2013 OCaml 1 Acknowledgement The material on these slides is based on notes provided by Dexter Kozen. 2 About OCaml A functional programming language All computation

More information

Programming Languages

Programming Languages Programming Languages Tevfik Koşar Lecture - XIII March 2 nd, 2006 1 Roadmap Functional Languages Lambda Calculus Intro to Scheme Basics Functions Bindings Equality Testing Searching 2 1 Functional Languages

More information

Functional Programming. Pure Functional Languages

Functional Programming. Pure Functional Languages Functional Programming Pure functional PLs S-expressions cons, car, cdr Defining functions read-eval-print loop of Lisp interpreter Examples of recursive functions Shallow, deep Equality testing 1 Pure

More information

Constrained Types and their Expressiveness

Constrained Types and their Expressiveness Constrained Types and their Expressiveness JENS PALSBERG Massachusetts Institute of Technology and SCOTT SMITH Johns Hopkins University A constrained type consists of both a standard type and a constraint

More information

Functional Programming Language Haskell

Functional Programming Language Haskell Functional Programming Language Haskell Mohammed Aslam CIS 24 Prof. Kopec Presentation: 03 Date: 05/05/2003 Haskell is a general purpose, purely functional programming language named after the logician

More information

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic 3.4 Deduction and Evaluation: Tools 3.4.1 Conditional-Equational Logic The general definition of a formal specification from above was based on the existence of a precisely defined semantics for the syntax

More information

Extracting the Range of cps from Affine Typing

Extracting the Range of cps from Affine Typing Extracting the Range of cps from Affine Typing Extended Abstract Josh Berdine, Peter W. O Hearn Queen Mary, University of London {berdine, ohearn}@dcs.qmul.ac.uk Hayo Thielecke The University of Birmingham

More information

Introduction to the Lambda Calculus

Introduction to the Lambda Calculus Introduction to the Lambda Calculus Overview: What is Computability? Church s Thesis The Lambda Calculus Scope and lexical address The Church-Rosser Property Recursion References: Daniel P. Friedman et

More information

Universes. Universes for Data. Peter Morris. University of Nottingham. November 12, 2009

Universes. Universes for Data. Peter Morris. University of Nottingham. November 12, 2009 for Data Peter Morris University of Nottingham November 12, 2009 Introduction Outline 1 Introduction What is DTP? Data Types in DTP Schemas for Inductive Families 2 of Data Inductive Types Inductive Families

More information

Lecture Notes on Program Equivalence

Lecture Notes on Program Equivalence Lecture Notes on Program Equivalence 15-312: Foundations of Programming Languages Frank Pfenning Lecture 24 November 30, 2004 When are two programs equal? Without much reflection one might say that two

More information

Informal Semantics of Data. semantic specification names (identifiers) attributes binding declarations scope rules visibility

Informal Semantics of Data. semantic specification names (identifiers) attributes binding declarations scope rules visibility Informal Semantics of Data semantic specification names (identifiers) attributes binding declarations scope rules visibility 1 Ways to Specify Semantics Standards Documents (Language Definition) Language

More information

CS3110 Spring 2017 Lecture 9 Inductive proofs of specifications

CS3110 Spring 2017 Lecture 9 Inductive proofs of specifications CS3110 Spring 2017 Lecture 9 Inductive proofs of specifications Robert Constable 1 Lecture Plan 1. Repeating schedule of remaining five problem sets and prelim. 2. Comments on tautologies and the Coq logic.

More information

Type-directed Syntax Transformations for ATS-style Programs with Proofs

Type-directed Syntax Transformations for ATS-style Programs with Proofs Type-directed Syntax Transformations for ATS-style Programs with Proofs Andrei Lapets August 14, 2007 1 Introduction In their work on ATS [CX05] and ATS LF [CX04], the authors present an ML-like language

More information

Logic - CM0845 Introduction to Haskell

Logic - CM0845 Introduction to Haskell Logic - CM0845 Introduction to Haskell Diego Alejandro Montoya-Zapata EAFIT University Semester 2016-1 Diego Alejandro Montoya-Zapata (EAFIT University) Logic - CM0845 Introduction to Haskell Semester

More information

Topic IV. Block-structured procedural languages Algol and Pascal. References:

Topic IV. Block-structured procedural languages Algol and Pascal. References: References: Topic IV Block-structured procedural languages Algol and Pascal Chapters 5 and 7, of Concepts in programming languages by J. C. Mitchell. CUP, 2003. Chapters 10( 2) and 11( 1) of Programming

More information

Programming Systems in Artificial Intelligence Functional Programming

Programming Systems in Artificial Intelligence Functional Programming Click to add Text Programming Systems in Artificial Intelligence Functional Programming Siegfried Nijssen 8/03/16 Discover thediscover world at the Leiden world University at Leiden University Overview

More information

1 A question of semantics

1 A question of semantics PART I BACKGROUND 1 A question of semantics The goal of this chapter is to give the reader a glimpse of the applications and problem areas that have motivated and to this day continue to inspire research

More information

Handout 10: Imperative programs and the Lambda Calculus

Handout 10: Imperative programs and the Lambda Calculus 06-02552 Princ of Progr Languages (and Extended ) The University of Birmingham Spring Semester 2016-17 School of Computer Science c Uday Reddy2016-17 Handout 10: Imperative programs and the Lambda Calculus

More information

Hutton, Graham and Bahr, Patrick (2016) Cutting out continuations. In: WadlerFest, April 2016, Edinburgh, Scotland.

Hutton, Graham and Bahr, Patrick (2016) Cutting out continuations. In: WadlerFest, April 2016, Edinburgh, Scotland. Hutton, Graham and Bahr, Patrick (2016) Cutting out continuations. In: WadlerFest, 11-12 April 2016, Edinburgh, Scotland. Access from the University of Nottingham repository: http://eprints.nottingham.ac.uk/32703/1/cutting.pdf

More information

CS 415 Midterm Exam Spring 2002

CS 415 Midterm Exam Spring 2002 CS 415 Midterm Exam Spring 2002 Name KEY Email Address Student ID # Pledge: This exam is closed note, closed book. Good Luck! Score Fortran Algol 60 Compilation Names, Bindings, Scope Functional Programming

More information

Proving the Correctness of Distributed Algorithms using TLA

Proving the Correctness of Distributed Algorithms using TLA Proving the Correctness of Distributed Algorithms using TLA Khushboo Kanjani, khush@cs.tamu.edu, Texas A & M University 11 May 2007 Abstract This work is a summary of the Temporal Logic of Actions(TLA)

More information

Imperative Functional Programming

Imperative Functional Programming Imperative Functional Programming Uday S. Reddy Department of Computer Science The University of Illinois at Urbana-Champaign Urbana, Illinois 61801 reddy@cs.uiuc.edu Our intuitive idea of a function is

More information

Data types for mcrl2

Data types for mcrl2 Data types for mcrl2 Aad Mathijssen April 5, 2018 We provide a syntax for the standard data types of the mcrl2 language. This syntax is intended to be a practical mix between standard mathematical notation

More information

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter 2.1-2.7 p. 1/27 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer

More information

Abstract This paper describes AxSL, an Axiomatic Specication Language that extends algebraic axiom methods to support object-oriented concepts such as

Abstract This paper describes AxSL, an Axiomatic Specication Language that extends algebraic axiom methods to support object-oriented concepts such as Extending Algebraic Axiom Techniques to Handle Object-Oriented Specications Alyce Brady, Member, IEEE David R. Musser, Member, IEEE Computer Society David L. Spooner, Member, IEEE August 2, 1999 Abstract

More information

Questions? Static Semantics. Static Semantics. Static Semantics. Next week on Wednesday (5 th of October) no

Questions? Static Semantics. Static Semantics. Static Semantics. Next week on Wednesday (5 th of October) no Questions? First exercise is online: http://www.win.tue.nl/~mvdbrand/courses/glt/1112/ Deadline 17 th of October Next week on Wednesday (5 th of October) no lectures!!! Primitive types Primitive value

More information

University of Utrecht. 1992; Fokker, 1995), the use of monads to structure functional programs (Wadler,

University of Utrecht. 1992; Fokker, 1995), the use of monads to structure functional programs (Wadler, J. Functional Programming 1 (1): 1{000, January 1993 c 1993 Cambridge University Press 1 F U N C T I O N A L P E A R L S Monadic Parsing in Haskell Graham Hutton University of Nottingham Erik Meijer University

More information

Programming in Omega Part 1. Tim Sheard Portland State University

Programming in Omega Part 1. Tim Sheard Portland State University Programming in Omega Part 1 Tim Sheard Portland State University Tim Sheard Computer Science Department Portland State University Portland, Oregon PSU PL Research at Portland State University The Programming

More information

Automated Reasoning. Natural Deduction in First-Order Logic

Automated Reasoning. Natural Deduction in First-Order Logic Automated Reasoning Natural Deduction in First-Order Logic Jacques Fleuriot Automated Reasoning Lecture 4, page 1 Problem Consider the following problem: Every person has a heart. George Bush is a person.

More information

Compiling Exceptions Correctly

Compiling Exceptions Correctly Compiling Exceptions Correctly Graham Hutton and Joel Wright School of Computer Science and IT University of Nottingham, United Kingdom Abstract. Exceptions are an important feature of modern programming

More information

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Sections p.

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Sections p. CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Sections 10.1-10.3 p. 1/106 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer

More information

Introduction. chapter Functions

Introduction. chapter Functions chapter 1 Introduction In this chapter we set the stage for the rest of the book. We start by reviewing the notion of a function, then introduce the concept of functional programming, summarise the main

More information

The design of a programming language for provably correct programs: success and failure

The design of a programming language for provably correct programs: success and failure The design of a programming language for provably correct programs: success and failure Don Sannella Laboratory for Foundations of Computer Science School of Informatics, University of Edinburgh http://homepages.inf.ed.ac.uk/dts

More information

which a value is evaluated. When parallelising a program, instances of this class need to be produced for all the program's types. The paper commented

which a value is evaluated. When parallelising a program, instances of this class need to be produced for all the program's types. The paper commented A Type-Sensitive Preprocessor For Haskell Noel Winstanley Department of Computer Science University of Glasgow September 4, 1997 Abstract This paper presents a preprocessor which generates code from type

More information

Functional Programming

Functional Programming Functional Programming Overview! Functional vs. imperative programming! Fundamental concepts! Evaluation strategies! Pattern matching! Higher order functions! Lazy lists References! Richard Bird, Introduction

More information

Mathematics for Computer Scientists 2 (G52MC2)

Mathematics for Computer Scientists 2 (G52MC2) Mathematics for Computer Scientists 2 (G52MC2) L07 : Operations on sets School of Computer Science University of Nottingham October 29, 2009 Enumerations We construct finite sets by enumerating a list

More information

7. Introduction to Denotational Semantics. Oscar Nierstrasz

7. Introduction to Denotational Semantics. Oscar Nierstrasz 7. Introduction to Denotational Semantics Oscar Nierstrasz Roadmap > Syntax and Semantics > Semantics of Expressions > Semantics of Assignment > Other Issues References > D. A. Schmidt, Denotational Semantics,

More information

KeyNote: Trust Management for Public-Key. 180 Park Avenue. Florham Park, NJ USA.

KeyNote: Trust Management for Public-Key. 180 Park Avenue. Florham Park, NJ USA. KeyNote: Trust Management for Public-Key Infrastructures Matt Blaze 1 Joan Feigenbaum 1 Angelos D. Keromytis 2 1 AT&T Labs { Research 180 Park Avenue Florham Park, NJ 07932 USA fmab,jfg@research.att.com

More information

the application rule M : x:a: B N : A M N : (x:a: B) N and the reduction rule (x: A: B) N! Bfx := Ng. Their algorithm is not fully satisfactory in the

the application rule M : x:a: B N : A M N : (x:a: B) N and the reduction rule (x: A: B) N! Bfx := Ng. Their algorithm is not fully satisfactory in the The Semi-Full Closure of Pure Type Systems? Gilles Barthe Institutionen for Datavetenskap, Chalmers Tekniska Hogskola, Goteborg, Sweden Departamento de Informatica, Universidade do Minho, Braga, Portugal

More information

The Compositional C++ Language. Denition. Abstract. This document gives a concise denition of the syntax and semantics

The Compositional C++ Language. Denition. Abstract. This document gives a concise denition of the syntax and semantics The Compositional C++ Language Denition Peter Carlin Mani Chandy Carl Kesselman March 12, 1993 Revision 0.95 3/12/93, Comments welcome. Abstract This document gives a concise denition of the syntax and

More information

MLW. Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky. March 26, Radboud University Nijmegen

MLW. Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky. March 26, Radboud University Nijmegen 1 MLW Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky Radboud University Nijmegen March 26, 2012 inductive types 2 3 inductive types = types consisting of closed terms built from constructors

More information

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011 CS152: Programming Languages Lecture 11 STLC Extensions and Related Topics Dan Grossman Spring 2011 Review e ::= λx. e x e e c v ::= λx. e c τ ::= int τ τ Γ ::= Γ, x : τ (λx. e) v e[v/x] e 1 e 1 e 1 e

More information

Algebraic Properties of CSP Model Operators? Y.C. Law and J.H.M. Lee. The Chinese University of Hong Kong.

Algebraic Properties of CSP Model Operators? Y.C. Law and J.H.M. Lee. The Chinese University of Hong Kong. Algebraic Properties of CSP Model Operators? Y.C. Law and J.H.M. Lee Department of Computer Science and Engineering The Chinese University of Hong Kong Shatin, N.T., Hong Kong SAR, China fyclaw,jleeg@cse.cuhk.edu.hk

More information

SORT INFERENCE \coregular" signatures, they derive an algorithm for computing a most general typing for expressions e which is only slightly more comp

SORT INFERENCE \coregular signatures, they derive an algorithm for computing a most general typing for expressions e which is only slightly more comp Haskell Overloading is DEXPTIME{complete Helmut Seidl Fachbereich Informatik Universitat des Saarlandes Postfach 151150 D{66041 Saarbrucken Germany seidl@cs.uni-sb.de Febr., 1994 Keywords: Haskell type

More information

Case study: leical analysis Leical analysis converts u sequences of characters u into u sequences of tokens u tokens are also called words or leemes F

Case study: leical analysis Leical analysis converts u sequences of characters u into u sequences of tokens u tokens are also called words or leemes F Lecture 5 0 Case study: leical analysis Leical analysis converts u sequences of characters u into u sequences of tokens u tokens are also called words or leemes For us, a token will be one of: u a number

More information

LECTURE 16. Functional Programming

LECTURE 16. Functional Programming LECTURE 16 Functional Programming WHAT IS FUNCTIONAL PROGRAMMING? Functional programming defines the outputs of a program as a mathematical function of the inputs. Functional programming is a declarative

More information

Deriving Generic Functions by Example

Deriving Generic Functions by Example Deriving Generic Functions by Example Neil Mitchell University of York, UK http://www.cs.york.ac.uk/~ndm/ Abstract. A function is said to be generic if it operates over values of any data type. For example,

More information

4.5 Pure Linear Functional Programming

4.5 Pure Linear Functional Programming 4.5 Pure Linear Functional Programming 99 4.5 Pure Linear Functional Programming The linear λ-calculus developed in the preceding sections can serve as the basis for a programming language. The step from

More information

Substitution in Structural Operational Semantics and value-passing process calculi

Substitution in Structural Operational Semantics and value-passing process calculi Substitution in Structural Operational Semantics and value-passing process calculi Sam Staton Computer Laboratory University of Cambridge Abstract Consider a process calculus that allows agents to communicate

More information

Functional programming Primer I

Functional programming Primer I Functional programming Primer I COS 320 Compiling Techniques Princeton University Spring 2016 Lennart Beringer 1 Characteristics of functional programming Primary notions: functions and expressions (not

More information

Data Types. (with Examples In Haskell) COMP 524: Programming Languages Srinivas Krishnan March 22, 2011

Data Types. (with Examples In Haskell) COMP 524: Programming Languages Srinivas Krishnan March 22, 2011 Data Types (with Examples In Haskell) COMP 524: Programming Languages Srinivas Krishnan March 22, 2011 Based in part on slides and notes by Bjoern 1 Brandenburg, S. Olivier and A. Block. 1 Data Types Hardware-level:

More information

A Small Interpreted Language

A Small Interpreted Language A Small Interpreted Language What would you need to build a small computing language based on mathematical principles? The language should be simple, Turing equivalent (i.e.: it can compute anything that

More information

Functional Programming. Pure Functional Languages

Functional Programming. Pure Functional Languages Functional Programming Pure functional PLs S-expressions cons, car, cdr Defining functions read-eval-print loop of Lisp interpreter Examples of recursive functions Shallow, deep Equality testing 1 Pure

More information

Nano-Lisp The Tutorial Handbook

Nano-Lisp The Tutorial Handbook Nano-Lisp The Tutorial Handbook Francis Sergeraert March 4, 2006 1 Various types of Nano-Lisp objects. There are several type notions and in this documentation only the notion of implementation type (itype

More information

datatype 'a stream Cons of 'a * 'a stream susp; fun map f Nil map f (Cons(x,xs)) = Cons(f x, delay (map f (force xs))); fun countdown n = Cons(n, dela

datatype 'a stream Cons of 'a * 'a stream susp; fun map f Nil map f (Cons(x,xs)) = Cons(f x, delay (map f (force xs))); fun countdown n = Cons(n, dela How to add laziness to a strict language without even being odd Philip Wadler Bell Laboratories, Lucent Technologies wadler@research.bell-labs.com David MacQueen Bell Laboratories, Lucent Technologies

More information

Principles of Programming Languages [PLP-2015] Detailed Syllabus

Principles of Programming Languages [PLP-2015] Detailed Syllabus Principles of Programming Languages [PLP-2015] Detailed Syllabus This document lists the topics presented along the course. The PDF slides published on the course web page (http://www.di.unipi.it/~andrea/didattica/plp-15/)

More information

Functional Programming with Isabelle/HOL

Functional Programming with Isabelle/HOL Functional Programming with Isabelle/HOL = Isabelle λ β HOL α Florian Haftmann Technische Universität München January 2009 Overview Viewing Isabelle/HOL as a functional programming language: 1. Isabelle/HOL

More information

Principles of Programming Languages 2017W, Functional Programming

Principles of Programming Languages 2017W, Functional Programming Principles of Programming Languages 2017W, Functional Programming Assignment 3: Lisp Machine (16 points) Lisp is a language based on the lambda calculus with strict execution semantics and dynamic typing.

More information

Formal Systems and their Applications

Formal Systems and their Applications Formal Systems and their Applications Dave Clarke (Dave.Clarke@cs.kuleuven.be) Acknowledgment: these slides are based in part on slides from Benjamin Pierce and Frank Piessens 1 Course Overview Introduction

More information

Annex A (Informative) Collected syntax The nonterminal symbols pointer-type, program, signed-number, simple-type, special-symbol, and structured-type

Annex A (Informative) Collected syntax The nonterminal symbols pointer-type, program, signed-number, simple-type, special-symbol, and structured-type Pascal ISO 7185:1990 This online copy of the unextended Pascal standard is provided only as an aid to standardization. In the case of dierences between this online version and the printed version, the

More information

3. Functional Programming. Oscar Nierstrasz

3. Functional Programming. Oscar Nierstrasz 3. Functional Programming Oscar Nierstrasz Roadmap > Functional vs. Imperative Programming > Pattern Matching > Referential Transparency > Lazy Evaluation > Recursion > Higher Order and Curried Functions

More information

1 INTRODUCTION 2 Represent a multiset as an association list, where the rst argument of a pair is an item and the second argument is the multiplicity

1 INTRODUCTION 2 Represent a multiset as an association list, where the rst argument of a pair is an item and the second argument is the multiplicity Programming with Multisets J.W. Lloyd Department of Computer Science University of Bristol Bristol BS8 1UB, UK Abstract This paper proposes a novel way of introducing multisets into declarative programming

More information

Functions as data. Massimo Merro. 9 November Massimo Merro The Lambda language 1 / 21

Functions as data. Massimo Merro. 9 November Massimo Merro The Lambda language 1 / 21 Functions as data Massimo Merro 9 November 2011 Massimo Merro The Lambda language 1 / 21 The core of sequential programming languages In the mid 1960s, Peter Landin observed that a complex programming

More information

Chapter 11 :: Functional Languages

Chapter 11 :: Functional Languages Chapter 11 :: Functional Languages Programming Language Pragmatics Michael L. Scott Copyright 2016 Elsevier 1 Chapter11_Functional_Languages_4e - Tue November 21, 2017 Historical Origins The imperative

More information

Proving Theorems with Athena

Proving Theorems with Athena Proving Theorems with Athena David R. Musser Aytekin Vargun August 28, 2003, revised January 26, 2005 Contents 1 Introduction 1 2 Proofs about order relations 2 3 Proofs about natural numbers 7 3.1 Term

More information

Organization of Programming Languages CS3200/5200N. Lecture 11

Organization of Programming Languages CS3200/5200N. Lecture 11 Organization of Programming Languages CS3200/5200N Razvan C. Bunescu School of Electrical Engineering and Computer Science bunescu@ohio.edu Functional vs. Imperative The design of the imperative languages

More information

Design of it : an Aldor library to express parallel programs Extended Abstract Niklaus Mannhart Institute for Scientic Computing ETH-Zentrum CH-8092 Z

Design of it : an Aldor library to express parallel programs Extended Abstract Niklaus Mannhart Institute for Scientic Computing ETH-Zentrum CH-8092 Z Design of it : an Aldor library to express parallel programs Extended Abstract Niklaus Mannhart Institute for Scientic Computing ETH-Zentrum CH-8092 Zurich, Switzerland e-mail: mannhart@inf.ethz.ch url:

More information

A Simplified Correctness Proof for a Well-Known Algorithm Computing Strongly Connected Components

A Simplified Correctness Proof for a Well-Known Algorithm Computing Strongly Connected Components A Simplified Correctness Proof for a Well-Known Algorithm Computing Strongly Connected Components Ingo Wegener FB Informatik, LS2, Univ. Dortmund, 44221 Dortmund, Germany wegener@ls2.cs.uni-dortmund.de

More information

A modern back-end for a dependently typed language

A modern back-end for a dependently typed language A modern back-end for a dependently typed language MSc Thesis (Afstudeerscriptie ) written by Remi Turk (born January 11, 1983 in Rotterdam) under the supervision of Dr Andres Löh and Dr Piet Rodenburg,

More information

TIC. %goo~~oo eomputer-science. ELECTE f. No-te on Coridhitiom Cominliati"I~n Standard ML1

TIC. %goo~~oo eomputer-science. ELECTE f. No-te on Coridhitiom CominliatiI~n Standard ML1 eomputer-science No-te on Coridhitiom Cominliati"I~n Standard ML1 mom Nicholas Haines Edoardo Biagioni Robert Hiarper Brian G. Mimnes June 1993 CMU-CS-93. 11 TIC ELECTE f 00..7733 %goo~~oo Note on Conditioual

More information

Monads in Haskell. Nathanael Schilling. December 12, 2014

Monads in Haskell. Nathanael Schilling. December 12, 2014 Monads in Haskell Nathanael Schilling December 12, 2014 Abstract In Haskell, monads provide a mechanism for mapping functions of the type a -> m b to those of the type m a -> m b. This mapping is dependent

More information

Beluga: A Framework for Programming and Reasoning with Deductive Systems (System Description)

Beluga: A Framework for Programming and Reasoning with Deductive Systems (System Description) Beluga: A Framework for Programming and Reasoning with Deductive Systems (System Description) Brigitte Pientka and Joshua Dunfield McGill University, Montréal, Canada {bpientka,joshua}@cs.mcgill.ca Abstract.

More information

proc {Produce State Out} local State2 Out2 in State2 = State + 1 Out = State Out2 {Produce State2 Out2}

proc {Produce State Out} local State2 Out2 in State2 = State + 1 Out = State Out2 {Produce State2 Out2} Laziness and Declarative Concurrency Raphael Collet Universite Catholique de Louvain, B-1348 Louvain-la-Neuve, Belgium raph@info.ucl.ac.be May 7, 2004 Abstract Concurrency and distribution in a programming

More information

A Typed Calculus Supporting Shallow Embeddings of Abstract Machines

A Typed Calculus Supporting Shallow Embeddings of Abstract Machines A Typed Calculus Supporting Shallow Embeddings of Abstract Machines Aaron Bohannon Zena M. Ariola Amr Sabry April 23, 2005 1 Overview The goal of this work is to draw a formal connection between steps

More information