• 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
          • Syntax-for-tools
            • Formalized-subset
            • Mapping-to-language-definition
              • Ldm-stmts
              • Ldm-type-spec-list
              • Ldm-exprs
              • Ldm-absdeclor-obj
              • Ldm-declor-fun
              • Ldm-declors/dirdeclors-obj
              • Ldm-dirdeclor-fun
              • Ldm-decl-tag
              • Ldm-struct-declon
              • Ldm-decl-obj
              • Ldm-transunit-ensemble
              • Ldm-dirabsdeclor-obj
              • Ldm-decl-fun
              • Ldm-extdecl
              • Ldm-param-declon
              • Ldm-fundef
              • Ldm-param-declor
              • Ldm-dirdeclor-obj
              • Ldm-struct-declon-list
              • Ldm-stor-spec-list
              • Ldm-param-declon-list
              • Ldm-transunit
              • Ldm-desiniter
              • Ldm-tyname
              • Ldm-isuffix-option
              • Ldm-expr-option
              • Ldm-desiniter-list
              • Ldm-dec/oct/hex-const
                • Ldm-isuffix
                • Ldm-ident
                • Ldm-extdecl-list
                • Ldm-binop
                • Ldm-initer
                • Ldm-const
                • Ldm-enumer-list
                • Ldm-enumer
                • Ldm-label
                • Ldm-lsuffix
                • Ldm-iconst
                • Ldm-declor-obj
                • Ldm-comp-stmt
                • Ldm-expr
                • Ldm-expr-list
                • Ldm-block-item-list
                • Ldm-stmt
                • Ldm-block-item
              • Input-files
              • Compilation-database
              • Printer
              • Output-files
              • Abstract-syntax-operations
              • Implementation-environments
              • Abstract-syntax
              • Concrete-syntax
              • Disambiguation
              • Validation
              • Gcc-builtins
              • Preprocessing
              • Parsing
            • Atc
            • Transformation-tools
            • Language
            • Representation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • 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
    • Mapping-to-language-definition

    Ldm-dec/oct/hex-const

    Map a decimal, octal, or hexadecimal constant to a value and to an integer constant base in the language definition.

    Signature
    (ldm-dec/oct/hex-const const) → (mv value base)
    Arguments
    const — Guard (dec/oct/hex-constp const).
    Returns
    value — Type (natp value).
    base — Type (c::iconst-basep base).

    Definitions and Theorems

    Function: ldm-dec/oct/hex-const

    (defun ldm-dec/oct/hex-const (const)
      (declare (xargs :guard (dec/oct/hex-constp const)))
      (let ((__function__ 'ldm-dec/oct/hex-const))
        (declare (ignorable __function__))
        (dec/oct/hex-const-case
             const
             :dec (mv const.value (c::iconst-base-dec))
             :oct (mv const.value (c::iconst-base-oct))
             :hex (mv (str::hex-digit-chars-value const.digits)
                      (c::iconst-base-hex)))))

    Theorem: natp-of-ldm-dec/oct/hex-const.value

    (defthm natp-of-ldm-dec/oct/hex-const.value
      (b* (((mv acl2::?value ?base)
            (ldm-dec/oct/hex-const const)))
        (natp value))
      :rule-classes :rewrite)

    Theorem: iconst-basep-of-ldm-dec/oct/hex-const.base

    (defthm iconst-basep-of-ldm-dec/oct/hex-const.base
      (b* (((mv acl2::?value ?base)
            (ldm-dec/oct/hex-const const)))
        (c::iconst-basep base))
      :rule-classes :rewrite)

    Theorem: ldm-dec/oct/hex-const-of-dec/oct/hex-const-fix-const

    (defthm ldm-dec/oct/hex-const-of-dec/oct/hex-const-fix-const
      (equal (ldm-dec/oct/hex-const (dec/oct/hex-const-fix const))
             (ldm-dec/oct/hex-const const)))

    Theorem: ldm-dec/oct/hex-const-dec/oct/hex-const-equiv-congruence-on-const

    (defthm
      ldm-dec/oct/hex-const-dec/oct/hex-const-equiv-congruence-on-const
      (implies (dec/oct/hex-const-equiv const const-equiv)
               (equal (ldm-dec/oct/hex-const const)
                      (ldm-dec/oct/hex-const const-equiv)))
      :rule-classes :congruence)