lecture outline
play

Lecture Outline 1. The lecturer DD2457 Program 2. Introduction to - PDF document

Lecture Outline 1. The lecturer DD2457 Program 2. Introduction to semantics 3. Course syllabus Semantics and Analysis 4. Course objectives Introductory Lecture 5. Course organization Lecturer What is semantics ? Dilian Gurov


  1. Lecture Outline 1. The lecturer DD2457 Program 2. Introduction to semantics 3. Course syllabus Semantics and Analysis 4. Course objectives Introductory Lecture 5. Course organization Lecturer What is ” semantics ”? • Dilian Gurov • From the Greek: ”meaning” • E-mail: dilian@csc.kth.se • Linguistics: syntax, semantics, pragmatics • Phone: 08-790 81 98 (office) • Computer Science: – Programming languages (Java, Scheme) • Visiting address: – Database query languages (SQL) Osquars backe 2, floor 4, room 4417 • ”Formal” semantics: • Research interests: meaning = behaviour – Analysis of program behaviour – Correctness: logics, compositionality as a mathematical object! Program Behaviour: Aspects Why Formal Semantics? • Function : what is the computed object? Provides the basis for formal analysis! • Time : how many computation steps? 1. Programming language implementation • Abstract machines: unambiguous, correct • Space : how much memory is needed? 2. Program transformation • Interaction behaviour : • Program analysis: optimizing compilers what sequences of interactions ? 3. Program correctness on-going behaviour, reactive systems • Program analysis: security example: request server • Program verification: proving correctness 1

  2. The Example Language While The Example Language While Euclid’s algorithm for computing GCD • Integers and integer variables • Arithmetic and boolean expressions • Assignment, conditional, while loops while ¬(x=y) do • Extensions: if x <= y – Procedures then y := y - x – Exceptions else x := x - y – Concurrency Semantic Styles Operational Semantics • Operational semantics: • Configurations : ”state of computation” program behaviour: states & transitions intial and final configurations granularity: big-step, small-step, … • Transitions between configurations • Denotational semantics: relation, defined by rules programs as ”state transformers” • Computations : • Axiomatic semantics: sequences of transitions programs as ”predicate transformers” from initial to final configurations properties of states as logic assertions Operational Semantics Denotational Semantics 1. ”Big-step” Operational Semantics • Relates initial and final states transitions relate initial and final configs • Meaning of program is a mapping! 2. ”Small-step” Operational Semantics from intial to final configurations, transitions relate internal configs ”state transformer” 3. Abstract Machines • Meaning of constructs: execution strategy embedded into rules given by defining equations • Tricky for loops: recursive equations Fixed-point Theory, Domain Theory 2

  3. Axiomatic Semantics Course Syllabus • Relates properties of initial and final states Part I. Operational semantics and programs are ”predicate transformers”, language implementation properties of states: state assertions Part II. Denotational semantics and • Meaning of programs: Hoare triples program analysis • Meaning of constructs: Part III. Axiomatic semantics and given by rules (”axiomatic”) program verification Course Aim Intended Learning Outcomes After the course, students should be able to: • Obtain an abstract understanding of • Motivate and relate the various semantic styles program behaviour: • Extend these to other language features – Leads to better software design • Apply the various techniques: – Enables to argue about correctness – Prove correctness of implementation: spec: op. sem., impl: abstract machine, relate! • Apply and develop abstract tools – Perform various program analyses: detection of signs, error detection, security – The basis for developing concrete tools – Prove correctness of programs: – Two lab assignments construct proof tableaux, extract verification con’s Course Organization Assignments • 6 written homework assignments . Consist of • 15 lectures/tutorials, 2 labs, exercises taken from the textbook or composed 6 assignments, 1 written exam by the course leader • Course book : • Written solutions are checked in class by peer ” Semantics with Applications ” by Nielson reviewing , with the help of solutions provided by and Nielson, check Kårbokhandeln the course leader; are then collected • Each peer reviewed and passed assignment • Course web page : gives a bonus point for the final exam (out of 30 www.csc.kth.se/DD2457/semant13/ points). Criterion for passing is to have made a • Course board: sv. ”kursnämnd” decent attempt to solve the problem rather than volunteers? to have necessarily produced a correct solution 3

  4. Lab Assignments • 2 laboratory assignments . Carried out in teams of at most two. The lab sessions are only for getting assistance and presenting the solutions. 1. Implementing an interpreter for the While language based on the notion of abstract machines developed in Chapter 4 of the textbook. 2. Adapting the interpreter from the first one to run with abstract values instead of with concrete ones, thus implementing the abstract interpretation technique for program analysis developed in Chapter 7 of the textbook, but in an operational semantics style. The technique is applied to program transformation . 4

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend