• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • 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
                • Mask-for-generic-signx
                • Mask-for-fixed-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
    • Svmask-for-signx

    Mask-for-fixed-signx

    Signature
    (mask-for-fixed-signx mask n) → mask
    Arguments
    mask — Guard (4vmask-p mask).
    n — Guard (natp n).
    Returns
    mask — Type (4vmask-p mask).

    Definitions and Theorems

    Function: mask-for-fixed-signx$inline

    (defun mask-for-fixed-signx$inline (mask n)
     (declare (xargs :guard (and (4vmask-p mask) (natp n))))
     (let ((__function__ 'mask-for-fixed-signx))
      (declare (ignorable __function__))
      (if (zp n)
          (if (sparseint-equal mask 0) 0 1)
       (sparseint-bitor
         (sparseint-concatenate n mask 0)
         (if (sparseint-test-bitand mask (sparseint-concatenate n 0 -1))
             (sparseint-concatenate (- n 1) 0 1)
           0)))))

    Theorem: 4vmask-p-of-mask-for-fixed-signx

    (defthm 4vmask-p-of-mask-for-fixed-signx
      (b* ((mask (mask-for-fixed-signx$inline mask n)))
        (4vmask-p mask))
      :rule-classes :rewrite)