• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
        • Deftreeops
        • Defdefparse
          • Defdefparse-implementation
            • Defdefparse-event-generation
            • Defdefparse-fn
            • Defdefparse-input-processing
              • Defdefparse-process-inputs
              • Defdefparse-process-name
              • Defdefparse-process-package
              • Defdefparse-process-grammar
                • Defdefparse-process-prefix
                • *defdefparse-allowed-options*
              • Defdefparse-table
              • Defdefparse-macro-definition
          • Defgrammar
          • Tree-utilities
          • Notation
          • Grammar-parser
          • Meta-circular-validation
          • Parsing-primitives-defresult
          • Parsing-primitives-seq
          • Operations
          • Examples
          • Differences-with-paper
          • Constructor-utilities
          • Grammar-printer
          • Parsing-tools
        • Vwsim
        • Isar
        • Wp-gen
        • Dimacs-reader
        • Pfcs
        • Legacy-defrstobj
        • Proof-checker-array
        • Soft
        • C
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Defdefparse-input-processing

    Defdefparse-process-grammar

    Process the :grammar input.

    Signature
    (defdefparse-process-grammar grammar ctx state) 
      → 
    (mv erp grammar state)
    Arguments
    ctx — Guard (ctxp ctx).
    Returns
    grammar — Type (common-lisp::symbolp grammar).

    Return the grammar (i.e. the constant name) if successful.

    Definitions and Theorems

    Function: defdefparse-process-grammar

    (defun defdefparse-process-grammar (grammar ctx state)
     (declare (xargs :stobjs (state)))
     (declare (xargs :guard (ctxp ctx)))
     (let ((__function__ 'defdefparse-process-grammar))
      (declare (ignorable __function__))
      (b*
       (((er &)
         (ensure-value-is-constant-name$
              grammar "The :GRAMMAR input" t nil))
        (rules (constant-value grammar (w state)))
        ((unless (and (rulelistp rules) (consp rules)))
         (er-soft+
          ctx t nil
          "The :GRAMMAR input is the name of a constant, ~
                       but its value ~x0 is not a non-empty ABNF grammar."
          rules)))
       (value grammar))))

    Theorem: symbolp-of-defdefparse-process-grammar.grammar

    (defthm symbolp-of-defdefparse-process-grammar.grammar
      (b* (((mv acl2::?erp ?grammar acl2::?state)
            (defdefparse-process-grammar grammar ctx state)))
        (common-lisp::symbolp grammar))
      :rule-classes :rewrite)