INF220 - Software Specification

INF220 - Programvarespesifikasjon

Autumn 2023

Contents on this web page

Course content and curriculum

The course presents a theory for the design and reuse of software components. The focus is on APIs (signatures/interfaces) with property specifications, and studies how this gives a full theory of generic code reuse. The framework provides a close match to computer hardware, including multicore, parallel computers, GPUs and emerging energy efficient hardware architctures.

Property specifications can be formally verified using tools, ensuring software correctness. A timely question is if this is how to tame generative programming, like GitHub's copilot and Chat-GPT. Such tools generate seemingly good code, but there is no guarantee the provided code is relevant, correct or safe.

The course's theory is illustrated with practical software development in Magnolia. Magnolia is an experimental programming language tightly integrating property specifications and program code. Compiled code can be run as command line applications or interpreted as, e.g., microservices. The language design supports high integrity programming (reliable, robust, safe, secure) by validating correctness and guarding every operation.

The course looks into topics like the following.

  1. Algebraic specifications for discovering and defining API contracts. This process is called Domain Engineering.
    Good API design is central for domain specific languages, software product lines, microservices and web services in general.
  2. Institutions as a framework for modularisation, reuse, specification and testing.
  3. Semantic models: mathematical abstractions, bit patterns from hardware, abstract syntax trees and free constructions.
    The setting gives us evaluators for free.
  4. Generic programming for code reuse and translation of property specifications.
  5. Cheap verification of generic code: free theorems, property inheritance, proof by testing.
  6. Guarding (preconditions) against partiality.
    Which gives free constructions for error recovery.
  7. Extended reuse by Syntactic Theory Functors (STFs) and Syntactic Model Functors (SMFs).
  8. Green computing (sustainable computing): programming models and techniques that support more efficient use of hardware, thus cutting the energy cost for computations. This is important for mobile computing where batteries capacity is limited. It is also important for large scale computing, where significant amounts of electricity can be saved.

Reading Material

The curriculum consists of all lectures, notes, handouts, exercises, and related course material, most of it will be covered in the following handout (to be made available later — check MittUiB).

The following supplementary reading material gives an idea about the course contents.

Additional Reading Material

For those especially interested in reading up on background material, the following (classical) books are recommended.

Teachers

Lecturer and course responsible: Magne Haveraaen
Teaching assistant: Sander Wiig

The participants are adviced to organise study groups for discussing the topics of the course and assist each other in solving the exercises.

Schedule for lectures and seminar groups

See the official schedule, which may be subject to change:

Teaching starts Monday 21 August 2023 (week 34), Teaching will be in the form of lectures, exercises and time off for self studies.

The HiB building (Høyteknologisenteret i Bergen) is Thormøhlensgt 55, 5008 Bergen. The room is in datablokken, the taller of the two towers (to the right of the main entrance).

Semester plan

The following teaching plan is tentative and will change.

  1. Foundations 1: interface, expression, model, assignment, evaluation — generative AI and binary search
    Exercise set 1 (Set theory)
  2. Foundations 2: property specification (EL, CEL), satisfaction.
    Exercise set 1 (Set theory)
  3. Foundations 3: property specification (BL), reuse (inclusion morphisms), institutions;
    Exercise set 2 (Specification theory)
  4. Foundations 4: satisfaction, reuse (interface morphisms), institutions; models Mod and theories Th
    Exercise set 3 (Installing Magnolia, Magnolia tutorial)
  5. Magnolia overview (language and library); Homomorphisms
    Examples: semigroup, monoid, group, semiring, ring — possibly lattice (pointless topology), sheaf, preorder.
    Exercise set 4 (Institutions)
  6. Foundations 5: expression algebras and evaluation homomorphisms, generated/free/initial algebras, homomorphic image algebra and property preservation
    Exercise set 5 (Property testing)
  7. Foundations 6: constructing algebras (subalgebras, products/powers, quotients), property preservation and reflection
    Exercise set 6 (Generated/Free/Initial and institutions)
  8. Foundations 7: data structures (data invariants, congruence relations, arrays and tuples); substitutions
    Exercise set 7 (Data structures and algebra constructions)
  9. Foundations 8: inlining, generic programming and institutions — and in Magnolia; procedures and functionalisation
    Exercise set 8 (Generics as an institution interface morphism)
  10. Domain engineering the Magnolia way; — API, microservices, software product lines;
    Presentation of compulsory assignment problems (team work)
    Exercise set 9 (Compulsory assignment)
  11. Exercise set 9 (compulsory assignment)
  12. Exercise set 9 (compulsory assignment)
  13. Exercise set 9 (compulsory assignment)
  14. Curriculum summary, Q&A
    Voluntary student presentations (Thursday, room Kremle, at 1415): solutions to the compulsory assignments

Exam

The course will be evaluated by an oral exam Monday 27 and Tuesday 28 November 2023.


Last updated 2023-12-11 by Magne Haveraaen