<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to DFA Introduction</title><link>https://sourceforge.net/p/javafsm/wiki/DFA%2520Introduction/</link><description>Recent changes to DFA Introduction</description><atom:link href="https://sourceforge.net/p/javafsm/wiki/DFA%20Introduction/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 13 Apr 2012 16:25:52 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/javafsm/wiki/DFA%20Introduction/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage DFA Introduction modified by Dimitri Papaioannou</title><link>https://sourceforge.net/p/javafsm/wiki/DFA%2520Introduction/</link><description>&lt;pre&gt;--- v7 
+++ v8 
@@ -20,8 +20,12 @@
 
     :::java
     DFABuilder&lt;String, Character&gt; builder = DFA.newDFA(alphabet);
-    builder.setInitialState("A").addFinalState("B").addTransition("A", "A", '0').addTransition("A", "B", '1')
-                .addTransition("B", "A", '1').addTransition("B", "B", '0');
+    builder.setInitialState("A").
+            addFinalState("B").
+            addTransition("A", "A", '0').
+            addTransition("A", "B", '1').
+            addTransition("B", "A", '1').
+            addTransition("B", "B", '0');
     DeterministicFiniteAutomaton&lt;String, Character&gt; machine = builder.build();
 
 If when calling "build" the automaton is not complete, the builder is going to throw a DFABuilderException.
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dimitri Papaioannou</dc:creator><pubDate>Fri, 13 Apr 2012 16:25:52 -0000</pubDate><guid>https://sourceforge.net846d48bdbf4851f2adb245edf960b16b5b02a246</guid></item><item><title>WikiPage DFA Introduction modified by Dimitri Papaioannou</title><link>https://sourceforge.net/p/javafsm/wiki/DFA%2520Introduction/</link><description>&lt;pre&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dimitri Papaioannou</dc:creator><pubDate>Fri, 13 Apr 2012 16:24:55 -0000</pubDate><guid>https://sourceforge.netc7245cd7cdfb8e35a44dbbbbd66475d2de3a695e</guid></item><item><title>WikiPage DFA Introduction modified by Dimitri Papaioannou</title><link>https://sourceforge.net/p/javafsm/wiki/DFA%2520Introduction/</link><description>&lt;pre&gt;--- v5 
+++ v6 
@@ -7,7 +7,7 @@
 Let A be an alphabet and S be a finite set of states. 
 A _State Transition Diagram_ is just a function mapping a symbol and a state to a state:
 
-delta: AxS -&gt; S
+_delta: AxS --&gt; S_
 
 A _DFA_ consists of such a State Transition Diagram together with an _initial state_ s0 in S, and a non-empty set of _final states_ also in S.
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dimitri Papaioannou</dc:creator><pubDate>Fri, 13 Apr 2012 16:23:38 -0000</pubDate><guid>https://sourceforge.net5427aefd559368c3d3422c732e104ce0de4d8639</guid></item><item><title>WikiPage DFA Introduction modified by Dimitri Papaioannou</title><link>https://sourceforge.net/p/javafsm/wiki/DFA%2520Introduction/</link><description>&lt;pre&gt;--- v4 
+++ v5 
@@ -34,4 +34,4 @@
     assertFalse(machine.accepts(BasicWord.fromString("1111")));
     assertFalse(machine.accepts(BasicWord.fromString("1010101")));
 
-Good, it seems to work :)
+
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dimitri Papaioannou</dc:creator><pubDate>Fri, 13 Apr 2012 16:23:13 -0000</pubDate><guid>https://sourceforge.net220618799df26ce63ad49a2061e5e379f313a9fb</guid></item><item><title>WikiPage DFA Introduction modified by Dimitri Papaioannou</title><link>https://sourceforge.net/p/javafsm/wiki/DFA%2520Introduction/</link><description>&lt;pre&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dimitri Papaioannou</dc:creator><pubDate>Fri, 13 Apr 2012 15:19:53 -0000</pubDate><guid>https://sourceforge.net1c54c931397dee560925fa4e249bf05eb3433647</guid></item><item><title>WikiPage Deterministic Finite Automaton modified by Dimitri Papaioannou</title><link>https://sourceforge.net/p/javafsm/wiki/Deterministic%2520Finite%2520Automaton/</link><description>&lt;pre&gt;--- v2 
+++ v3 
@@ -13,3 +13,25 @@
 
 So what's all this about?  Finite Automata are all about recognizing _languages_ over alphabets, where a language is simply a subset on the set of all words. In particular, FAs can recognize _regular expressions_. 
 It works as follows: You feed the DFA a string which is a sequence of symbols. The DFA sets itself in motion by starting at the initial state and following the transition diagram based on the set of symbols. If when symbols are accounted for, the DFA ends in one of the termination states, then it is a valid word. If not, then it is an invalid word.
+
+Let's make all this concrete with an example.
+Let A be the alphabet of two symbols A = {0,1}.
+We are going to build an FSA that recognizes the language that accepts all strings with an odd number of 1s. This is a simple machine with only two states. The DFA implementation here uses an abstract builder pattern:
+
+    :::java
+    DFABuilder&lt;String, Character&gt; builder = DFA.newDFA(alphabet);
+    builder.setInitialState("A").addFinalState("B").addTransition("A", "A", '0').addTransition("A", "B", '1')
+                .addTransition("B", "A", '1').addTransition("B", "B", '0');
+    DeterministicFiniteAutomaton&lt;String, Character&gt; machine = builder.build();
+
+If when calling "build" the automaton is not complete, the builder is going to throw a DFABuilderException.
+
+Now let's test out the automaton with some JUnite assert statements:
+
+    :::java
+    assertTrue(machine.accepts(BasicWord.fromString("1011")));
+    assertTrue(machine.accepts(BasicWord.fromString("0010000011000101")));
+    assertFalse(machine.accepts(BasicWord.fromString("1111")));
+    assertFalse(machine.accepts(BasicWord.fromString("1010101")));
+
+Good, it seems to work :)
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dimitri Papaioannou</dc:creator><pubDate>Fri, 13 Apr 2012 02:06:15 -0000</pubDate><guid>https://sourceforge.net36be18bd1aab00ffaeee68370467609594aee527</guid></item><item><title>WikiPage Deterministic Finite Automaton modified by Dimitri Papaioannou</title><link>https://sourceforge.net/p/javafsm/wiki/Deterministic%2520Finite%2520Automaton/</link><description>&lt;pre&gt;--- v1 
+++ v2 
@@ -11,4 +11,5 @@
 
 A _DFA_ consists of such a State Transition Diagram together with an _initial state_ s0 in S, and a non-empty set of _final states_ also in S.
 
-So what's all this about?  
+So what's all this about?  Finite Automata are all about recognizing _languages_ over alphabets, where a language is simply a subset on the set of all words. In particular, FAs can recognize _regular expressions_. 
+It works as follows: You feed the DFA a string which is a sequence of symbols. The DFA sets itself in motion by starting at the initial state and following the transition diagram based on the set of symbols. If when symbols are accounted for, the DFA ends in one of the termination states, then it is a valid word. If not, then it is an invalid word.
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dimitri Papaioannou</dc:creator><pubDate>Fri, 13 Apr 2012 01:57:14 -0000</pubDate><guid>https://sourceforge.neted064d0e7c4ccd44ec5da6b65448bbbcdc5e0c23</guid></item><item><title>WikiPage Deterministic Finite Automaton modified by Dimitri Papaioannou</title><link>https://sourceforge.net/p/javafsm/wiki/Deterministic%2520Finite%2520Automaton/</link><description>A Deterministic Finite Automaton (DFA) is a state diagram with some additional structure. Before jumping in the code some definitions are necessary:

An _Alphabet_ is a finite set of symbols. A symbol can be anything from a number to a rune, to a complex Java object.

A _word_ or _string_ in an alphabet A is a finite sequence of symbols of A.

Let A be an alphabet and S be a finite set of states. 
A _State Transition Diagram_ is just a function mapping a symbol and a state to a state:

delta: AxS -&gt; S

A _DFA_ consists of such a State Transition Diagram together with an _initial state_ s0 in S, and a non-empty set of _final states_ also in S.

So what's all this about?  
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dimitri Papaioannou</dc:creator><pubDate>Fri, 13 Apr 2012 01:50:32 -0000</pubDate><guid>https://sourceforge.netae052aad5bee264b1dfbf7cf61eb12466b62cdd3</guid></item></channel></rss>