OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] Syntax versus Semantics (was: "vocabulary constraints" and other constraints (was: Re: [xml-dev] RE: Difference between "normalize" and "canonicalize"?))

Unfortunately we can't use the word "semantics" without hitting the abuse of
the term that has always existed in the world of compilers, where everything
outside the BNF grammar (for example, a rule that you can't refer to a
variable that hasn't been declared) is traditionally referred to as
"semantics". As far as I can tell, this bears almost no relationship to the
use of the term by those studying natural languages, whose analog in
programming would be answering the question "what does the program do?", and
whose analog for XML would be "what information does the XML document convey
to the recipient?".

Because of this history of disparate meanings for the word, my own
preference is to avoid using it at all.

We're talking here about rules for deciding statically whether a document is
or is not a member of some set of valid documents, for example the set of
valid XSLT stylesheets. Building on Michael S-McQ's analysis, I would
suggest one might classify the validity rules according to the computational
power needed to express them:

(a) those rules that can be expressed using regular expressions

(b) those rules that can be expressed in BNF

(c) those rules that can be expressed in first-order predicate calculus
(e.g. XPath 2.0)

(d) those rules that can only be evaluated using a Turing machine.

XSD 1.1 gives us (a) and (c). I don't know whether (b) is a subset of (c) -
I suspect not. (Any theorists listening who can tell me?) In Saxon I'm also
allowing (d) by virtue of XPath assertions that call out to extension
functions written in Java - for example that allows you to test whether the
value of the select attribute in a stylesheet is indeed a valid XPath

Michael Kay

> -----Original Message-----
> From: Costello, Roger L. [mailto:costello@mitre.org] 
> Sent: 01 March 2009 13:03
> To: 'xml-dev@lists.xml.org'
> Subject: [xml-dev] Syntax versus Semantics (was: "vocabulary 
> constraints" and other constraints (was: Re: [xml-dev] RE: 
> Difference between "normalize" and "canonicalize"?))
> Michael Sperberg-McQueen wrote: 
> > if we know how to specify it formally -- especially if we 
> can specify 
> > it in a way that doesn't require a Turing machine -- and check it 
> > automatically and conveniently, we tend to call it (whatever it is) 
> > syntax.  If we don't know how, then it's semantics.
> Neat!
> And Michael also wrote:
> > One of the great themes of computer science over the last 
> sixty years 
> > has been the long-running campaign to move more and more 
> things out of 
> > the "must be checked by eyeball" / semantics area, and into 
> the "can 
> > readily be checked by machine" / syntax area.
> 1. If something is in the realm of "semantics" does that mean 
> it can only be processed by humans (eyeballs)? It cannot be 
> processed by machines?
> 2. If something is in the realm of "syntax" does that mean it 
> can be declaratively expressed, whereas something in the 
> realm of "semantics" can only be procedurally expressed?
> 3. Suppose that something can be expressed declaratively but 
> it takes pages and pages to express it. Is it still syntax?
> I'd like to take a stab at defining syntax and semantics, 
> incorporating 
>    - the distinction of declarative versus procedural and 
>    - the distinction of simple to express versus complex:
> Something is syntax if it can be simply specified in a 
> declarative manner and it can be checked automatically and 
> conveniently.
> Something is semantics if it cannot be simply specified in a 
> declarative manner or it requires procedural code to express it.
> Do you agree with these definitions?
> /Roger
> ______________________________________________________________
> _________
> XML-DEV is a publicly archived, unmoderated list hosted by 
> OASIS to support XML implementation and development. To 
> minimize spam in the archives, you must subscribe before posting.
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org List archive: 
> http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS