Programming Lang U Ages and Compilers (CS 421)

Total Page:16

File Type:pdf, Size:1020Kb

Programming Lang U Ages and Compilers (CS 421) Contact Information – Grigore Rosu Programming Languages and Office: 2110 SC Compilers (CS 421) Office hours: Tuesdays 11:00am – 12:00pm Thursdays 11:00am – 12:00pm Grigore Rosu Also by appointment 2110 SC, UIUC Email: [email protected] http://courses.engr.illinois.edu/cs421 Slides by Elsa Gunter, based in part on slides by Mattox Beckman, as updated by Vikram Adve and Gul Agha 1/23/2014 1 1/23/2014 2 Contact Information - TAs Course Website Teaching Assistants Office: 0207 SC http://courses.engr.illinois.edu/cs421 Edgar Pek ([email protected]) Main page - summary of news items Hours: Wed 2:00pm – 4:00pm Policy - rules governing course Amarin Phaosawasdi ([email protected]) Lectures - syllabus and slides Hours: Monday 2:00pm – 4:00pm MPs - information about homework Andrei Stefanescu ([email protected]) Exams Hours: Friday 2:00pm – 4:00pm Unit Projects - for 4 credit students Resources - tools and helpful info FAQ 1/23/2014 3 1/23/2014 4 Some Course References Course Grading No required textbook. Homework 20% Essentials of Programming Languages (2nd Edition) by Daniel P. Friedman, Mitchell Wand and About 11 MPs (in Ocaml) and 11 written assignments Christopher T. Haynes, MIT Press 2001. Submitted by handin on EWS linux machines MPs – plain text code that compiles; HWs – pdf Compilers: Principles, Techniques, and Tools, (also No extensions and no late submissions granted known as "The Dragon Book"); by Aho, Sethi, and (unless there are very special circumstances) Ullman. Published by Addison-Wesley. ISBN: 0- 201-10088-6. 2 Midterms - 20% each In class – March 6, April 17 Modern Compiler Implementation in ML by Andrew W. Appel, Cambridge University Press 1998 DO NOT MISS EXAM DATES! Final 40% - May 13, 3 hours (details to be given) Additional ones for Ocaml given separately 1/23/2014 5 1/23/2014 6 Course Homework Course Homework and Exams You may discuss homeworks and their solutions Problems from homework may appear verbatim, or with others with some modification on exams You may work in groups, but you must list members with whom you worked if you share Caution: Failure to be able to do homework solutions or solution outlines problems when they appear on the exam may Each student must turn in their own solution cause you to loose credit for the assignment from separately which they came, if you turned in a solution for the You may look at examples from class and other problem on the assignment similar examples from any source Note: University policy on plagiarism still holds - cite your sources if you are not the sole author of your solution 1/23/2014 7 1/23/2014 8 Course Objectives OCAML New programming paradigm Compiler is on the EWS-linux systems at Functional programming /usr/local/bin/ocaml Order of Evaluation Tail Recursion A (possibly better, non-PowerPoint) text Continuation Passing Style version of this lecture can be found at Phases of an interpreter / compiler http://courses.engr.illinois.edu/cs421/lecture Lexing and parsing s/ocaml-intro-shell.txt Type checking For the OCAML code for today’s lecture see Evaluation http://courses.engr.illinois.edu/cs421/lecture Programming Language Semantics s/ocaml-intro.ml Lambda Calculus Operational Semantics 1/23/2014 9 1/23/2014 10 WWW Addresses for OCAML References for CAML Main CAML home: Supplemental texts (not required): http://caml.inria.fr/index.en.html The Objective Caml system release 4.0, by To install OCAML on your computer see: Xavier Leroy, online manual http://caml.inria.fr/ocaml/release.en.html Introduction to the Objective Caml Programming Language, by Jason Hickey Developing Applications With Objective Caml, by Emmanuel Chailloux, Pascal Manoury, and Bruno Pagano, on O’Reilly Available online from course resources 1/23/2014 11 1/23/2014 12 OCAML Features of OCAML CAML is European descendant of original ML Higher order applicative language American/British version is SML Call-by-value parameter passing O is for object-oriented extension Modern syntax ML stands for Meta-Language Parametric polymorphism ML family designed for implementing Aka structural polymorphism theorem provers Automatic garbage collection It was the meta-language for programming the User-defined algebraic data types “object” language of the theorem prover Despite obscure original application area, OCAML It’s fast - winners of the 1999 and 2000 ICFP is a full general-purpose programming language Programming Contests used OCAML 1/23/2014 13 1/23/2014 14 Why learn OCAML? Session in OCAML Something new: many features may not % ocaml appear in languages that you already know Objective Caml version 3.12.0 # (* Read-eval-print loop; expressions and Assumed basis for much research in declarations *) programming language research 2 + 3;; (* Expression *) Closely related to popular - : int = 5 OCAML is particularly efficient for # 3 < 2;; programming tasks involving languages (e.g. - : bool = false parsing, compilers, user interfaces) Used at Microsoft Research for writing SLAM, a formal methods tool for C programs 1/23/2014 15 1/23/2014 16 No Overloading for Basic Arithmetic Operations No Implicit Coercion # 15 * 2;; # 1.0 * 2;; (* No Implicit Coercion *) - : int = 30 Characters 0-3: # 1.35 + 0.23;; (* Wrong type of addition *) 1.0 * 2;; (* No Implicit Coercion *) Characters 0-4: ^^^ 1.35 + 0.23;; (* Wrong type of addition *) Error: This expression has type float but an expression was expected of type ^^^^ int Error: This expression has type float but an expression was expected of type int # 1.35 +. 0.23;; - : float = 1.58 1/23/2014 17 1/23/2014 18 Sequencing Expressions Terminology # "Hi there";; (* has type string *) Output refers both to the result returned - : string = "Hi there" from a function application … # print_string "Hello world\n";; (* has type unit *) As in + outputs integers, whereas +. outputs floats Hello world … and to text printed as a side-effect of a - : unit = () computation # (print_string "Bye\n"; 25);; (* Sequence of exp *) As in print_string “\n” outputs a carriage return Bye In terms of values, it outputs ( ) (“unit”) - : int = 25 We will standardly use “output” to refer to the value returned 1/23/2014 19 1/23/2014 20 Declarations; Sequencing of Declarations Environments # let x = 2 + 3;; (* declaration *) Environments record what value is associated with val x : int = 5 a given identifier Central to the semantics and implementation of a # let test = 3 < 2;; language val test : bool = false Notation # let a = 3 let b = a + 2;; (* Sequence of dec = {name1 value1, name2 value2, …} *) Using set notation, but describes a partial function val a : int = 3 Often stored as list, or stack To find value start from left and take first match val b : int = 5 1/23/2014 21 1/23/2014 22 Global Variable Creation New Bindings Hide Old # 2 + 3;; (* Expression *) // 2 = {b 5, a 3, test false} // doesn’t affect the environment let test = 3.7;; # let test = 3 < 2;; (* Declaration *) val test : bool = false What is the environment after this declaration? // 1 = {test false} # let a = 3 let b = a + 2;; (* Seq of dec *) // 2 = {b 5, a 3, test false} 1/23/2014 23 1/23/2014 24 New Bindings Hide Old Local let binding // = {a 3, b 5, test 3.7} // 2 = {b 5, a 3, test false} 3 let test = 3.7;; # let c = let b = a + a // 4 = {b 6} + 3 What is the environment after this // ={b 6, a 3, test 3.7} declaration? in b * b;; val c : int = 36 // = {c 36, a 3, b 5, test 3.7} // = {a 3, b 5, test 3.7} 5 3 # b;; - : int = 5 1/23/2014 25 1/23/2014 26 Local Variable Creation Booleans (aka Truth Values) // 5 = {c 36, b 5, a 3, test 3.7} # true;; # let b = 5 * 4 - : bool = true // 6 = {b 20, c 36, a 3, test 3.7} # false;; in 2 * b;; - : bool = false - : int = 40 // = 7 5 # if b > a then 25 else 0;; # b;; - : int = 25 - : int = 5 1/23/2014 27 1/23/2014 28 Booleans Tuples # 3 > 1 && 4 > 6;; # let s = (5,"hi",3.2);; - : bool = false val s : int * string * float = (5, "hi", 3.2) # 3 > 1 || 4 > 6;; # let (a,b,c) = s;; (* (a,b,c) is a pattern *) - : bool = true val a : int = 5 # (print_string "Hi\n"; 3 > 1) || 4 > 6;; val b : string = "hi" Hi val c : float = 3.2 - : bool = true # 3 > 1 || (print_string "Bye\n"; 4 > 6);; # let x = 2, 9.3;; (* tuples don't require parens in Ocaml *) - : bool = true # not (4 > 6);; val x : int * float = (2, 9.3) - : bool = true 1/23/2014 29 1/23/2014 30 Tuples Functions # (*Tuples can be nested *) # let plus_two n = n + 2;; let d = ((1,4,62),("bye",15),73.95);; val plus_two : int -> int = <fun> val d : (int * int * int) * (string * int) * float = # plus_two 17;; ((1, 4, 62), ("bye", 15), 73.95) - : int = 19 # (*Patterns can be nested *) # let plus_two = fun n -> n + 2;; let (p,(st,_),_) = d;; (* _ matches all, binds nothing val plus_two : int -> int = <fun> *) # plus_two 14;; val p : int * int * int = (1, 4, 62) - : int = 16 val st : string = "bye" First definition syntactic sugar for second 1/23/2014 31 1/23/2014 32 Using a nameless function Values fixed at declaration time # (fun x -> x * 3) 5;; (* An application *) # let x = 12;; - : int = 15 val x : int = 12 # ((fun y -> y +. 2.0), (fun z -> z * 3));; # let plus_x y = y + x;; (* As data *) val plus_x : int -> int = <fun> - : (float -> float) * (int -> int) = (<fun>, <fun>) # plus_x 3;; Note: in fun v -> exp(v), scope of variable is What is the result? only the body exp(v) 1/23/2014 33 1/23/2014 34 Values fixed at declaration time Values fixed at declaration time # let x = 12;; # let x = 7;;
Recommended publications
  • A Formalization of the C99 Standard in HOL, Isabelle And
    A Formalization of the C99 Standard in HOL, Isabelle and Coq Robbert Krebbers Freek Wiedijk Institute for Computing and Information Sciences, Radboud University Nijmegen, The Netherlands The C99 standard Related projects Some subtleties of C The official description issued by ANSI and ISO: Michael Norrish. C and C++ semantics (L4.verified) Undefined behavior due to unknown evaluation order: Written in English Xavier Leroy et al. Verified C compiler in Coq (Compcert) int i = 0; No mathematically precise formalism Chucky Ellison and Grigore Rosu. Executable C semantics in Maude i = ++i; // undefined Incomplete and ambiguous Overflow of signed integers is undefined: The formalizations The Formalin project int i = INT_MAX; Describe a space C semantics of all possible C semantics with relations return i < i + 1; May 2011 to May 2015 between these semantics // undefined: hence, a compiler is allowed to http://ch2o.cs.ru.nl/ And, a small step semantics, C99 : C semantics // optimize this to return 1 Create a formalization of the complete C99 standard On the other hand, unsigned integer arithmetic is modular In the theorem provers HOL4, Isabelle/HOL and Coq Undefined behavior due to jumping into a block with a variable length Which follow the standard closely array declaration: All derived from a common master formalization (e.g. in Ott) goto foo; // undefined Isabelle/ Features int a[n]; HOL4 label foo; printf("bar\n"); C preprocessor HOL Freeing memory makes pointers to it indeterminate C standard library int *x = malloc(sizeof(int)); Floating point arithmetic 99 free (x); Casts C printf("%p\n", x); // undefined Non-determinism Contiguously allocated objects Sequence points int x = 30, y = 31; Alignment requirements int *p = &x + 1, *q = &y; Non-local control flow ( , / , signal handling) goto setjmp longjmp if (memcmp(&p, &q, sizeof(p)) == 0) { volatile, restrict and const variables printf("%d\n", *p); Programs in a `freestanding environment' COQ // the standard is unclear whether this is Purposes // defined (see Defect report #260).
    [Show full text]
  • Curriculum Vitæ RESEARCH INTERESTS EDUCATION PROFESSIONAL POSITIONS
    Curriculum Vitæ Mark Hills East Carolina University Department of Computer Science Greenville, North Carolina, United States of America Phone: (252) 328-9692 (office) E-mail: [email protected] Skype: mahills Home page: http://www.cs.ecu.edu/hillsma/ RESEARCH INTERESTS I am interested broadly in the fields of programming languages and software engineering, especially where they intersect. Specifically, my research focuses on static and dynamic program analysis; empirical software engineering; software analytics; software repository mining; automated refactoring; programming language semantics; and program verification. My goal is to provide developers with powerful new tools for under- standing, creating, analyzing, and improving software. As part of this, I am a continuing contributor to Rascal, a meta-programming language for program analysis, program transformation, and programming language implementation. EDUCATION • Ph.D. in Computer Science (advisor Grigore Ro¸su),University of Illinois Urbana-Champaign, com- pleted December 2009. • B.S. in Computer Science, Western Illinois University, 1995 PROFESSIONAL POSITIONS Associate Professor East Carolina University, Department of Computer Science (Assistant Professor 2013{2019, Associate Professor 2019{present) My research at ECU has focused on understanding complex, web-based systems written in dynamic lan- guages. This research includes a strong empirical component, looking first at how developers use specific features of dynamic languages, and second at how knowledge of these uses, which implicitly represent devel- oper intent, can lead to more precise analysis tools. Recently, I have also started to look at how to model the knowledge of developers (including students), and at how such models can be used to direct developers to more relevant, understandable code examples.
    [Show full text]
  • A DSL for Dynamic Semantics Specification}, Year = {2015}}
    Delft University of Technology Software Engineering Research Group Technical Report Series DynSem: A DSL for Dynamic Semantics Specification Vlad Vergu, Pierre Neron, Eelco Visser Report TUD-SERG-2015-003 SERG TUD-SERG-2015-003 Published, produced and distributed by: Software Engineering Research Group Department of Software Technology Faculty of Electrical Engineering, Mathematics and Computer Science Delft University of Technology Mekelweg 4 2628 CD Delft The Netherlands ISSN 1872-5392 Software Engineering Research Group Technical Reports: http://www.se.ewi.tudelft.nl/techreports/ For more information about the Software Engineering Research Group: http://www.se.ewi.tudelft.nl/ This technical report is an extended version of the paper: Vlad Vergu, Pierre Neron, Eelco Visser. DynSem: A DSL for Dynamic Semantics Specification. In Mari- bel Fernandez, editor, 26th International Conference on Rewriting Techniques and Applications, RTA 2015, Proceedings Leibniz International Proceedings in Informatics Schloss Dagstuhl Leibniz-Zentrum fur Infor- matik, Dagstuhl Publishing, Germany. @inproceedings{VerguNV-RTA-2015, Author = {Vlad Vergu and Pierre Neron and Eelco Visser}, Booktitle = {26th International Conference on Rewriting Techniques and Applications, RTA 2015, Proceedings}, Month = {June}, Note = {To appear}, Publisher = {Schloss Dagstuhl -- Leibniz-Zentrum fur Informatik, Dagstuhl Publishing, Germany}, Series = {Leibniz International Proceedings in Informatics}, Title = {DynSem: A DSL for Dynamic Semantics Specification}, Year = {2015}}
    [Show full text]
  • KEVM: a Complete Semantics of the Ethereum Virtual Machine
    CORE Metadata, citation and similar papers at core.ac.uk Provided by Illinois Digital Environment for Access to Learning and Scholarship Repository KEVM: A Complete Semantics of the Ethereum Virtual Machine Everett Hildenbrandt (UIUC), Manasvi Saxena (UIUC), Xiaoran Zhu (UIUC), Nishant Rodrigues (UIUC), Philip Daian (Cornell Tech, IC3, and RV Inc.), Dwight Guth (RV Inc.), and Grigore Ro¸su(UIUC and RV Inc.) August 1, 2017 Abstract A developing field of interest for the distributed systems and applied cryptography community is that of smart contracts: self-executing financial instruments that synchronize their state, often through a blockchain. One such smart contract system that has seen widespread practical adoption is Ethereum, which has grown to secure approximately 30 billion USD of currency value and in excess of 300,000 daily transactions. Unfortunately, the rise of these technologies has been marred by a repeated series of security vulnerabilities and high profile contract failures. To address these failures, the Ethereum community has turned to formal verification and program analysis which show great promise due to the computational simplicity and bounded- time execution inherent to smart contracts. Despite this, no fully formal, rigorous, comprehensive, and executable semantics of the EVM (Ethereum Virtual Machine) currently exists, leaving a lack of rigor on which to base such tools. In this work, we present KEVM, the first fully executable formal semantics of the EVM, the bytecode language in which smart contracts are executed. We create this semantics in a framework for executable semantics, the K framework. We show that our semantics not only passes the official 40,683-test stress test suite for EVM implementations, but also reveals ambiguities and potential sources of error in the existing on-paper formalization of EVM semantics [45] on which our work is based.
    [Show full text]
  • Working Formal Methods Symposium 1St International Workshop from 2017 Bucharest, Romania, July 5-8, 2017
    Working Formal Methods Symposium 1st International Workshop FROM 2017 Bucharest, Romania, July 5-8, 2017 Informal Proceedings Dorel Lucanu and Viorica Sofronie-Stokkermans (Eds.) July 5-8, 2017 Foreword This volume contains the papers presented at FROM 2017, Working Formal Methods Symposium, held on July 5-8 in Bucharest. Formal methods use mathematical techniques and rigour for developing soft- ware and hardware. The formal methods can be used to specify, verify, and analyse in any part of the system life cycle: requirements engineering, modeling, design, architecture, implementation, testing, maintenance and evolution. This assumes on the one hand the development of adequate mathematical methods and frameworks and on the other hand the development of tools that help the user to effectively apply these methods/frameworks in the life cycle of the sys- tem. Working Formal Methods Symposium (FROM) aims to bring together researchers and practitioners who work in the area of formal methods by contributing with new theoretical results, methods, techniques, and frameworks, and/or make the formal methods work by creating or using software tools that apply theoretical contributions. Areas and formalisms of interest include: category theory in computer science, distributed systems and concurrency, formal languages and automata theory, for- mal modelling, verification and testing, logic in computer science, mathematical structures in computer science, models of computation, semantics of program- ming languages. Methods of interest include: model checking, deductive verification, automated reasoning and model generation, automated induction, symbolic computation. Applications of interest include: program analysis, verification and synthesis of software and hardware, computational logic, computer mathematics, knowledge representation, ontology reasoning, deductive databases, uncertainty reasoning and soft computing.
    [Show full text]
  • Industrial Experience Report on the Formal Specification of a Packet
    Industrial Experience Report on the Formal Specification of a Packet Filtering Language Using the K Framework Gurvan LE GUERNIC Benoit COMBEMALE José A. GALINDO DGA Maîtrise de l’Information INRIA RENNES – BRETAGNE ATLANTIQUE 35998 Rennes Cedex 9, France Campus universitaire de Beaulieu 35042 Rennes Cedex, France Many project-specific languages, including in particular filtering languages, are defined using non- formal specifications written in natural languages. This leads to ambiguities and errors in the speci- fication of those languages. This paper reports on an industrial experiment on using a tool-supported language specification framework (K) for the formal specification of the syntax and semantics of a filtering language having a complexity similar to those of real-life projects. This experimentation aims at estimating, in a specific industrial setting, the difficulty and benefits of formally specifying a packet filtering language using a tool-supported formal approach. 1 Introduction Packet filtering (accepting, rejecting, modifying or generating packets, i.e. strings of bits, belonging to a sequence) is a recurring problematic in the domain of information systems security. Such filters can serve, among other uses, to reduce the attack surface by limiting the capacities of a communication link to the legitimate needs of the system it belongs to. This type of filtering can be applied to network links (which is the most common use), product interfaces, or even on the communication buses of a product. If the filtering policy needs to be adapted during the deployment or operational phases of the system or product, it is often required to design a specific language L (syntax and semantics) to express new filtering policies during the lifetime of the system or product.
    [Show full text]
  • MOP: an Efficient and Generic Runtime Verification Framework
    Technical report UIUCDCS-R-2007-2836, March 2007 MOP: An Efficient and Generic Runtime Verification Framework ∗ Feng Chen Grigore Ros¸u University of Illinois at Urbana-Champaign {fengchen,grosu}@cs.uiuc.edu Abstract 1. Introduction Monitoring-Oriented Programming (MOP 1) [19, 16, 20, 17] Runtime verification [28, 41, 10] aims at combining test- is a formal framework for software development and analy- ing with formal methods in a mutually beneficial way. The sis, in which the developer specifies desired properties using idea underlying runtime verification is that system require- definable specification formalisms, along with code to ex- ments specifications, typically formal and referring to tem- ecute when properties are violated or validated. The MOP poral behaviors and histories of events or actions, are rig- framework automatically generates monitors from the spec- orously checked at runtime against the current execution of ified properties and then integrates them together with the the program, rather than statically against all hypothetical user-defined code into the original system. executions. If used for bug detection, runtime verification The previous design of MOP only allowed specifications gives a rigorous means to state and test complex temporal without parameters, so it could not be used to state and mon- requirements, and is particularly appealing when combined itor safety properties referring to two or more related ob- with test case generation [5] or with steering of programs jects. In this paper we propose a parametric specification- [34]. A large number of runtime verification techniques, al- formalism-independent extension of MOP, together with an gorithms, formalisms, and tools such as Tracematches [2], implementation of JavaMOP that supports parameters.
    [Show full text]
  • A Language-Independent Program Verification Framework
    A Language-Independent Program Verification Framework Xiaohong Chen1 and Grigore Ro¸su1;2 1 University of Illinois at Urbana-Champaign 2 Runtime Verification Inc. Abstract. This invited paper describes an approach to language-independent deductive verification using the K semantics framework, in which an operational semantics of a language is defined and a program verifier together with other language tools are generated automatically, correct- by-construction. 1 Introduction and Motivation Given a program and a specification of the program, the deductive verification problem asks if the program satisfies the specification. If the answer is positive, a collection of proof obligations is expected to be generated as evidence, while counterexamples, often of the form of concrete program execution traces, witness the negative answer. Many program verification approaches are associated with a program logic and a proof system of that logic that allows to derive new facts about programs from axioms and established facts. The proof rules of the proof system define the semantics of the target language. Hoare logic [12], for example, is a program logic proposed in 1969 for a simple imperative language which we refer to as IMP. The syntax of IMP is defined in Fig. 1, where Id is the category for program variables and Exp is the category for arithmetic expressions. If- statements and while-statements use Exp as conditions, where zero means false and nonzero values mean true. The specification of an IMP program is written as a Hoare triple, consisting of the program and its precondition and postcondition (e.g., Fig. 2). A set of Hoare logic proof rules can then be used to rigorously reason about the correctness of IMP programs (Fig.
    [Show full text]
  • A Rewriting Approach to the Design and Evolution of Object-Oriented Languages
    Outline Problem Description Goal Statement Research Method Questions and Discussion A Rewriting Approach to the Design and Evolution of Object-Oriented Languages Mark Hills and Grigore Ro¸su {mhills, grosu}@cs.uiuc.edu Department of Computer Science University of Illinois at Urbana-Champaign 30 July 2007 Mark Hills and Grigore Ro¸su Rewriting for OO Language Design and Evolution Outline Problem Description Goal Statement Research Method Questions and Discussion 1 Problem Description 2 Goal Statement 3 Research Method 4 Questions and Discussion Mark Hills and Grigore Ro¸su Rewriting for OO Language Design and Evolution Outline Problem Description Goal Statement Research Method Questions and Discussion Outline 1 Problem Description 2 Goal Statement 3 Research Method 4 Questions and Discussion Mark Hills and Grigore Ro¸su Rewriting for OO Language Design and Evolution Outline Problem Description Goal Statement Research Method Questions and Discussion Defining Languages Most languages defined informally first, formally later (if ever) Order seems backwards; would be nice to start with a formal definition Problem: often not very flexible, need something that can be useful during design Mark Hills and Grigore Ro¸su Rewriting for OO Language Design and Evolution Outline Problem Description Goal Statement Research Method Questions and Discussion Why Formal Definitions? Define a real language “meaning”, independent of a specific implementation Develop a solid basis for experimenting with extensions Help guard against ambiguities, unexpected feature interactions,
    [Show full text]
  • Defining the Circus Operational Semantics in the K-Framework
    Defining the Circus operational semantics inthe K-framework Alex Alberto, Marie-Claude Gaudel To cite this version: Alex Alberto, Marie-Claude Gaudel. Defining the Circus operational semantics in the K-framework. [Research Report] LRI - CNRS, University Paris-Sud; ICMC, University of Sao Paulo. 2017, pp.59. hal-01438386 HAL Id: hal-01438386 https://hal.archives-ouvertes.fr/hal-01438386 Submitted on 17 Jan 2017 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Defining the Circus operational semantics in the K-framework Alex Alberto1 and Marie-Claude Gaudel2 1Universidade de S~aoPaulo, ICMC, S~aoCarlos, Brazil 2LRI, Univ. Paris-Sud and CNRS, Universit´eParis-Saclay, 91405 Orsay, France January 17, 2017 Abstract This report documents how we have implemented a trace generator for the Circus specification language using K, a rewrite-based executable semantic framework in which programming languages, type systems and formal analysis tools can be defined using configurations, computations and rules. This implementation is based on the operational semantics of Circus, that we have revisited to make it exploitable with K. The moti- vation of this work is the development of a test generation environment for Circus.
    [Show full text]
  • Programming Language Design (CS 422)
    Programming Language Design (CS 422) Elsa L Gunter 2112 Siebel Center, UIUC [email protected] http://courses.engr.illinois.edu/cs422/sp2016 Slides based in part on previous lectures by Grigore Ro¸su January 18, 2017 Slides based in part on previous lectures by Grigore Ro¸suJanuary 18, 2017 1 Elsa L Gunter Programming Language Design (CS 422) / 25 Contact Information Office: 2112 Siebel Center Office hours: Wednesday, Friday 12:50pm { 1:45pm Also by appointment Email: [email protected] Slides based in part on previous lectures by Grigore Ro¸suJanuary 18, 2017 2 Elsa L Gunter Programming Language Design (CS 422) / 25 Course Website main page - summary of news items policy - rules governing the course lectures - syllabus, slides and example code mps - Information about homework unit projects - for 4 credit students resources - papers, tools, and helpful info faq - answers to some general questions about the course and course resources Slides based in part on previous lectures by Grigore Ro¸suJanuary 18, 2017 3 Elsa L Gunter Programming Language Design (CS 422) / 25 Some Course References No Required Textbook Concrete Semantics With Isabelle/HOL, by Tobias Nipkow and Gerwin Klein. Springer, 2014. (In your snv directory) Lecture Notes of Grigore Rosu, found in Resources The Formal Semantics of Programming Languages: An Introduction by Glynn Winskel. MIT Press, 1993. Essentials of Programming Languages (2nd Edition) by Daniel P. Friedman, Mitchell Wand and Christopher T. Haynes, MIT Press 2001 Slides based in part on previous lectures by Grigore Ro¸suJanuary 18, 2017 4 Elsa L Gunter Programming Language Design (CS 422) / 25 Main Programming Platform: Isabelle/HOL Download from: http://www.cl.cam.ac.uk/research/hvg/Isabelle/ Runs inside jEdit Two implementation languages: SML (for proofs) and Scala (for jEdit) Full-powered general-purpose interactive mathematical theorem prover Can export executable specifications directly to code in SML, OCaml, Haskell, and Scala.
    [Show full text]
  • Inductive Proof Systems for Compositional Proofs in Reachability Logic Vlad Rusu, David Nowak
    (Co)inductive Proof Systems for Compositional Proofs in Reachability Logic Vlad Rusu, David Nowak To cite this version: Vlad Rusu, David Nowak. (Co)inductive Proof Systems for Compositional Proofs in Reachabil- ity Logic. Working Formal Methods Symposium, Sep 2019, Timisoara, Romania. pp. 32-47, 10.4204/EPTCS.303.3. hal-02176456v2 HAL Id: hal-02176456 https://hal.inria.fr/hal-02176456v2 Submitted on 23 Aug 2019 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. (Co)inductive Proof Systems for Compositional Proofs in Reachability Logic Vlad Rusu David Nowak Inria CRIStAL∗ Lille, France Lille, France Reachability Logic is a formalism that can be used, among others, for expressing partial-correctness properties of transition systems. In this paper we present three proof systems for this formalism, all of which are sound and complete and inherit the coinductive nature of the logic. The proof systems differ, however, in several aspects. First, they use induction and coinduction in different proportions. The second aspect regards compositionality, broadly meaning their ability to prove simpler formulas on smaller systems, and to reuse those formulas as lemmas for more complex formulas on larger systems.
    [Show full text]