Synopsis

Resource usage—the amount of time, memory, and energy a program requires for its execution—is one of the central subjects of computer science. Nevertheless, resource usage often does not play a central role in classical programming-language concepts such as operational semantics, type systems, and program logics. The first part of the course revisits these concepts to model and analyze resource usage of programs in a compositional and mathematically-precise way. The emphasis is on practical, type-based techniques that automatically inform programmers about the resource usage of their code.

The second part of the course studies probabilistic programming languages. Such languages describe probability distributions and can be used to precisely describe and analyze probabilistic models. Probabilistic languages are for instance used in statistical modeling and to facilitate probabilistic inference. The focus of the course is on the semantics and analysis of probabilistic languages. Interestingly, the techniques from the first part can be applied to automatically analyze the expected cost and results of probabilistic programs.

The third part of the course, presents an application of automatic resource bound analysis in Nomos, a programming language for implementing digital contracts. Nomos is based on session types, which are a focus in this part. Moreover, blockchains and smart contracts are briefly covered to motivate the need for resource bounds.

Topics

  • Recurrence relations
  • Amortized analysis and the potential method
  • Type systems and type inference
  • Operational semantics
  • Cost semantics for parallel and sequential evaluation
  • Substructural type systems
  • Linear automatic amortized resource analysis
  • Automatic amortized resource analysis for higher-order programs
  • Polynomial amortized resource analysis
  • Type inference for automatic amortized resource analysis
  • Resource Aware ML
  • Probabilistic programming
  • Weakest pre-expectation calculus
  • Blockchains and digital contracts
  • Session types
  • Resource-aware session types
  • Shared session types and modal separation
  • Nomos