• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • 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
        • Bv
        • Imp-language
        • Event-macros
        • Java
          • Atj
          • Aij
          • Language
            • Syntax
              • Grammar
              • Unicode-escapes
              • Unicode-input-char
              • Escape-sequence
              • Identifiers
                • Midentifier
                • Ascii-identifier-part-p
                • Identifier
                • Tidentifier
                • Umidentifier
                • Ascii-identifier-ignore-p
                  • Ascii-identifier-start-p
                  • Nonascii-identifier-part-p
                  • Nonascii-identifier-ignore-p
                  • Nonascii-identifier-start-p
                  • Identifier-part-listp
                  • Identifier-start-p
                  • Identifier-part-p
                  • Identifier-ignore-p
                  • No-identifier-ignore-p
                  • Tidentifierp
                  • Identifierp
                  • Umidentifier-fix
                  • Tidentifier-fix
                  • Midentifier-fix
                  • Identifier-fix
                  • Umidentifierp
                  • Midentifierp
                  • Identifier-list
                • Primitive-types
                • Reference-types
                • Keywords
                • Unicode-characters
                • Integer-literals
                • String-literals
                • Octal-digits
                • Hexadecimal-digits
                • Decimal-digits
                • Binary-digits
                • Character-literals
                • Null-literal
                • Floating-point-literals
                • Boolean-literals
                • Package-names
                • Literals
              • Semantics
          • 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
    • Identifiers

    Ascii-identifier-ignore-p

    Check if an ASCII character is ignorable in identifiers.

    Signature
    (ascii-identifier-ignore-p char) → yes/no
    Arguments
    char — Guard (asciip char).
    Returns
    yes/no — Type (booleanp yes/no).

    [JLS14:3.8] introduces the notion of `ignorable' character in identifiers: two identifiers are considered `equal' when, after ignoring (i.e. removing) the ignorable characters, the two identifiers are the same (i.e. same characters in the same order). [JLS14:3.8] defines this notion in terms of the API method Character.isIdentifierIgnorable(int). [JAPIS14] says that this method returns true on the Unicode characters with codes 0 to 8, 14 to 27, and 127 to 159, as well as the ones with the FORMAT general category value.

    Running OpenJDK 14's implementation of this API method on all the ASCII codes (i.e. the integers from 0 to 127), reveals that the ignorable ASCII characters are the ones with the codes 0 to 8, 14 to 27, and 127, and no others. Ideally, this should be confirmed with the Unicode standard, in regard to the FORMAT general category.

    Definitions and Theorems

    Function: ascii-identifier-ignore-p

    (defun ascii-identifier-ignore-p (char)
      (declare (xargs :guard (asciip char)))
      (let ((__function__ 'ascii-identifier-ignore-p))
        (declare (ignorable __function__))
        (b* ((char (mbe :logic (ascii-fix char)
                        :exec char)))
          (or (and (<= 0 char) (<= char 8))
              (and (<= 14 char) (<= char 27))
              (= char 127)))))

    Theorem: booleanp-of-ascii-identifier-ignore-p

    (defthm booleanp-of-ascii-identifier-ignore-p
      (b* ((yes/no (ascii-identifier-ignore-p char)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: ascii-identifier-ignore-p-of-ascii-fix-char

    (defthm ascii-identifier-ignore-p-of-ascii-fix-char
      (equal (ascii-identifier-ignore-p (ascii-fix char))
             (ascii-identifier-ignore-p char)))

    Theorem: ascii-identifier-ignore-p-ascii-equiv-congruence-on-char

    (defthm ascii-identifier-ignore-p-ascii-equiv-congruence-on-char
      (implies (ascii-equiv char char-equiv)
               (equal (ascii-identifier-ignore-p char)
                      (ascii-identifier-ignore-p char-equiv)))
      :rule-classes :congruence)