• 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
          • Syntax-for-tools
          • Atc
          • Language
            • Abstract-syntax
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
              • Cst-statement-conc?
              • Cst-white-space-conc?
              • Cst-token-conc?
              • Cst-external-declaration-conc?
              • Cst-list-list-conc-matchp$
              • Cst-lexeme-conc?
              • Cst-list-list-alt-matchp$
              • Cst-block-item-conc?
              • Cst-list-rep-matchp$
              • Cst-list-elem-matchp$
              • Cst-constant-conc?
              • Cst-comment-conc?
              • Cst-external-declaration-conc2-rep-elem
              • Cst-external-declaration-conc1-rep-elem
              • Cst-struct-declarator-list-conc-rep-elem
              • Cst-storage-class-specifier-conc-rep-elem
              • Cst-matchp$
              • Cst-external-declaration-conc2-rep
              • Cst-external-declaration-conc1-rep
              • Cst-white-space-conc5-rep-elem
              • Cst-white-space-conc4-rep-elem
              • Cst-white-space-conc3-rep-elem
              • Cst-white-space-conc2-rep-elem
              • Cst-white-space-conc1-rep-elem
              • Cst-struct-declarator-list-conc-rep
              • Cst-struct-declarator-conc-rep-elem
              • Cst-storage-class-specifier-conc-rep
              • Cst-storage-class-specifier-conc
              • Cst-specifier-qualifier-list-conc
              • Cst-parameter-type-list-conc-rep-elem
              • Cst-init-declarator-list-conc-rep-elem
              • Cst-init-declarator-list-conc-rep
              • Cst-identifier-nondigit-conc-rep-elem
              • Cst-hexadecimal-prefix-conc-rep-elem
              • Cst-external-declaration-conc2
              • Cst-external-declaration-conc1
              • Cst-enumeration-constant-conc-rep-elem
              • Cst-enumeration-constant-conc-rep
              • Cst-constant-expression-conc-rep-elem
              • Cst-constant-expression-conc-rep
              • Cst-block-item-conc2-rep-elem
              • Cst-block-item-conc1-rep-elem
              • *grammar*
                • *grammar*-tree-operations
              • Cst-white-space-conc5-rep
              • Cst-white-space-conc5
              • Cst-white-space-conc4-rep
              • Cst-white-space-conc4
              • Cst-white-space-conc3-rep
              • Cst-white-space-conc3
              • Cst-white-space-conc2-rep
              • Cst-white-space-conc2
              • Cst-white-space-conc1-rep
              • Cst-white-space-conc1
              • Cst-vertical-tab-conc-rep-elem
              • Cst-unsigned-suffix-conc-rep-elem
              • Cst-unsigned-suffix-conc-rep
              • Cst-typedef-name-conc-rep-elem
              • Cst-struct-declarator-list-conc
              • Cst-struct-declarator-conc-rep
              • Cst-struct-declaration-conc
              • Cst-statement-conc6-rep-elem
              • Cst-statement-conc6-rep
              • Cst-statement-conc5-rep-elem
              • Cst-statement-conc5-rep
              • Cst-statement-conc4-rep-elem
              • Cst-statement-conc4-rep
              • Cst-statement-conc3-rep-elem
              • Cst-statement-conc3-rep
              • Cst-statement-conc2-rep-elem
              • Cst-statement-conc2-rep
              • Cst-statement-conc1-rep-elem
              • Cst-statement-conc1-rep
              • Cst-parameter-type-list-conc-rep
              • Cst-parameter-type-list-conc
              • Cst-parameter-declaration-conc
              • Cst-lexeme-conc3-rep-elem
              • Cst-lexeme-conc2-rep-elem
              • Cst-lexeme-conc1-rep-elem
              • Cst-init-declarator-list-conc
              • Cst-identifier-nondigit-conc-rep
              • Cst-identifier-nondigit-conc
              • Cst-horizontal-tab-conc-rep-elem
              • Cst-hexadecimal-prefix-conc-rep
              • Cst-hexadecimal-prefix-conc
              • Cst-function-definition-conc
              • Cst-expression-statement-conc
              • Cst-enumeration-constant-conc
              • Cst-double-quote-conc-rep-elem
              • Cst-constant-expression-conc
              • Cst-constant-conc2-rep-elem
              • Cst-constant-conc1-rep-elem
              • Cst-compound-statement-conc
              • Cst-comment-conc2-rep-elem
              • Cst-comment-conc1-rep-elem
              • Cst-carriage-return-conc-rep-elem
              • Cst-carriage-return-conc-rep
              • Cst-block-item-conc2-rep
              • Cst-block-item-conc1-rep
              • Cst-vertical-tab-conc-rep
              • Cst-unsigned-suffix-conc
              • Cst-typedef-name-conc-rep
              • Cst-token-conc4-rep-elem
              • Cst-token-conc3-rep-elem
              • Cst-token-conc2-rep-elem
              • Cst-token-conc1-rep-elem
              • Cst-struct-declarator-conc
              • Cst-statement-conc6
              • Cst-statement-conc5
              • Cst-statement-conc4
              • Cst-statement-conc3
              • Cst-statement-conc2
              • Cst-statement-conc1
              • Cst-long-suffix-conc-rep-elem
              • Cst-long-suffix-conc-rep
              • Cst-line-feed-conc-rep-elem
              • Cst-line-comment-conc
              • Cst-lexeme-conc3-rep
              • Cst-lexeme-conc2-rep
              • Cst-lexeme-conc1-rep
              • Cst-horizontal-tab-conc-rep
              • Cst-horizontal-tab-conc
              • Cst-form-feed-conc-rep-elem
              • Cst-expression-conc-rep-elem
              • Cst-expression-conc-rep
              • Cst-enum-specifier-conc
              • Cst-double-quote-conc-rep
              • Cst-constant-conc2-rep
              • Cst-constant-conc2
              • Cst-constant-conc1-rep
              • Cst-constant-conc1
              • Cst-comment-conc2-rep
              • Cst-comment-conc2
              • Cst-comment-conc1-rep
              • Cst-comment-conc1
              • Cst-character-conc-rep-elem
              • Cst-carriage-return-conc
              • Cst-block-item-conc2
              • Cst-block-item-conc1
              • Cst-block-comment-conc
              • Cst-vertical-tab-conc
              • Cst-typedef-name-conc
              • Cst-type-name-conc
              • Cst-token-conc4-rep
              • Cst-token-conc4
              • Cst-token-conc3-rep
              • Cst-token-conc3
              • Cst-token-conc2-rep
              • Cst-token-conc2
              • Cst-token-conc1-rep
              • Cst-token-conc1
              • Cst-space-conc-rep-elem
              • Cst-new-line-conc
              • Cst-long-suffix-conc
              • Cst-line-feed-conc-rep
              • Cst-line-feed-conc
              • Cst-lexeme-conc3
              • Cst-lexeme-conc2
              • Cst-lexeme-conc1
              • Cst-form-feed-conc-rep
              • Cst-form-feed-conc
              • Cst-expression-conc
              • Cst-double-quote-conc
              • Cst-declarator-conc
              • Cst-declaration-conc
              • Cst-character-conc-rep
              • Cst-character-conc
              • Cst-space-conc-rep
              • Cst-space-conc
              • Cst-%xe-7f-nat
              • Cst-%xe-29-nat
              • Cst-%xb-c-nat
              • Cst-%x30-7f-nat
              • Cst-%x2b-7f-nat
              • Cst-%x2b-2e-nat
              • Cst-%x0-9-nat
              • Cst-%x0-7f-nat
            • Integer-formats
            • Types
            • Portable-ascii-identifiers
            • Values
            • Integer-operations
            • Computation-states
            • Object-designators
            • Operations
            • Errors
            • Tag-environments
            • Function-environments
            • Character-sets
            • Flexible-array-member-removal
            • Arithmetic-operations
            • Pointer-operations
            • Bytes
            • Keywords
            • Real-operations
            • Array-operations
            • Scalar-operations
            • Structure-operations
          • Representation
          • Transformation-tools
          • Insertion-sort
          • Pack
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • 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
  • Grammar

*grammar*

The grammar of C, in ACL2.

We use our verified grammar parser and our abstractor to turn the grammar in the grammar.abnf file into an ACL2 representation.

We use ACL2::add-const-to-untranslate-preprocess to keep this constant unexpanded in output.

We show that the grammar is well-formed, closed, and ASCII.

Definitions and Theorems

Function: untranslate-preprocess-*grammar*

(defun untranslate-preprocess-*grammar* (acl2::term acl2::wrld)
  (if (equal acl2::term (list 'quote *grammar*))
      '*grammar*
    (abnf::untranslate-preprocess-*grammar* acl2::term acl2::wrld)))

Theorem: rulelist-wfp-of-*grammar*

(defthm rulelist-wfp-of-*grammar*
  (abnf::rulelist-wfp *grammar*))

Theorem: rulelist-closedp-of-*grammar*

(defthm rulelist-closedp-of-*grammar*
  (abnf::rulelist-closedp *grammar*))

Theorem: ascii-only-*grammar*

(defthm ascii-only-*grammar*
  (abnf::rulelist-in-termset-p *grammar* (integers-from-to 0 127)))

Subtopics

*grammar*-tree-operations
Tree operations specialized to *grammar*.