Docs / Syntax / Category / Numeral / Grammar

The grammar of numerals

import Linglib.Syntax.Category.Numeral.Grammar · namespace Numeral

A recursive numeral system builds its numerals from two stocks of morphemes, the digits and the multipliers, by Hurford's phrase-structure rules: a NUMBER is a digit or a PHRASE, optionally followed by another NUMBER, and denotes the sum of its parts; a PHRASE is a multiplier, optionally preceded by a NUMBER, and denotes their product. The rules generate many numerals for each number. Hurford's Packing Strategy selects among them by requiring the sister of every NUMBER to have the highest value the multipliers allow under the value of the node above it. Dividing by the highest multiplier that fits and treating quotient and remainder the same way builds a packed numeral, and where the digits are a counting sequence and the multipliers have distinct values every packed numeral is built so, up to whether one is pronounced before a multiplier.

Main definitions

Implementation notes

The leaves of a numeral are morphemes, and a function v gives the number each denotes, so the same numeral can be read over a language's words or over bare numbers. Digits and multipliers are lists; the theorems about ofValue take the digits to be a counting sequence, the word at position k denoting k + 1. ofValue returns a junk digit where the digits run out. The rule PHRASE − NUMBER of the later literature is not included.

References

The phrase-structure categories

L62–70
L70

A PHRASE is a multiplier, optionally preceded by a NUMBER, as in two hundred.

inductive PhraseL72–78
(α : Type u) :
  • base {α : Type u} (m : α) : Phrase α

    A multiplier is a PHRASE, as ten is.

  • mul {α : Type u} (n : Number α) (m : α) : Phrase α

    A NUMBER followed by a multiplier is a PHRASE.

Built from

Used by Number, instReprPhrase, instDecidableEqPhrase.decEq_2, instDecidableEqPhrase, instReprPhrase.repr_2, Phrase.head, Phrase.yield, Phrase.value, Phrase.Generated, Phrase.decGenerated, Phrase.count, Phrase.value_eq_count_mul, Phrase.Packed, Phrase.decPacked, Phrase.Packed.isHighestUnder, Phrase.deleteOne, Number.packed_digit_iff, Phrase.count_pos, Number.packed_add_iff

The value of a NUMBER is the sum of its immediate constituents, where v gives the values of the morphemes.

def Number.valueL101–106
{α : Type u} (v : α → ℕ) :
Number α → ℕ

Built from ,

Used by Phrase.value, Phrase.count, Phrase.Packed, Phrase.decPacked, Phrase.deleteOne, Number.value_ofValue, Number.value_pos, Number.Packed.ofValue_value, Number.Packed.deleteOne_eq_of_value_eq, Number.packed_add_iff

Used in Hurford2007, IoninMatushansky2006

A NUMBER is generated from the digits D and the multipliers M.

def Number.GeneratedL115–119
{α : Type u} (D M : List α) :
Number α → Prop

Built from ,

Used by Phrase.Generated, Number.decGenerated, Phrase.decGenerated, instDecidablePredNumberGeneratedOfDecidableEq, Number.generated_ofValue, Number.value_pos, Number.Packed.ofValue_value, Number.Packed.deleteOne_eq_of_value_eq

Used in Hurford2007

L128–135
L137–142
L154–156

The Packing Strategy

m is a multiplier of the highest value not above the ceiling x.

def IsHighestUnderL161–163
{α : Type u} (v : α → ℕ) (M : List α) (x : ℕ) (m : α) :
  • IsHighestUnder v M x m = MaximalFor (fun (m : α) => m ∈ M ∧ v m ≤ x) v m

Used by isHighestUnder_iff, IsHighestUnder.mem, IsHighestUnder.value_le, IsHighestUnder.le_value, isHighestUnder_self, IsHighestUnder.of_le, IsHighestUnder.succ, instDecidableIsHighestUnderOfDecidableEq, isHighestUnder_of_highestUnder_eq_some, IsHighestUnder.highestUnder_eq, Phrase.Packed, Phrase.decPacked, Phrase.Packed.isHighestUnder, Number.ofValue_mul_add

L165–168
L170
L172
L174–176
L178–179
L181–184
L186–191
L193–194
L201–202
L204–208
L210–217

A NUMBER is packed when the sister of every NUMBER in it has the highest possible value, the Packing Strategy (82) of Hurford 1975, p. 67. A digit is packed only where no multiplier fits under it; a PHRASE followed by a NUMBER has the highest multiplier under the value of the whole, and leaves a remainder below that multiplier.

def Number.PackedL221–229
{α : Type u} (v : α → ℕ) (M : List α) :
Number α → Prop

The definition is too large to print here; read it in the source.

Built from ,

Used by Phrase.Packed, Number.decPacked, Phrase.decPacked, instDecidablePredNumberPackedOfDecidableEq, Number.packed_ofValue, Number.Packed.ofValue_value, Number.Packed.deleteOne_eq_of_value_eq, Number.packed_digit_iff, Number.packed_add_iff

Used in Hurford2007

A PHRASE is packed when its multiplier is the highest under its value and its NUMBER is packed.

def Phrase.PackedL231–235
{α : Type u} (v : α → ℕ) (M : List α) :
Phrase α → Prop

Built from , , ,

Used by Number.Packed, Phrase.decPacked, instDecidablePredPhrasePackedOfDecidableEq, Phrase.Packed.isHighestUnder, Number.packed_digit_iff, Number.packed_add_iff

L249–254

One before a multiplier

deleteOne leaves every one before a multiplier unpronounced, so that [one M] is the bare multiplier, Hurford's 1-Deletion.

def Number.deleteOneL270–275
{α : Type u} (v : α → ℕ) :
Number α → Number α

Built from ,

Used by Phrase.deleteOne, Number.Packed.ofValue_value, Number.Packed.deleteOne_eq_of_value_eq

Used in Hurford2007

The packed numeral of a value

ofValue v D M x is the packed NUMBER of value x. Where no multiplier fits under x it is the digit at position x of the counting sequence D; otherwise it is as many of the highest multiplier that fits as go into x, followed by the remainder, the count and the remainder being built the same way and a count of one being left unpronounced.

@[irreducible] def Number.ofValueL286–302
{α : Type u} (v : α → ℕ) (D M : List α) [Inhabited α] (x : ℕ) :

The definition is too large to print here; read it in the source.

Built from

Used by Number.ofValue_of_forall_lt, Number.ofValue_of_highestUnder_eq_some, Number.ofValue_mul_add, Number.packed_ofValue, Number.value_ofValue, Number.generated_ofValue, Number.Packed.ofValue_value

Used in Hurford2007

L305–312
L318–325
L340–349

The numeral built by dividing by the highest multiplier that fits is packed.

theorem Number.packed_ofValueL391–394
{α : Type u} {v : α → ℕ} {D M : List α} {x : ℕ} [Inhabited α] (hS : IsSystem v D M) (hx : 0 < x) :
Packed v M (ofValue v D M x)

Built from , ,

L396–398
L400–402
L406–414

In a numeral system a packed NUMBER is the one built from its value, up to whether one is pronounced before a multiplier: its multiplier is the highest that fits, its count the quotient and its remainder the remainder.

theorem Number.Packed.ofValue_valueL416–445
{α : Type u} {v : α → ℕ} {D M : List α} [Inhabited α] (hS : IsSystem v D M) {e : Number α} :
Packed v M e → Generated D M e → ofValue v D M (value v e) = deleteOne v e

Built from , , , , , ,

L447–453

Hurford's formulation

Hurford 1975's (82) rules out a node of value x whose daughters are a NUMBER and a sister of value y when some well-formed structure of a category other than NUMBER that the node expands to has a value z with y < z ≤ x. At a NUMBER the sister is a digit or a PHRASE, and (82) agrees with Number.Packed.

L462–466
L468–470
L472–511