Check a while loop's pre and inv conditions.

This commit is contained in:
Nigel Tao committed 2017-06-01 17:11:01 +10:00
1 parent bcf6a7ee1d
commit 3f5bb7a02b
5 files changed
+115 -29

No files matched your search

+7 -1
View File
@@ -17,7 +17,9 @@ pub func lzw_decoder.decode?(dst ptr io.buf1, src ptr io.buf1, src_final bool)()
// TODO: implement.
while true {
while true,
pre n_bits < 8,
{
while n_bits < width,
post n_bits >= width,
{
@@ -28,5 +30,9 @@ pub func lzw_decoder.decode?(dst ptr io.buf1, src ptr io.buf1, src_final bool)()
// TODO: implement.
break
// TODO: process n_bits further so that (n_bits < 8) and remove this
// temporary hack.
n_bits = 0
}
}