Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formal grammar #232

Open
benjub opened this issue Jan 13, 2022 · 0 comments
Open

Formal grammar #232

benjub opened this issue Jan 13, 2022 · 0 comments

Comments

@benjub
Copy link
Contributor

benjub commented Jan 13, 2022

In Appendix E (EBNF grammar), an include-stmt can only appear in the outermost-scope-stmt. However, metamath.c v0.198 does accept include-stmts within blocks. This makes things context-dependent since an inclusion statement simply "pastes" the content of the included file at that point: since constant-stmts can only appear in the outermost-scope-stmt, the included file, if not in the outermost scope, cannot contain any constant-stmt.

So one can modify the EBNF grammar to remove include-stmt from the production rule outermost-scope-stmt ::= ... and put it instead in the production rule stmt ::= ..., but then more constraints for database validity do not appear in the grammar (since they are context-dependent). Or one can modify metamath.c to reject inclusion statements not in the outermost scope, but I think this is a non-necessary restriction. A third possibility is to accept both inclusion statements and $c statements anywhere (this is backward compatible: a database conforming to the former version also conforms to the new). I haven't thought this through, but wanted to record it here for future reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant