text‹The ‹VAR {_}›syntax supports two variants: 🚫‹VAR {x = t}›where‹t::nat›is the decreasing expression,
the variant, and‹x› a variable that can be referred tofrom inner annotations.
The ‹x› can be necessary for nested loops, e.g. to prove that the inner loops do not mess with‹t›. 🚫‹VAR {t}›where the variable is omitted because it is not needed. ›
syntax "_While0" :: "'bexp \ 'assn \ 'com \ 'com"
(‹(‹indent=1 notation=‹mixfix Hoare while expression››WHILE _/ INV (‹open_block notation=‹mixfix Hoare invariant››{_}) //DO _ /OD)› [0, 0, 0] 61) text‹The ‹_While0›syntaxis translated into the ‹_While›syntaxwith the trivial variant 0.
This is ok because partial correctness proofs do not make use of the variant.›
text‹Completeness requires(?) the ability to refer to an outer variant in an inner invariant. Thus we need to abstract over a variable equated with the variant, the ‹x›in‹VAR {x = t}›.
But the ‹x› should only occur in invariants. To enforce this, syntaxtranslationsin🍋‹hoare_syntax.ML›
separate the program from its annotations and only the latter are abstracted over over ‹x›.
(Thus‹x› can also occur in inner variants, but that neither helps nor hurts.)›
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.