• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
        • Riscv
        • Bitcoin
        • Zcash
          • Jubjub
          • Verify-zcash-r1cs
          • Lift-zcash-r1cs
          • Pedersen-hash
          • Zcash-gadgets
          • Bit/byte/integer-conversions
            • Leos2ip
            • Lebs2osp
            • Lebs2ip
            • Leos2bsp
            • I2lebsp
            • I2bebsp
            • Constants
            • Blake2-hash
            • Randomness-beacon
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Bit/byte/integer-conversions

    I2bebsp

    The function \mathsf{I2BEBSP} in [ZPS:5.1].

    Signature
    (i2bebsp l x) → bits
    Arguments
    l — Guard (natp l).
    x — Guard (integer-range-p 0 (expt 2 l) x).
    Returns
    bits — Type (bit-listp bits).

    Definitions and Theorems

    Function: i2bebsp

    (defun i2bebsp (l x)
      (declare (xargs :guard (and (natp l)
                                  (integer-range-p 0 (expt 2 l) x))))
      (let ((__function__ 'i2bebsp))
        (declare (ignorable __function__))
        (acl2::nat=>bebits l x)))

    Theorem: bit-listp-of-i2bebsp

    (defthm bit-listp-of-i2bebsp
      (b* ((bits (i2bebsp l x)))
        (bit-listp bits))
      :rule-classes :rewrite)

    Theorem: len-of-i2bebsp

    (defthm len-of-i2bebsp
      (b* ((?bits (i2bebsp l x)))
        (equal (len bits) (nfix l))))

    Theorem: i2bebsp-injectivity

    (defthm i2bebsp-injectivity
      (implies (and (< (nfix x1) (expt 2 (nfix l)))
                    (< (nfix x2) (expt 2 (nfix l))))
               (equal (equal (i2bebsp l x1) (i2bebsp l x2))
                      (equal (nfix x1) (nfix x2)))))