• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • 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
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Bit/byte/integer-conversions

    I2lebsp

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

    Signature
    (i2lebsp 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: i2lebsp

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

    Theorem: bit-listp-of-i2lebsp

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

    Theorem: len-of-i2lebsp

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

    Theorem: i2lebsp-injectivity

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