• 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
      • Taspi
      • Riscv
      • 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

    Lebs2ip

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

    Signature
    (lebs2ip s) → x
    Arguments
    s — Guard (bit-listp s).
    Returns
    x — Type (natp x).

    The $\ell$ argument can be determined from the S argument: it is the length of S. Thus, in our formalization we just have one argument.

    Definitions and Theorems

    Function: lebs2ip

    (defun lebs2ip (s)
      (declare (xargs :guard (bit-listp s)))
      (let ((__function__ 'lebs2ip))
        (declare (ignorable __function__))
        (acl2::lebits=>nat s)))

    Theorem: natp-of-lebs2ip

    (defthm natp-of-lebs2ip
      (b* ((x (lebs2ip s))) (natp x))
      :rule-classes :type-prescription)

    Theorem: lebs2ip-upper-bound

    (defthm lebs2ip-upper-bound
      (b* ((?x (lebs2ip s)))
        (< x (expt 2 (len s))))
      :rule-classes :linear)

    Theorem: lebs2ip-injectivity

    (defthm lebs2ip-injectivity
      (implies (equal (len s1) (len s2))
               (equal (equal (lebs2ip s1) (lebs2ip s2))
                      (equal (bit-list-fix s1)
                             (bit-list-fix s2)))))