Prettybigstep semantics


 Augustine Little
 2 years ago
 Views:
Transcription
1 Prettybigstep semantics Arthur Charguéraud INRIA October / 34
2 Motivation Formalization of JavaScript with Sergio Maeis, Daniele Filaretti, Alan Schmitt, Martin Bodin. Previous work: Semiformal smallstep semantics for the entire language (jssec.net) Informal bigstep semantics for the core language (POPL'12) Current work: Formal bigstep semantics for the entire language Interpreter proved correct w.r.t. the semantics 2 / 34
3 Motivation for bigstep Bigstep semantics: more faithful to the reference manual easier than smallstep for proving an interpreter easier than smallstep for proving a program logic Smallstep semantics considered bettersuited for: machinecode semantics not the case of JS type soundness proofs no types in JS concurrent languages no concurrency in JS 3 / 34
4 Bigstep semantics for loops Semantics of a Cstyle loop for ( ; t 1 ; t 2 ) { t 3 }, written for t 1 t 2 t 3, in terms of the evaluation judgment t /m v /m. t 1/m1 false /m2 for t 1 t 2 t 3/m1 tt /m2 t 1/m1 true /m2 t 3/m2 tt /m3 t 2/m3 tt /m4 for t 1 t 2 t 3/m4 tt /m5 for t 1 t 2 t 3/m1 tt /m5 4 / 34
5 Bigstep semantics for loops: exceptions Exceptions in terms of the judgment t /m exn /m. t 1/m1 exn /m 2 for t 1 t 2 t 3/m1 exn /m 2 t 1/m1 true /m2 t 3/m2 exn /m 3 for t 1 t 2 t 3/m1 exn /m 3 t 1/m1 true /m2 t 3/m2 tt /m3 t 2/m3 exn /m 4 for t 1 t 2 t 3/m1 exn /m 4 t 1/m1 true /m2 t 3/m2 tt /m3 t 2/m3 tt /m4 for t 1 t 2 t 3/m4 exn /m 5 for t 1 t 2 t 3/m1 exn /m 5 5 / 34
6 Bigstep semantics for loops: divergence Divergence in terms of the coinductive judgment t /m (Leroy 2006). t 1/m1 for t 1 t 2 t 3/m1 t 1/m1 true /m2 t 3/m2 for t 1 t 2 t 3/m1 t 1/m1 true /m2 t 3/m2 tt /m3 t 2/m3 for t 1 t 2 t 3/m1 t 1/m1 true /m2 t 3/m2 tt /m3 t 2/m3 tt /m4 for t 1 t 2 t 3/m4 for t 1 t 2 t 3/m1 6 / 34
7 Bigstep semantics for loops: summary t 1/m1 false /m 2 for t 1 t 2 t 3/m1 tt /m2 t 1/m1 true /m 2 t 3/m2 tt /m3 t 2/m3 tt /m4 for t 1 t 2 t 3/m4 tt /m5 for t 1 t 2 t 3/m1 tt /m5 t 1/m1 exn /m 2 for t 1 t 2 t 3/m1 exn /m 2 t 1/m1 true /m t 2 3/m2 exn /m 3 for t 1 t 2 t 3/m1 exn /m 3 t 1/m1 for t 1 t 2 t 3/m1 t 1/m1 true /m t 2 3/m2 for t 1 t 2 t 3/m1 t 1/m1 true /m 2 t 3/m2 tt /m3 t 2/m3 exn /m 4 for t 1 t 2 t 3/m1 exn /m 4 t 1/m1 true /m 2 t 3/m2 tt /m3 t 2/m3 for t 1 t 2 t 3/m1 t 1/m1 true /m 2 t 3/m2 tt /m3 t 2/m3 tt /m4 for t 1 t 2 t 3/m4 exn /m 5 for t 1 t 2 t 3/m1 exn /m 5 t 1/m1 true /m 2 t 3/m2 tt /m3 t 2/m3 tt /m4 for t 1 t 2 t 3/m4 for t 1 t 2 t 3/m1 Even with factorization: 9 rules, 21 premises. With prettybigstep: 6 rules, 7 premises. 7 / 34
8 In this talk Prettybigstep semantics: construction extension to traces application to corecaml type soundness proofs 8 / 34
9 Prettybigstep 9 / 34
10 Bigstep semantics Grammar of λterms v := int n abs x t t := val v var x app t t Callbyvalue bigstep semantics (t v) v v t 1 abs x t t 2 v [x v] t v app t 1 t 2 v 10 / 34
11 A rst attempt Bigstep rule for applications: t 1 abs x t t 2 v [x v] t v app t 1 t 2 v A rst attempt at prettybigstep rules: t 1 v 1 app v 1 t 2 v app t 1 t 2 v t 2 v 2 app v 1 v 2 v app v 1 t 2 v [x v] t v app (abs x t) v v Similar idea in Cousot and Cousot's biinductive semantics (2007) 11 / 34
12 Intermediate terms To prevent overlap between the rules, we use intermediate terms. e := trm t app1 v t app2 v v Denition of the judgment e v, with trm implicit v v t 1 v 1 app1 v 1 t 2 v app t 1 t 2 v t 2 v 2 app2 v 1 v 2 v app1 v 1 t 2 v [x v] t v app2 (abs x t) v v 12 / 34
13 Adding exceptions Valuecarrying exceptions and exception handlers t :=... raise t try t t Two behaviors: return a value or throw an exception. e b b := ret v exn v 13 / 34
14 Generalization of intermediate terms Need to generalize intermediate terms t 1 b 1 app1 b 1 t 2 b app t 1 t 2 b app1 (exn v) t 2 exn v t 2 b 2 app2 v 1 b 2 b app1 (ret v 1 ) t 2 b New grammar of intermediate terms e := trm t app1 b t app2 v b raise1 b try1 b t 14 / 34
15 Prettybigstep rules for exceptions v v t 1 b 1 app1 b 1 t 2 b app t 1 t 2 b app1 (exn v) t exn v t 2 b 2 app2 v 1 b 2 b app1 v 1 t 2 b app2 v (exn v) exn v [x v] t b app2 (abs x t) v b t 1 b 1 try1 b 1 t 2 b try t 1 t 2 b try1 v t v app t v b try1 (exn v) t b t b 1 raise1 b 1 b raise t b raise1 v exn v raise1 (exn v) exn v 15 / 34
16 Adding divergence Outcome of an evaluation: termination or divergence o := ter b div New grammar of intermediate terms e := trm t app1 o t app2 v o raise1 o try1 o t Evaluation rules t 1 o 1 app1 o 1 t 2 b app t 1 t 2 b app1 div t div 16 / 34
17 The abort predicate We want to factorize pairs of similar rules, such as: app1 (exn v) t (exn v) app1 div t div Solution: abort o app1 o t o where abort characterizes exceptions (exn v) and divergence (div). 17 / 34
18 Summary: grammars and judgments Grammars: b := ret v exn v o := ter b div e := trm t app1 o t app2 v o raise1 o try1 o t Judgments: abort o e o e co o Theorem (equivalence with bigstep) t ter b t b t co div t 18 / 34
19 Summary: rules v v t 1 o 1 app1 o 1 t 2 o app t 1 t 2 o abort o app1 o t o t 2 o 2 app2 v 1 o 2 o app1 v 1 t 2 o t o 1 raise1 o 1 o raise t o t 1 o 1 try1 o 1 t 2 o try t 1 t 2 o abort o app2 v o o abort o raise1 o o try1 v t v [x v] t o app2 (abs x t) v o raise1 v exn v app t v o try1 (exn v) t o try1 div t div 19 / 34
20 Traces 20 / 34
21 Denition of traces A trace records I/O interactions and ɛtransitions. A terminating program has a nite trace. A diverging program has an innite trace. α := ɛ in n out n τ := list α σ := stream α o := ter τ b div σ We are not using possiblyinnite traces (coinductive lists) like Nakata and Uustalu (2009) and Danielsson (2012). 21 / 34
22 Operation on traces Concatenation of a nite trace τ to the front τ τ τ σ τ o Equivalence of two traces up to nite consecutive insertions of ɛtransitions o o ɛ n [α] o ɛ m [α] o 22 / 34
23 Trace semantics in prettybigstep Every rule appends an ɛtranstion in order to be productive. v ter [ɛ] v t 1 o 1 app1 o 1 t 2 o app t 1 t 2 [ɛ] o abort o app1 o t o t 2 o 2 app2 v 1 o 2 o app1 (ter τ v 1 ) t 2 τ o abort o app2 v o o [x v] t o app2 (abs x t) (ter τ v) τ o 23 / 34
24 Trace semantics in prettybigstep, cont. I/O operations are recorded in the trace. t o 1 write1 o 1 o write t [ɛ] o write1 (ter τ n) ter τ [out n] tt t o 1 read1 o 1 o read t [ɛ] o read1 (ter τ tt) ter τ [in n] n abort o read1 o o abort o write1 o o 24 / 34
25 Benets of trace semantics Theorem (nite traces can only be produced by nite derivations) e co ter τ v e ter τ v So, we do not need the inductive judgment: the coinductive one suces. Theorem (equivalence with bigstep) t co ter τ b t b/τ t co div σ t /σ 25 / 34
26 Proofs with trace semantics: problems A typical simulation theorem e co o o. o o e co o Coinductive proof? No luck! 1. is not coinductive 2. is not coinductive 3. o is not coinductive Yet, coinductive reasoning is morally correct. 26 / 34
27 Prettybigstep: scaling up 27 / 34
28 Scaling up to real languages What's next: the generic abort rule semantics of sideeects semantics of loops formalization of corecaml 28 / 34
29 Abort rules Many similar abort rules: can we factorize them? abort o app1 o t o abort o app2 v o o abort o raise1 o o 29 / 34
30 The generic abort rule The auxiliary function getout getout (app1 o t) Some o getout (app2 v o) Some o getout (raise1 o) Some o getout (trm t) None getout (try1 o t) None The generic abort rule, which replaces the rules from the previous slide getout e = Some o e o abort o 30 / 34
31 Sideeects Generalization of terminating outcomes to carry a memory store: o := ter m b div Evaluation judgment in the form e /m o. Example rules: t 1 /m o 1 app1 o 1 t 2 /m o app t 1 t 2 /m o t 2 /m o 2 app2 v 1 o 2 /m o app1 (ter m v 1 ) t 2 /m o 31 / 34
32 Prettybigstep semantics for loops A single intermediate term for i o t 1 t 2 t 3, where i {1, 2, 3}. Evaluation rules, with the judgment e /m o. t 1 /m o 1 for 1 o 1 t 1 t 2 t 3 /m o for t 1 t 2 t 3 /m o for 1 (ret m false) t 1 t 2 t 3 /m ret m tt t 3 /m o 3 for 2 o 3 t 1 t 2 t 3 /m o for 1 (ret m true) t 1 t 2 t 3 /m o t 2 /m o 2 for 3 o 2 t 1 t 2 t 3 /m o for 2 (ret m tt) t 1 t 2 t 3 /m o for t 1 t 2 t 3 /m o for 3 (ret m tt) t 1 t 2 t 3 /m o abort o for i o t 1 t 2 t 3 /m o 32 / 34
33 Prettybigstep semantics for corecaml Formalization of corecaml: booleans, integers, tuples, algebraic data types, mutable records, boolean operators (lazy and, lazy or, negation), integer operators (negation, addition, subtraction, multiplication, division), comparison operator, functions, recursive functions, applications, sequences, letbindings, conditionals (with optional else branch), for loops and while loops, pattern matching (with nested patterns, as patterns, or patterns, and when clauses), raise construct, trywith construct with pattern matching, and assertions. rules premises tokens Bigstep without divergence Bigstep with divergence Prettybigstep Prettybigstep reduces the size of the denition by 40%. Prettybigstep reduces the number of premises by more than a factor / 34
34 Thanks! 34 / 34
Verication by Finitary Abstraction Weizmann Institute of Sciences and Universite Joseph Fourier, Grenoble Fourth International Spin Workshop (SPIN'98) Paris 2.11.98 Joint work with: Y. Kesten Ben Gurion
More informationFunctional programming languages
Functional programming languages Part II: abstract machines Xavier Leroy INRIA Rocquencourt MPRI 242, 2007 X. Leroy (INRIA) Functional programming languages MPRI 242, 2007 1 / 73 Execution models for
More informationCBV Semantics (Draft) Navit Fedida, John Havlicek, Nissan Levi, and Hillel Miller Motorola, Inc. 7700 W. Parmer Lane Austin, TX 78729 13 January 2002 Abstract A precise denition is given of the semantics
More informationBiinductive Structural Semantics
SOS 2007 Preliminary Version Biinductive Structural Semantics (Extended Abstract) Patrick Cousot 1 Département d'informatique, École normale supérieure, 45 rue d'ulm, 75230 Paris cedex 05, France Radhia
More informationThe countdown problem
JFP 12 (6): 609 616, November 2002. c 2002 Cambridge University Press DOI: 10.1017/S0956796801004300 Printed in the United Kingdom 609 F U N C T I O N A L P E A R L The countdown problem GRAHAM HUTTON
More informationCoinductive BigStep Semantics for Concurrency
Coinductive BigStep Semantics for Concurrency Tarmo Uustalu Institute of Cybernetics at Tallinn University of Technology, Akadeemia tee 21, 12618 Tallinn, Estonia tarmo@cs.ioc.ee In a paper presented
More informationPeter V. Homeier and David F. Martin. homeier@cs.ucla.edu and dmartin@cs.ucla.edu
A Mechanically Veried Verication Condition Generator Peter V. Homeier and David F. Martin Computer Science Department, University of California, Los Angeles 90024 USA homeier@cs.ucla.edu and dmartin@cs.ucla.edu
More informationRegression Verification: Status Report
Regression Verification: Status Report Presentation by Dennis Felsing within the Projektgruppe Formale Methoden der Softwareentwicklung 20131211 1/22 Introduction How to prevent regressions in software
More informationML 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 information1 Operational Semantics for While
Models of Computation, 2010 1 1 Operational Semantics for While The language While of simple while programs has a grammar consisting of three syntactic categories: numeric expressions, which represent
More informationCS412/CS413. Introduction to Compilers Tim Teitelbaum. Lecture 18: Intermediate Code 29 Feb 08
CS412/CS413 Introduction to Compilers Tim Teitelbaum Lecture 18: Intermediate Code 29 Feb 08 CS 412/413 Spring 2008 Introduction to Compilers 1 Summary: Semantic Analysis Check errors not detected by lexical
More informationCOMPUTER 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 informationElementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.
Elementary Number Theory and Methods of Proof CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.edu/~cse215 1 Number theory Properties: 2 Properties of integers (whole
More informationExtraction 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 informationThe previous chapter provided a definition of the semantics of a programming
Chapter 7 TRANSLATIONAL SEMANTICS The previous chapter provided a definition of the semantics of a programming language in terms of the programming language itself. The primary example was based on a Lisp
More informationPOLYTYPIC 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 informationThe CompCert verified C compiler
The CompCert verified C compiler Compiler built and proved by Xavier Leroy et al. Talk given by David Pichardie  Harvard University / INRIA Rennes Slides largely inspired by Xavier Leroy own material
More information[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 informationLanguage. Johann Eder. Universitat Klagenfurt. Institut fur Informatik. Universiatsstr. 65. A9020 Klagenfurt / AUSTRIA
PLOP: A Polymorphic Logic Database Programming Language Johann Eder Universitat Klagenfurt Institut fur Informatik Universiatsstr. 65 A9020 Klagenfurt / AUSTRIA February 12, 1993 Extended Abstract The
More informationMAT71506 Program Verication: Exercises
MAT71506 Program Verication: Exercises Antero Kangas Tampere University of Technology Department of Mathematics September 11, 2014 Accomplishment Exercises are obligatory and probably the grades will
More informationPROGRAM LOGICS FOR CERTIFIED COMPILERS
PROGRAM LOGICS FOR CERTIFIED COMPILERS Separation logic is the twentyfirstcentury variant of Hoare logic that permits verification of pointermanipulating programs. This book covers practical and theoretical
More informationA Systematic Approach. to Parallel Program Verication. Tadao TAKAOKA. Department of Computer Science. Ibaraki University. Hitachi, Ibaraki 316, JAPAN
A Systematic Approach to Parallel Program Verication Tadao TAKAOKA Department of Computer Science Ibaraki University Hitachi, Ibaraki 316, JAPAN Email: takaoka@cis.ibaraki.ac.jp Phone: +81 94 38 5130
More informationResources, process calculi and GodelDummett logics
Resources, process calculi and GodelDummett logics Dominique Larchey LORIA { CNRS Nancy, France 1 GödelDummett logics LC Most studied intermediate logic IL LC CL Proof theory, proofsearch IL (Dyckho
More informationCompiler Construction
Compiler Construction Regular expressions Scanning Görel Hedin Reviderad 2013 01 23.a 2013 Compiler Construction 2013 F021 Compiler overview source code lexical analysis tokens intermediate code generation
More informationEnsuring Consistency in Long Running Transactions
Ensuring Consistency in Long Running Transactions UCLA Computer Science Dept. Technical Report TR070011 Jeffrey Fischer Rupak Majumdar Department of Computer Science, University of California, Los Angeles
More informationIntroduction to formal semantics 
Introduction to formal semantics  Introduction to formal semantics 1 / 25 structure Motivation  Philosophy paradox antinomy division in object und Meta language Semiotics syntax semantics Pragmatics
More information15150 Lecture 11: Tail Recursion; Continuations
15150 Lecture 11: Tail Recursion; Continuations Lecture by Dan Licata February 21, 2011 In this lecture we will discuss space usage: analyzing the memory it takes your program to run tail calls and tail
More informationObservational Program Calculi and the Correctness of Translations
Observational Program Calculi and the Correctness of Translations Manfred SchmidtSchauss 1, David Sabel 1, Joachim Niehren 2, and Jan Schwinghammer 1 GoetheUniversity, Frankfurt, Germany 2 INRIA Lille,
More informationCS 103X: Discrete Structures Homework Assignment 3 Solutions
CS 103X: Discrete Structures Homework Assignment 3 s Exercise 1 (20 points). On wellordering and induction: (a) Prove the induction principle from the wellordering principle. (b) Prove the wellordering
More informationC++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 4: Control Structures I (Selection)
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 4: Control Structures I (Selection) Objectives In this chapter, you will: Learn about control structures Examine relational
More informationRigorous Software Development CSCIGA 3033009
Rigorous Software Development CSCIGA 3033009 Instructor: Thomas Wies Spring 2013 Lecture 11 Semantics of Programming Languages Denotational Semantics Meaning of a program is defined as the mathematical
More informationInvestigating a File Transfer Protocol Using CSP and B
Noname manuscript No. (will be inserted by the editor) Investigating a File Transfer Protocol Using CSP and B Neil Evans, Helen Treharne Department of Computer Science, Royal Holloway, University of London
More informationChapter 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 informationCSE 880. Advanced Database Systems. Active Database Design Issues
CSE 880 Advanced Database Systems Active Database Design Issues S. Pramanik 1 Design Principles for Active Databases 1. Problems: Complex interactions due to cascading of triggers. Unknown side effects
More informationIndiana State Core Curriculum Standards updated 2009 Algebra I
Indiana State Core Curriculum Standards updated 2009 Algebra I Strand Description Boardworks High School Algebra presentations Operations With Real Numbers Linear Equations and A1.1 Students simplify and
More informationOrigin Tracking in Attribute Grammars
Origin Tracking in Attribute Grammars Kevin Williams and Eric Van Wyk University of Minnesota Stellenbosch, WG2.11, January 2022, 2015 1 / 37 First, some advertising Multiple new faculty positions at
More informationSelection: if Statement
: if Statement The simplest selection structure in C++ is the if statement. Syntactically: 1 if The Boolean expression must be enclosed in parentheses, and
More informationWHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?
WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT? introduction Many students seem to have trouble with the notion of a mathematical proof. People that come to a course like Math 216, who certainly
More informationPROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON
PROBLEM SOLVING WITH SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON Addison Wesley Boston San Francisco New York London
More informationVocabulary. Term Page Definition Clarifying Example. biconditional statement. conclusion. conditional statement. conjecture.
CHAPTER Vocabulary The table contains important vocabulary terms from Chapter. As you work through the chapter, fill in the page number, definition, and a clarifying example. biconditional statement conclusion
More informationAutomata and Formal Languages
Automata and Formal Languages Winter 20092010 Yacov HelOr 1 What this course is all about This course is about mathematical models of computation We ll study different machine models (finite automata,
More informationStatic Program Transformations for Efficient Software Model Checking
Static Program Transformations for Efficient Software Model Checking Shobha Vasudevan Jacob Abraham The University of Texas at Austin Dependable Systems Large and complex systems Software faults are major
More informationCHAPTER 18 Programming Your App to Make Decisions: Conditional Blocks
CHAPTER 18 Programming Your App to Make Decisions: Conditional Blocks Figure 181. Computers, even small ones like the phone in your pocket, are good at performing millions of operations in a single second.
More informationThe Halting Problem is Undecidable
185 Corollary G = { M, w w L(M) } is not Turingrecognizable. Proof. = ERR, where ERR is the easy to decide language: ERR = { x { 0, 1 }* x does not have a prefix that is a valid code for a Turing machine
More informationALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology)
ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology) Subject Description: This subject deals with discrete structures like set theory, mathematical
More informationAnatomy of Programming Languages. William R. Cook
Anatomy of Programming Languages William R. Cook Copyright (C) 2013 2 Chapter 1 Preliminaries Preface What? This document is a series of notes about programming languages, originally written for students
More informationProgramming Language Pragmatics
Programming Language Pragmatics THIRD EDITION Michael L. Scott Department of Computer Science University of Rochester ^ШШШШШ AMSTERDAM BOSTON HEIDELBERG LONDON, '*i» ЩЛ< ^ ' m H NEW YORK «OXFORD «PARIS»SAN
More informationBoolean Expressions, Conditions, Loops, and Enumerations. Precedence Rules (from highest to lowest priority)
Boolean Expressions, Conditions, Loops, and Enumerations Relational Operators == // true if two values are equivalent!= // true if two values are not equivalent < // true if left value is less than the
More informationCS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013
Oct 4, 2013, p 1 Name: CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013 1. (max 18) 4. (max 16) 2. (max 12) 5. (max 12) 3. (max 24) 6. (max 18) Total: (max 100)
More informationAP Computer Science Java Subset
APPENDIX A AP Computer Science Java Subset The AP Java subset is intended to outline the features of Java that may appear on the AP Computer Science A Exam. The AP Java subset is NOT intended as an overall
More informationCMPSCI 250: Introduction to Computation. Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013
CMPSCI 250: Introduction to Computation Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013 Regular Expressions and Their Languages Alphabets, Strings and Languages
More informationReview questions for Chapter 9
Answer first, then check at the end. Review questions for Chapter 9 True/False 1. A compiler translates a highlevel language program into the corresponding program in machine code. 2. An interpreter is
More informationSANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR ODD/EVEN ACADEMICSEMESTER (201415) ASSIGNMENT / QUESTION BANK (2110003) [F.Y.B.E.
SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR ODD/EVEN ACADEMICSEMESTER (201415) ASSIGNMENT / QUESTION BANK Subject: Computer Programming and Utilization (2110003) [F.Y.B.E.: ALL BRANCHES] Unit 1
More informationChapter 15 Functional Programming Languages
Chapter 15 Functional Programming Languages Introduction  The design of the imperative languages is based directly on the von Neumann architecture Efficiency (at least at first) is the primary concern,
More informationChapter 13: Query Processing. Basic Steps in Query Processing
Chapter 13: Query Processing! Overview! Measures of Query Cost! Selection Operation! Sorting! Join Operation! Other Operations! Evaluation of Expressions 13.1 Basic Steps in Query Processing 1. Parsing
More informationOAMulator. Online One Address Machine emulator and OAMPL compiler. http://myspiders.biz.uiowa.edu/~fil/oam/
OAMulator Online One Address Machine emulator and OAMPL compiler http://myspiders.biz.uiowa.edu/~fil/oam/ OAMulator educational goals OAM emulator concepts Von Neumann architecture Registers, ALU, controller
More informationThe Foundations: Logic and Proofs. Chapter 1, Part III: Proofs
The Foundations: Logic and Proofs Chapter 1, Part III: Proofs Rules of Inference Section 1.6 Section Summary Valid Arguments Inference Rules for Propositional Logic Using Rules of Inference to Build Arguments
More informationFormal Languages and Automata Theory  Regular Expressions and Finite Automata 
Formal Languages and Automata Theory  Regular Expressions and Finite Automata  Samarjit Chakraborty Computer Engineering and Networks Laboratory Swiss Federal Institute of Technology (ETH) Zürich March
More information4 Domain Relational Calculus
4 Domain Relational Calculus We now present two relational calculi that we will compare to RA. First, what is the difference between an algebra and a calculus? The usual story is that the algebra RA is
More informationChapter 6: Programming Languages
Chapter 6: Programming Languages Computer Science: An Overview Eleventh Edition by J. Glenn Brookshear Copyright 2012 Pearson Education, Inc. Chapter 6: Programming Languages 6.1 Historical Perspective
More informationProgramming Languages
Programming Languages Programming languages bridge the gap between people and machines; for that matter, they also bridge the gap among people who would like to share algorithms in a way that immediately
More informationExample. ref= pic1.gif
XSL Transformations, Database Queries, and Computation 1. Introduction and Overview XSLT is a recent specialpurpose language for transforming XML documents Expressive power of XSLT? Pekka Kilpelainen
More informationAlgebraic Properties and Proofs
Algebraic Properties and Proofs Name You have solved algebraic equations for a couple years now, but now it is time to justify the steps you have practiced and now take without thinking and acting without
More informationBoolean Algebra Part 1
Boolean Algebra Part 1 Page 1 Boolean Algebra Objectives Understand Basic Boolean Algebra Relate Boolean Algebra to Logic Networks Prove Laws using Truth Tables Understand and Use First Basic Theorems
More informationGeneralized Modus Ponens
Generalized Modus Ponens This rule allows us to derive an implication... True p 1 and... p i and... p n p 1... p i1 and p i+1... p n implies p i implies q implies q allows: a 1 and... a i and... a n implies
More informationCS 111 Classes I 1. Software Organization View to this point:
CS 111 Classes I 1 Software Organization View to this point: Data Objects and primitive types Primitive types operators (+, /,,*, %). int, float, double, char, boolean Memory location holds the data Objects
More informationµz An Efficient Engine for Fixed points with Constraints
µz An Efficient Engine for Fixed points with Constraints Kryštof Hoder, Nikolaj Bjørner, and Leonardo de Moura Manchester University and Microsoft Research Abstract. The µz tool is a scalable, efficient
More informationMobile Resource Guarantees
Mobile Resource Guarantees Ian Stark Laboratory for Foundations of Computer Science School of Informatics, University of Edinburgh David Aspinall, Stephen Gilmore, Don Sannella, *Kenneth MacKenzie, *Lennart
More informationFoundational Proof Certificates
An application of proof theory to computer science INRIASaclay & LIX, École Polytechnique CUSO Winter School, Proof and Computation 30 January 2013 Can we standardize, communicate, and trust formal proofs?
More informationIntroducing 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 informationChapter 3 Programming with Recursion
Plan Chapter 3 Programming with Recursion (Version of 16 November 2005) 1. Examples...................................... 3.2 2. Induction...................................... 3.5 3. Construction methodology.....................
More informationComputer Programming I
Computer Programming I COP 2210 Syllabus Spring Semester 2012 Instructor: Greg Shaw Office: ECS 313 (Engineering and Computer Science Bldg) Office Hours: Tuesday: 2:50 4:50, 7:45 8:30 Thursday: 2:50 4:50,
More informationRepetition and Loops. Additional Python constructs that allow us to effect the (1) order and (2) number of times that program statements are executed.
New Topic Repetition and Loops Additional Python constructs that allow us to effect the (1) order and (2) number of times that program statements are executed. These constructs are the 1. while loop and
More informationAnnouncements. CompSci 230 Discrete Math for Computer Science Sets. Introduction to Sets. Sets
CompSci 230 Discrete Math for Computer Science Sets September 12, 2013 Prof. Rodger Slides modified from Rosen 1 nnouncements Read for next time Chap. 2.32.6 Homework 2 due Tuesday Recitation 3 on Friday
More informationMODULAR ARITHMETIC. a smallest member. It is equivalent to the Principle of Mathematical Induction.
MODULAR ARITHMETIC 1 Working With Integers The usual arithmetic operations of addition, subtraction and multiplication can be performed on integers, and the result is always another integer Division, on
More informationSimple Loop Patterns and Rich Loop Invariants
Simple Loop Patterns and Rich Loop Invariants Marc Sango AdaCore CNAM 05102011 Marc Sango (AdaCore CNAM) Simple Loop Patterns and Rich Loop Invariants 05102011 1 / 17 Contents 1 Motivation 2 Principle
More informationEngineering Problem Solving with C++, Etter/Ingber
Engineering Problem Solving with C++, Etter/Ingber Chapter 3 Control Structures 1 Control structures Algorithm Development Conditional Expressions Selection Statements Repetition Statements Structuring
More informationCorrespondence analysis for strong threevalued logic
Correspondence analysis for strong threevalued logic A. Tamminga abstract. I apply Kooi and Tamminga s (2012) idea of correspondence analysis for manyvalued logics to strong threevalued logic (K 3 ).
More informationHighLevel Programming Languages. Nell Dale & John Lewis (adaptation by Michael Goldwasser)
HighLevel Programming Languages Nell Dale & John Lewis (adaptation by Michael Goldwasser) LowLevel Languages What are disadvantages of lowlevel languages? (e.g., machine code or assembly code) Programming
More informationOn Negotiation as Concurrency Primitive. Javier Esparza, Techn. Univ. München (D) Jörg Desel, FernUniversität in Hagen (D)
On Negotiation as Concurrency Primitive Javier Esparza, Techn. Univ. München (D) Jörg Desel, FernUniversität in Hagen (D) 1 On Negotiation as Concurrency Primitive I: arbitrary / weakly deterministic /deterministic
More informationSoftware Analysis (POPA Sec , )
Software Analysis (POPA Sec. 2.2.2, 2.52.5.2) Klaus Ostermann Based on slides by Jurriaan Hage Overview Correctness proof Live Variables Analysis The While language with procedures Live Variables Analysis
More informationMany algorithms, particularly divide and conquer algorithms, have time complexities which are naturally
Recurrence Relations Many algorithms, particularly divide and conquer algorithms, have time complexities which are naturally modeled by recurrence relations. A recurrence relation is an equation which
More informationLAKE ELSINORE UNIFIED SCHOOL DISTRICT
LAKE ELSINORE UNIFIED SCHOOL DISTRICT Title: PLATO Algebra 1Semester 2 Grade Level: 1012 Department: Mathematics Credit: 5 Prerequisite: Letter grade of F and/or N/C in Algebra 1, Semester 2 Course Description:
More informationAnalyse et Conception Formelle. Lesson 5. Crash Course on Scala
Analyse et Conception Formelle Lesson 5 Crash Course on Scala T. Genet (ISTIC/IRISA) ACF5 1 / 36 Bibliography Simply Scala. Online tutorial: http://www.simply.com/fr http://www.simply.com/ Programming
More informationStructure Definitions. Inconsistent Data Structure. Repaired Data Structure. attributelist
Static Specification Analysis for Termination of SpecificationBased Data Structure Repair Brian Demsky Laboratory for Computer Science Massachusetts Institute of Technology Martin Rinard Laboratory for
More informationCompiler I: Syntax Analysis Human Thought
Course map Compiler I: Syntax Analysis Human Thought Abstract design Chapters 9, 12 H.L. Language & Operating Sys. Compiler Chapters 1011 Virtual Machine Software hierarchy Translator Chapters 78 Assembly
More informationFinite Automata. Reading: Chapter 2
Finite Automata Reading: Chapter 2 1 Finite Automaton (FA) Informally, a state diagram that comprehensively captures all possible states and transitions that a machine can take while responding to a stream
More informationGENERIC and GIMPLE: A New Tree Representation for Entire Functions
GENERIC and GIMPLE: A New Tree Representation for Entire Functions Jason Merrill Red Hat, Inc. jason@redhat.com 1 Abstract The tree SSA project requires a tree representation of functions for the optimizers
More informationData Structures Fibonacci Heaps, Amortized Analysis
Chapter 4 Data Structures Fibonacci Heaps, Amortized Analysis Algorithm Theory WS 2012/13 Fabian Kuhn Fibonacci Heaps Lacy merge variant of binomial heaps: Do not merge trees as long as possible Structure:
More informationCompiler Design. Type Checking
Compiler Design Type Checking Static Checking Token Stream Parser Abstract Syntax Tree Static Checker Decorated Abstract Syntax Tree Intermediate Code Generator Intermediate Code Static (Semantic) Checks
More informationA Propositional Dynamic Logic for CCS Programs
A Propositional Dynamic Logic for CCS Programs Mario R. F. Benevides and L. Menasché Schechter {mario,luis}@cos.ufrj.br Abstract This work presents a Propositional Dynamic Logic in which the programs are
More informationCHAPTER 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 informationTermination 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 informationA set is a Many that allows itself to be thought of as a One. (Georg Cantor)
Chapter 4 Set Theory A set is a Many that allows itself to be thought of as a One. (Georg Cantor) In the previous chapters, we have often encountered sets, for example, prime numbers form a set, domains
More informationDiscrete Mathematics, Chapter : Predicate Logic
Discrete Mathematics, Chapter 1.41.5: Predicate Logic Richard Mayr University of Edinburgh, UK Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.41.5 1 / 23 Outline 1 Predicates
More informationIntroduction to Python
WEEK ONE Introduction to Python Python is such a simple language to learn that we can throw away the manual and start with an example. Traditionally, the first program to write in any programming language
More informationAURA: A language with authorization and audit
AURA: A language with authorization and audit Steve Zdancewic University of Pennsylvania WG 2.8 2008 Securityoriented Languages Limin Jia, Karl Mazurak, Jeff Vaughan, Jianzhou Zhao Joey Schorr and Luke
More information2.1. Inductive Reasoning EXAMPLE A
CONDENSED LESSON 2.1 Inductive Reasoning In this lesson you will Learn how inductive reasoning is used in science and mathematics Use inductive reasoning to make conjectures about sequences of numbers
More informationInformatica e Sistemi in Tempo Reale
Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)
More informationProperties of Real Numbers
16 Chapter P Prerequisites P.2 Properties of Real Numbers What you should learn: Identify and use the basic properties of real numbers Develop and use additional properties of real numbers Why you should
More information