• 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
        • Running-linux
        • Introduction
        • Asmtest
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • X86isa-state
          • Syscalls
          • Cpuid
          • Linear-memory
          • Rflag-specifications
          • Characterizing-undefined-behavior
          • App-view
          • Top-level-memory
          • X86-decoder
          • Physical-memory
          • Decoding-and-spec-utils
          • Instructions
            • Two-byte-opcodes
            • One-byte-opcodes
            • Fp-opcodes
            • Instruction-semantic-functions
            • X86-illegal-instruction
            • Implemented-opcodes
            • Opcode-maps
              • Cpuid
              • Opcode-maps-structures
              • Implemented-opcodes
              • Chk-exc-fn
              • Filtering-instructions
                • Select-insts
                • Remove-insts-with-feat
                • Keep-insts-with-feat
                  • Select-opcode-map
                • Addressing-method-code-p
                • Operand-type-code-p
                • Eval-pre-map
              • X86-general-protection
              • X86-device-not-available
              • X86-step-unimplemented
              • Privileged-opcodes
              • Three-byte-opcodes
            • Register-readers-and-writers
            • 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
    • Quote
    • Filtering-instructions

    Keep-insts-with-feat

    Keep all instructions from inst-lst that have ANY feature present in feat

    Signature
    (keep-insts-with-feat inst-lst feat) → new-inst-lst
    Arguments
    inst-lst — Guard (inst-list-p inst-lst).
    feat — Guard (acl2::keyword-listp feat).
    Returns
    new-inst-lst — Type (inst-list-p new-inst-lst), given (inst-list-p inst-lst).

    Definitions and Theorems

    Function: keep-insts-with-feat

    (defun keep-insts-with-feat (inst-lst feat)
      (declare (xargs :guard (and (inst-list-p inst-lst)
                                  (acl2::keyword-listp feat))))
      (let ((__function__ 'keep-insts-with-feat))
        (declare (ignorable __function__))
        (if (endp inst-lst)
            nil
          (b* ((inst (car inst-lst))
               (rest (keep-insts-with-feat (cdr inst-lst)
                                           feat))
               ((inst inst))
               (opcode inst.opcode)
               ((opcode opcode))
               ((when (any-present-in feat opcode.feat))
                (cons inst rest)))
            rest))))

    Theorem: inst-list-p-of-keep-insts-with-feat

    (defthm inst-list-p-of-keep-insts-with-feat
      (implies (inst-list-p inst-lst)
               (b* ((new-inst-lst (keep-insts-with-feat inst-lst feat)))
                 (inst-list-p new-inst-lst)))
      :rule-classes :rewrite)