• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
        • Soft
        • C
          • Syntax-for-tools
            • Disambiguator
            • Abstract-syntax
            • Parser
            • Validator
            • Printer
            • Formalized-subset
            • Mapping-to-language-definition
              • Ldm-type-spec-list
              • Ldm-stmts/blocks
              • Ldm-exprs
              • Ldm-declor-obj
              • Ldm-absdeclor-obj
              • Ldm-dirdeclor-obj
              • Ldm-declor-fun
              • Ldm-dirdeclor-fun
              • Ldm-decl-tag
              • Ldm-decl-obj
              • Ldm-transunit-ensemble
              • Ldm-structdecl
              • Ldm-dirabsdeclor-obj
              • Ldm-decl-fun
              • Ldm-extdecl
              • Ldm-fundef
              • Ldm-param-declor
              • Ldm-param-declon
              • Ldm-structdecl-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-expr
                • Ldm-expr-list
                • Ldm-block-item-list
                • Ldm-stmt
                • Ldm-block-item
              • Input-files
              • Defpred
              • Output-files
              • Abstract-syntax-operations
              • Validation-information
              • Implementation-environments
              • Concrete-syntax
              • Unambiguity
              • Ascii-identifiers
              • Preprocessing
              • Abstraction-mapping
            • Atc
            • Language
            • Representation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Mapping-to-language-definition

    Ldm-ident

    Map an identiifer to an identifier in the language definition.

    Signature
    (ldm-ident ident) → (mv erp ident1)
    Arguments
    ident — Guard (identp ident).
    Returns
    ident1 — Type (c::identp ident1).

    Since the language definition requires ACL2 strings, we throw an error if the identifier is not an ACL2 string.

    Definitions and Theorems

    Function: ldm-ident

    (defun ldm-ident (ident)
      (declare (xargs :guard (identp ident)))
      (let ((__function__ 'ldm-ident))
        (declare (ignorable __function__))
        (b* (((reterr) (c::ident "irrelevant"))
             (string (ident->unwrap ident))
             ((unless (stringp string))
              (reterr (msg "Unsupported identifier with non-string ~x0."
                           string))))
          (retok (c::ident string)))))

    Theorem: identp-of-ldm-ident.ident1

    (defthm identp-of-ldm-ident.ident1
      (b* (((mv acl2::?erp ?ident1)
            (ldm-ident ident)))
        (c::identp ident1))
      :rule-classes :rewrite)

    Theorem: ldm-ident-ok-when-ident-formalp

    (defthm ldm-ident-ok-when-ident-formalp
      (implies (ident-formalp ident)
               (b* (((mv acl2::?erp ?ident1)
                     (ldm-ident ident)))
                 (not erp))))

    Theorem: ldm-ident-of-ident-fix-ident

    (defthm ldm-ident-of-ident-fix-ident
      (equal (ldm-ident (ident-fix ident))
             (ldm-ident ident)))

    Theorem: ldm-ident-ident-equiv-congruence-on-ident

    (defthm ldm-ident-ident-equiv-congruence-on-ident
      (implies (ident-equiv ident ident-equiv)
               (equal (ldm-ident ident)
                      (ldm-ident ident-equiv)))
      :rule-classes :congruence)