Structural induction is your friend
We have been going through a structural induction proof in class that is based on the induction scheme we set out earlier. Basically, if we can show something is true for every form in our language, then that something is true for the entire language. No big deal there.
What seems to be causing folks a bit of trouble is how the proof is set up. Basically, we have to definitions of our language. The operational semantic function for arithmetic expressions has the form:
<a,sigma> -> n
while the denotational semantic function has the form:
A[[a]]sigma = n
Somehow, we have to show that these are equivalent. The first thing we do is get both descriptions in the same form. In this case, sets that share the form of the denotational definition. So, we can define a function that returns the value for an expression as specified by the operational definition like this:
{(sigma,n) | <a,sigma> -> n}
This set defines a function that given a sigma, will return the n that the operational semantics definition says it should.
So why reformulate the definition and write this odd set definition? Quite simply, it formulates a denotational definition from the operational definition. That is quite helpful because now all we need to do is prove that these two denotational definitions are the same:
P(a) == A[[a]] = {(sigma,n) | <a,sigma;> -> n}
after expanding A[[a]]:
P(a) == {(sigma,n) | D(sigma,a,n)} = {(sigma,n) | <a,sigma> -> n}
where D is the denotational definition we developed a week ago.
Now you should see where we are headed. If we can show that:
D(sigma,a,n) <=> <a,sigma> -> n
then we know that if a pair is in A[[a]] it is also in the denotation function defined using the operational semantics. That is what we have been up to.
More later on where the preconditions come from and how they are used.
What seems to be causing folks a bit of trouble is how the proof is set up. Basically, we have to definitions of our language. The operational semantic function for arithmetic expressions has the form:
<a,sigma> -> n
while the denotational semantic function has the form:
A[[a]]sigma = n
Somehow, we have to show that these are equivalent. The first thing we do is get both descriptions in the same form. In this case, sets that share the form of the denotational definition. So, we can define a function that returns the value for an expression as specified by the operational definition like this:
{(sigma,n) | <a,sigma> -> n}
This set defines a function that given a sigma, will return the n that the operational semantics definition says it should.
So why reformulate the definition and write this odd set definition? Quite simply, it formulates a denotational definition from the operational definition. That is quite helpful because now all we need to do is prove that these two denotational definitions are the same:
P(a) == A[[a]] = {(sigma,n) | <a,sigma;> -> n}
after expanding A[[a]]:
P(a) == {(sigma,n) | D(sigma,a,n)} = {(sigma,n) | <a,sigma> -> n}
where D is the denotational definition we developed a week ago.
Now you should see where we are headed. If we can show that:
D(sigma,a,n) <=> <a,sigma> -> n
then we know that if a pair is in A[[a]] it is also in the denotation function defined using the operational semantics. That is what we have been up to.
More later on where the preconditions come from and how they are used.
Comments