• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
        • Sdm-instruction-set-summary
        • Tlb
        • Running-linux
        • Introduction
        • Asmtest
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • X86isa-state
          • Syscalls
          • Cpuid
          • Linear-memory
          • Rflag-specifications
          • Characterizing-undefined-behavior
          • Top-level-memory
          • App-view
          • X86-decoder
          • Physical-memory
          • Decoding-and-spec-utils
          • Instructions
          • Register-readers-and-writers
            • Zmms-reads-and-writes
            • Gprs-reads-and-writes
            • Mmx-registers-reads-and-writes
            • Xmms-reads-and-writes
            • Rflags-reads-and-writes
            • Gpr-indices
            • Vex-vvvv-reg-index
            • Msr-reads-and-writes
            • Ctr-reads-and-writes
              • !ctri-write
                • !msra
                • Msra
            • X86-modes
            • Segmentation
            • Other-non-deterministic-computations
            • Environment
            • Paging
          • Implemented-opcodes
          • To-do
          • Proof-utilities
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
          • Utils
          • Debugging-code-proofs
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Ctr-reads-and-writes

    !ctri-write

    Signature
    (!ctri-write ctr-index val x86) → x86
    Arguments
    ctr-index — Guard (natp ctr-index).
    val — Guard (n64p val).
    Returns
    x86 — Type (x86p x86), given (x86p x86).

    Definitions and Theorems

    Function: !ctri-write

    (defun !ctri-write (ctr-index val x86)
      (declare (xargs :stobjs (x86)))
      (declare (xargs :guard (and (natp ctr-index) (n64p val))))
      (declare (xargs :guard (< ctr-index 17)))
      (let ((__function__ '!ctri-write))
        (declare (ignorable __function__))
        (b* ((val-write (case ctr-index
                          (*cr0* (loghead 32 val))
                          (*cr4* (logapp 21 val (ctri *cr4* x86)))
                          (otherwise val)))
             (x86 (!ctri ctr-index val-write x86)))
          x86)))

    Theorem: x86p-of-!ctri-write

    (defthm x86p-of-!ctri-write
      (implies (x86p x86)
               (b* ((x86 (!ctri-write ctr-index val x86)))
                 (x86p x86)))
      :rule-classes :rewrite)