ComputingComputer ScienceFormal MethodsProgramming LanguagesSemanticsProgramming Language DesignSoftware DesignSpecification LanguagesPattern MatchingPattern Matching SemanticsXpath
this article provides a tutorial introduction to these techniques. While little here will be new to the language theorist, some of what is here may be of use to the markup technologist. A formal semantics brings to light issues that can be hard to spot in an english language description. For instance, matching is a central concept in XSLT. Here is how it was described in [XSL-Dec98]. The result of the MatchExpr is true if, for any node in the document that contains the context of the MatchExpr, the result of evaluating the SelectExpr with that node as context contains the context of the MatchExpr. Otherwise the result is false. The attempt to make this sentence precise has rendered it almost unreadable. Even so, as we shall later see, the sentence is ambiguous, so even a careful reading can leave one unsure of the intention. In contrast, the formal specification given here presents the same information in just one line, is easier to read than the english, and avoids the ambiguity. Partly as a result of insight gleaned from the semantics, the definition of match patterns in XSLT was simplified and made easier to implement. The formal semantics is given in a style known as denotational semantics. There are several textbook introductions to this subject, including those by Schmidt [Schmidt] and Allison [Allison]. We will be able to get by using some of the most basic ideas from semantics. Many of the tricky corners is semantics arise from possibly infinite behaviour, such as a program that may enter an infinite loop. Since in our case we deal with finite documents and finite sets of nodes, these complexities can be avoided. 1 The formal semantics also draws upon techniques from the functional programming community. Again, there are several fine introductions, including t...
2
Malcolm Wallace, Colin Runciman · 1999 · 160 citations
Computing, Computer Science, Algebra +16
The structure of typed programming languages
Choice Reviews Online · 1994 · 58 citations