Definitionadvanced
Synchronous context-free grammar
Also called SCFG, syntax-directed transduction grammar.
A grammar whose rules rewrite a nonterminal into a pair of strings with linked nonterminals, deriving a source and target sentence together.
A synchronous context-free grammar (SCFG) is a context-free grammar whose rules produce two strings at once. Each rule rewrites one nonterminal into a source string and a target string, and every nonterminal on the source side is linked to one nonterminal with the same label on the target side. A derivation rewrites linked nonterminals together, so it builds a source sentence and its translation from one shared tree, while the order of the subtrees can differ between the two sides. SCFGs are the formal basis of inversion transduction grammars, hierarchical phrase-based translation and syntax-based translation with GHKM rules.
Definition
An SCFG is a tuple with a finite set of nonterminals, a source alphabet , a target alphabet , a start symbol , and a finite set of rules of the form
where , , , and is a one-to-one map between the nonterminal occurrences in and those in that links only occurrences with the same label. The links are written as indices: . The rank of a rule is its number of linked pairs, and the rank of is the largest rank of its rules.
A sentential form is a pair with a link map between its nonterminals. A derivation step picks a linked pair and a rule , replaces by on the source side and by on the target side, and gives the new linked pairs fresh indices. The translation of is the relation
In translation, the source is and the target is ; the grammar itself is symmetric, and swapping the two sides of every rule gives a grammar for the inverse relation. A weighted SCFG gives each rule a weight, and a derivation the product (or, in log space with natural logs, the sum) of the weights of its rules. A derivation has one tree, whose nodes are rule applications; the source tree and the target tree are the same tree with the children of each node in two orders.
Examples and non-examples
Example (SOV to SVO). Japanese puts the verb after the object, English before it. The grammar
derives
The VP rule reorders its two children, and the words of each child stay together on both sides.
Example (reversal). The rank 1 grammar , , translates every string over into its reverse.
Example (Hiero rule). has one nonterminal label and mixes words with linked gaps; it swaps the two noun phrases around a Chinese possessive marker.
Non-example (unequal labels). links to . Links must join equal labels, because both sides of a link are rewritten by the same rule.
Non-example (deletion or copying). has an unlinked , and uses one source nonterminal twice. Neither is an SCFG rule, because the link map must be one to one. Copying rules belong to tree transducers.
Non-example (copy relation). The relation is not the translation of any SCFG, because the target side of an SCFG translation is a context-free language (see below), and is not context-free.
Non-example (two independent grammars). Two CFGs, one for each language, with no links between their nonterminals generate pairs of unrelated sentences, not translations.
Related definitions
- Projections (theorem). Dropping the target side of every rule gives a CFG for , and dropping the source side a CFG for the targets. So both projections are context-free languages, and parsing the source with the source CFG, for example by the CYK algorithm after binarizing the source sides, takes time and gives a packed forest, a hypergraph, from which the target side is read.
- Rank and binarization (theorem). A rule can be split into rank 2 rules with new nonterminals exactly when its nonterminal order can be built by repeatedly joining adjacent blocks, in the same or in the opposite order. The order 2 4 1 3 cannot: no two of its nonterminals are adjacent on both sides. Aho and Ullman showed that rank 3 grammars give no more translations than rank 2 grammars, while for higher ranks each rank adds new translations.
- Inversion transduction grammar. An ITG is an SCFG of rank 2 in a normal form, with straight and inverted binary rules. Every SCFG of rank 2 or 3 has an equivalent ITG.
- Biparsing. Deciding whether takes time for an ITG. Satta and Peserico (2005) showed that it is NP-hard when the grammar is part of the input and its rank is not bounded.
- Syntax-directed translation. In compilers, syntax-directed translation attaches arbitrary actions to the rules of one grammar. An SCFG is the special case where the action of each rule writes out fixed words and the translations of the children in some order, and nothing else.
- Simple SCFGs and pushdown transducers. If every rule keeps its nonterminals in the same order on both sides, the grammar is simple, and Aho and Ullman (1969) relate these translations to the ones computed by pushdown transducers.
- Finite-state transducers. A rank 1 SCFG whose nonterminal is always at the right end of both sides defines a rational relation, the kind computed by a finite-state transducer.
- Tree-based rules. Synchronous tree substitution grammars, such as the GHKM rules, let one side of a rule be a tree fragment of several levels. Flattening each fragment to its root and its frontier gives an SCFG rule, so the translation relation is the same, but the tree that the rules build differs.
References
- Lewis and Stearns 1968, the definition of syntax-directed transduction, with rules that rewrite a nonterminal on the input and the output side together
- Alfred V. Aho and Jeffrey D. Ullman, Syntax directed translations and the pushdown assembler, Journal of Computer and System Sciences 3(1), 1969, pages 37 to 56, syntax-directed translation schemata, their simple (order-preserving) form, and their relation to pushdown transducers
- Chiang 2007, the definition of synchronous context-free grammars with linked nonterminals and their derivations, used for translation
- Philipp Koehn, Statistical Machine Translation, Cambridge University Press, 2010, Chapter 11 (tree-based models: synchronous grammars)
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag XZYMCK Edit this page History Report an error Markdown