Music as a Formal Language

Similar documents
ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam

1. (a) Explain the procedure to convert Context Free Grammar to Push Down Automata.

Peter Wood. Department of Computer Science and Information Systems Birkbeck, University of London Automata and Formal Languages

Introduction to Computers & Programming

SCHEME FOR INTERNAL ASSESSMENT TEST 3

Regular expressions and automata

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Introduction to Automata

Computability and Complexity

Pushdown Automata. Notes on Automata and Theory of Computation. Chia-Ping Chen

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY

CMSC 330: Organization of Programming Languages. Pushdown Automata Parsing

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES

Foundations of Informatics: a Bridging Course

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Finite-state Machines: Theory and Applications

Discrete Mathematics. CS204: Spring, Jong C. Park Computer Science Department KAIST

5 Context-Free Languages

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Theory of Computation

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs

NPDA, CFG equivalence

(b) If G=({S}, {a}, {S SS}, S) find the language generated by G. [8+8] 2. Convert the following grammar to Greibach Normal Form G = ({A1, A2, A3},

Turing machines and linear bounded automata

Properties of Context-Free Languages. Closure Properties Decision Properties

Harvard CS 121 and CSCI E-207 Lecture 10: Ambiguity, Pushdown Automata

CSCE 551: Chin-Tser Huang. University of South Carolina

60-354, Theory of Computation Fall Asish Mukhopadhyay School of Computer Science University of Windsor

Computability and Complexity

CPS 220 Theory of Computation

The Emptiness Problem for Valence Automata or: Another Decidable Extension of Petri Nets

Part 4 out of 5 DFA NFA REX. Automata & languages. A primer on the Theory of Computation. Last week, we showed the equivalence of DFA, NFA and REX

1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u,

Finite-state machines (FSMs)

CS21 Decidability and Tractability

CPS 220 Theory of Computation Pushdown Automata (PDA)

Ogden s Lemma for CFLs

Finite State Machines Transducers Markov Models Hidden Markov Models Büchi Automata

CSE 105 THEORY OF COMPUTATION

Rational graphs trace context-sensitive languages

Automata Theory (2A) Young Won Lim 5/31/18

Decidability (intro.)

Formal Models in NLP

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

MA/CSSE 474 Theory of Computation

ACS2: Decidability Decidability

4.2 The Halting Problem

DM17. Beregnelighed. Jacob Aae Mikkelsen

Turing machines and linear bounded automata

Pushdown Automata (2015/11/23)

Before We Start. The Pumping Lemma. Languages. Context Free Languages. Plan for today. Now our picture looks like. Any questions?

Harvard CS 121 and CSCI E-207 Lecture 9: Regular Languages Wrap-Up, Context-Free Grammars

Final exam study sheet for CS3719 Turing machines and decidability.

FINITE STATE AUTOMATA

The Pumping Lemma. for all n 0, u 1 v n u 2 L (i.e. u 1 u 2 L, u 1 vu 2 L [but we knew that anyway], u 1 vvu 2 L, u 1 vvvu 2 L, etc.

6.1 The Pumping Lemma for CFLs 6.2 Intersections and Complements of CFLs

Applied Computer Science II Chapter 1 : Regular Languages

Introduction to the Theory of Computing

Pushdown Automata: Introduction (2)

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

Computational Models - Lecture 4

Introduction to Theory of Computing

Chapter Five: Nondeterministic Finite Automata

Theory of Computation (IV) Yijia Chen Fudan University

Theory of Computation

Context Sensitive Grammar

MTH401A Theory of Computation. Lecture 17

Improved TBL algorithm for learning context-free grammar

INF210 Datamaskinteori (Models of Computation)

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

CSCI 1590 Intro to Computational Complexity

3130CIT Theory of Computation

Einführung in die Computerlinguistik

3515ICT: Theory of Computation. Regular languages

Finite State Machines 2

CS Lecture 28 P, NP, and NP-Completeness. Fall 2008

acs-07: Decidability Decidability Andreas Karwath und Malte Helmert Informatik Theorie II (A) WS2009/10

CS:4330 Theory of Computation Spring Regular Languages. Finite Automata and Regular Expressions. Haniel Barbosa

A representation of context-free grammars with the help of finite digraphs

FLAC Context-Free Grammars

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

Complexity of Natural Languages Mildly-context sensitivity T1 languages

Decidability (What, stuff is unsolvable?)

Introduction to Theoretical Computer Science. Motivation. Automata = abstract computing devices

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed

CS5371 Theory of Computation. Lecture 7: Automata Theory V (CFG, CFL, CNF)

UNIT-VIII COMPUTABILITY THEORY

October 6, Equivalence of Pushdown Automata with Context-Free Gramm

Syntax Analysis Part I


Theory of Languages and Automata

Computability and Complexity

Chapter 3. Regular grammars

Introduction and Motivation. Introduction and Motivation. Introduction to Computability. Introduction and Motivation. Theory. Lecture5: Context Free

CDM Parsing and Decidability

Computability and Complexity

Theory of Computation

INF Introduction and Regular Languages. Daniel Lupp. 18th January University of Oslo. Department of Informatics. Universitetet i Oslo

Turing machines and linear bounded automata

Transcription:

Music as a Formal Language Finite-State Automata and Pd Bryan Jurish moocow@ling.uni-potsdam.de Universität Potsdam, Institut für Linguistik, Potsdam, Germany pd convention 2004 / Jurish / Music as a formal language p. 1/19

Overview The Big Idea: Music as a Formal Language A Brief Tour of Formal Language Theory Finite-State Machines The pd-gfsm Pd Externals Future Directions Concluding Remarks pd convention 2004 / Jurish / Music as a formal language p. 2/19

The Big Idea Music as a formal language Syntactic characterization Generic musical structure Formal languages for music Expressive power Practical requirements Applications Open Questions Cognitive plausibility? Musical language spoken language? pd convention 2004 / Jurish / Music as a formal language p. 3/19

Formal Language Theory Alphabets and Strings Finite (terminal) Alphabet Σ = {a 1,..., a n } Free Monoid Σ, (finite strings over Σ) Formal Languages Formal Language L Σ Grammars and Automata Grammar G = V, Σ, P, S generates language L = L(G) by production rules α β P Automaton M = Q, Σ, Γ, δ, q 0, F recognizes language L = L(M) by transition rules δ pd convention 2004 / Jurish / Music as a formal language p. 4/19

Chomsky Inclusion Hierarchy Turing Machines Linear Bounded Turing Machines Pushdown Automata Finite-State Automata Type-0 { w, M w L(M)} Type-1 {ww w Σ } Type-2 {a n b n n } Type-3 {a n n } Rule Grammars Context-Sensitive Grammars Context-Free Grammars Regular Grammars pd convention 2004 / Jurish / Music as a formal language p. 5/19

Musical Structure Tone Dependencies Context-Free Non-Context-Free Musical Languages ML CFL pd convention 2004 / Jurish / Music as a formal language p. 6/19

Context-Sensitive Languages Indexed Languages (IL) {a 2n n } Type-1 (CSL) {a n! n } MCSL Convergent MCSLs (T AL = LIL = HL = CCL) {a n b n c n d n n } Type-2 (CF L) {a p p prime } Linear CF Rewrite Languages (LCF RL) {www w a Dyck word} pd convention 2004 / Jurish / Music as a formal language p. 7/19

Practical Considerations Improvisation Property Flexibility Mutability Given a valid prefix v Σ of a word vw L, it is decidable in constant time for each a Σ whether there is a w Σ such that vaw L. Amounts to incremental computability. Minimize requirements on what might constitute musical structure. Enable efficient runtime change of language structure. pd convention 2004 / Jurish / Music as a formal language p. 8/19

Finite-State Machines Finite-State Acceptor (FSA) A = Q, Σ, δ, q 0, F Q a finite set of states, Σ a finite terminal alphabet, δ : Q Σ 2 Q a finite transition function, q 0 a distinguished initial state, and F Q a set of final states. Rooted directed graph with edge labels in Σ. Finite-State Transducer (FST) M = Q, Σ, Γ, δ, q 0, F Basically an FSA with edge labels in Σ Γ. Weighted FSMs Extend δ by marking each arc with a weight w. pd convention 2004 / Jurish / Music as a formal language p. 9/19

Finite State Machines: Example A Recognizer for Simple Cadences IV/1 I/1 0 1 V/1 V/0.3 IV/0.7 3 2 pd convention 2004 / Jurish / Music as a formal language p. 10/19

Finite State Machines: Applications Markov Chains weighted FSAs incremental stochastic sequence generation Hidden Markov Models weighted FSTs runtime quantization and classification Rational Transformations control message rewrite rules Regular Expressions user-interface specifications pd convention 2004 / Jurish / Music as a formal language p. 11/19

The pd-gfsm Library gfsm alphabet NAME Maps Pd atoms integer labels AT&T text format I/O gfsm automaton NAME Weighted finite-state transducer AT&T text and native binary format I/O Suitable for large machines ( 3 million states) gfsm state NAME STATE ID Holds current state for incremental processing gfsm markov NAME Trainable Markov chain patch pd convention 2004 / Jurish / Music as a formal language p. 12/19

gfsm markov Example 1 Simple 12-Bar Blues C, F, C, C, F, F, C, C, G, F, C, G, C symbol add $1 gfsm_markov m1 0 C:-/2 C:-/1 0 C G:-/2 C:-/1 G F:-/2 C:-/3 F:-/1 F:-/1 F pd convention 2004 / Jurish / Music as a formal language p. 13/19

gfsm markov Example 2 12-Bar Blues with upper duration labels C 1, F 1, C 2, F 2, C 2, G 1, F 1, C 1, G 1, C 1 any2list add $1 $2 gfsm_markov m1 0 G:1/2 C:1/1 G F:1/1 C:1/1 0 C F:2/1 F:1/1 C:1/1 C:2/2 F pd convention 2004 / Jurish / Music as a formal language p. 14/19

gfsm markov Example 3 12-Bar Blues with complex state labels C.1, F.1, C.2, F.2, C.2, G.1, F.1, C.1, G.1, C.1 symbol add $1 gfsm_markov m1 0 C.1:-/1 0 C.1 G.1:-/1 C.1:-/1 G.1 F.1:-/1 C.1:-/1 F.1:-/1 G.1:-/1 F.1 C.2:-/1 C.2 F.2:-/1 C.2:-/1 F.2 pd convention 2004 / Jurish / Music as a formal language p. 15/19

Future Directions FSM Operations Algebra: compose, intersect, remove-ε Continuous FSMs Threading Compilers & Interfaces Regular Expressions 2-Level Rules Graphical Editor Stochastic Modelling Viterbi Algorithm Baum-Welch Re-estimation pd convention 2004 / Jurish / Music as a formal language p. 16/19

Concluding Remarks Expressive Power RL CFL ML MCSL PDL = T L Practical Considerations Improvisability Flexibility Mutability Embedded Implementation pd-gfsm FSMs (weak) in Pd (strong) Best of both worlds pd convention 2004 / Jurish / Music as a formal language p. 17/19

The End pd convention 2004 / Jurish / Music as a formal language p. 18/19

Mild Context-Sensitivity For every mildly context-sensitive L MCSL: Contstant Growth There is a fixed upper bound j on the minimum length difference between two words of L. Intuition: j length of a measure. Polynomial Parsing Time w? L is decidable in O( w k ) time for some k. Too weak? Improvisation property Bounded Cross-Serial Dependencies There is an upper bound m on the number of cross-serial structural dependencies exhibited by words of L. Too strong? Theme and Variation pd convention 2004 / Jurish / Music as a formal language p. 19/19