Hoare.lean
ARM64 Subroutine Specifications
Relational separation-logic contracts (Spec), AAPCS64 calling-convention invariants (CalleeSavedPreserved, CallingConventionPreserved, Returned, SubroutineStop, SubroutineOutcome), execution judgments (reaches_stop, safe_until, safe_reaches, reaches_outcome, exits_with), framed Hoare triples (subroutine_ok, safe_subroutine_ok, exit_ok, HookOk, HookSat), symbol-addressed program judgments (Program., Program., Program.), and subroutine-to-hook primitives (subroutineHook).
reaches_outcome and subroutine_ok are defined inside a plain public section (not @[expose]), so client modules see only their abstract signatures while ProofLib rules and adequacy tests in Arm64/ import all Arm64. explicitly. Frame, consequence, and bare-machine adequacy properties are checked in Arm64/ and Arm64/.
All judgments assume prog. and quantify over an arbitrary frame R : SepProp. subroutine_ok states total correctness: from any 16-byte-aligned .Running entry state satisfying spec., execution terminates in a valid SubroutineOutcome. safe_subroutine_ok states safety-style partial correctness: execution either reaches a valid SubroutineOutcome or runs forever in .Running with a Step successor at every reachable state, so faulting (.Exception) and halting (.Halted) runs are excluded.
namespace Arm64@[expose] public section5 declarations not shown (lines 52–96): theorems, which Lean checks, or definitions that no headline statement uses
Arm64., Arm64., Arm64., Arm64., Arm64.
def Returned
def SubroutineStop
Terminal stopping condition for a subroutine entered at s0: normal return (Returned s0 s), panic (s.Panicked), process exit (s.Exited code), or out-of-memory in brk/mmap/mprotect/mremap (s.OutOfMemory).
10 declarations not shown (lines 111–199): theorems, which Lean checks, or definitions that no headline statement uses
Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64.
end -- @[expose] public section38 declarations not shown (lines 205–526): theorems, which Lean checks, or definitions that no headline statement uses
Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64., Arm64.
end Arm64