Theory Preliminary_Library
theory Preliminary_Library
imports Main "HOL-Library.Word" "Word_Lib.Word_Lib_Sumo" "HOL-Library.Countable"
begin
section ‹Preliminary Theories›
text ‹In this subsection, we provide the type and value system used by the CHERI-C Memory Model.
We also provide proofs for the conversion between large words (i.e. bits) and a list of bytes.
For primitive bytes that are not $U8_\tau$ or $S8_\tau$, we need to be able to convert between
their normal representation and list of bytes so that storing values work as intended.
The high-level detail is given in the paper~\cite{park_2022}.›
subsection ‹Types and Values›
text ‹We first formalise the capability type. We first define \textit{memory capabilities} as a record,
then we define \textit{tagged capabilities} by extending the record. We state the class
comp\_countable for future work, but countable is sufficient for the block\_id type.
For the permissions, we present only those used by the memory model.›
class comp_countable = countable + zero + ord