Dependency length #
The length of a dependency is the distance in words between head and dependent. This file defines
the total dependency length of a graph, transports a graph along a permutation of its positions,
and defines the distance from a head to the nearest word of a dependent's yield, dependency length
measured to the boundary of the dependent's phrase. On a projective tree that distance is one
more than the sizes of the yields of the sibling dependents between head and dependent: it is the
block measure WordOrder.Arrangement.boundaryDist with yields as blocks. Summed over the elements
after a head, the block measure weighs each element's length by the number of elements farther
out, so by the rearrangement inequality an order whose lengths grow outward is shortest: this is
Behaghel's law of growing constituents, and its mirror image orders long before short before a
final head.
Main definitions #
Graph.totalLength: the sum ofNat.distover the arcs.Graph.map: a graph transported along a permutation of its positions;Graph.mirrorandGraph.linearizeread it in reverse and in a given order.Graph.yieldDist: the distance from a position to the nearest word of a yield.WordOrder.Arrangement.boundaryDist: the distance in words between two constituents of given lengths in an arrangement.Graph.siblingArrangement: a head and its dependents in the order of their positions.
Main results #
Graph.totalLength_map: transport along an isometry preserves total dependency length.Graph.yieldDist_eq_one_add_sum: on a projective tree, the yield distance from a head to a dependent is one more than the yield sizes of the dependents between them.WordOrder.Arrangement.sum_boundaryDist_after_le: Behaghel's law, no rearrangement of the elements after a head is shorter than the order whose lengths grow outward.Graph.sum_yieldDist_eq_sum_boundaryDist: on a projective tree a head's yield distances are the boundary distances of its sibling arrangement with phrase lengths.
References #
Mirroring an arrangement swaps monovariation and antivariation of a weight with rank.
The number of elements after d is its rank from the end.
Rearranging the elements after x keeps precedence relative to anything not after x.
Rearranging the elements after x leaves the set of them unchanged.
The distance in words between the closest boundaries of x and y when each element c is
ℓ c words long, which is one more than the words of the elements between them and zero from an
element to itself.
Equations
- a.boundaryDist ℓ x y = if x = y then 0 else 1 + ∑ c : α with a.Precedes x c ∧ a.Precedes c y ∨ a.Precedes y c ∧ a.Precedes c x, ℓ c
Instances For
Mirroring preserves every distance.
Summed over the elements after x, the distances from x weigh each element's length by the
number of elements farther out, which cross its words.
Rearranging the elements after x leaves the distance from x to anything not after it.
Behaghel's law of growing constituents ([Beh09]). When the lengths of the elements
after x grow outward (ℓ monovaries with rank, short before long), no rearrangement of them
shortens the distance from x to them.
The rearrangement is strictly longer exactly when it is not itself short before long.
Over the whole head, rearranging the elements after x cannot shorten the head's measure
when their lengths grow outward.
Over the whole head, the rearrangement is strictly longer exactly when it is not itself short before long.
In the mirror image, when the lengths of the elements before x grow outward (long before
short), no rearrangement of them shortens the distance from x to them.
Total dependency length sums Nat.dist over all arcs, the quantity dependency-length
minimisation is about.
Equations
- g.totalLength = ∑ v : Fin n, ∑ w ∈ g.children v, (↑v).dist ↑w
Instances For
Total dependency length reads only the arc structure, never the tokens.
Transport: same structure, different linearization #
g.map σ transports g along the position permutation σ. Arcs, tokens and root move
together, so the labeled structure is unchanged and only the linearization varies.
Equations
Instances For
Transport along an isometry of the positions preserves total dependency length.
Position reversal preserves Nat.dist.
The mirror image of a graph has the same total dependency length — the head-final preference is the exact mirror of the head-initial one ([FLG20], examples (7)–(8)).
The graph read in the order order, which lists every position once. The token at
position p is the token of g at order[p], arcs and root following.
Equations
Instances For
Arc length and the dependent's phrase #
An arc to the far end of the dependent's own phrase is at least as long as the phrase: when every position the dependent dominates lies between the head and the dependent, the arc's length bounds their number. Direction is free for a one-word phrase and costly for a long one.
Distance to a phrase #
The distance from v to the nearest word of the yield of w, dependency length measured to
the closest boundary of the dependent's phrase.
Instances For
The distance to a phrase is at most the distance to its head.
On a projective tree the distance from a head to the nearest word of a dependent's phrase is one more than the phrase sizes of the dependents between them.
A head's dependents as an arrangement #
A head together with its dependents.
Instances For
The rank of a sibling counts the siblings before it.
Equations
- g.siblingRank v c = ⟨{d ∈ g.siblings v | d < ↑c}.card, ⋯⟩
Instances For
A head and its dependents arranged by position. The inverse is classical, but Precedes
reads only the rank, which the kernel reduces.
Equations
- g.siblingArrangement v = Equiv.ofBijective (g.siblingRank v) ⋯
Instances For
The phrase length of a position is the number of words of its yield.
Equations
- g.phraseLength c = (g.yield c).toFinset.card
Instances For
On a projective tree the yield distance from a head to a dependent is the boundary distance of the sibling arrangement with phrase lengths.
The sum of a head's yield distances is the head's measure in the sibling arrangement.