# HG changeset patch # User Christian Urban # Date 1351046433 -3600 # Node ID 93fc2f18e129e58029b1a663cb2e928db0b9cfc6 # Parent 5529cfb2a81e3700825b41f33962c31c9a60ad7e tuned diff -r 5529cfb2a81e -r 93fc2f18e129 automata.scala --- a/automata.scala Sat Oct 20 16:44:39 2012 +0100 +++ b/automata.scala Wed Oct 24 03:40:33 2012 +0100 @@ -90,6 +90,17 @@ val A = mk_automaton(ALT("ab","ac")) +A.start +A.states.toList.length + println(A.accepts("bd")) println(A.accepts("ab")) println(A.accepts("ac")) + +val r1 = STAR(ALT("a","b")) +val r2 = SEQ("b","b") +val r3 = SEQ(SEQ(SEQ(r1, r2), r1), "a") +val B = mk_automaton(r3) + +B.start +B.states.toList.length diff -r 5529cfb2a81e -r 93fc2f18e129 hw04.tex --- a/hw04.tex Sat Oct 20 16:44:39 2012 +0100 +++ b/hw04.tex Wed Oct 24 03:40:33 2012 +0100 @@ -93,15 +93,12 @@ % explain what is a context-free grammar and the language it generates % -% What does it mean for two regular expressions to be equivalent. % % Define the language L(M) accepted by a deterministic finite automaton M. % -% Draw a parse tree for.... % % does (a + b)*b+ and (a*b+) + (b*b+) define the same language -% -% What does it mean for a grammar to be ambiguous + \end{document} diff -r 5529cfb2a81e -r 93fc2f18e129 slides04.pdf Binary file slides04.pdf has changed