• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Svex-compilation
        • Moddb
        • Svmods
        • Svstmt
        • Sv-tutorial
        • Expressions
          • Rewriting
          • Svex
          • Bit-blasting
          • Functions
          • 4vmask
            • Svex-argmasks
              • Svmask-for-bitand
              • Svmask-for-signx
              • Svmask-for-bitxor
              • Svmask-for-concat
              • Svmask-for-bit?!
              • Svmask-for-bit?
              • Svmask-for-?!
              • Svmask-for-?
              • Svmask-for-?*
              • Svmask-for-==??
              • Svmask-for-rsh
              • Svmask-for-bitsel
              • Svmask-for-+
              • Svmask-for-override
              • Svmask-for-uand
              • Svmask-for-zerox
              • Svmask-for-safer-==?
              • Svmask-for-bitor
              • Svmask-for-partinst
              • 4vmasklist-len-fix
              • Svmask-for-==?
              • Svmask-for-xdet
              • Svmask-for-unfloat
              • 4vmask-all-or-none
                • Svmask-for-partsel
                • Svmask-for-offp
                • Svmask-for-bitnot
                • Svmask-for-===*
                • Svmask-for-===
                • Svmask-for-res
                • Svmask-for-onp
                • Svmask-for-blkrev
                • Svmask-for-resor
                • Svmask-for-resand
                • Svmask-for-pow
                • Svmask-for-onehot0
                • Svmask-for-onehot
                • Svmask-for-lsh
                • Svmask-for-id
                • Svmask-for-countones
                • Svmask-for-clog2
                • Svmask-for-/
                • Svmask-for-==
                • Svmask-for-<
                • Svmask-for-*
                • Svmask-for-%
                • Svmask-for-uxor
                • Svmask-for-uor
                • Svmask-for-u-
                • Svmask-for-b-
                • Unrev-block-index
                • Svmask-for-unknown-function
                • Sparseint-unrev-blocks
              • 4vmask-p
              • 4vmask-subsumes
              • 4veclist-mask
              • 4vec-mask-to-zero
              • 4vec-mask
              • 4vmasklist-subsumes
              • 4vmask-union
              • 4vec-mask?
              • 4vmask-equiv
              • 4vmask-fix
              • 4vmask-alist
              • 4veclist-mask?
              • 4vmasklist
              • 4vmask-empty
            • Why-infinite-width
            • Svex-vars
            • Evaluation
            • Values
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Svex-argmasks

    4vmask-all-or-none

    Care mask for an argument that matters fully, unless we don't care about any bits at all.

    Signature
    (4vmask-all-or-none outer-mask) → arg-mask
    Arguments
    outer-mask — Care mask from the outer expression.
        Guard (4vmask-p outer-mask).
    Returns
    arg-mask — Care mask for the argument.
        Type (4vmask-p arg-mask).

    In various SVEX functions, such as (bitsel index expr), the index expressions have a simple care-mask behavior:

    • If we care about any bit of the bitsel expression, then we care about all of the bits of index.
    • Otherwise, we don't care about this expression at all, so all of its arguments are completely irrelevant and there is no reason to care about the index at all.

    Similar things happen in, e.g., reduction operators, arithmetic operators (due to globally caring about whether there are any X/Z bits), etc., so this function ends up being widely used in the the functions that implement svex-argmasks.

    Definitions and Theorems

    Function: 4vmask-all-or-none$inline

    (defun 4vmask-all-or-none$inline (outer-mask)
      (declare (xargs :guard (4vmask-p outer-mask)))
      (let ((__function__ '4vmask-all-or-none))
        (declare (ignorable __function__))
        (if (4vmask-empty outer-mask) 0 -1)))

    Theorem: 4vmask-p-of-4vmask-all-or-none

    (defthm 4vmask-p-of-4vmask-all-or-none
      (b* ((arg-mask (4vmask-all-or-none$inline outer-mask)))
        (4vmask-p arg-mask))
      :rule-classes :rewrite)

    Theorem: 4vmask-all-or-none$inline-of-4vmask-fix-outer-mask

    (defthm 4vmask-all-or-none$inline-of-4vmask-fix-outer-mask
      (equal (4vmask-all-or-none$inline (4vmask-fix outer-mask))
             (4vmask-all-or-none$inline outer-mask)))

    Theorem: 4vmask-all-or-none$inline-4vmask-equiv-congruence-on-outer-mask

    (defthm
        4vmask-all-or-none$inline-4vmask-equiv-congruence-on-outer-mask
      (implies (4vmask-equiv outer-mask outer-mask-equiv)
               (equal (4vmask-all-or-none$inline outer-mask)
                      (4vmask-all-or-none$inline outer-mask-equiv)))
      :rule-classes :congruence)