Safe Haskell | Safe-Inferred |
---|
Default model of rewriting functions used in adp-multi.
Documentation
type SymbolID = (Int, Int)Source
Every 1-dim parser has one symbol, every 2-dim parser two symbols. In a production with parsers p1 to pn, each parser has a number, 1 to n. Each symbol of a parser also has a number, 1 or 2, as only two dimensions are supported now. Both numbers form a unique identifier for each symbol in a production.
Example: f > r
a and c shall have dimension 1, b dimension 2.
Then a has id (1,1), b has ids (2,1) and (2,2), and
c has (3,1). Applying a rewriting function of type Dim1
or Dim2
to the list of ids produces a permutation of those, possibly
split up in two dimensions.
E.g., [(1,1),(2,1),(2,2),(3,1)] gets ([(2,1),(3,1)],[(2,2),(1,1)]) if the rewriting function is: r [a,b1,b2,c] = ([b1,c],[b2,a]).