Commit Graph

5956 Commits

Author SHA1 Message Date
Rafal Kolanski 1ab65b78ed refine+crefine: arch-split Machine_R
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-07-08 15:05:33 +10:00
Rafal Kolanski 9dabd695c2 refine: unify Invocations_R
This is a small file and the one arch-specific lemma has a proof
identical on all architectures. Therefore use only one version of this
file.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-07-08 15:05:33 +10:00
Rafal Kolanski eb42ce5b5d refine: arch-split EmptyFail
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-07-08 15:05:33 +10:00
Rafal Kolanski 028c191931 refine: EmptyFail given Arch prefix
In preparation for arch-split.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-07-08 15:05:33 +10:00
Rafal Kolanski d47ff4c5c5 refine: link to generic Corres in README
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-07-08 08:24:16 +10:00
Rafal Kolanski c2133b9b9a crefine: update for Bits_R arch-split
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-07-08 08:24:16 +10:00
Rafal Kolanski cf2f72984d refine: update for Bits_R arch-split
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-07-08 08:24:16 +10:00
Rafal Kolanski 4a39665a28 refine: arch-split Bits_R
Notable changes:
* isCap_simps is only available in Arch; generic gets gen_isCap_simps
* projectKOs is now [simp] on all architectures

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-07-08 08:24:16 +10:00
Rafal Kolanski 9abf77e353 refine: update import hierarchy for Bits_R arch-split
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-07-08 08:24:16 +10:00
Rafal Kolanski 617ea042e5 refine: Bits_R given Arch prefix
In preparation for arch-split.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-07-08 08:24:16 +10:00
Rafal Kolanski 893810aee7 refine: use ARM version of Corres.thy
Leave corresK as is, consolidate ex_abs as an abbreviation on
ex_abs_underlying, and provide convenience _def lemma instead of using a
definition. Clean up Refine.thy for affected architectures.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-07-08 08:24:16 +10:00
Gerwin Klein be238597cc arm+arm-hyp+aarch64 machine: fix GICv3 gicNumTargets_bits
The value of gicNumTargets_bits was wrong for GICv3 platforms, breaking
CRefine for those platforms.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 19:19:20 +10:00
Gerwin Klein b35045a477 x64+riscv refine: style
Bring safe_parent_for' in line with the other architectures.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein 31b8b5278e capDL-api: seplogic lemmas for ARMIssueSGISignal
Add separation logic specification lemmas for the new SGISignalCap API
for later use in sys-init.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein e23f8766ab capDL-api: restyle IRQ_DP
Fix + modernise style and proofs.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein 08c7d7da98 sys-init: exclude SGISignalCap
For now exclude SGISignalCap from wellformed specs. To be relaxed
later.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein a690fd7288 drefine+dpolicy: SGISignalCap proofs
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein d18507e7a1 capDL: add SGISignalCap API to capDL
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein bb87bdf8a4 riscv infoflowc: SGISignalCap update
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein d0f591f7ab arm access+infoflow: SGISignalCap security thms
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein c4368bf0b6 arm+arm-hyp+aarch64 crefine: SGISignalCap proofs
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein a4c5e63c77 riscv crefine: consolidate maxIRQ_ucast_toEnum_irq_t*
Bring the maxIRQ_ucast_toEnum_irq_t* names in line with the other
architectures.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein eb01dba78a x64+riscv crefine: CTD interface updates
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein 88f4ba7328 arm+arm-hyp+aarch64 refine: SGISignalCap proofs
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein 59b9cc1d17 x64+riscv refine: CDT interface update
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein 666ec75f6a refine: valid_badges + mdb_chunked arch interface
SGISignal caps require arch specific conditions in the valid_badges and
mdb_chunked predicates. Add an arch interface for these.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein de07915334 arm+arm-hyp+aarch64 ainvs: SGISignalCap proofs
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein 6124f6d907 x64+riscv ainvs: adjust for new CDT interface
This contains a slight tweak to generic CSpace_AI and proof adjustments
for the architectures that do not implement the SGISignalCap API.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein d4fafd2bdb aspec+machine: SGISignalCap API + cdt interfaces
- add SGISignalCap API for ARM, ARM_HYP, AARCH64
- add generic interface for should_be_arch_parent_of and
  is_irq_control_descendant in the cdt implementation
- add default interface implementations new interfaces for RISCV64, X64

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein dd4281c363 design+haskell-translator: SGI arch interfaces and caseconvs
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein 52da59e2b1 haskell: add SGISignalCap API
This affects all architectures, because generic interfaces are changing,
but the SGISignalCap API is only added to ARM, ARM_HYP, and AARCH64.
For X64 and RISCV64, we trivially implement the new interfaces, and in
generic code we call those interfaces.

These new interfaces are isArchMDBParentOf and
isIRQControlCapDescendant, for checking in generic code if there are
architecture specific cases in isMDBParentOf and isCapRevocable
respectively.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein c69aafdc4d arm+arm-hyp+aarch64 machine: SGI interface
Define the new constants numSGIs and gicNumTargets, plus a new
machine operation ipiSendTarget.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Gerwin Klein e8a219ffc9 word_lib: add toEnum_unat_le
Relates toEnum (unat x) with ucast.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:53:07 +10:00
Corey Lewis aebe8c6b20 tests: make haskell-translator depend on kernel-config
This protects against both tests being run simultaneously and trying to
write to the same file.

Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2025-06-24 15:27:31 +10:00
Rafal Kolanski c40784523e refine: link to generic StateRelation in README
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-06-18 14:46:12 +10:00
Rafal Kolanski de832184db arm+riscv infoflow refine: update for state relation arch-split
Newer arches and global interfaces favour left shifts over k*2^n, which
results in breakage in proofs of older arches.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-06-18 14:46:12 +10:00
Rafal Kolanski fb71de520b refine: update proofs for StateRelation arch-split
setObject_other_corres was temporarily patched to handle both arch and generic
objects, while setObject_other_arch_corres is a derived version for arch
objects only. This will be revised later as arch-split continues.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-06-18 14:46:12 +10:00
Rafal Kolanski d333943da6 refine: arch-split StateRelation
Similarly to invariants, the state relation contains a large number of
definitions. To reduce load on locales and number of theory files, the
architecture-specific definitions go first (ArchStateRelation), then the
generic definitions and lemmas (StateRelation), and finally the
arch-specific lemmas (ArchStateRelationLemmas).

Notable changes:
- due to ghost_relation being arch-specific on AARCH64, ghost_relation
  becomes arch-specific, with a generic `ghost_relation_wrapper`
  exported into generic context
- ghost_relation is required to not depend on machine state
- the [a]obj_relation_cuts infrastructure conflated arch and generic
  object cases in other_obj_relation and those had to be split up
- obj_relation_cutsE unfortunately still spills all the cases, but
  defining that properly can only happen when dealing with KHeap_R
- after discussion, we opted for introducing StateRelationPre to contain
  generic setup needed by ArchStateRelation
- it turned out APIType_map is not used anywhere (in lieu of APIType_map2
  introduced in Retype_R), so was removed

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-06-18 14:46:12 +10:00
Rafal Kolanski b65d99e7dd refine: StateRelation.thy given Arch prefix
In preparation for arch-split.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-06-18 14:46:12 +10:00
Rafal Kolanski 250cda25fa refine: arch-split InvariantUpdates_H
Currenly only one interface assumption: valid_arch_state'_interrupt

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-06-18 14:46:12 +10:00
Rafal Kolanski eae2e39b33 refine: InvariantUpdates_H given Arch prefix
In preparation for arch-split.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2025-06-18 14:46:12 +10:00
Gerwin Klein 3667ef81cd lib: remove last z3 smt call
The demo does not work with `smt (verit)` (diverges). Comment out the
Z3 call, since it is not essential for anything.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-06-13 13:20:24 +10:00
Gerwin Klein cce45708fb lib: reduce warnings
- pos_mod_sign is now in the default simp set
- pred_*_def lemmas have become lemma sets -- use only the
  parts that are needed in metis to avoid warnings.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-06-13 13:20:24 +10:00
Gerwin Klein 4ac805fedc lib: avoid default z3 smt
Use `smt (verity)` instead of just `smt` to avoid the Z3 default. There
is no soundness problem with Z3, but various versions of Z3 do not work
on Linux/AArch64 which means that proof reconstruction fails.

To make sure these proofs work with vanilla Isabelle distributions, we
fix the invocations instead of providing specific Z3 versions.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-06-13 13:20:24 +10:00
Gerwin Klein 42e2b326d3 word_lib: sync with afp-2025
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-06-13 13:20:24 +10:00
Gerwin Klein c1ff5273bb misc/jedit: update goto-error macro
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-06-13 13:20:24 +10:00
Gerwin Klein 82127dedd6 drefine: update to Isabelle 2025
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-06-13 13:20:24 +10:00
Gerwin Klein 7ebc458bc1 infoflow: update to Isabelle2025
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-06-13 13:20:24 +10:00
Gerwin Klein ef609d225f access: update to Isabelle2025
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-06-13 13:20:24 +10:00
Gerwin Klein c78fd386d3 refine+crefine: update to Isabelle2025
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-06-13 13:20:24 +10:00