System Description: Delphin A Functional Programming Language for Deductive Systems

Size: px
Start display at page:

Download "System Description: Delphin A Functional Programming Language for Deductive Systems"

Transcription

1 System Description: Delphin A Functional Programming Language for Deductive Systems Adam Poswolsky 1 and Carsten Schürmann 2 1 Yale University poswolsky@cs.yale.edu 2 IT University of Copenhagen carsten@itu.dk Abstract. Delphin is a functional programming language [PS08] utilizing dependent higher-order datatypes. Delphin is a two level system, which cleanly separates data from computation. The data level is LF [HHP93], which allows for the specification of deductive systems following the judgments-as-types methodology utilizing higher-order abstract syntax (HOAS). The computation level facilitates the manipulation of such encodings by providing a newness constructor to create parameters (fresh constants) and the ability to write functions over parameters, which we also call parameter functions. A wealth of documentation and examples are available online at delphin. 1 The Delphin System Delphin is a functional programming language built to facilitate the encoding, manipulation, and reasoning over dependent higher-order datatypes. Delphin is a two level system distinguishing between data and computation. The data level is the logical framework LF [HHP93], which supports dependent types and higherorder abstract syntax (HOAS). The computation level provides mechanisms such as case-analysis and recursion to allow for the manipulation of data. Delphin is first and foremost a general purpose programming language supporting complex data structures. However, it is also well-suited to be used in the setting of the Logosphere project [SPS], a digital library of formal proofs that brings together different proof assistants and theorem provers, with the goal to facilitate the exchange of mathematical knowledge by converting proofs from one logical formalism into another via partial theory morphisms. Delphin has been successfully used in expressing translations from HOL, Nuprl, and various other logics. Specification of Data. As the data level is LF, one may encode languages using HOAS as well as dependent types. The language being encoded is referred to as the object language. For example, an encoding of the untyped λ-calculus can represent its functions as LF functions. This means that variables of the object language are represented as LF variables and the application of object-level functions is just LF application. This deceptively simple idea allows for the encoding of complex data structures (object languages) without having to worry about

2 the representation of variables, renamings, or substitutions that are prevalent in logic derivations, typing derivations, operational semantics, and more. The representation of deductive systems utilizes the judgments-as-types technique. This means that we represent a judgment as a type, and derivation trees correspond to objects of that type. Checking the correctness of a derivation is reduced to simply type-checking the LF object representing said derivation. Dependent types are necessary to encode non-trivial judgments. Besides utilizing HOAS to represent languages, it is also used in this paradigm to represent hypothetical judgments. Computation. The operational semantics of Delphin is fairly straightforward. The key feature is that we distinguish between two methods of variable binding. The function type constructor binds variables that are intended for instantiation, which means that computation is delayed until application. This gives us the typical function space that is expected in any programming language. Additionally, the newness type constructor binds variables that will always remain uninstantiated and hence computation will not be delayed. The introduction form of is the ν (pronounced new) construct, νx.e, where x can occur free in e. Evaluation of e occurs while the binding x remains uninstantiated. Therefore, for the scope of e, the variable x behaves as a fresh constructor, which we will henceforth call a parameter. One may view ν as a method of dynamically extending the signature, where the signature refers to the collection of datatype constructors. A detailed explanation can be found in [PS08]. Delphin pervasively distinguishes between LF-types A, parameter types A #, and computation-level types τ. Note that the only terms of type A # are variables x, which also have type A. Thus, one may view the type A # as a subtype of A. The dynamic creation of parameters is used to compute under data level (LF) λ-binders. The introduction of parameters, via νx.e, introduces the -type, making it a local effect. This is in contrast to nominal approaches [GP02], such as FreshML, where the creation of parameters is a global effect and then additional reasoning is necessary to ensure parameters do not escape their scope [Pot07], which is instead an inherent property of our system. Additionally, other recent work [?] ensures parameters do not escape their scope by using an enriched data level with explicit substitutions and contexts. The manipulation of LF objects is facilitated by case-analysis and recursion. Dynamically introduced parameters may be eliminated using higher-order matching. Finally, reasoning explicitly about parameters is also supported via parameter functions, i.e. computational functions whose domains range over parameters. For example, passing around a function f of type x A #. B allows us to save a map between parameters of type A and objects of type B. From a first-order perspective, f can be thought of as a substitution, but parameter functions can do much more. For example, the codomain of the function may be a pair, which comes up heavily in our example suite. This provides a natural way to reason about parameters without resorting to a first-order encoding, making substitutions explicit, or adding ad-hoc specifications. Unlike Delphin,

3 the Twelf [PS98] meta-theory cannot support such functions as it is not higherorder (i.e. inputs and outputs cannot be meta-level functions). Instead, Twelf has the user define a block specification to save this relationship which is naturally expressible using Delphin s parameter functions. Reasoning. As computation occurs with respect to a dynamic collection of parameters, determining if a list of cases is exhaustive is a non-trivial question. If a list of cases is incomplete, Delphin will return a Match Non-Exhaustive Warning providing a list of cases which are missing. Additionally, if one tries to call a function which makes sense with respect to an incompatible collection of parameters, Delphin will return a World Subsumption Error. If no warning message is generated, then programs are guaranteed not to get stuck (i.e. progress holds). The problem of determining if a list of cases is exhaustive is also referred to as coverage checking. Earlier work [SP03] determines coverage of LF objects in an empty context. This was extended for use in Twelf by supporting an open context of blocks [Sch00]. In Delphin, we support LF objects in any context and also handle computation-level higher-order functions, e.g. parameter functions. Finally, if a function passes the coverage checker and is terminating, then it is total and may also be interpreted as a proof. The termination checker for Delphin is currently only a prototype and supports lexicographic extensions of the subterm ordering over the inputs. The termination order is simply the order of all explicit arguments. 2 Case Studies Delphin has been used for a number of experiments, which are all available on our website. Here we outline just a few. Hindley-Milner Type Inference 3. We have an extensive case study of a subset of ML, called Mini-ML. We can implement the operational semantics, prove value soundness and prove type preservation. The most novel feature is a Hindley- Milner type-inference algorithm. This illustrates the power of reasoning about parameters. Parameters are used in place of references, where a new parameter can be thought of as a fresh memory location. We then pass around environments, which are implemented as parameter functions. Logic. Other examples include the proof of the Church-Rosser theorem for the untyped λ-calculus under β-reduction using the method of parallel reduction 4. We have implemented cut-elimination of the intuitionistic sequent calculus. 5 In the framework of expressing morphisms between logics, we have expressed 3 delphin/delphin-examples/mini-ml 4 delphin/delphin-examples/church-rosser 5 delphin/delphin-examples/cut-elim

4 translations from HOL to Nuprl 6 as well as translations between sequent and natural deduction calculi. All of these examples were based on similar proofs in Twelf, but the Twelf blocks are replaced with parameter functions. In all these examples, the parameter functions save mappings between parameters, which are extended with additional mappings when we introduce new parameters. As these extensions are prevalent in converting Twelf examples into Delphin, we provide syntactic sugar to allow the programmer to concisely express the extension. During type reconstruction this is converted into an appropriate function of the form found in our discussion of the underlying type-theory [PS08]. Isomorphism between HOAS and debruijn 7. A more advanced use of parameter functions occurs in our example converting between terms of the untyped λ- calculus encoded in HOAS to one utilizing debruijn indices. In this example we use a parameter function to maintain a mapping of parameters to debruijn indices. However, we do more than just simply extend this mapping. When handling the λ case, we create a new parameter mapped to debruijn index 1 and update all other mappings to be offset by 1. Furthermore, we use Delphin to show that the translation between these two languages is an isomorphism. This example illustrates the expressivity of parameter functions as we can use it to express complex statements about the underlying parameters (or context). For example, to prove the translation is an isomorphism, we used parameter functions to express the invariant that all parameters are mapped to different debruijn indices. 3 Implementation Delphin is implemented in Standard ML and has been compiled under SML of New Jersey and PolyML. In this section we will discuss the key implementation concerns involving the data level, type reconstruction, implicit arguments, operational semantics, and coverage checking. Data Level. Recall that the programmer can take advantage of HOAS by representing object-language functions as LF functions. Here we will briefly discuss the implementation of LF which happens under-the-hood. Delphin borrows some Twelf code to deal with LF-level unification and LFlevel type reconstruction, but with extensions. The implementation of LF in Twelf exploits the fact that one cannot have nested functions, allowing one to assume the context is empty, an invariant that does not hold in Delphin. The main property of LF is that all terms possess a unique canonical form modulo αβη. The implementation utilizes debruijn notation to avoid dealing with α-equivalence. Instead of constantly computing canonical forms, we use a 6 delphin/delphin-examples/hol-nuprl 7 delphin/delphin-examples/debruijn

5 spine notation and weak-head normal forms [DHKP98]. This is a very useful optimization as it is wasteful to compute the entire canonical form only to discover that two terms differ in their top-level constructors. Coverage analysis and type reconstruction make use of logic variables and unification. In the presences of logic variables, we must add some form of closures. Therefore, we utilize explicit substitutions and follow the unification algorithm in [DHKP98] which describes higher-order unification in this setting. Equations that fall within the fragment of higher-order patterns are solved immediately, while all other equations are postponed as constraints. Such constraints are reawakened when a variable in the postponed equation is instantiated. It is also important to note that the Delphin unification algorithm extends the LF version with support for variables of parameter type (i.e. variables that can only be instantiated with parameters) and computation-level types. Type Reconstruction. The type reconstruction algorithm converts terms into the Delphin internal syntax [PS08]. Our algorithm will always report either a principal type, a type error, or in the case of leftover constraints, an indication that the type is ambiguous and needs further annotations. The result of this algorithm neither has free variables nor has logic variables, and thus is a valid Delphin expression. We have found that, in practice, pattern-variables never need to be explicitly quantified, as we also find in mainstream programming languages such as ML and Haskell. Reconstruction occurs in three stages: 1. The first stage is an approximate type reconstruction, which effectively throws out all dependent types and determines the simply-typed form of the type. 2. With this approximate information we create appropriate logic variables and utilize unification to infer the exact type (with dependencies). 3. The formal system (internal syntax) requires an explicit declaration of patternvariables, but we allow the user to express patterns by just using free variables. Therefore, the final step finds all free variables and explicitly quantifies them to the respective pattern where the variable first occurs. Implicitness. It is redundant to explicitly supply an input argument which is indexed in another input argument. Therefore, we extend the reconstruction algorithm above to allow free variables in types. These free variables are implicitly -quantified. Similarly, we also implicitly quantify free variables in LF constants, just as Twelf does. When applying a function, the reconstruction algorithm will automatically fill in the implicit arguments. This support is just a frontend convenience and does not affect the underlying theory. Evaluation, coverage, and termination are unaware of what is implicit/explicit in the frontend. Additionally, Delphin supports the syntax for terms that are explicit but can be inferred. This syntax instructs the reconstructor to fill in the term automatically, which is possible when the type forces it to be a particular term. Operational Semantics. The evaluator for Delphin expressions is fairly straightforward. If multiple branches match, it will pick the first branch that matches

6 and continue execution. Pattern variables are filled in with logic variables and we employ unification during runtime to instantiate such variables. Coverage Checking. The problem of coverage checking refers to determining if a function s list of cases is exhaustive. If a function has an exhaustive list of cases, then it will never get stuck, i.e. return Match Non-Exhaustive Failure during execution. Delphin allows different functions to make sense with respect to different collections of parameters, also called its world. A function s world is declared as a set of types. The function can be executed in any extension of the context with parameters incorporating said types. The flexibility of allowing functions in different worlds generates concerns when one function calls another. For example, assume function f is covered for closed terms (no parameters allowed) and assume function g is covered for terms allowing some parameters. In this scenario, function f can use function g, but the reverse is not true. Therefore, after type reconstruction, Delphin employs the coverage checker which is also a world checker which makes sure that functions defined with respect to one set of parameters can only call functions which also handle at least the same set of parameters. More specifically, the programmer uses a params keyword to specify the intended world of a function, and determining if a function is accessible corresponds to determining if all fresh parameters (with respect to the context in which the function was defined) are compatible with its world. The extension to Delphin for specifying worlds has been proved correct and is also available on our webpage. In contrast, Twelf specifies a context-schema stating explicitly the form of the entire context. However, this is only reasonable since Twelf only allows toplevel functions and hence all functions are declared in the empty context. As Delphin is a higher-order language and hence supports the definition of nested functions, functions may be declared in different contexts. Therefore, the important characteristic is not the form of the entire context, but the extensions of parameters allowed. 4 Environment Although Delphin is implemented in ML, it can be executed as a stand-alone program. The frontend provides a top-level similar to that of ML itself. Error and Warning messages are reported in the same form as in SML of New Jersey, allowing one to use SML Emacs scripts to jump to error-locations easily. The parser and lexer are implemented using ML-Yacc and ML-Lex, respectively. The frontend supports loading LF signatures as well as loading Delphin programs. For illustrative and debugging purposes, Delphin provides the ability to pretty-print arbitrary Delphin expressions with options to make patternvariables and implicit arguments explicit. Additionally, Delphin allows the disabling/enabling of the coverage checker and the termination checker. Just as in any other programming language, one may write, execute, and experiment with programs directly using the frontend. We provide a large set

7 of illustrative examples, to hopefully allow one to get quickly acquainted with Delphin. Delphin and its related publications are all available for download on our website delphin. References [DHKP98] Gilles Dowek, Thérèse Hardin, Claude Kirchner, and Frank Pfenning. Unification via explicit substitutions: The case of higher-order patterns. Rapport de Recherche 3591, INRIA, December Preliminary version appeared at JICSLP 96. [GP02] Murdoch Gabbay and Andrew M. Pitts. A new approach to abstract syntax with variable binding. Formal Aspects Computing, 13(3-5): , [HHP93] Robert Harper, Furio Honsell, and Gordon Plotkin. A framework for defining logics. Journal of the Association for Computing Machinery, 40(1): , January [Pot07] François Pottier. Static name control for FreshML. In Twenty-Second Annual IEEE Symposium on Logic In Computer Science (LICS 07), Wroclaw, [PS98] Poland, July Frank Pfenning and Carsten Schürmann. Twelf User s Guide, 1.2 edition, September Available as Technical Report CMU-CS , Carnegie Mellon University. [PS08] Adam Poswolsky and Carsten Schürmann. Practical programming with higher-order encodings and dependent types. In European Symposium on Programming (ESOP), [Sch00] [SP03] Carsten Schürmann. Automating the Meta-Theory of Deductive Systems. PhD thesis, Carnegie Mellon University, CMU-CS Carsten Schürmann and Frank Pfenning. A coverage checking algorithm for LF. In David Basin and Burkhart Wolff, editors, Proccedings of Theorem Proving in Higher Order Logics (TPHOLs 03), volume LNCS-2758, Rome, Italy, Springer Verlag. [SPS] Carsten Schürmann, Frank Pfenning, and Natarajan Shankar. Logosphere. A Formal Digital Library. Logosphere homepage:

Bindings, mobility of bindings, and the -quantifier

Bindings, mobility of bindings, and the -quantifier ICMS, 26 May 2007 1/17 Bindings, mobility of bindings, and the -quantifier Dale Miller, INRIA-Saclay and LIX, École Polytechnique This talk is based on papers with Tiu in LICS2003 & ACM ToCL, and experience

More information

Introducing Formal Methods. Software Engineering and Formal Methods

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

More information

Type Classes with Functional Dependencies

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

More information

Termination Checking: Comparing Structural Recursion and Sized Types by Examples

Termination Checking: Comparing Structural Recursion and Sized Types by Examples Termination Checking: Comparing Structural Recursion and Sized Types by Examples David Thibodeau Decemer 3, 2011 Abstract Termination is an important property for programs and is necessary for formal proofs

More information

Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic

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

More information

ML for the Working Programmer

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

More information

A Bidirectional Refinement Type System for LF

A Bidirectional Refinement Type System for LF LFMTP 2007 A Bidirectional Refinement Type System for LF William Lovas 1 Frank Pfenning 2 Computer Science Department Carnegie Mellon University Pittsburgh, PA, USA Abstract We present a system of refinement

More information

Journal of Functional Programming, volume 3 number 4, 1993. Dynamics in ML

Journal of Functional Programming, volume 3 number 4, 1993. Dynamics in ML Journal of Functional Programming, volume 3 number 4, 1993. Dynamics in ML Xavier Leroy École Normale Supérieure Michel Mauny INRIA Rocquencourt Abstract Objects with dynamic types allow the integration

More information

Functional Programming. Functional Programming Languages. Chapter 14. Introduction

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

More information

Chapter 7: Functional Programming Languages

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

More information

Adding GADTs to OCaml the direct approach

Adding GADTs to OCaml the direct approach Adding GADTs to OCaml the direct approach Jacques Garrigue & Jacques Le Normand Nagoya University / LexiFi (Paris) https://sites.google.com/site/ocamlgadt/ Garrigue & Le Normand Adding GADTs to OCaml 1

More information

AURA: A language with authorization and audit

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

More information

Introduction to type systems

Introduction to type systems Introduction to type systems p. 1/5 Introductory Course on Logic and Automata Theory Introduction to type systems Polyvios.Pratikakis@imag.fr Based on slides by Jeff Foster, UMD Introduction to type systems

More information

Software quality improvement via pattern matching

Software quality improvement via pattern matching Software quality improvement via pattern matching Radu Kopetz and Pierre-Etienne Moreau INRIA & LORIA {Radu.Kopetz, Pierre-Etienne.Moreau@loria.fr Abstract. Nested if-then-else statements is the most common

More information

Yale University Department of Computer Science. Representing Reductions of NP-complete Problems in Logical Frameworks A Case Study

Yale University Department of Computer Science. Representing Reductions of NP-complete Problems in Logical Frameworks A Case Study Yale University Department of Computer Science Representing Reductions of NP-complete Problems in Logical Frameworks A Case Study Carsten Schürmann Jatin Shah YALEU/DCS/TR-1254 August 2003 Representing

More information

The Technology Behind a Graphical User Interface for an Equational Reasoning Assistant

The Technology Behind a Graphical User Interface for an Equational Reasoning Assistant The Technology Behind a Graphical User Interface for an Equational Reasoning Assistant Andy Gill Department of Computing Science, University of Glasgow Abstract The Haskell Equational Reasoning Assistant

More information

System BV is NP-complete

System BV is NP-complete System BV is NP-complete Ozan Kahramanoğulları 1,2 Computer Science Institute, University of Leipzig International Center for Computational Logic, TU Dresden Abstract System BV is an extension of multiplicative

More information

[Refer Slide Time: 05:10]

[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

More information

Foundational Proof Certificates

Foundational Proof Certificates An application of proof theory to computer science INRIA-Saclay & LIX, École Polytechnique CUSO Winter School, Proof and Computation 30 January 2013 Can we standardize, communicate, and trust formal proofs?

More information

Relations: their uses in programming and computational specifications

Relations: their uses in programming and computational specifications PEPS Relations, 15 December 2008 1/27 Relations: their uses in programming and computational specifications Dale Miller INRIA - Saclay & LIX, Ecole Polytechnique 1. Logic and computation Outline 2. Comparing

More information

System Description: The MathWeb Software Bus for Distributed Mathematical Reasoning

System Description: The MathWeb Software Bus for Distributed Mathematical Reasoning System Description: The MathWeb Software Bus for Distributed Mathematical Reasoning Jürgen Zimmer 1 and Michael Kohlhase 2 1 FB Informatik, Universität des Saarlandes jzimmer@mathweb.org 2 School of Computer

More information

Tableaux Modulo Theories using Superdeduction

Tableaux Modulo Theories using Superdeduction Tableaux Modulo Theories using Superdeduction An Application to the Verification of B Proof Rules with the Zenon Automated Theorem Prover Mélanie Jacquel 1, Karim Berkani 1, David Delahaye 2, and Catherine

More information

Extraction of certified programs with effects from proofs with monadic types in Coq

Extraction of certified programs with effects from proofs with monadic types in Coq Extraction of certified programs with effects from proofs with monadic types in Coq Marino Miculan 1 and Marco Paviotti 2 1 Dept. of Mathematics and Computer Science, University of Udine, Italy 2 IT University

More information

Automated Theorem Proving - summary of lecture 1

Automated Theorem Proving - summary of lecture 1 Automated Theorem Proving - summary of lecture 1 1 Introduction Automated Theorem Proving (ATP) deals with the development of computer programs that show that some statement is a logical consequence of

More information

Semantic Analysis: Types and Type Checking

Semantic Analysis: Types and Type Checking Semantic Analysis Semantic Analysis: Types and Type Checking CS 471 October 10, 2007 Source code Lexical Analysis tokens Syntactic Analysis AST Semantic Analysis AST Intermediate Code Gen lexical errors

More information

1 Introduction. 2 An Interpreter. 2.1 Handling Source Code

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

More information

Parsing Technology and its role in Legacy Modernization. A Metaware White Paper

Parsing Technology and its role in Legacy Modernization. A Metaware White Paper Parsing Technology and its role in Legacy Modernization A Metaware White Paper 1 INTRODUCTION In the two last decades there has been an explosion of interest in software tools that can automate key tasks

More information

Object-Oriented Software Specification in Programming Language Design and Implementation

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

More information

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

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

More information

Brigitte Pientka. Programming Languages, Verification, Automated Theorem Proving, Logical Frameworks, Logic, Type Theory, Logic Programming

Brigitte Pientka. Programming Languages, Verification, Automated Theorem Proving, Logical Frameworks, Logic, Type Theory, Logic Programming Brigitte Pientka Department of Computer Science 5552 Beacon St #22 Pittsburgh, PA 15213-3891 Pittsburgh, PA 15217 (412) 268 3076 (412) 422 0621 e-mail: bp@cs.cmu.edu http://www.cs.cmu.edu/ bp Research

More information

Modal Proofs as Distributed Programs (Extended Abstract)

Modal Proofs as Distributed Programs (Extended Abstract) Modal Proofs as Distributed Programs (Extended Abstract) Limin Jia and David Walker Princeton University 35 Olden St., Princeton, NJ 08544, USA {ljia,dpw}@cs.princeton.edu Abstract. We develop a new foundation

More information

First-Class Type Classes

First-Class Type Classes First-Class Type Classes Matthieu Sozeau 1 and Nicolas Oury 2 1 Univ. Paris Sud, CNRS, Laboratoire LRI, UMR 8623, Orsay, F-91405 INRIA Saclay, ProVal, Parc Orsay Université, F-91893 sozeau@lri.fr 2 University

More information

Automated Program Behavior Analysis

Automated Program Behavior Analysis Automated Program Behavior Analysis Stacy Prowell sprowell@cs.utk.edu March 2005 SQRL / SEI Motivation: Semantics Development: Most engineering designs are subjected to extensive analysis; software is

More information

A Type System for Data-Flow Integrity on Windows Vista

A Type System for Data-Flow Integrity on Windows Vista A Type System for Data-Flow Integrity on Windows Vista Avik Chaudhuri University of California at Santa Cruz avik@cs.ucsc.edu Prasad Naldurg Sriram Rajamani Microsoft Research India {prasadn,sriram}@microsoft.com

More information

Deterministic Discrete Modeling

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

More information

Using the Computer to Prove the Correctness of Programs p.1/12

Using the Computer to Prove the Correctness of Programs p.1/12 Using the Computer to Prove the Correctness of Programs Bengt Nordström bengt@cs.chalmers.se ChungAng University on leave from Chalmers University, Göteborg, Sweden Using the Computer to Prove the Correctness

More information

Specification and Analysis of Contracts Lecture 1 Introduction

Specification and Analysis of Contracts Lecture 1 Introduction Specification and Analysis of Contracts Lecture 1 Introduction Gerardo Schneider gerardo@ifi.uio.no http://folk.uio.no/gerardo/ Department of Informatics, University of Oslo SEFM School, Oct. 27 - Nov.

More information

CHAPTER 7 GENERAL PROOF SYSTEMS

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

More information

CS510 Software Engineering

CS510 Software Engineering CS510 Software Engineering Propositional Logic Asst. Prof. Mathias Payer Department of Computer Science Purdue University TA: Scott A. Carr Slides inspired by Xiangyu Zhang http://nebelwelt.net/teaching/15-cs510-se

More information

Software Engineering Reference Framework

Software Engineering Reference Framework Software Engineering Reference Framework Michel Chaudron, Jan Friso Groote, Kees van Hee, Kees Hemerik, Lou Somers, Tom Verhoeff. Department of Mathematics and Computer Science Eindhoven University of

More information

Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:

Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation: CSE341T 08/31/2015 Lecture 3 Cost Model: Work, Span and Parallelism In this lecture, we will look at how one analyze a parallel program written using Cilk Plus. When we analyze the cost of an algorithm

More information

A Visual Language Based System for the Efficient Management of the Software Development Process.

A Visual Language Based System for the Efficient Management of the Software Development Process. A Visual Language Based System for the Efficient Management of the Software Development Process. G. COSTAGLIOLA, G. POLESE, G. TORTORA and P. D AMBROSIO * Dipartimento di Informatica ed Applicazioni, Università

More information

StaRVOOrS: A Tool for Combined Static and Runtime Verification of Java

StaRVOOrS: A Tool for Combined Static and Runtime Verification of Java StaRVOOrS: A Tool for Combined Static and Runtime Verification of Java Jesús Mauricio Chimento 1, Wolfgang Ahrendt 1, Gordon J. Pace 2, and Gerardo Schneider 3 1 Chalmers University of Technology, Sweden.

More information

Random vs. Structure-Based Testing of Answer-Set Programs: An Experimental Comparison

Random vs. Structure-Based Testing of Answer-Set Programs: An Experimental Comparison Random vs. Structure-Based Testing of Answer-Set Programs: An Experimental Comparison Tomi Janhunen 1, Ilkka Niemelä 1, Johannes Oetsch 2, Jörg Pührer 2, and Hans Tompits 2 1 Aalto University, Department

More information

Type Systems. Luca Cardelli. Microsoft Research

Type Systems. Luca Cardelli. Microsoft Research Type Systems Luca Cardelli Microsoft Research 1 Introduction The fundamental purpose of a type system is to prevent the occurrence of execution errors during the running of a program. This informal statement

More information

MAP-I Programa Doutoral em Informática. Rigorous Software Development

MAP-I Programa Doutoral em Informática. Rigorous Software Development MAP-I Programa Doutoral em Informática Rigorous Software Development Unidade Curricular em Teoria e Fundamentos Theory and Foundations (UCTF) DI-UM, DCC-FCUP May, 2012 Abstract This text presents a UCTF

More information

POLYTYPIC PROGRAMMING OR: Programming Language Theory is Helpful

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/

More information

Enforcing Data Quality Rules for a Synchronized VM Log Audit Environment Using Transformation Mapping Techniques

Enforcing Data Quality Rules for a Synchronized VM Log Audit Environment Using Transformation Mapping Techniques Enforcing Data Quality Rules for a Synchronized VM Log Audit Environment Using Transformation Mapping Techniques Sean Thorpe 1, Indrajit Ray 2, and Tyrone Grandison 3 1 Faculty of Engineering and Computing,

More information

InvGen: An Efficient Invariant Generator

InvGen: An Efficient Invariant Generator InvGen: An Efficient Invariant Generator Ashutosh Gupta and Andrey Rybalchenko Max Planck Institute for Software Systems (MPI-SWS) Abstract. In this paper we present InvGen, an automatic linear arithmetic

More information

Verification of Imperative Programs in Theorema

Verification of Imperative Programs in Theorema Verification of Imperative Programs in Theorema Laura Ildikó Kovács, Nikolaj Popov, Tudor Jebelean 1 Research Institute for Symbolic Computation, Johannes Kepler University, A-4040 Linz, Austria Institute

More information

The ProB Animator and Model Checker for B

The ProB Animator and Model Checker for B The ProB Animator and Model Checker for B A Tool Description Michael Leuschel and Michael Butler Department of Electronics and Computer Science University of Southampton Highfield, Southampton, SO17 1BJ,

More information

Jedd: A BDD-based Relational Extension of Java

Jedd: A BDD-based Relational Extension of Java Jedd: A BDD-based Relational Extension of Java Ondřej Lhoták Laurie Hendren Sable Research Group, School of Computer Science McGill University, Montreal, Canada {olhotak,hendren}@sable.mcgill.ca ABSTRACT

More information

Verifying security protocols using theorem provers

Verifying security protocols using theorem provers 1562 2007 79-86 79 Verifying security protocols using theorem provers Miki Tanaka National Institute of Information and Communications Technology Koganei, Tokyo 184-8795, Japan Email: miki.tanaka@nict.go.jp

More information

The Model Checker SPIN

The Model Checker SPIN The Model Checker SPIN Author: Gerard J. Holzmann Presented By: Maulik Patel Outline Introduction Structure Foundation Algorithms Memory management Example/Demo SPIN-Introduction Introduction SPIN (Simple(

More information

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

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

More information

Overview of the TACITUS Project

Overview of the TACITUS Project Overview of the TACITUS Project Jerry R. Hobbs Artificial Intelligence Center SRI International 1 Aims of the Project The specific aim of the TACITUS project is to develop interpretation processes for

More information

Formal Engineering for Industrial Software Development

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

More information

Jieh Hsiang Department of Computer Science State University of New York Stony brook, NY 11794

Jieh Hsiang Department of Computer Science State University of New York Stony brook, NY 11794 ASSOCIATIVE-COMMUTATIVE REWRITING* Nachum Dershowitz University of Illinois Urbana, IL 61801 N. Alan Josephson University of Illinois Urbana, IL 01801 Jieh Hsiang State University of New York Stony brook,

More information

CMCS 312: Programming Languages Lecture 3: Lambda Calculus (Syntax, Substitution, Beta Reduction) Acar & Ahmed 17 January 2008

CMCS 312: Programming Languages Lecture 3: Lambda Calculus (Syntax, Substitution, Beta Reduction) Acar & Ahmed 17 January 2008 CMCS 312: Programming Languages Lecture 3: Lambda Calculus (Syntax, Substitution, Beta Reduction) Acar & Ahmed 17 January 2008 Contents 1 Announcements 1 2 Introduction 1 3 Abstract Syntax 1 4 Bound and

More information

FORMALLY CERTIFIED SATISFIABILITY SOLVING. Duck Ki Oe. An Abstract

FORMALLY CERTIFIED SATISFIABILITY SOLVING. Duck Ki Oe. An Abstract FORMALLY CERTIFIED SATISFIABILITY SOLVING by Duck Ki Oe An Abstract Of a thesis submitted in partial fulfillment of the requirements for the Doctor of Philosophy degree in Computer Science in the Graduate

More information

Programming Languages

Programming Languages Programming Languages Qing Yi Course web site: www.cs.utsa.edu/~qingyi/cs3723 cs3723 1 A little about myself Qing Yi Ph.D. Rice University, USA. Assistant Professor, Department of Computer Science Office:

More information

Linear Types for Continuations

Linear Types for Continuations 1/28 Linear Types for Continuations Alex Simpson LFCS, School of Informatics University of Edinburgh, UK Joint work with: Jeff Egger (LFCS, Edinburgh) Rasmus Møgelberg (ITU, Copenhagen) Linear Types for

More information

Translating Combinatory Reduction Systems into the Rewriting Calculus

Translating Combinatory Reduction Systems into the Rewriting Calculus RULE 2003 Preliminary Version Translating Combinatory Reduction Systems into the Rewriting Calculus Clara Bertolissi, and Horatiu Cirstea, and Claude Kirchner INPL & University Nancy II & INRIA & LORIA

More information

Programming Languages Featherweight Java David Walker

Programming Languages Featherweight Java David Walker Programming Languages Featherweight Java David Walker Overview Featherweight Java (FJ), a minimal Javalike language. Models inheritance and subtyping. Immutable objects: no mutation of fields. Trivialized

More information

PROGRAM LOGICS FOR CERTIFIED COMPILERS

PROGRAM LOGICS FOR CERTIFIED COMPILERS PROGRAM LOGICS FOR CERTIFIED COMPILERS Separation logic is the twenty-first-century variant of Hoare logic that permits verification of pointer-manipulating programs. This book covers practical and theoretical

More information

ML-Flex Implementation Notes

ML-Flex Implementation Notes ML-Flex Implementation Notes Aaron Turon adrassi@uchicago.edu February 17, 2006 Contents 1 Organization 2 2 Theory 3 2.1 Regular expressions................................ 3 2.2 Derivatives.....................................

More information

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 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

More information

The Lean Theorem Prover

The Lean Theorem Prover The Lean Theorem Prover Jeremy Avigad Department of Philosophy and Department of Mathematical Sciences Carnegie Mellon University (Lean s principal developer is Leonardo de Moura, Microsoft Research, Redmond)

More information

A Note on Context Logic

A Note on Context Logic A Note on Context Logic Philippa Gardner Imperial College London This note describes joint work with Cristiano Calcagno and Uri Zarfaty. It introduces the general theory of Context Logic, and has been

More information

Cedalion A Language Oriented Programming Language (Extended Abstract)

Cedalion A Language Oriented Programming Language (Extended Abstract) Cedalion A Language Oriented Programming Language (Extended Abstract) David H. Lorenz Boaz Rosenan The Open University of Israel Abstract Implementations of language oriented programming (LOP) are typically

More information

Program equivalence in functional metaprogramming via nominal Scott domains

Program equivalence in functional metaprogramming via nominal Scott domains Program equivalence in functional metaprogramming via nominal Scott domains Steffen Gerhard Lösch Trinity College This dissertation is submitted for the degree of Doctor of Philosophy May 2014 To Niklas,

More information

Moving from CS 61A Scheme to CS 61B Java

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

More information

On Understanding Types, Data Abstraction, and Polymorphism

On Understanding Types, Data Abstraction, and Polymorphism 1 Computing Surveys, Vol 17 n. 4, pp 471-522, December 1985 On Understanding Types, Data Abstraction, and Polymorphism Luca Cardelli AT&T Bell Laboratories, Murray Hill, NJ 07974 (current address: DEC

More information

1.1 WHAT IS A PROGRAMMING LANGUAGE?

1.1 WHAT IS A PROGRAMMING LANGUAGE? 1 INTRODUCTION 1.1 What is a Programming Language? 1.2 Abstractions in Programming Languages 1.3 Computational Paradigms 1.4 Language Definition 1.5 Language Translation 1.6 Language Design How we communicate

More information

How To Write A Type System

How To Write A Type System Type Systems 1 Introduction Luca Cardelli Digital Equipment Corporation Systems Research Center The fundamental purpose of a type system is to prevent the occurrence of execution errors during the running

More information

Types, Polymorphism, and Type Reconstruction

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

More information

Summary Last Lecture. Automated Reasoning. Outline of the Lecture. Definition sequent calculus. Theorem (Normalisation and Strong Normalisation)

Summary Last Lecture. Automated Reasoning. Outline of the Lecture. Definition sequent calculus. Theorem (Normalisation and Strong Normalisation) Summary Summary Last Lecture sequent calculus Automated Reasoning Georg Moser Institute of Computer Science @ UIBK Winter 013 (Normalisation and Strong Normalisation) let Π be a proof in minimal logic

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence ICS461 Fall 2010 1 Lecture #12B More Representations Outline Logics Rules Frames Nancy E. Reed nreed@hawaii.edu 2 Representation Agents deal with knowledge (data) Facts (believe

More information

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

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

More information

Checking Access to Protected Members in the Java Virtual Machine

Checking Access to Protected Members in the Java Virtual Machine Checking Access to Protected Members in the Java Virtual Machine Alessandro Coglio Kestrel Institute 3260 Hillview Avenue, Palo Alto, CA 94304, USA Ph. +1-650-493-6871 Fax +1-650-424-1807 http://www.kestrel.edu/

More information

Static Analysis and Validation of Composite Behaviors in Composable Behavior Technology

Static Analysis and Validation of Composite Behaviors in Composable Behavior Technology Static Analysis and Validation of Composite Behaviors in Composable Behavior Technology Jackie Zheqing Zhang Bill Hopkinson, Ph.D. 12479 Research Parkway Orlando, FL 32826-3248 407-207-0976 jackie.z.zhang@saic.com,

More information

Static Typing for Object-Oriented Programming

Static Typing for Object-Oriented Programming Science of Computer Programming 23(1):19 53, 1994. Static Typing for Object-Oriented Programming Jens Palsberg palsberg@daimi.aau.dk Michael I. Schwartzbach mis@daimi.aau.dk Computer Science Department

More information

Type and Effect Systems

Type and Effect Systems Type and Effect Systems Flemming Nielson & Hanne Riis Nielson Department of Computer Science, Aarhus University, Denmark. Abstract. The design and implementation of a correct system can benefit from employing

More information

Semester Review. CSC 301, Fall 2015

Semester Review. CSC 301, Fall 2015 Semester Review CSC 301, Fall 2015 Programming Language Classes There are many different programming language classes, but four classes or paradigms stand out:! Imperative Languages! assignment and iteration!

More information

OutsideIn(X) Modular type inference with local assumptions

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

More information

Unified Static and Runtime Verification of Object-Oriented Software

Unified Static and Runtime Verification of Object-Oriented Software Unified Static and Runtime Verification of Object-Oriented Software Wolfgang Ahrendt 1, Mauricio Chimento 1, Gerardo Schneider 2, Gordon J. Pace 3 1 Chalmers University of Technology, Gothenburg, Sweden

More information

Overview Motivating Examples Interleaving Model Semantics of Correctness Testing, Debugging, and Verification

Overview Motivating Examples Interleaving Model Semantics of Correctness Testing, Debugging, and Verification Introduction Overview Motivating Examples Interleaving Model Semantics of Correctness Testing, Debugging, and Verification Advanced Topics in Software Engineering 1 Concurrent Programs Characterized by

More information

Applied Type System. (Extended Abstract) Hongwei Xi. Boston University. Abstract. The framework Pure Type System (PTS) offers a simple

Applied Type System. (Extended Abstract) Hongwei Xi. Boston University. Abstract. The framework Pure Type System (PTS) offers a simple Applied Type System (Extended Abstract) Hongwei Xi Boston University Abstract. The framework Pure Type System (PTS) offers a simple and general approach to designing and formalizing type systems. However,

More information

Dependent Types at Work

Dependent Types at Work Dependent Types at Work Ana Bove and Peter Dybjer Chalmers University of Technology, Göteborg, Sweden {bove,peterd}@chalmers.se Abstract. In these lecture notes we give an introduction to functional programming

More information

COMPUTER SCIENCE TRIPOS

COMPUTER SCIENCE TRIPOS CST.98.5.1 COMPUTER SCIENCE TRIPOS Part IB Wednesday 3 June 1998 1.30 to 4.30 Paper 5 Answer five questions. No more than two questions from any one section are to be answered. Submit the answers in five

More information

Neighborhood Data and Database Security

Neighborhood Data and Database Security Neighborhood Data and Database Security Kioumars Yazdanian, FrkdCric Cuppens e-mail: yaz@ tls-cs.cert.fr - cuppens@ tls-cs.cert.fr CERT / ONERA, Dept. of Computer Science 2 avenue E. Belin, B.P. 4025,31055

More information

A Certified Type-Preserving Compiler from Lambda Calculus to Assembly Language

A Certified Type-Preserving Compiler from Lambda Calculus to Assembly Language A Certified Type-Preserving Compiler from Lambda Calculus to Assembly Language Adam Chlipala University of California, Berkeley adamc@cs.berkeley.edu Abstract We present a certified compiler from the simply-typed

More information

Programming Language Concepts for Software Developers

Programming Language Concepts for Software Developers Programming Language Concepts for Software Developers Peter Sestoft IT University of Copenhagen, Denmark sestoft@itu.dk Abstract This note describes and motivates our current plans for an undergraduate

More information

Idris, a General Purpose Dependently Typed Programming Language: Design and Implementation

Idris, a General Purpose Dependently Typed Programming Language: Design and Implementation Under consideration for publication in J. Functional Programming 1 Idris, a General Purpose Dependently Typed Programming Language: Design and Implementation EDWIN BRADY School of Computer Science, University

More information

How Programmers Use Internet Resources to Aid Programming

How Programmers Use Internet Resources to Aid Programming How Programmers Use Internet Resources to Aid Programming Jeffrey Stylos Brad A. Myers Computer Science Department and Human-Computer Interaction Institute Carnegie Mellon University 5000 Forbes Ave Pittsburgh,

More information

Paraphrasing controlled English texts

Paraphrasing controlled English texts Paraphrasing controlled English texts Kaarel Kaljurand Institute of Computational Linguistics, University of Zurich kaljurand@gmail.com Abstract. We discuss paraphrasing controlled English texts, by defining

More information

Analysis of Uncertain Data: Tools for Representation and Processing

Analysis of Uncertain Data: Tools for Representation and Processing Analysis of Uncertain Data: Tools for Representation and Processing Bin Fu binf@cs.cmu.edu Eugene Fink e.fink@cs.cmu.edu Jaime G. Carbonell jgc@cs.cmu.edu Abstract We present initial work on a general-purpose

More information

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 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)

More information

Progress Report to ONR on MURI Project Building Interactive Formal Digital Libraries of Algorithmic Mathematics

Progress Report to ONR on MURI Project Building Interactive Formal Digital Libraries of Algorithmic Mathematics Progress Report to ONR on MURI Project Building Interactive Formal Digital Libraries of Algorithmic Mathematics Robert L. Constable Cornell University February 2003 Project Web Page http://www.cs.cornell.edu/info/projects/nuprl/html/digital

More information

The Ergo Support System: An Integrated Set of Tools for Prototyping Integrated Environments

The Ergo Support System: An Integrated Set of Tools for Prototyping Integrated Environments The Ergo Support System: An Integrated Set of Tools for Prototyping Integrated Environments Peter Lee, Frank Pfenning, Gene Rollins, and William Scherlis Department of Computer Science Carnegie Mellon

More information