• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
        • Sdm-instruction-set-summary
        • Tlb
          • Tlb-key
            • !tlb-key->implicit-supervisor-access
            • Tlb-key-fast
            • Tlb-key-p
            • !tlb-key->r-w-x
            • !tlb-key->vpn
            • !tlb-key->smep
            • !tlb-key->smap
            • !tlb-key->cpl
            • !tlb-key->nxe
            • Tlb-key->implicit-supervisor-access
            • !tlb-key->wp
              • !tlb-key->ac
              • Tlb-key->vpn
              • Tlb-key->smep
              • Tlb-key->smap
              • Tlb-key->r-w-x
              • Tlb-key->cpl
              • Tlb-key-fix
              • Tlb-key->wp
              • Tlb-key->nxe
              • Tlb-key->ac
              • Good-tlb-key-p
            • Tlbp
            • Tlb-entryp
          • Running-linux
          • Introduction
          • Asmtest
          • X86isa-build-instructions
          • Publications
          • Contributors
          • Machine
          • Implemented-opcodes
          • To-do
          • Proof-utilities
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
          • Utils
          • Debugging-code-proofs
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Tlb-key

    !tlb-key->wp

    Update the |X86ISA|::|WP| field of a tlb-key bit structure.

    Signature
    (!tlb-key->wp wp x) → new-x
    Arguments
    wp — Guard (bitp wp).
    x — Guard (tlb-key-p x).
    Returns
    new-x — Type (tlb-key-p new-x).

    Definitions and Theorems

    Function: !tlb-key->wp$inline

    (defun !tlb-key->wp$inline (wp x)
      (declare (xargs :guard (and (bitp wp) (tlb-key-p x))))
      (mbe :logic
           (b* ((wp (mbe :logic (bfix wp) :exec wp))
                (x (tlb-key-fix x)))
             (part-install wp x :width 1 :low 0))
           :exec (the (unsigned-byte 46)
                      (logior (the (unsigned-byte 46)
                                   (logand (the (unsigned-byte 46) x)
                                           (the (signed-byte 2) -2)))
                              (the (unsigned-byte 1) wp)))))

    Theorem: tlb-key-p-of-!tlb-key->wp

    (defthm tlb-key-p-of-!tlb-key->wp
      (b* ((new-x (!tlb-key->wp$inline wp x)))
        (tlb-key-p new-x))
      :rule-classes :rewrite)

    Theorem: !tlb-key->wp$inline-of-bfix-wp

    (defthm !tlb-key->wp$inline-of-bfix-wp
      (equal (!tlb-key->wp$inline (bfix wp) x)
             (!tlb-key->wp$inline wp x)))

    Theorem: !tlb-key->wp$inline-bit-equiv-congruence-on-wp

    (defthm !tlb-key->wp$inline-bit-equiv-congruence-on-wp
      (implies (bit-equiv wp wp-equiv)
               (equal (!tlb-key->wp$inline wp x)
                      (!tlb-key->wp$inline wp-equiv x)))
      :rule-classes :congruence)

    Theorem: !tlb-key->wp$inline-of-tlb-key-fix-x

    (defthm !tlb-key->wp$inline-of-tlb-key-fix-x
      (equal (!tlb-key->wp$inline wp (tlb-key-fix x))
             (!tlb-key->wp$inline wp x)))

    Theorem: !tlb-key->wp$inline-tlb-key-equiv-congruence-on-x

    (defthm !tlb-key->wp$inline-tlb-key-equiv-congruence-on-x
      (implies (tlb-key-equiv x x-equiv)
               (equal (!tlb-key->wp$inline wp x)
                      (!tlb-key->wp$inline wp x-equiv)))
      :rule-classes :congruence)

    Theorem: !tlb-key->wp-is-tlb-key

    (defthm !tlb-key->wp-is-tlb-key
      (equal (!tlb-key->wp wp x)
             (change-tlb-key x :wp wp)))

    Theorem: tlb-key->wp-of-!tlb-key->wp

    (defthm tlb-key->wp-of-!tlb-key->wp
      (b* ((?new-x (!tlb-key->wp$inline wp x)))
        (equal (tlb-key->wp new-x) (bfix wp))))

    Theorem: !tlb-key->wp-equiv-under-mask

    (defthm !tlb-key->wp-equiv-under-mask
      (b* ((?new-x (!tlb-key->wp$inline wp x)))
        (tlb-key-equiv-under-mask new-x x -2)))