• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
          • Why-infinite-width
          • Svex-vars
          • Evaluation
          • Values
            • 4vec
              • 4vec-operations
              • 4vec-p
              • S4vecs
              • 4vec-examples
              • Maybe-4vec
              • 4vec-equiv
              • Make-4vec
              • 4vec->upper
                • 4vec->lower
                • 4veclist
                • 4vec-fix
                • Make-honsed-4vec
                • 4vec-index-p
              • 4vec-<<=
              • 3vec
              • 2vec
              • 2vecx
              • 2vecnatx
              • 4vec-x
              • 4vec-1x
              • 4vec-1z
              • 4vec-z
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • 4vec

    4vec->upper

    Raw accessor for the upper integer from a 4vec.

    Signature
    (4vec->upper x) → upper
    Arguments
    x — Guard (4vec-p x).
    Returns
    upper — Type (integerp upper).

    Definitions and Theorems

    Function: 4vec->upper$inline

    (defun 4vec->upper$inline (x)
      (declare (xargs :guard (4vec-p x)))
      (let ((__function__ '4vec->upper))
        (declare (ignorable __function__))
        (mbe :logic
             (if (consp x)
                 (ifix (car x))
               (if (integerp x) x -1))
             :exec (if (consp x) (car x) x))))

    Theorem: integerp-of-4vec->upper

    (defthm integerp-of-4vec->upper
      (b* ((upper (4vec->upper$inline x)))
        (integerp upper))
      :rule-classes (:rewrite :type-prescription))

    Theorem: 4vec->upper-of-4vec

    (defthm 4vec->upper-of-4vec
      (equal (4vec->upper (4vec upper lower))
             (ifix upper)))

    Theorem: 4vec->upper-of-4vec-fix

    (defthm 4vec->upper-of-4vec-fix
      (equal (4vec->upper (4vec-fix x))
             (4vec->upper x)))

    Theorem: 4vec-equiv-implies-equal-4vec->upper-1

    (defthm 4vec-equiv-implies-equal-4vec->upper-1
      (implies (4vec-equiv x x-equiv)
               (equal (4vec->upper x)
                      (4vec->upper x-equiv)))
      :rule-classes (:congruence))