 Hi and welcome back to program analysis. This is part 5 of this lecture on operational semantics and what we're going to do in this fifth and final part of this lecture is to have a brief look at big step semantics. So this is the second style of structural operational semantics that we're going to discuss here and we'll see how it is somewhat similar to small step semantics but at the same time also pretty different. So now in the previous video we've seen these small steps semantics and what we've seen there is that we had to find this transition relation such that each transition, so each step in this relation corresponds to an individual step of computation. Now in contrast what we want to do here is to basically omit some more details and take bigger steps. That's why we have the name big step semantics so that the transition relation now corresponds to the full evaluation of a piece of code. In order to do this we again need to define a transition system and to keep things a little simpler. Fortunately the configurations remain the same as before so it's again a pair of a program and a store but the evaluation relation is changing so this is the new transition relation for this new transition system that we're defining here and specifically that change such that we now use this notation where we have a program and the store we start with and then we use this down arrow notation here. It looks a bit like a smiley but actually it's a down arrow which leads us to a change program P prime and a change store S prime. The way you should read this is that this down arrow is read as evaluates to and the result of this evaluation is the last configuration of the evaluation sequence of this program P given the store S if this program P terminates. So it's the last configuration of the evaluation sequence of this program P given the store S assuming that P actually terminates. So in order to define this evaluation relation I need to again give you the axioms and rules because we've now done this already twice for the abstract machine and for the small steps operational semantics I'm not going to go through all the axioms and rules but I just give a few representative examples here and then I'll share the full set of axioms and rules with you afterwards. So let's start with one axiom that we've also seen in the small steps semantics and actually it looks very similar it's the one that is used to read the value of some variables. So if you have some location or variable L and some store S then this evaluates to N and S if the store maps L to L. So this is again the axiom to read variables and as you can tell by comparing this to the previous axiom that we've seen in small steps semantics this is almost as before. So now given that this is almost as before let's also have a look at some axioms and rules that actually change quite a bit and as an example let's here look at an axiom sorry a rule that we are using to evaluate an assignment. So if you have an assignment that looks like this so we say we want to write into location L the value of evaluating this expression E then we can evaluate this in one step to skip and an updated store S prime which is further updated by mapping L to N under the condition that we have a way to actually evaluate E, S to N and S prime. So note that there are potentially two updates of the store here one in the precondition of this rule where we're saying while evaluating the expression E there might be an update to S prime and then once we have evaluated E to the value N we'll update the store again down here by taking this S prime and now also changing the mapping of L so that it now maps to N. So this rule is for assignments and as you can tell by comparing it to the corresponding rules for small steps semantics this is actually much simpler because we here have only one rule instead of the two rules that we had before and as a third example of a rule let's have at the rule that allows us to evaluate a sequence of commands so if you have a sequence C1 semicolon C2 and now want to evaluate this given some initial store S then all of this can be evaluated in just a single step to skip with a new store S double prime under two conditions one is that if we start with C1 and evaluate this given store S then this evaluates to skip and a store S prime and after that we take C2 and evaluate this given this store S prime and this then evaluates to skip with a changed store S double prime. So as you can see this basically allows us again to do something we have done in multiple steps with the small steps semantics now in a single step step because we are reducing this entire sequence of commands in a single step to skip. Let me illustrate this using an example and you'll see more examples of this in the exercise. So let's again look at this program that swaps the value of two arguments where we are writing the value of X into Z and then overwrite X with the value of Y and then after that put the value of Z into Y and let's say we are doing this with an initial store where Z is zero and X is one and Y is two. So what we want to show here is that if we take this program P and this initial store S then all of this evaluates to skip and a store S prime where eventually S prime looks as follows so Z at the end will map to one X will map to two and Y will map to one and now in order to do this we need to show that you can take this one transition step and in order to do this we again have to construct a proof tree which starts by showing that if we take our program P and evaluated given store S then this evaluates to skip and store S prime because the outermost command here is a sequence of commands we can do this using the sequence rule and in order to use that rule we need to show two things namely that the first statement that we have here evaluates to skip and changes the store so in order to not repeat my writing here too much let's say we call this sorry only until here P prime and let's say we call this P double prime then we need to show that P prime starting in S evaluates to skip and leads to some store S double prime and the second part of this sequence of commands to P prime prime if we start to evaluate this in S double prime then this will evaluate also to skip and leads to the store S prime that we are using down in the conclusion and now in order to show that we can actually draw these conclusions we need to also again use some rules so P prime also consists of two statements itself which means we need to use our sequence rule another time and I'm not showing you all the details here so I actually would like to invite you to try this out yourself and if you have questions then please ask in the exercise to resolve them but essentially what this boils down to just to give you a sketch of this proof tree is that for the first command in the sequence you'll have to use the assignment rule which you have seen on the previous slide and in order to use this assignment rule you will have to use another rule which allows you to actually read the value of variable x and this is the variable rule and then on the other side of this subtree it looks very similar because there's another assignment so again here the assignment rule is used and then the variable rule is used to read the value of variable y and then on the right hand side of this entire tree it again looks kind of similar just that we do not need to use the sequence rule again but we'll directly use the assignment rule here which has some preconditions and in order to show that these preconditions are actually true we need to use the variable rule all right and that's already the end of video number five in this lecture on operational semantics so you've now seen three ways to define the semantics of this simple language one that is at a very low level where we define a hypothetical machine this abstract machine specifically designed for this language and where we show very low level steps that help us to eventually determine the meaning of programs written in SIMP and then we've gone up this letter of abstraction by looking at small steps a small step operational semantics and then in this video also a little bit of big step operational semantics and each of these three ways of defining the semantics essentially yields the same result it tells you the meaning of programs in SIMP just in three different ways of writing it down thank you very much for listening i hope you've learned something in this lecture and then see you next time