- TuTh 12:30-13:50 in the Comp Ling Lab in SBS N250
- Office Hours MW 4:30-6pm in IACS L160
- Syllabus
- Useful Links for github, markdown, LaTeX, and Haskell
- Jacob Rowen: jacob.rowen@stonybrook.edu
- Office Hours TuTh 4-5pm in the Seminar Room or by request
- Han Li: han.li.4@stonybrook.edu
- Office Hours by request
- Student presentations
- We reviewed monoids (and semirings) for generalized deterministic (and non-deterministic) string transducers.
- We studied transducer composition.
- Additional optional reading: Computational Phonology
- We finished our discussion of algebraic characterizations of subseqeuntial functions.
- We began our discussion of algebraic characterizations of subseqeuntial functions.
- We studies tier-extensions of classes of languages and algrbraic characterizations thereof. A tier is a subset of the alphabet; these are the symbols that are salient. Non-tier symbols are non-salient/inert/irrelevant; they are called neutral in the computer science literature.
- Given a tier T, the tier projection of a string
a₁a₂...aₙis the stringb₁b₂...bₙwhere eachbᵢequalsaᵢwhenaᵢ ∈ Tand equals the empty string whenaᵢ ∈ Σ/T. Given a tier T, the inverse tier projection of a stringa₁a₂...aₙapplies arbitrarily many finitely insertions and deletions of neutral symbols to thea₁a₂...aₙ. In other words the inverse tier projection ofa₁a₂...aₙis the language L such that for anyw ∈ L, the tier projection ofwequals the the tier projection ofa₁a₂...aₙ. - The main lessons:
- Any formal class of languages C can be "tierified" to make a new
class TC. Given C, TC is the class of languages obtained by
taking any
L ∈ Cand anyT ⊆ Σand adding the inverse tier projection ofLto TC. - Given a minimal DFSA for a language L, the neutral elements never change the state of the DFSA. In other words, they are self-loops on ALL the states. Consequently, they are the identity element in the syntactic semigroup. This provides (in my view) a very natural and sound basis for tiers mathematically.
- If C has an algebraic characterization, then TC has one too. To see whether L belongs to TC, build the syntactic semigroup for L as before. Then remove the identity element from the semigroup (provided no non-neutral elements multiply to it) and check whether the resulting semigroup belongs to C. If so, then L belongs to TC.
- Checking multitier definite is slighlty more complicated. It
comes down to wrapping each
xwith variabless,tas insxtto ensure that the tier elements are being considered. In any case, key equations are given in Lambert forthcoming as well as Lambert's disseratation and other resources available at dakotahlambert.com.
- Any formal class of languages C can be "tierified" to make a new
class TC. Given C, TC is the class of languages obtained by
taking any
- We considered two examples.
- We saw that the constraint that words contain at most one stress
was Tier-(co/Finite). Logically, it can be expressed as
\/{[́σ]%||%<>, [́σ]%||%<́σ>}. - We saw that symmetric harmony (such as sibilant harmony in
Navajo) can be expressed as Multi-tier-(co/Finite). Logically, it
can be expressed as
\/{[s]%||%<>, [ʃ]%||%<>}. This is in addition to its other characterizations as SP and TSL, which are given logically as/\{~<s, ʃ>, ~<ʃ, s>}and/\{~[s,ʃ]<s ʃ>, ~[s,ʃ]<ʃ s>}, respectively.
- We saw that the constraint that words contain at most one stress
was Tier-(co/Finite). Logically, it can be expressed as
- For next week, please read
- ISL functions are definite functions (Lambert and Heinz 2023)
- Some OSL functions are tier-definite/tier-reverse definite (Lambert and Heinz 2024)
- Following, Lambert forthcoming, we explained that in general many classes of formal languages, but not necessarily all, will have an algebraic characterization. In particular, the syntactic semigroups of the languages belonging to the class will have some property that languages not belonging to the class will not have.
- These characterizations are expressed in terms of equations that must be satsisfied by every instantion of the variables in the equations with every element in the semigroup.
- For k-definite languages, the equation is
[sx₁x₂...xₖ=x₁x₂...xₖ]. Note this hask+1variables which means as thekincreases the check gets very expensive since therenᵏcombinations to check when the semigroup hasnelements. - Idempotents are semigroup elements
xsuch thatx=xx. The "omega" inx^ωis an operation that returns the idempotent obtained by multiplyingxwith itself over and over again. In every finite semigroup, for all elementsxin the semigroup, there exists exactly one idempotent of the formxⁿwithn > 1. - Then definite languages are characterized by the equation is
[sx^ω=x^ω]. - We discussed similar equations for the reverse definite and generalized definite classes of languages.
- We discussed the Nerode equivalence relation, and explained how the blocks in the partition it induces over Σ* corresponds to the states in the minimal DFSA.
- We discussed the Myhill equivalence relation, and explained how it is a refinement of the Nerode relation. The blocks here correspond to the elements of the syntactic semigroup. These blocks are well-behaved under concatenation. (The Myhill blocks form a congruence, whereas the Nerode blocks form a left congruence.)
- We finished our discussion of minimizaton of DFSA.
- For next Thursday, please do HW09 on DFSA completion, complement, union, and intersection.
- We discussed determinization of NFSA, and minimizaton of DFSA the course notes).
- Kozen 1997 is an additional resource on determinization and minimization (see chapters 5,6 and 13,14).
- We introduced NFSA (pages 39-40 in the course notes).
- We reviewed the logical operations of negation, conjunction, and disjunction, and how they relate to complement, intersection, and union.
- We designed a logical language (piecewise local like expressions) for the Locally Testable and Piecewise Testable languages
- We explained how it could be implemented with the operations we have studied. And how the expressions have a tree structure that could be interpreted as strings on the one hand, and as DFSA on the other.
- We looked at some basic code for DFSA using the record syntax from HW09
- We studied how to take a DFSA and make it complete.
- We studied how to find the complement of a DFSA and how to find the union and intersection of two DFSA using the product construction.
- The operations for DBFTA are the same. There is one issue with respect to complement, however.
- The complement of a DBFTA cannot be made with respect to Σᵀ. This is
because Σᵀ has no bound on the branching degree of its trees. The
complement of a DBFTA cannot be made with respect to Σᵀⁿ (⊂ Σᵀ) of
trees limited to ones whose maximal branching degrees less than
n.
- We discussed Strictly Local, Definite, Reverse Definite, and Generalized Definite classes from Lambert forthcoming
- We continued to discuss plebby expressions.
- We reviewed solutions to the RE expression for "all and only those strings with no 'aa' substring."
- We reviewed the kinds of expression grammars from last time.
- We introduced plebby expressions (pages 15-16 in the course notes).
- Read Lambert forthcoming for Tuesday after break. Supplementary materials are here.
- We discussed chapter 13 on higher order functions.
- For next Thursday, please do HW08 on deterministic bottom up tree transducers.
- We introduced the original regular expression, cat-union expressions, generalized regular expressions and star-free expressions (pages 13-15 in the course notes).
- We discussed the theorems that relate the expressivity of these formalisms.
- We discussed HW07.
- We reviewed deterministic bottom up tree transducers.
- We reviewed deterministic string transducers by studying a machine that nasalizes vowels before nasal consonants. This led us to introduce the notion of 'pausing/holding' output until the following context is read, which disambiguates what output to produce.
- We considered the issue that arises for a process intended to nasalize a span of vowels of arbitrarily length prior to a nasal vowel.
- We explained how deterministic transducers can process strings
either left-to-right or right-to-left.
- An unbounded series of changes triggered by a left context is possible to express with a left-to-right DFST.
- An unbounded series of changes triggered by a right context is possible to express with a right-to-left DFST,
- We then defined deterministic bottom-up tree transducers, which utilize the concepts of trees with variables in the leaves and tree substitution into those variables. We looked at two examples, the latter of which was a simplified version of wh-movement.
- For Tuesday, please do HW07.
- Also we will discuss Chapter 13 of Sanella et al. 2021 on further abstractions next Tuesdady as well.
- Class is canceled because of the blizzard "of the century."
- HW06 is now due Thursday Feb 26.
- We discussed higher order functions, partial application, and nameless functions using lambda expressions.
- We finished our intro discussion of deterministic string tree transducers by discussing some examples.
- For Tuedsay, please complete HW06 on implementing deterministic string and tree acceptors.
- For Tuesday, please read Chapter 13 of Sanella et al. 2021 on further abstractions.
- We had a Q&A about chapter 5 of Sanella et al. 2021.
- We discussed deterministic string tree transducers, which are the first parts of Chapters 6 of the course notes.
- For Thursday, please complete HW05 on Hawaiian phonotactics.
- For Thursday, please read Chapter 12 of Sanella et al. 2021 on Higher-Order Functions. Focus on the later section regarding folds and partial application.
- We had a Q&A about HW04.
- We reviewed a couple exercises over trees from Exercise 19 in chapter 3 of the course notes).
- We introduced deterministic, finite-state acceptors (Chapter 4, beginning only) and deterministic, finite-state, bottom-up tree acceptors (Chapter 5, beginning only) from the the course notes).
- For next Tuesday, please finish HW04 and the Chapter reading of Sanella et al. 2021 on Lists and Comprehensions.
- We had a Q&A about chapter 3 of Sanella et al. 2021.
- We discussed HW03.
- We introduced Haskell list notation.
- We defined some additional functions on trees.
- For next Tuesday
- Complete HW04.
- Read Chapter 5 of Sanella et al. 2021 on Lists and Comprehensions.
- We defined functions
addOneandtimesTwofor strings (Exercise 18 in chapter 3 of the course notes). - We defined functions
sumandproductfor strings (Exercise 19 in chapter 3 of the course notes) - We generalized those functions to the higher order functions
mapandfoldrespectively. (Note thisfoldis calledfoldrin Haskell.)map :: (a -> b) -> Seq a -> Seq bfold :: (a -> b -> b) -> b -> Seq a -> b
- We showed:
addOne = map (+1)timesTwo = map (*2)sum = fold (+) 0product = fold (*) 1
- We defined trees as recursive data structures, and reviewed how the size of a tree can be computed recursively.
- For next Tuesday, please complete
HW03. You don't
need to define
maporfoldhere. It is fine to provide direct working definitions of the requested functions.
- We discussed exercise 1 of Chapter 2 of Sanella et al. 2021.
- We reviewed the definition of strings in Chapter 3 of the course notes.
- We discussed how functions like
replicate,take, anddropcan be defined recursively. - For Thursday, please complete HW02.
- Today had some Q&A about Chapter 1 of Sanella et al. 2021.
- We then discussed
ghciandghc, as well as.lhsand.hshaskell file, using this very brief getting started guide. - We then introduced types in Haskell (Chapter 2 of Sanella et al. 2021.). We discussed types, polymorphic types, type classes, and type constructors.
- Then we provided a recursive definition of strings, as well as an accompanying definition of the length of strings from the beginning of chapter 3 of the course notes. We observed how the structure of the computation of length parallels the recursive data structure.
- For Tuesday please do exercise 1 in Chapter 2 of Sanella et al. 2021 following the more specific directions in the HW01 repo.
- Today we introduced the course and went over the syllabus.
- {strings, trees} x {acceptors, transducers} x {determinism, non-determinism} + algebraic classifications + natural language phonology, morphology, syntax
- intro slides
- Supplemental readings (not required, but may provide useful perspective)
- Cheng 2015 on abstraction
- Cormen 2013 on algorithms
- Garey and Johnson 1979 on time complexity
- Stabler 2019 on the importance of trees for syntax
- Graf 2022 on subregular linguistics
- Heinz 2025 on subregular phonology
- Bird and Gibbons 2020 p.xv: "Algorithms in real life are a good deal more intricate than the ones presented in this book. The shortest-path algorithm in a satellite navigation system is a good deal more complicated than a shortest-path algorithm as presented in a textbook on algorithm design. Real-life algorithms have to cope with the problems of scale, with the effective use of a computer’s hardware, with user interfaces, and with many other things that go into a well-designed and useful product. None of these aspects is covered in the present book, nor indeed in most books devoted solely to the principles of algorithm design."
- For Thursday:
- Review chapter 1 of Sanella et al. 2021 on sets, relations, and functions.
- Please make sure you have a github account set up and send me your username so I can add you to the "Compling2-Spring2026-SBU" github organization.
- Install Haskell using GHCup. Instructions are here. If you need assistance, please let us know asap. Windows users may want to install the Windows Subsystem for Linux or set up a Virtual Machine with a Linux distribution (such as Ubuntu) running on it. Instructions for how to install Ubuntu on a virtual machine are here.
- How do you know if you were able to install Haskell successfully?
Open a terminal window, and at the command line, do the following.
$ ghci GHCi, version 9.2.8: https://www.haskell.org/ghc/ :? for help ghci> take 5 [1 .. ] [1,2,3,4,5] ghci>