• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • 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->r-w-x

    Update the |X86ISA|::|R-W-X| field of a tlb-key bit structure.

    Signature
    (!tlb-key->r-w-x r-w-x x) → new-x
    Arguments
    r-w-x — Guard (2bits-p r-w-x).
    x — Guard (tlb-key-p x).
    Returns
    new-x — Type (tlb-key-p new-x).

    Definitions and Theorems

    Function: !tlb-key->r-w-x$inline

    (defun !tlb-key->r-w-x$inline (r-w-x x)
      (declare (xargs :guard (and (2bits-p r-w-x) (tlb-key-p x))))
      (mbe :logic
           (b* ((r-w-x (mbe :logic (2bits-fix r-w-x)
                            :exec r-w-x))
                (x (tlb-key-fix x)))
             (part-install r-w-x x :width 2 :low 6))
           :exec (the (unsigned-byte 46)
                      (logior (the (unsigned-byte 46)
                                   (logand (the (unsigned-byte 46) x)
                                           (the (signed-byte 9) -193)))
                              (the (unsigned-byte 8)
                                   (ash (the (unsigned-byte 2) r-w-x)
                                        6))))))

    Theorem: tlb-key-p-of-!tlb-key->r-w-x

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

    Theorem: !tlb-key->r-w-x$inline-of-2bits-fix-r-w-x

    (defthm !tlb-key->r-w-x$inline-of-2bits-fix-r-w-x
      (equal (!tlb-key->r-w-x$inline (2bits-fix r-w-x)
                                     x)
             (!tlb-key->r-w-x$inline r-w-x x)))

    Theorem: !tlb-key->r-w-x$inline-2bits-equiv-congruence-on-r-w-x

    (defthm !tlb-key->r-w-x$inline-2bits-equiv-congruence-on-r-w-x
      (implies (2bits-equiv r-w-x r-w-x-equiv)
               (equal (!tlb-key->r-w-x$inline r-w-x x)
                      (!tlb-key->r-w-x$inline r-w-x-equiv x)))
      :rule-classes :congruence)

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

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

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

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

    Theorem: !tlb-key->r-w-x-is-tlb-key

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

    Theorem: tlb-key->r-w-x-of-!tlb-key->r-w-x

    (defthm tlb-key->r-w-x-of-!tlb-key->r-w-x
      (b* ((?new-x (!tlb-key->r-w-x$inline r-w-x x)))
        (equal (tlb-key->r-w-x new-x)
               (2bits-fix r-w-x))))

    Theorem: !tlb-key->r-w-x-equiv-under-mask

    (defthm !tlb-key->r-w-x-equiv-under-mask
      (b* ((?new-x (!tlb-key->r-w-x$inline r-w-x x)))
        (tlb-key-equiv-under-mask new-x x -193)))