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

Grammar-parser-soundness

Soundness theorems for the parser of ABNF grammars.

If parse-grammar succeeds, it returns a parse tree for the input rooted at rulelist:

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*))))

This is proved via two sets of theorems for the parsing functions out of which parse-grammar is built:

  • Input decomposition: if parsing succeeds, the string at the leaves of the returned tree(s) consists of the consumed natural numbers in the input.
  • Tree matching: if parsing succeeds, the returned tree(s) match(es) the syntactic entity that the parsing function is meant to parse.

Subtopics

Grammar-parser-tree-matching
Tree matching theorems for the parser of ABNF grammars.
Grammar-parser-input-decomposition
Input decomposition theorems for the parser of ABNF grammars.
Parse-treep-of-parse-grammar
Top-level soundness theorem of the parser of ABNF grammars.