• 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

    N2v

    Convert a natural into a corresponding unsigned bvec (with constant bits).

    Signature
    (n2v n) → *

    Definitions and Theorems

    Function: n2v

    (defun n2v (n)
      (declare (xargs :guard t))
      (let ((__function__ 'n2v))
        (declare (ignorable __function__))
        (if (eql (nfix n) 0)
            nil
          (bfr-ucons (equal 1 (logcar n))
                     (n2v (logcdr n))))))

    Theorem: true-listp-of-n2v

    (defthm true-listp-of-n2v
      (true-listp (n2v n))
      :rule-classes :type-prescription)

    Theorem: bfr-list->u-of-n2v

    (defthm bfr-list->u-of-n2v
      (equal (bfr-list->u (n2v n) env)
             (nfix n)))

    Theorem: pbfr-list-depends-on-of-n2v

    (defthm pbfr-list-depends-on-of-n2v
      (not (pbfr-list-depends-on k p (n2v n))))