Hoppa till huvudinnehållet

DD2457 Programsemantik och programanalys 6,0 hp

To give a semantics for a programming language means to give a precise definition of the behaviour of programs written in this language. Once the semantics of the language has been described formally, one can go about and prove various language properties like determinism, prove correctness of program implementations based on abstract machines, justify various program analyses used in syntax-oriented editors and program transformations used in optimising compilers, and specify and prove correctness of concrete programs. This provides the formal basis for a variety of software tools for program analysis, optimisation and verification.

Kursomgångar saknas för aktuella eller kommande terminer.
Rubriker med innehåll från kursplan DD2457 (VT 2022–) är markerade med en asterisk ( )

Innehåll och lärandemål

Kursinnehåll

* Part I. Operational Semantics and Language Implementation: natural semantics, structural operational semantics, abstract machines, correctness of language implementation.

* Part II. Denotational Semantics and Program Analysis: denotational semantics, fixed-point theory, program analysis and transformation.

* Part III. Axiomatic Semantics and Program Verification: axiomatic semantics, program specification and verification, weakest pre-conditions, verification condition generation.

Lärandemål

The overall aim of the course is to study the main semantic styles used for capturing the meaning of programs in a formal way, namely operational semantics, denotational semantics and axiomatic semantics, compare their strengths and weaknesses, and use these semantics for program analysis, optimisation and verification, both in theory and as a basis for software tools.

The successful student will be able to perform constructions such as:

* Construct the state space of a program as a basis for program behaviour analysis through state space exploration.

* Translate programs to abstract machine code, and execute the latter.

* Compute the denotation of a program.

* As above, but in abstract domains.

* Extend a programming language with new language features, and extend its semantics and abstract machine implementations accordingly.

* Suggest and justify program transformations supported by a suitable program analysis.

* Specify and verify programs in Hoare logic.

* Generate verification conditions from a program with annotated while loops.

as well as be able to formally establish results such as:

* Relate different semantic styles.

* Prove language properties such as determinism and termination.

* Show correctness of a given program transformation by proving equivalence of the original and the transformed program.

* Show properties of a given semantics.

For passing the course, a student has to demonstrate proficiency with problems of the first type; for the highest grade he/she has to be equally proficient at the remaining types of problems.

Kurslitteratur och förberedelser

Särskild behörighet

För fristående kursstuderande:

DD1337 Programmering, DD1338 Algoritmer och Datastrukturer, SF1630 Diskret Matematik, DD1350 Logik för Dataloger eller motsvarande kurser.

Rekommenderade förkunskaper

5B1118/SF1610 Discrete Mathematics, mandatory and 5B1928/SF1642 Logic, recommended

Utrustning

Ingen information tillagd

Kurslitteratur

Ingen information tillagd

Examination och slutförande

När kurs inte längre ges har student möjlighet att examineras under ytterligare två läsår.

Betygsskala

A, B, C, D, E, FX, F

Examination

  • HEM1 - Hemuppgifter, 2,0 hp, betygsskala: P, F
  • LAB1 - Laborationer, 2,0 hp, betygsskala: P, F
  • TEN1 - Tentamen, 2,0 hp, betygsskala: A, B, C, D, E, FX, F

Examinator beslutar, baserat på rekommendation från KTH:s handläggare av stöd till studenter med funktionsnedsättning, om eventuell anpassad examination för studenter med dokumenterad, varaktig funktionsnedsättning.

Examinator får medge annan examinationsform vid omexamination av enstaka studenter.

Övriga krav för slutbetyg

* LAB1 - Laboratory work, 2,0 hp, grade: Pass/fail

* HEM1 - Exercises, 2,0 hp, grade: Pass/fail

* TEN1 - Examination, 2,0 hp, grade: A, B, C, D, E, FX, F

Möjlighet till komplettering

Ingen information tillagd

Möjlighet till plussning

Ingen information tillagd

Examinator

Etiskt förhållningssätt

  • Vid grupparbete har alla i gruppen ansvar för gruppens arbete.
  • Vid examination ska varje student ärligt redovisa hjälp som erhållits och källor som använts.
  • Vid muntlig examination ska varje student kunna redogöra för hela uppgiften och hela lösningen.

Ytterligare information

Kursrum i Canvas

Registrerade studenter hittar information för genomförande av kursen i kursrummet i Canvas. En länk till kursrummet finns under fliken Studier i Personliga menyn vid kursstart.

Ges av

Huvudområde

Datalogi och datateknik

Utbildningsnivå

Avancerad nivå

Påbyggnad

Ingen information tillagd

Kontaktperson

Dilian Gurov, e-post: dilian@kth.se, 790 8198

Övergångsbestämmelser

Examinationen genomförs under övergångsperioden inom ramen för kursen DD2557. Kursmodulerna i DD2457 ersätts av kursmoduler i DD2557 med samma namn.