• 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
              • Expr-pure-formalp
              • Type-spec-list-integer-formalp
              • Stmts/blocks-formalp
              • Extdecl-formalp
              • Ident-formalp
                • Type-spec-list-formalp
                • Tyname-formalp
                • Pointers-formalp
                • Dirdeclor-obj-formalp
                • Desiniter-formalp
                • Fundef-formalp
                • Decl-obj-formalp
                • Decl-block-formalp
                • Initdeclor-obj-formalp
                • Expr-asg-formalp
                • Structdecl-formalp
                • Initdeclor-block-formalp
                • Decl-struct-formalp
                • Dirdeclor-fun-formalp
                • Dirdeclor-block-formalp
                • Initdeclor-fun-formalp
                • Transunit-ensemble-formalp
                • Param-declor-formalp
                • Initer-formalp
                • Expr-call-formalp
                • Declor-obj-formalp
                • Decl-fun-formalp
                • Param-declon-formalp
                • Structdeclor-formalp
                • Stor-spec-list-formalp
                • Declor-fun-formalp
                • Declor-block-formalp
                • Strunispec-formalp
                • Structdecl-list-formalp
                • Param-declon-list-formalp
                • Desiniter-list-formalp
                • Extdecl-list-formalp
                • Expr-list-pure-formalp
                • Transunit-formalp
                • Const-formalp
                • Stmt-formalp
                • Block-item-list-formalp
                • Block-item-formalp
              • Mapping-to-language-definition
              • 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
    • Formalized-subset

    Ident-formalp

    Check if an identifier has formal dynamic semantics.

    Signature
    (ident-formalp ident) → yes/no
    Arguments
    ident — Guard (identp ident).
    Returns
    yes/no — Type (booleanp yes/no).

    Identifiers are supported, via c::exec-ident, when they denote variables. Based on the identifier alone, we cannot determine whether it denotes a variable, so we must accept it here, delegating the test to whether it denotes a variable elsewhere.

    However, we impose a restriction here, to ensure that the C subset defined by these predicates is a subset of the one defined by the syntactic language mapping, whose ldm-ident function requires the identifier to be an ACL2 string. So here we require the identifier to be an ACL2 string as well.

    This may turn out to be too restrictive, e.g. if we want to support the verification of transformations that take advantage of the flexibility mentioned in ident. So we may revisit this in the future.

    Definitions and Theorems

    Function: ident-formalp

    (defun ident-formalp (ident)
      (declare (xargs :guard (identp ident)))
      (let ((__function__ 'ident-formalp))
        (declare (ignorable __function__))
        (stringp (ident->unwrap ident))))

    Theorem: booleanp-of-ident-formalp

    (defthm booleanp-of-ident-formalp
      (b* ((yes/no (ident-formalp ident)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: ident-formalp-of-ident-fix-ident

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

    Theorem: ident-formalp-ident-equiv-congruence-on-ident

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