• 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
        • 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

    Tidentifier

    Fixtype of Java type identifiers.

    The grammar rule for type-identifier in [JLS14:3.8] defines a type identifier as a regular identifier that is not var or yield.

    Accordingly, we model Java type identifiers as regular identifiers (the kinds used in most contexts, not in module-related contexts) that differ from the Unicode sequences for var and yield.

    Definitions and Theorems

    Function: tidentifierp

    (defun tidentifierp (x)
      (declare (xargs :guard t))
      (let ((__function__ 'tidentifierp))
        (declare (ignorable __function__))
        (and (identifierp x)
             (not (equal x (string=>unicode "var")))
             (not (equal x (string=>unicode "yield"))))))

    Theorem: booleanp-of-tidentifierp

    (defthm booleanp-of-tidentifierp
      (b* ((yes/no (tidentifierp x)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Function: tidentifier-fix

    (defun tidentifier-fix (x)
      (declare (xargs :guard (tidentifierp x)))
      (mbe :logic
           (if (tidentifierp x)
               x
             (list (char-code #\$)))
           :exec x))

    Theorem: tidentifierp-of-tidentifier-fix

    (defthm tidentifierp-of-tidentifier-fix
      (b* ((fixed-x (tidentifier-fix x)))
        (tidentifierp fixed-x))
      :rule-classes :rewrite)

    Theorem: tidentifier-fix-when-tidentifierp

    (defthm tidentifier-fix-when-tidentifierp
      (implies (tidentifierp x)
               (equal (tidentifier-fix x) x)))

    Function: tidentifier-equiv$inline

    (defun tidentifier-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (tidentifierp acl2::x)
                                  (tidentifierp acl2::y))))
      (equal (tidentifier-fix acl2::x)
             (tidentifier-fix acl2::y)))

    Theorem: tidentifier-equiv-is-an-equivalence

    (defthm tidentifier-equiv-is-an-equivalence
      (and (booleanp (tidentifier-equiv x y))
           (tidentifier-equiv x x)
           (implies (tidentifier-equiv x y)
                    (tidentifier-equiv y x))
           (implies (and (tidentifier-equiv x y)
                         (tidentifier-equiv y z))
                    (tidentifier-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: tidentifier-equiv-implies-equal-tidentifier-fix-1

    (defthm tidentifier-equiv-implies-equal-tidentifier-fix-1
      (implies (tidentifier-equiv acl2::x x-equiv)
               (equal (tidentifier-fix acl2::x)
                      (tidentifier-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: tidentifier-fix-under-tidentifier-equiv

    (defthm tidentifier-fix-under-tidentifier-equiv
      (tidentifier-equiv (tidentifier-fix acl2::x)
                         acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-tidentifier-fix-1-forward-to-tidentifier-equiv

    (defthm equal-of-tidentifier-fix-1-forward-to-tidentifier-equiv
      (implies (equal (tidentifier-fix acl2::x)
                      acl2::y)
               (tidentifier-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: equal-of-tidentifier-fix-2-forward-to-tidentifier-equiv

    (defthm equal-of-tidentifier-fix-2-forward-to-tidentifier-equiv
      (implies (equal acl2::x (tidentifier-fix acl2::y))
               (tidentifier-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: tidentifier-equiv-of-tidentifier-fix-1-forward

    (defthm tidentifier-equiv-of-tidentifier-fix-1-forward
      (implies (tidentifier-equiv (tidentifier-fix acl2::x)
                                  acl2::y)
               (tidentifier-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: tidentifier-equiv-of-tidentifier-fix-2-forward

    (defthm tidentifier-equiv-of-tidentifier-fix-2-forward
      (implies (tidentifier-equiv acl2::x (tidentifier-fix acl2::y))
               (tidentifier-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)