• 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->cpl

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

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

    Definitions and Theorems

    Function: !tlb-key->cpl$inline

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

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

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

    Theorem: !tlb-key->cpl$inline-of-2bits-fix-cpl

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

    Theorem: !tlb-key->cpl$inline-2bits-equiv-congruence-on-cpl

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

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

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

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

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

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

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

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

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

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

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