Lemma step_invariant (stack:stack) (buffer:Stream token): forall buffer_tmp, (exists word_old, buffer = word_old ++ buffer_tmp /\ word_has_stack_semantics word_old stack) -> match step init stack buffer_tmp with | OK (Accept_sr sem buffer_new) => exists word_new, buffer = word_new ++ buffer_new /\ inhabited (parse_tree (NT (start_nt init)) word_new sem) | OK (Progress_sr stack_new buffer_new) => exists word_new, buffer = word_new ++ buffer_new /\ word_has_stack_semantics word_new stack_new | Err | OK Fail_sr => True end.