• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
        • Lint
        • Mlib
          • Scopestack
          • Filtering-by-name
          • Vl-namefactory
          • Substitution
          • Allexprs
          • Hid-tools
          • Vl-consteval
          • Range-tools
          • Lvalexprs
          • Hierarchy
          • Finding-by-name
          • Expr-tools
          • Expr-slicing
          • Stripping-functions
          • Stmt-tools
          • Modnamespace
          • Vl-parse-expr-from-str
          • Welltyped
          • Reordering-by-name
          • Flat-warnings
          • Genblob
          • Expr-building
          • Datatype-tools
            • Vl-usertype-resolve
            • Vl-datatype-range
            • Vl-datatype-exprtype
            • Vl-datatype-range-conservative
            • Vl-find-structmember
            • Vl-datatype-usertype-elim
            • Vl-packeddimensionlist-total-size
            • Vl-datatype-bitselect-ok
              • Vl-datatype->structmembers
              • Vl-datatype-set-unsigned
              • Vl-packed-datatype-size
              • Vl-datatype-size
            • Syscalls
            • Relocate
            • Expr-cleaning
            • Namemangle
            • Caremask
            • Port-tools
            • Lvalues
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Datatype-tools

    Vl-datatype-bitselect-ok

    Determines whether this datatype can be bitselected.

    Signature
    (vl-datatype-bitselect-ok x) → okp
    Arguments
    x — Guard (vl-datatype-p x).

    The input datatype should not have packed or unpacked dimensions; if it does, then it's definitely OK to index into it (though it's only a bitselect if it's the last packed dimension). The input datatype should have usertypes resolved.

    Definitions and Theorems

    Function: vl-datatype-bitselect-ok

    (defun vl-datatype-bitselect-ok (x)
     (declare (xargs :guard (vl-datatype-p x)))
     (declare (xargs :guard (and (not (consp (vl-datatype->pdims x)))
                                 (not (consp (vl-datatype->udims x))))))
     (let ((__function__ 'vl-datatype-bitselect-ok))
       (declare (ignorable __function__))
       (vl-datatype-case
            x
            (:vl-coretype (b* (((vl-coredatatype-info xinfo)
                                (vl-coretypename->info x.name)))
                            (and xinfo.size (not (eql xinfo.size 1)))))
            (:vl-struct x.packedp)
            (:vl-union x.packedp)
            (:vl-enum nil)
            (:vl-usertype nil))))

    Theorem: vl-datatype-bitselect-ok-of-vl-datatype-fix-x

    (defthm vl-datatype-bitselect-ok-of-vl-datatype-fix-x
      (equal (vl-datatype-bitselect-ok (vl-datatype-fix x))
             (vl-datatype-bitselect-ok x)))

    Theorem: vl-datatype-bitselect-ok-vl-datatype-equiv-congruence-on-x

    (defthm vl-datatype-bitselect-ok-vl-datatype-equiv-congruence-on-x
      (implies (vl-datatype-equiv x x-equiv)
               (equal (vl-datatype-bitselect-ok x)
                      (vl-datatype-bitselect-ok x-equiv)))
      :rule-classes :congruence)