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 to from 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›syntax is translated into the ‹_While› syntax with 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, syntax translations in 🍋‹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.)›
datatype 'a anno =
Abasic |
Aseq "'a anno""'a anno" |
Acond "'a anno""'a anno" |
Awhile "'a set""'a ==> nat""nat ==> 'a anno"
ML_file ‹hoare_syntax.ML›
end
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-05-03)
¤
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.