• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
        • Deftreeops
        • Defdefparse
        • Defgrammar
        • Tree-utilities
        • Notation
        • Grammar-parser
          • Grammar-parser-implementation
          • Grammar-parser-correctness
            • Grammar-parser-completeness
            • Grammar-parser-soundness
              • Grammar-parser-tree-matching
              • Grammar-parser-input-decomposition
              • Parse-treep-of-parse-grammar
          • 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
        • C
        • Proof-checker-array
        • Soft
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Ethereum
        • Leftist-trees
        • Java
        • 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
    • Grammar-parser-soundness

    Parse-treep-of-parse-grammar

    Top-level soundness theorem of the parser of ABNF grammars.

    If parse-grammar succeeds, it returns a parse tree for the input rooted at rulelist. This is proved from the input decomposition theorem and tree matching theorem for rulelist, and the fact that parse-grammar fails if there is extra input.

    An alternative formulation is to avoid nat-list-fix but include the hypothesis that the input satisfies nat-listp.

    Definitions and Theorems

    Theorem: parse-treep-of-parse-grammar

    (defthm parse-treep-of-parse-grammar
      (let ((tree? (parse-grammar nats)))
        (implies tree?
                 (parse-treep tree? (nat-list-fix nats)
                              *rulelist* *grammar*))))