ABNF in ACL2 Alessandro Coglio Kestrel Institute Workshop 2017
ABNF in ACL2
A B N F
Augmented Backus-Naur Form
Augmented Backus-Naur Form is a formal context-free grammar notation that adds conveniences and makes slight modifications to Backus-Naur Form.
Augmented Backus-Naur Form is a formal context-free grammar notation that adds conveniences and makes slight modifications to Backus-Naur Form, e.g.: numeric range terminal notations case-insensitive string terminal notations DIGIT = %x30-39 HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" h16 = 1*4HEXDIG repetition prefixes, min. (default 0) to max. (default ∞) message-body = *OCTET RWS = 1*( SP / HTAB )
Augmented Backus-Naur Form
A B N F
ABNF
ABNF is specified by two RFCs (i.e. Internet standards).
ABNF is specified by two RFCs (i.e. Internet standards).
ABNF is specified by two RFCs (i.e. Internet standards).
ABNF is specified by two RFCs (i.e. Internet standards).
ABNF is specified by two RFCs (i.e. Internet standards).
ABNF is specified by two RFCs (i.e. Internet standards).
ABNF is specified by two RFCs (i.e. Internet standards).
ABNF is specified by two RFCs (i.e. Internet standards).
ABNF specif RFCs
The RFCs use natural language to informally specify ABNF.
The RFCs use natural language to informally specify ABNF.
The RFCs use natural language to informally specify ABNF.
The RFCs use natural language to informally specify ABNF.
The RFCs use natural language to informally specify ABNF.
The RFCs use natural language to informally specify ABNF. specifies ABNF language
The RFCs use natural language to informally specify ABNF. specifies ABNF language
The RFCs use natural language to informally specify ABNF. ABNF language informally specifies
The RFCs use natural language to informally specify ABNF. specifies ABNF language
The RFCs use natural language to informally specify ABNF. specifies ABNF language
The RFCs use natural language to informally specify ABNF. specifies ABNF language
The RFCs use natural language to informally specify ABNF. specifies ABNF language syntax semantics
The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies ABNF language syntax semantics
The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. formally specif natural language informally specifies ABNF language syntax semantics
The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies formally specifies ABNF language syntax semantics
The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies formally specifies ABNF language syntax semantics
The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies formally specifies ABNF language syntax semantics How to formally specify ABNF in ACL2, faithfully to the RFCs, including the meta-circular formal syntax specification?
The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies semantics syntax formally ABNF language How to formally specify ABNF in ACL2, faithfully to the RFCs, including the meta-circular formal syntax specification?
The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies formally specifies ABNF language syntax semantics How to formally specify ABNF in ACL2, faithfully to the RFCs, including the meta-circular formal syntax specification?
The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies formally specifies ABNF language syntax semantics How to formally specify ABNF in ACL2, faithfully to the RFCs, including the meta-circular formal syntax specification? ACL2
ACL2 The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies formally specifies ABNF language syntax semantics ACL2 How to formally specify ABNF in ACL2, faithfully to the RFCs, including the meta-circular formal syntax specification?
? The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies formally specifies ABNF language syntax semantics ? How to formally specify ABNF in ACL2, faithfully to the RFCs, including the meta-circular formal syntax specification?
? The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies formally specifies ? syntax ABNF language semantics How to formally specify ABNF in ACL2, faithfully to the RFCs, including the meta-circular formal syntax specification?
? The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies formally specifies ABNF language syntax semantics ? How to formally specify ABNF in ACL2, faithfully to the RFCs, including the meta-circular formal syntax specification?
? The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies formally specifies ABNF language syntax semantics ? How to formally specify ABNF in ACL2, faithfully to the RFCs, including the meta-circular formal syntax specification?
? The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies formally specifies ABNF language semantics syn tax ? How to formally specify ABNF in ACL2, faithfully to the RFCs, including the meta-circular formal syntax specification?
? The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies formally specifies ABNF language syntax syntax semantics ? How to formally specify ABNF in ACL2, faithfully to the RFCs, including the meta-circular formal syntax specification?
? The RFCs use natural language to informally specify ABNF. And they use ABNF to formally specify the syntax of ABNF. natural language informally specifies formally specifies ABNF language concrete syntax abstract syntax semantics ? How to formally specify ABNF in ACL2, faithfully to the RFCs, including the meta-circular formal syntax specification?
abstract syntax
abstract syntax
Formalize an abstract syntax
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF.
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ...
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ...
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ...
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... alternation = concatenation *(*c-wsp "/" *c-wsp concatenation)
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... alternation = concatenation * concatenation
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... alternation = * concatenation concatenation
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... alternation = concatenation *concatenation
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... alternation = concatenation *concatenation
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... alternation = *concatenation
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... alternation = * concatenation
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... = * alternation concatenation
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... (fty::deflist alternation :elt-type concatenation)
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... concatenation repetition (fty::deflist alternation :elt-type concatenation)
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... (fty::deflist alternation :elt-type concatenation) concatenation repetition)
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... (fty::deflist alternation :elt-type concatenation) (fty::deflist concatenation :elt-type repetition)
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... repetition repeat element (fty::deflist alternation :elt-type concatenation) (fty::deflist concatenation :elt-type repetition) (fty::deflist alternation :elt-type concatenation) (fty::deflist concatenation :elt-type repetition)
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... (fty::deflist alternation :elt-type concatenation) (fty::deflist concatenation :elt-type repetition) repetition repeat element
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... (fty::deflist alternation :elt-type concatenation) (fty::deflist concatenation :elt-type repetition) (fty::defprod repetition ((range repeat-range) (element element)))
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... element rulename rulename group group alternation (fty::deflist alternation :elt-type concatenation) (fty::deflist concatenation :elt-type repetition) (fty::defprod repetition ((range repeat-range) (element element)))
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... (fty::deflist alternation :elt-type concatenation) (fty::deflist concatenation :elt-type repetition) (fty::defprod repetition ((range repeat-range) (element element))) element rulename rulename group alternation
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... (fty::deflist alternation :elt-type concatenation) (fty::deflist concatenation :elt-type repetition) (fty::defprod repetition ((range repeat-range) (element element))) (fty::deftagsum element (:rulename ((get rulename))) (:group ((get alternation))) ...)
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... ... (fty::deflist alternation :elt-type concatenation) (fty::deflist concatenation :elt-type repetition) (fty::defprod repetition ((range repeat-range) (element element))) (fty::deftagsum element (:rulename ((get rulename))) (:group ((get alternation))) ...)
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... (fty::deflist alternation :elt-type concatenation) (fty::deflist concatenation :elt-type repetition) (fty::defprod repetition ((range repeat-range) (element element))) (fty::deftagsum element (:rulename ((get rulename))) (:group ((get alternation))) ...) ...
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.: alternation = concatenation *(*c-wsp "/" *c-wsp concatenation) concatenation = repetition *(1*c-wsp repetition) repetition = [repeat] element element = rulename / group / ... group = "(" *c-wsp alternation *c-wsp ")" ... (fty::deftypes alt/conc/rep/elem (fty::deflist alternation :elt-type concatenation) (fty::deflist concatenation :elt-type repetition) (fty::defprod repetition ((range repeat-range) (element element))) (fty::deftagsum element (:rulename ((get rulename))) (:group ((get alternation))) ...)
Formalize an abstract syntax of ABNF in ACL2, based on the ABNF grammar rules that define the concrete syntax of ABNF, e.g.:
ABNF ABNF grammar
The start nonterminal of the ABNF grammar of ABNF is rulelist.
The start nonterminal of the ABNF grammar of ABNF is rulelist. rulelist = 1*( rule / (*c-wsp c-nl) )
The start nonterminal of the ABNF grammar of ABNF is rulelist. rulelist = 1*( rule / (*c-wsp c-nl) )
The start nonterminal of the ABNF grammar of ABNF is rulelist. rulelist = 1*( rule / (*c-wsp c-nl) )
The start nonterminal of the ABNF grammar of ABNF is rulelist. rulelist = 1*( rule / (*c-wsp c-nl) ) In the abstract syntax, an ABNF grammar is a value of type rulelist.
The start nonterminal of the ABNF grammar of ABNF is rulelist. rulelist = 1*( rule / (*c-wsp c-nl) ) In the abstract syntax, an ABNF grammar is a value of type rulelist.
The start nonterminal of the ABNF grammar of ABNF is rulelist. rulelist = 1*( rule / (*c-wsp c-nl) ) rule In the abstract syntax, an ABNF grammar is a value of type rulelist.
The start nonterminal of the ABNF grammar of ABNF is rulelist. rulelist = 1*( rule / (*c-wsp c-nl) ) In the abstract syntax, an ABNF grammar is a value of type rulelist. rulelist rule
The start nonterminal of the ABNF grammar of ABNF is rulelist. rulelist = 1*( rule / (*c-wsp c-nl) ) In the abstract syntax, an ABNF grammar is a value of type rulelist. (fty::deflist rulelist :elt-type rule)
The start nonterminal of the ABNF grammar of ABNF is rulelist. rulelist = 1*( rule / (*c-wsp c-nl) ) In the abstract syntax, an ABNF grammar is a value of type rulelist. value (fty::deflist rulelist :elt-type rule)
The start nonterminal of the ABNF grammar of ABNF is rulelist. rulelist = 1*( rule / (*c-wsp c-nl) ) In the abstract syntax, an ABNF grammar is a value of type rulelist. (fty::deflist rulelist :elt-type rule) These values (grammars) can be operated upon in the ACL2 logic, e.g. to check their well-formedness and to compose them.
The start nonterminal of the ABNF grammar of ABNF is rulelist. rulelist = 1*( rule / (*c-wsp c-nl) ) In the abstract syntax, an ABNF grammar is a value of type rulelist. (fty::deflist rulelist :elt-type rule) These values (grammars) can be operated upon in the ACL2 logic, e.g. to check their well-formedness and to compose them.
In the abstract syntax, an ABNF grammar is a value of type rulelist.
abstract syntax
abstract syntax
natural language ABNF language concrete syntax abstract syntax informally specifies formally specifies ABNF language concrete syntax abstract syntax semantics formally specifies
semantics
semantics
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities.
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities.
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x = *y %d17.80 y = 2z / %d1-4 z = "a"
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a"
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" *y %d17.80
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" *y %d17.80
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" *y %d17.80
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y %d17.80
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y %d17.80
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" %d17.80 y y y
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" %d17.80 y y y
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" %d17.80 y y y
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y %d17.80
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y %d17.80
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" %d1-4 y y y (17 80)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) %d1-4
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) %d1-4
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" %d1-4 y y y (17 80) (2)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2) %d1-4
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2) %d1-4
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2) (4)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" z z y y y (17 80) (2) (4)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2) z z (4)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2) z z (4)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" "a" y y y (17 80) (2) z z (4)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2) z z (4) "a"
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2) z z (4) "a"
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2) z z (4) (65)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" "a" y y y (17 80) (2) z z (4) (65)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2) z z (4) (65) "a"
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2) z z (4) (65) "a"
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2) z z (4) (65) (97)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: match parse tree a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2) z z (4) (65) (97)
a parse tree that matches x Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2) z z (4) (65) (97) a parse tree that matches x
a parse tree that matches x Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: a grammar x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) branches are organized into lists (for concatenations) of lists (for repetitions) (2) z z (4) a parse tree that matches x (65) (97)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: x x = *y %d17.80 y = 2z / %d1-4 z = "a" y y y (17 80) (2) z z (4) (65) (97) branches are organized into lists (for concatenations) of lists (for repetitions)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: x y (17 80) (2) (4) z (65) (97) x = *y %d17.80 y = 2z / %d1-4 z = "a" branches lists lists
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: x y (17 80) (2) (4) z (65) (97) branches lists lists
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: x y (17 80) (2) (4) z (65) (97) branches tree-list-list
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: x y (17 80) (2) (4) z (65) (97) type of parse trees (fty::deftypes trees (fty::deftagsum tree (:leafterm ((get nat-list))) (:leafrule ((get rulename))) (:nonleaf ((rulename? maybe-rulename) (branches tree-list-list)))) (fty::deflist tree-list :elt-type tree) (fty::deflist tree-list-list :elt-type tree-list))
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: x y (17 80) (2) (4) z (65) (97) x = *y %d17.80 y = 2z / %d1-4 z = "a"
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: x y (17 80) (2) (4) z (65) (97) x = *y %d17.80 y = 2z / %d1-4 z = "a"
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: x (tree-match-element-p tree element rules) x y (17 80) (2) (4) z (65) (97) x = *y %d17.80 y = 2z / %d1-4 z = "a"
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: matching relation x (tree-match-element-p tree element rules) x y (17 80) (2) (4) z (65) (97) x = *y %d17.80 y = 2z / %d1-4 z = "a"
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: x (tree-match-element-p tree element rules) matching relation x y (17 80) (2) (4) z (65) (97) x = *y %d17.80 y = 2z / %d1-4 z = "a"
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: x matching relation (tree-match-element-p tree element rules) x y (17 80) (2) (4) z (65) (97) x = *y %d17.80 y = 2z / %d1-4 z = "a" 17 80 2 4 65 97
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: x matching relation (tree-match-element-p tree element rules) x y (17 80) (2) (4) z (65) (97) x = *y %d17.80 y = 2z / %d1-4 z = "a" 2 65 97 4 17 80
string at the leaves of the tree Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.: x matching relation (tree-match-element-p tree element rules) x y (17 80) (2) (4) z (65) (97) x = *y %d17.80 y = 2z / %d1-4 z = "a" string at the leaves of the tree (equal (tree->string tree) string) (2 65 97 4 17 80)
Formalize a semantics of ABNF in terms of matching relations between parse trees and (abstract) syntactic entities, e.g.:
semantics
semantics
natural language ABNF language concrete syntax abstract syntax informally specifies formally specifies ABNF language concrete syntax abstract syntax semantics formally specifies
concrete syntax
concrete syntax
Formalize the concrete syntax of ABNF by transcribing the ABNF grammar rules of ABNF “in abstract syntax”, thus breaking the meta-circularity.
Formalize the concrete syntax of ABNF by transcribing the ABNF grammar rules of ABNF “in abstract syntax”, thus breaking the meta-circularity.
Formalize the concrete syntax of ABNF by transcribing the ABNF grammar rules of ABNF “in abstract syntax”, thus breaking the meta-circularity, e.g.: num-val = "%" (bin-val / dec-val / hex-val) group = "(" *c-wsp alternation *c-wsp ")"
Formalize the concrete syntax of ABNF by transcribing the ABNF grammar rules of ABNF “in abstract syntax”, thus breaking the meta-circularity, e.g.: num-val = "%" (bin-val / dec-val / hex-val) group = "(" *c-wsp alternation *c-wsp ")"
Formalize the concrete syntax of ABNF by transcribing the ABNF grammar rules of ABNF “in abstract syntax”, thus breaking the meta-circularity, e.g.: num-val = "%" (bin-val / dec-val / hex-val) num-val "%" bin-val / dec-val / hex-val group = "(" *c-wsp alternation *c-wsp ")"
Formalize the concrete syntax of ABNF by transcribing the ABNF grammar rules of ABNF “in abstract syntax”, thus breaking the meta-circularity, e.g.: num-val = "%" (bin-val / dec-val / hex-val) num-val "%" bin-val / dec-val / hex-val group = "(" *c-wsp alternation *c-wsp ")"
specially crafted and named functions and macros Formalize the concrete syntax of ABNF by transcribing the ABNF grammar rules of ABNF “in abstract syntax”, thus breaking the meta-circularity, e.g.: num-val = "%" (bin-val / dec-val / hex-val) (def-rule-const *num-val* (/_ "%" (!_ (/_ *bin-val*) (/_ *dec-val*) (/_ *hex-val*)))) specially crafted and named functions and macros group = "(" *c-wsp alternation *c-wsp ")"
specially crafted and named functions and macros Formalize the concrete syntax of ABNF by transcribing the ABNF grammar rules of ABNF “in abstract syntax”, thus breaking the meta-circularity, e.g.: num-val = "%" (bin-val / dec-val / hex-val) (def-rule-const *num-val* (/_ "%" (!_ (/_ *bin-val*) (/_ *dec-val*) (/_ *hex-val*)))) specially crafted and named functions and macros group = "(" *c-wsp alternation *c-wsp ")" group "(" * c-wsp alternation * c-wsp ")"
specially crafted and named functions and macros Formalize the concrete syntax of ABNF by transcribing the ABNF grammar rules of ABNF “in abstract syntax”, thus breaking the meta-circularity, e.g.: num-val = "%" (bin-val / dec-val / hex-val) (def-rule-const *num-val* (/_ "%" (!_ (/_ *bin-val*) (/_ *dec-val*) (/_ *hex-val*)))) specially crafted and named functions and macros group = "(" *c-wsp alternation *c-wsp ")" group "(" * c-wsp alternation * c-wsp ")"
specially crafted and named functions and macros Formalize the concrete syntax of ABNF by transcribing the ABNF grammar rules of ABNF “in abstract syntax”, thus breaking the meta-circularity, e.g.: num-val = "%" (bin-val / dec-val / hex-val) (def-rule-const *num-val* (/_ "%" (!_ (/_ *bin-val*) (/_ *dec-val*) (/_ *hex-val*)))) specially crafted and named functions and macros group = "(" *c-wsp alternation *c-wsp ")" (def-rule-const *group* (/_ "(" (*_ *c-wsp*) *alternation* (*_ *c-wsp*) ")"))
Formalize the concrete syntax of ABNF by transcribing the ABNF grammar rules of ABNF “in abstract syntax”, thus breaking the meta-circularity, e.g.:
concrete abstract syntax
Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities.
Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities.
Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities, e.g.: repeat () (42) DIGIT (49) (50) (48)
Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities, e.g.: repeat () (42) DIGIT (49) (50) (48) 42 49 50 48
Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities, e.g.: repeat () (42) DIGIT (49) (50) (48) 49 42 50 48
Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities, e.g.: repeat () (42) DIGIT (49) (50) (48) "1" "*" "2" "0"
Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities, e.g.: repeat () (42) DIGIT (49) (50) (48) 1 * 2
Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities, e.g.: repeat () (42) DIGIT (49) (50) (48) 1 * 2
Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities, e.g.: repeat () (42) DIGIT (49) (50) (48) * 1 20
abstraction function for repetition ranges Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities, e.g.: repeat () (42) DIGIT (49) (50) (48) (:REPEAT 1 (:FINITE 20)) abstraction function for repetition ranges (equal (abstract-repeat tree) range)
Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities, e.g.: rulelist rule ...
Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities, e.g.: rulelist rule ... rule rule rule ... ... ... ...
Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities, e.g.: rulelist rule ... rule ... ...
abstraction function for lists of rules Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities, e.g.: rulelist rule ... ((:RULE ...) (:RULE ...) ...) abstraction function for lists of rules (equal (abstract-rulelist tree) rules)
Formalize the relationship between concrete and abstract syntax via abstraction functions from parse trees of ABNF grammars to corresponding abstract syntactic entities, e.g.:
concrete syntax
concrete syntax
natural language ABNF language concrete syntax abstract syntax informally specifies formally specifies ABNF language concrete syntax abstract syntax semantics formally specifies
ABNF language concrete syntax abstract syntax semantics formally specifies
ABNF language concrete syntax abstract syntax semantics formally specifies
ABNF language formally specifies
ABNF language ABNF formally specifies
ABNF is used in several Internet syntax specifications, e.g. HTTP. ABNF language formally specifies
ABNF is used in several Internet syntax specifications, e.g. HTTP. ABNF language formally specifies
ABNF is used in several Internet syntax specifications, e.g. HTTP. ABNF language formally specifies
ABNF is used in several Internet syntax specifications, e.g. HTTP. ABNF language formally specifies
ABNF is used in several Internet syntax specifications, e.g. HTTP. ABNF language formally specifies
ABNF is used in several Internet syntax specifications, e.g. HTTP. HTTP syntax ABNF language formally specifies
ABNF is used in several Internet syntax specifications, e.g. HTTP. HTTP syntax formally specifies ABNF language formally specifies
ABNF is used in several Internet syntax specifications, e.g. HTTP. HTTP syntax formally specifies ABNF language formally specifies
syntax HTTP HTTP syntax ABNF language formally specifies
How to formally specify the HTTP syntax in ACL2, faithfully to the RFC? formally specifies ABNF language formally specifies
How to formally specify the HTTP syntax in ACL2, faithfully to the RFC? formally specifies ABNF language formally specifies
How to formally specify the HTTP syntax in ACL2, faithfully to the RFC?
How to formally specify the HTTP syntax in ACL2, faithfully to the RFC?
How to formally specify the HTTP syntax in ACL2, faithfully to the RFC?
How to formally specify the HTTP syntax in ACL2, faithfully to the RFC? ABNF grammar rules of HTTP
How to formally specify the HTTP syntax in ACL2, faithfully to the RFC? ABNF grammar rules of HTTP
How to formally specify the HTTP syntax in ACL2, faithfully to the RFC? Transcribe the ABNF grammar rules of HTTP in abstract (ABNF) syntax, as done with the ABNF grammar rules of ABNF?
How to formally specify the HTTP syntax in ACL2, faithfully to the RFC? Transcribe Transcribe the ABNF grammar rules of HTTP in abstract (ABNF) syntax, as done with the ABNF grammar rules of ABNF?
How to formally specify the HTTP syntax in ACL2, faithfully to the RFC? Transcribe the ABNF grammar rules of HTTP in abstract (ABNF) syntax, as done with the ABNF grammar rules of ABNF? transcribe T
How to formally specify the HTTP syntax in ACL2, faithfully to the RFC? Transcribe the ABNF grammar rules of HTTP in abstract (ABNF) syntax, as done with the ABNF grammar rules of ABNF? a constant of type rulelist, representing an ABNF grammar, which has semantics in ACL2 *http-grammar* transcribe tedious and error-prone
How to formally specify the HTTP syntax in ACL2, faithfully to the RFC? *http-grammar*
How to formally specify the HTTP syntax in ACL2, faithfully to the RFC? *http-grammar*
Write and use a verified parser of ABNF grammars. How to formally specify the HTTP syntax in ACL2, faithfully to the RFC? Write and use a verified parser of ABNF grammars. grammar text file *http-grammar* copy & paste
Write and use a verified parser of ABNF grammars. verified parser ABNF How to formally specify the HTTP syntax in ACL2, faithfully to the RFC? Write and use a verified parser of ABNF grammars. verified parser ABNF grammar grammar text file *http-grammar* copy & paste
Write and use a verified parser of ABNF grammars. How to formally specify the HTTP syntax in ACL2, faithfully to the RFC? Write and use a verified parser of ABNF grammars. parse tree of the ABNF grammar of HTTP grammar text file rulelist ... *http-grammar* copy & paste top-level syntax abstraction function parse-grammar-from-file abstract-rulelist verified ABNF grammar parser
verified ABNF grammar parser
verified ABNF grammar parser
The verified ABNF grammar parser consists of 85 functions.
The verified ABNF grammar parser consists of 85 functions. The ABNF grammar of ABNF is mostly LL(1), with three LL(2) rules, two LL(*) rules, and one (non-critically) ambiguous rule. The parser is implemented as recursive descent with backtracking, using the Seq macros from the Community Books. The parser correctness proof consists of soundness and completeness. Soundness: if the parser succeeds, the output parse tree matches rulelist and its tree->string is the input string. Completeness: running the parser on the tree->string of a parse tree that matches rulelist and that (necessarily) satisfies certain disambiguating restrictions, succeeds and yields that parse tree. move ABNF grammar parser to next slide The correctness proof consists of 424 theorems, organized into several inter-dependent categories. Completeness is much more laborious to prove than soundness. These proof techniques should be more generally applicable.
The verified ABNF grammar parser consists of 85 functions.
ABNF grammar parser
The ABNF grammar parser can be run on the ABNF grammar of ABNF.
parse-grammar-from-file The ABNF grammar parser can be run on the ABNF grammar of ABNF. The ABNF grammar parser can be run on the ABNF grammar of ABNF. *http-grammar* copy & paste rulelist ... abstract-rulelist parse-grammar-from-file HTTP RFC
parse-grammar-from-file The ABNF grammar parser can be run on the ABNF grammar of ABNF. The ABNF grammar parser can be run on the ABNF grammar of ABNF. HTTP RFC rulelist ... *http-grammar* copy & paste parse-grammar-from-file abstract-rulelist
parse-grammar-from-file The ABNF grammar parser can be run on the ABNF grammar of ABNF. The ABNF grammar parser can be run on the ABNF grammar of ABNF. ABNFRFCs rulelist ... *abnf-grammar* copy & paste parse-grammar-from-file abstract-rulelist
The ABNF grammar parser can be run on the ABNF grammar of ABNF. trascription in the formalization of the ABNF concrete syntax rulelist ... *abnf-grammar* copy & paste parse-grammar-from-file abstract-rulelist
The ABNF grammar parser can be run on the ABNF grammar of ABNF. trascription in the formalization of the ABNF concrete syntax formalization ABNF concrete syntax rulelist ... *abnf-grammar* copy & paste parse-grammar-from-file abstract-rulelist
The ABNF grammar parser can be run on the ABNF grammar of ABNF. This provides a validation of the ABNF concrete syntax formalization. trascription in the formalization of the ABNF concrete syntax rulelist ... *abnf-grammar* copy & paste parse-grammar-from-file abstract-rulelist
The ABNF grammar parser can be run on the ABNF grammar of ABNF. This provides a validation of the ABNF concrete syntax formalization. trascription in the formalization of the ABNF concrete syntax rulelist ... *abnf-grammar* copy & paste parse-grammar-from-file abstract-rulelist
For more information: “ABNF in ACL2”, Technical Report (http://www.kestrel.edu/~coglio)
For more information: “ABNF in ACL2”, Technical Report (http://www.kestrel.edu/~coglio)
For more information:
For more information:
For much more information:
For much more information: ‘ABNF’ topic in the ACL2+Books manual