Word order #
The order of a head relative to one of its dependents, and the linear arrangement of a finite set of constituents, in particular of the subject, object and verb of a clause.
HeadDirection is the two-valued order of a head and a dependent, head-initial when the head
precedes; HeadDirection.swap is the opposite direction, HeadDirection.ofLT the direction read
off two positions, HeadDirection.dependentEdge the side of the head on which its dependents lie,
and HeadDirection.nearest picks, from dependents in linear order on one side of their head, the
one next to it. WordOrder.Arrangement α n is a linear arrangement of the elements of α over
n ranks, a bijection onto Fin n, so that precedence, adjacency, the head direction of any pair,
the ends and the mirror image are read off the ranks. Arrangement Constituent 3 arranges the
three clausal constituents, and its six values are the basic word orders of the typological
literature, Arrangement.sov and its siblings, each labelled by its list of constituents.
Main declarations #
HeadDirection,HeadDirection.swap,HeadDirection.ofLT,HeadDirection.dependentEdge: the two directions, the involution exchanging them, the direction of a head and a dependent at given positions, and the edge of the head on which the dependents lie.HeadDirection.nearest: the dependent next to the head, such as the conjunct of a coordination that a selector or a probe next to it sees.WordOrder.Arrangement,Arrangement.Precedes,Arrangement.Adjacent,Arrangement.headDirection,Arrangement.mirror: an arrangement of a finite type over ranks, precedence and adjacency of two elements, the head direction of a pair, and the reversed arrangement.Arrangement.IsEnd,Arrangement.IsInitial,Arrangement.IsFinal,Arrangement.IsMedial: an element that heads every other in one direction, standing first or last, or neither.Arrangement.toList: the elements of an arrangement in their order.WordOrder.Constituent,Arrangement.sovand its siblings,Arrangement.label,Arrangement.ofLabel?: the subject, object and verb, their six arrangements, and the labels "SOV", … that name them.
Implementation notes #
The WALS classification of a language's dominant orders, with its "no dominant order" value, is
data (WALS Feature 81A and its siblings). A fragment records the arrangements a
language admits as a Finset (Arrangement Constituent 3); the pairwise orders the language
fixes are the ones every member agrees on, so no separate consistency invariant is needed. The
rank count is a parameter rather than Fintype.card α, so that numerals and decide reduce, and
the ends are defined by rank for the same reason.
References #
The order of a head and one of its dependents, head-initial when the head precedes, as a verb precedes its object in VO order and a preposition its noun phrase, head-final otherwise.
- headInitial : HeadDirection
- headFinal : HeadDirection
Instances For
Equations
- instDecidableEqHeadDirection x✝ y✝ = if h : x✝.ctorIdx = y✝.ctorIdx then isTrue ⋯ else isFalse ⋯
Equations
- instReprHeadDirection = { reprPrec := instReprHeadDirection.repr }
Equations
- instReprHeadDirection.repr HeadDirection.headInitial prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HeadDirection.headInitial")).group prec✝
- instReprHeadDirection.repr HeadDirection.headFinal prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HeadDirection.headFinal")).group prec✝
Instances For
Equations
- instFintypeHeadDirection = { elems := { val := ↑HeadDirection.enumList, nodup := HeadDirection.enumList_nodup }, complete := instFintypeHeadDirection._proof_1 }
The opposite direction.
Equations
Instances For
A direction is a given one or its opposite.
The direction of a head at position head with a dependent at position dep.
Equations
- HeadDirection.ofLT head dep = if head < dep then HeadDirection.headInitial else HeadDirection.headFinal
Instances For
The edge of a head on which its dependents lie, the right one for a head-initial head.
Equations
Instances For
The opposite direction puts the dependents on the other edge.
d.Orders head dep holds when the dependent at dep lies in direction d of the head at
head, after it for a head-initial head and before it for a head-final one. Unlike ofLT, it
fails when the two positions coincide.
Equations
- HeadDirection.headInitial.Orders x✝¹ x✝ = (x✝¹ < x✝)
- HeadDirection.headFinal.Orders x✝¹ x✝ = (x✝ < x✝¹)
Instances For
d.nearest l is the element of l, dependents in linear order on one side of their head,
that is next to the head, the first when the head precedes them and the last when it follows.
Equations
- HeadDirection.headInitial.nearest x✝ = x✝.head?
- HeadDirection.headFinal.nearest x✝ = x✝.getLast?
Instances For
Reversing the dependents and the side of the head picks out the same one.
The dependent next to the head is the first on every list exactly when the head precedes.
Lists related pointwise have related nearest elements.
A linear arrangement of the elements of α over n ranks, each element sent to its
rank.
Equations
- WordOrder.Arrangement α n = (α ≃ Fin n)
Instances For
Equations
- a.instDecidablePrecedes x y = { decide := (↑(a x)).succ.ble ↑(a y), reflects_decide := ⋯ }
x and y stand next to each other, one rank covering the other.
Equations
- a.Adjacent x y = (a x ⋖ a y ∨ a y ⋖ a x)
Instances For
The direction of the head x with respect to its dependent y.
Equations
- a.headDirection x y = HeadDirection.ofLT (a x) (a y)
Instances For
a.IsEnd x d holds when x is a head in direction d of every other element: x stands
first when d is head-initial and last when it is head-final.
Equations
- a.IsEnd x HeadDirection.headInitial = (↑(a x) = 0)
- a.IsEnd x HeadDirection.headFinal = (↑(a x) + 1 = n)
Instances For
x stands first.
Equations
- a.IsInitial x = a.IsEnd x HeadDirection.headInitial
Instances For
x stands last.
Equations
- a.IsFinal x = a.IsEnd x HeadDirection.headFinal
Instances For
x stands neither first nor last.
Instances For
Equations
- a.instDecidableIsEnd x HeadDirection.headInitial = { decide := (↑(a x)).beq 0, reflects_decide := ⋯ }
- a.instDecidableIsEnd x HeadDirection.headFinal = { decide := (↑(a x) + 1).beq n, reflects_decide := ⋯ }
Equations
- a.instDecidableIsMedial x = { decide := decide ¬a.IsInitial x && decide ¬a.IsFinal x, reflects_decide := ⋯ }
The mirror image #
The mirror image reverses every precedence.
The mirror image reverses the direction of every head with respect to a distinct dependent.
Adjacency #
Equations
- WordOrder.Arrangement.instDecidableAdjacent = decidable_of_iff (↑(a x) + 1 = ↑(a y) ∨ ↑(a y) + 1 = ↑(a x)) ⋯
The mirror image keeps every adjacency.
Ends #
The first element precedes every other.
The last element follows every other.
x stands at the d end exactly when it is a d-head of every other element.
The mirror image exchanges the two ends.
Of three elements over three ranks, two are adjacent exactly when the third is not medial.
The elements before and after an element #
The elements after x.
Instances For
The elements before x.
Instances For
Lists #
The elements in their order.
Equations
- a.toList = List.map (⇑(Equiv.symm a)) (List.finRange n)
Instances For
The three constituents of a transitive clause.
- subject : Constituent
- object : Constituent
- verb : Constituent
Instances For
Equations
- WordOrder.instDecidableEqConstituent x✝ y✝ = if h : x✝.ctorIdx = y✝.ctorIdx then isTrue ⋯ else isFalse ⋯
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- WordOrder.instReprConstituent = { reprPrec := WordOrder.instReprConstituent.repr }
Equations
- WordOrder.instFintypeConstituent = { elems := { val := ↑WordOrder.Constituent.enumList, nodup := WordOrder.Constituent.enumList_nodup }, complete := WordOrder.instFintypeConstituent._proof_1 }
The letter of a constituent in the labels "SOV", "SVO", … of the typological literature.
Equations
Instances For
Subject, object, verb.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Subject, verb, object.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Verb, subject, object.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Verb, object, subject.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Object, verb, subject.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Object, subject, verb.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The six basic orders.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every arrangement of the three constituents is a basic order.
The label of an arrangement of the three constituents, "SOV" for sov.
Equations
- a.label = String.ofList (List.map WordOrder.Constituent.letter a.toList)
Instances For
The basic order with the label s, if any.
Equations
- WordOrder.Arrangement.ofLabel? s = List.find? (fun (x : WordOrder.Arrangement WordOrder.Constituent 3) => decide (x.label = s)) WordOrder.Arrangement.basicOrders