CS 541 Lecture -*- Outline -*- * Introduction to Operational Semantics ** definition ------------------------------------------ OPERATIONAL SEMANTICS def: an operational semantics of a language L is: ------------------------------------------ ... a map from L into some language M, and a definition of M Q: Have we made any progress in defining L? Q: what's an example? e.g., compiler translates program into machine language ** problems *** well-definedness worry that the M may not be well-defined if it's complex (a real machine) solution is to use a simple, formally defined machine e.g. Turing machine or Landin's SECD machine *** using the semantics to reason about a program in the original language hard if have to follow lots of steps in the computation of the machine harder if the machine is complex one solution is to make a "1 step" machine, where reasoning is directly reflected in map into the machine. but there is still a problem if you have any kind of looping or recursion. ** advantages *** applications to compilation - study of compiler optimizations - correctness proofs for compilers - design of new compilers by design of new abs. machine e.g., Warren abstract machine (Prolog) graph reduction engines (functional) *** easiest kind of semantics to write down not a lot of complex math to master, basically Prolog *** best for semantics of concurrency (it seems) denotational approaches have trouble in their foundations for concurrency, although there are stream-based techniques in denotational semantics that help ** remarks it's because of the structural framework I'll present (due to Plotkin) that operational semantics has become more and more important ** Things to think about specifying - recursion - errors - can you leave some things unspecified