Context-Free Languages via Coalgebraic Trace Semantics
We show that, for functors with suitable mild restrictions, the initial algebra in the category of sets and functions gives rise to the final coalgebra in the (Kleisli) category of sets and relations. The finality principle thus obtained leads to the finite trace semantics of non-deterministic systems, which extends the trace semantics for coalgebras previously introduced by the second author. We demonstrate the use of our technical result by giving the first coalgebraic account on context-free grammars, where we obtain generated context-free languages via the finite trace semantics. Additionally, the constructions of both finite and possibly infinite parse trees are shown to be monads. Hence our extension of the application domain of coalgebras identifies several new mathematical constructions and structures.
KeywordsParse Tree Shapely Functor Main Technical Result Initial Algebra Trace Semantic
Unable to display preview. Download preview PDF.
- [ASU86]Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley series in Computer Science. Addison-Wesley, Reading (1986)Google Scholar
- [Bar04]Bartels, F.: On Generalized Coinduction and Probabilistic Specification Formats: Distributive Laws in Coalgebraic Modelling. PhD thesis, Free Univ. Amsterdam (2004)Google Scholar
- [BW83]Barr, M., Wells, C.: Toposes, Triples and Theories. Springer, Heidelberg (1983), Available free for downloading at http://www.cwru.edu/artsci/math/wells/pub/ttt.html
- [Jac04a]Jacobs, B.: Relating two approaches to coinductive solution of recurisve equations. In: Coalgebraic Methods in Computer Science (CMCS 2004). Elect. Notes in Theor. Comp. Sci, vol. 106. Elsevier, Amsterdam (2004)Google Scholar
- [Jac04b]Jacobs, B.: Trace semantics for coalgebras. In: Coalgebraic Methods in Computer Science (CMCS 2004). Elect. Notes in Theor. Comp. Sci, vol. 106. Elsevier, Amsterdam (2004)Google Scholar
- [Jac05a]Jacobs, B.: A bialgebraic review of regular expressions, deterministic automata and languages. Techn. Rep. NIII-R05003, Inst. for Computing and Information Sciences, Radboud Univ. Nijmegen (2005)Google Scholar
- [Jac05b]Jacobs, B.: Introduction to coalgebra. Towards mathematics of states and observations. Draft of a book (2005), http://www.cs.ru.nl/B.Jacobs/PAPERS/index.html
- [Wor]A. (Sokolova) Woracek. Personal communicationGoogle Scholar