• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
        • Term-level-reasoning
        • Glmc
        • Other-resources
        • Optimization
        • Reference
          • Def-gl-thm
          • Shape-specs
          • Symbolic-objects
          • Gl-aside
          • Def-gl-param-thm
          • Symbolic-arithmetic
          • Bfr
          • Def-gl-boolean-constraint
          • Gl-mbe
          • Bvec
            • Scdr
            • Bfr-list->s
            • Bfr-eval-list
            • Bfr-scons
            • Bfr-ucons
            • Bfr-list->u
            • Bfr-sterm
            • Bfr-snorm
            • Pbfr-list-depends-on
            • V2i
              • N2v
              • V2n
              • S-endp
              • I2v
              • First/rest/end
              • Bool->sign
            • Flex-bindings
            • Auto-bindings
            • Gl-interp
            • Gl-set-uninterpreted
            • Def-gl-clause-processor
            • Def-glcp-ctrex-rewrite
            • ACL2::always-equal
            • Gl-hint
            • Def-gl-rewrite
            • Def-gl-branch-merge
            • Gl-force-check
            • Gl-concretize
            • Gl-assert
            • Gl-param-thm
            • Gl-simplify-satlink-mode
            • Gl-satlink-mode
            • Gl-bdd-mode
            • Gl-aig-bddify-mode
            • Gl-fraig-satlink-mode
          • Debugging
          • Basic-tutorial
        • Esim
        • Vl2014
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Bvec

    V2i

    Convert a (pure constant) signed bvec into an integer.

    Signature
    (v2i v) → *
    Arguments
    v — Guard (true-listp v).

    Definitions and Theorems

    Function: v2i

    (defun v2i (v)
      (declare (xargs :guard (true-listp v)))
      (let ((__function__ 'v2i))
        (declare (ignorable __function__))
        (mbe :logic
             (if (s-endp v)
                 (bool->sign (car v))
               (logcons (bool->bit (car v))
                        (v2i (scdr v))))
             :exec
             (if (atom v)
                 0
               (if (atom (cdr v))
                   (if (car v) -1 0)
                 (logcons (bool->bit (car v))
                          (v2i (cdr v))))))))

    Theorem: v2i-of-bfr-eval-list

    (defthm v2i-of-bfr-eval-list
      (equal (v2i (bfr-eval-list x env))
             (bfr-list->s x env)))

    Theorem: v2i-of-i2v

    (defthm v2i-of-i2v
      (equal (v2i (i2v x)) (ifix x)))