• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
        • Atj
        • Aij
        • Language
          • Syntax
            • Grammar
            • Unicode-escapes
            • Unicode-input-char
            • Escape-sequence
            • Identifiers
            • Primitive-types
            • Reference-types
            • Unicode-characters
            • Keywords
              • Keywords-grammar-validation
                • Reserved-keywordp-when-grammar-reserved-keywordp
                • Contextual-keywordp-when-grammar-contextual-keywordp
                • Reserved-keyword-tree
                • Contextual-keyword-tree
                  • Grammar-reserved-keywordp
                  • Grammar-contextual-keywordp
                  • Grammar-contextual-keywordp-when-contextual-keywordp
                  • Grammar-reserved-keywordp-when-reserved-keywordp
                  • Reserved-keywordp-is-grammar-reserved-keywordp
                  • Contextual-keywordp-is-grammar-contextual-keywordp
                • Reserved-keywordp
                • Contextual-keywordp
                • *reserved-keywords*
                • *contextual-keywords*
              • 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
        • Riscv
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Keywords-grammar-validation

    Contextual-keyword-tree

    Tree for a contextual keyword.

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

    This is used in grammar-contextual-keywordp-when-contextual-keywordp.

    Definitions and Theorems

    Function: contextual-keyword-tree

    (defun contextual-keyword-tree (keyword)
     (declare (xargs :guard (contextual-keywordp keyword)))
     (let ((keyword (mbe :logic
                         (if (contextual-keywordp keyword)
                             keyword
                           (string=>unicode "yield"))
                         :exec keyword)))
      (abnf::tree-nonleaf (abnf::rulename "contextual-keyword")
                          (list (list (abnf::tree-leafterm keyword))))))

    Theorem: return-type-of-contextual-keyword-tree

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

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

    (defthm tree->string-of-contextual-keyword-tree
      (equal (abnf::tree->string (contextual-keyword-tree keyword))
             (if (contextual-keywordp keyword)
                 keyword
               (string=>unicode "yield"))))