Re: EBNF and its not-so-usefulness
Chris
> > I am in no way suggesting that any language may be completely defined
> > in EBNF.
>
> But why not, Chris? A language can most assuredly be completely defined
> in EBNF, assuming that by a language you mean the sentences generated by
> the grammar expressed by the EBNF definition.
The OED provides as a definition for language "The whole body of words and
of methods of combination of words used by a nation, people, or race". EBNF
could indeed (for at least certain classes of language) be used to define
both the "whole body of words" and "methods of combination of words" - in
practice it is not. It may define some key words but in general it treats
the main corpus of words as non-terminals and therefore defines their
general form but not the individual words - words that do not exist in the
language appear as admissible as ones that are not. It certainly contains
no semantic definitions.
> > Not all sentences that parse according to the grammar are necessary
> > legal or 'meaningful' in some wider sense.
>
> Certainly they should be in any clear and useful sense. For formal
> languages like KIF --- at least, those with a semantics that has no
> truth-value gaps --- every sentence generated by the grammar should have
> a well-defined meaning in every model.
Sorry, I should have said "necessarily". Again it depends upon the
language. In some cases every sentence generated by the language might well
have "a well-defined meaning in every model". In other cases there may be
some other constraints introduced. The XML recommendation has the notions
of "well-formed" and "valid" that are not defined in the EBNF. In other
cases the EBNF may be used to introduce constructs in the language at run
time - defining operators, for example. If a valid sentence in the language
being parsed introduces an infix operator that expects two operands that
return a truth value then the validity of an expression containing such a
term cannot be validated solely against the EBNF.
Chris Angus
Home: +44 (0) 16977 41504
SSI: +44 (0) 207 934 4960
Fax: +44 (0) 16977 41666
Chris.Angus@BTinternet.com or Chris.C.Angus@opc.shell.com