is_ASMcore predicate
is_ASMcore is a well-formedness predicate for assembler configurations represented by the ASMcoret record. In the referenced Isabelle model, register contents are integers and a register file is modeled as a list of such integers. The ASMcoret record contains delayed and current program-counter fields (dpc, pcp), general-purpose registers (gprs), special-purpose registers (sprs), and memory (mm). [C1]
The predicate exists because the assembler-level representation of addresses and values is less restrictive than the bit-vector representation, and because the registers type itself does not encode the required number of registers. is_ASMcore therefore restricts configurations to meaningful assembler states. [C2]
Definition
definition is_ASMcore :: ASMcoret ⇒ bool where
is_ASMcore st ≡ asmnat (dpc st) ∧
asmnat (pcp st) ∧
length (gprs st) = 32 ∧
length (sprs st) = 32 ∧
(∀ ind < 32. asm_int (reg (gprs st) ind)) ∧
(∀ ind < 32. asm_int (sreg (sprs st) ind)) ∧
(∀ ad. asm_int (data_mem_read (mm st) ad))
Validation conditions
For a state st : ASMcoret, is_ASMcore st requires: [C3]
dpc stis accepted byasmnat.pcp stis accepted byasmnat.gprs sthas length32.sprs sthas length32.- Every general-purpose register index below
32contains a value accepted byasm_int. - Every special-purpose register index below
32contains a value accepted byasm_int. - Every data-memory read value is accepted by
asm_int.
Role in the assembler model
The predicate validates ASMcoret configurations at the assembler level. The same model defines assembler instructions as an Isabelle datatype and defines execution over ASMcoret configurations with exec_instr; the Step transition function maps a configuration to its successor by executing the current instruction. [C4]