Closed jaewooklee93 closed 9 years ago
I think I am gonna do:
wellformed st stack prog: Prop
that execution of prog
with st
and stack
goes without ill-formed operations.Jeehoon
When I did this exercise by myself in the last week, it was relatively easy one which can be solved in 10 lines of codes, but now only the inductive definition of wellformed
will may take at least 10 lines.
As comment said (In order to make your correctness proof easier you may find it useful to go back and change your implementation!)
, I think the intention of this exercise is to show the fact that the slight change of definition can lead us to much easier proof.
I will try to think more about this problem...
Finally, I solved this problem with defining a new interpreter which can track the liveness of program and simulate the original interpreter, but this solution takes more than 100 lines...
We updated the definition: 2b1591b9cf8b184dedceed37793573862836054d
Interestingly, my long proof continued to work well even though the definition of s_executed
was changed. However, I also have replaced my previous submission with much compact proof of 5 lines.
@jaewooklee93 I believe that is because your proof did not rely on the altered part of the definition. It is the most pleasure thing that your proof is stripped down to 5 lines.
Jeehoon
In our
Assignment08_05.v
, we have to prove the correctness of stack compilerHowever, I think the definition of
s_execute
given in theAssignment08_00.v
is inappropriate to make the proof of correctness easier;because of the behavior at the error state. The definition you gave forces to stop the computation when invalid operations come in, but my desirable definition just ignores such invalid ops and keep going from the next ops.
Because of such slight difference at the error state, I cannot prove the following useful and intuitive
Lemma
with your definition, which is easily provable in my definition. execute (l1++l2) on stack = execute l2 on (execute l1 on stack) This lemma doesn't hold with your definition, the counterexample is l1=[SMult], l2=[SPush 0], stack=[]So I want to modify your definition in
Assignment08_00.v
, but I think it is not allowed, but is there any possible way to alleviate this conflict between two def'ns?