(*<*) theory Overview imports Imperative_HOL "HOL-Library.LaTeXsugar" begin
unbundle constrain_space_syntax (*>*)
text‹ ‹Imperative HOL› is a lightweight framework for reasoning
about imperative data structures in ‹Isabelle/HOL› cite‹"Nipkow-et-al:2002:tutorial"›. Its basic ideas are described in cite‹"Bulwahn-et-al:2008:imp_HOL"›. However their concrete
realisation has changed since, due to both extensions and
refinements. Therefore this overview wants to present the framework \qt{as it is} by now. It focusses on the user-view, less on matters
of construction. For details study of the theory sources is
encouraged. ›
section‹A polymorphic heap inside a monad›
text‹
Heaps (🚫‹heap›) can be populated by values of class 🚫‹heap›; HOL's default types are
already instantiated to class 🚫‹heap›. Class 🚫‹heap› is a subclass of 🚫‹countable›;
see theory ‹Countable› for ways to instantiate types as 🚫‹countable›.
The heap is wrapped up in a monad typ‹'a Heap› by means of the
following specification:
This allows for equational reasoning about monadic expressions; the
fact collection ‹execute_simps› contains appropriate rewrites
for all fundamental operations.
Primitive fine-granular control over heaps is available through rule ‹Heap_cases›:
section‹Relational reasoning about 🚫‹Heap› expressions›
text‹
To establish correctness of imperative programs, predicate
\begin{quote} 🚫‹effect› \end{quote}
provides a simple relational calculus. Primitive rules are ‹effectI› and ‹effectE›, rules
appropriate for reasoning about imperative operations are available in the ‹effect_intros› and ‹effect_elims› fact collections.
Often non-failure of imperative computations does not depend
on the heap at all; reasoning then can be easier using predicate
\begin{quote} 🚫‹success› \end{quote}
Introduction rules for const‹success› are available in the ‹success_intro› fact collection.
const‹execute›, const‹effect›, const‹success› and const‹bind›
are related by rules ‹execute_bind_success›, ‹success_bind_executeI›, ‹success_bind_effectI›, ‹effect_bindI›, ‹effect_bindE› and ‹execute_bind_eq_SomeI›. ›
section‹Monadic data structures›
text‹
The operations for monadic data structures (arrays and references)
come in two flavours:
\begin{itemize}
\item Operations on the bare heap; their number is kept minimal
to facilitate proving.
\item Operations on the heap wrapped up in a monad; these are designed
for executing.
\end{itemize}
Provided proof rules are such that they reduce monad operations to
operations on bare heaps.
Note that HOL equality coincides with reference equality and may be
used as primitive executable operation. ›
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.