Finite State Automata - From Theory to Code

Finite State Automata - From Theory to Code

9.975 Lượt nghe
Finite State Automata - From Theory to Code
This video presents in detail the creation of a general-purpose state machine using JavaScript. The result is code that we can quickly adapt to any finite automata by changing a few constants. This code can be tested in the W3Schools' JavaScript Online Editor https://www.w3schools.com/js/js_editor.asp. GitHub Source Code: https://github.com/intermation/video_examples/tree/main/fsa2js Timestamps 00:00 | Intro 00:11 | Problem statement 03:38 | Why we're using JavaScript 06:26 | Review of what it takes to represent an FSM 08:57 | Representing states in our code 12:41 | Representing input alphabet in our code 13:24 | Representing transition functions in our code 15:58 | A brief word about output 16:22 | JavaScript template starting point 16:51 | Defining the State array 17:50 | Defining the initial state and accepting states 18:40 | Defining the input alphabet string 18:50 | Defining the transition table 20:25 | Writing the transition function - returnNextState() 23:18 | Writing the code to simulate the actual machine 29:45 | Handling errors in input stream characters 32:22 | Demonstrating the code in a browser Hashtags #javascript #state #machine