• 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

    Leos2ip

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

    Signature
    (leos2ip s) → x
    Arguments
    s — Guard (byte-listp s).
    Returns
    x — Type (natp x).

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

    Definitions and Theorems

    Function: leos2ip

    (defun leos2ip (s)
      (declare (xargs :guard (byte-listp s)))
      (let ((__function__ 'leos2ip))
        (declare (ignorable __function__))
        (acl2::lebytes=>nat s)))

    Theorem: natp-of-leos2ip

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

    Theorem: leos2ip-upper-bound

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

    Theorem: leos2ip-injectivity

    (defthm leos2ip-injectivity
      (implies (equal (len s1) (len s2))
               (equal (equal (leos2ip s1) (leos2ip s2))
                      (equal (acl2::byte-list-fix s1)
                             (acl2::byte-list-fix s2)))))