(* * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) * Copyright (c) 2022 Apple Inc. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause *) (*<*) theory Chapter3_HoareHeap imports "AutoCorres2.AutoCorres" begin (*>*) subsection ‹\texttt{swap}› text ‹ Here, we use AutoCorres to verify a C program that reads and writes to the heap. Our C function, \texttt{swap}, swaps two words in memory: \lstinputlisting[language=C, firstline=11]{swap.c} Again, we translate the program using the C parser and AutoCorres. ›