• 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
              • Primitive-types
              • Reference-types
              • Keywords
                • Keywords-grammar-validation
                  • Jkeywordp-when-grammar-jkeywordp
                  • Jkeyword-tree
                    • Grammar-jkeywordp
                    • Grammar-jkeywordp-when-jkeywordp
                    • Jkeywordp-is-grammar-jkeywordp
                  • Jkeywordp
                  • Restricted-jkeywordp
                  • *jkeywords*
                  • *restricted-jkeywords*
                • 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
    • Keywords-grammar-validation

    Jkeyword-tree

    Tree for a (non-restricted) keyword.

    Signature
    (jkeyword-tree keyword) → tree
    Arguments
    keyword — Guard (jkeywordp keyword).
    Returns
    tree — Type (abnf-tree-with-root-p tree "keyword").

    This is used in grammar-jkeywordp-when-jkeywordp.

    Definitions and Theorems

    Function: jkeyword-tree

    (defun jkeyword-tree (keyword)
      (declare (xargs :guard (jkeywordp keyword)))
      (let ((__function__ 'jkeyword-tree))
        (declare (ignorable __function__))
        (let ((keyword (mbe :logic
                            (if (jkeywordp keyword)
                                keyword
                              (string=>unicode "_"))
                            :exec keyword)))
          (abnf::tree-nonleaf
               (abnf::rulename "keyword")
               (list (list (abnf::tree-leafterm keyword)))))))

    Theorem: return-type-of-jkeyword-tree

    (defthm return-type-of-jkeyword-tree
      (b* ((tree (jkeyword-tree keyword)))
        (abnf-tree-with-root-p tree "keyword"))
      :rule-classes :rewrite)

    Theorem: tree->string-of-keyword-tree

    (defthm tree->string-of-keyword-tree
      (equal (abnf::tree->string (jkeyword-tree keyword))
             (if (jkeywordp keyword)
                 keyword
               (string=>unicode "_"))))