An Interactive Approach to Formal Languages and Automata with JFLAP

Similar documents
A R "! I,,, !~ii ii! A ow ' r.-ii ' i ' JA' V5, 9. MiN, ;

COMPUTATIONAL COMPLEXITY OF LEFT-ASSOCIATIVE GRAMMAR

Grammars & Parsing, Part 1:

Syntax Parsing 1. Grammars and parsing 2. Top-down and bottom-up parsing 3. Chart parsers 4. Bottom-up chart parsing 5. The Earley Algorithm

Proof Theory for Syntacticians

CS 598 Natural Language Processing

Enumeration of Context-Free Languages and Related Structures

WSU Five-Year Program Review Self-Study Cover Page

Basic Parsing with Context-Free Grammars. Some slides adapted from Julia Hirschberg and Dan Jurafsky 1

GRAMMAR IN CONTEXT 2 PDF

Natural Language Processing. George Konidaris

Getting Started with Deliberate Practice

A Version Space Approach to Learning Context-free Grammars

11/29/2010. Statistical Parsing. Statistical Parsing. Simple PCFG for ATIS English. Syntactic Disambiguation

Grade 5 + DIGITAL. EL Strategies. DOK 1-4 RTI Tiers 1-3. Flexible Supplemental K-8 ELA & Math Online & Print

Computer Science 141: Computing Hardware Course Information Fall 2012

CS 446: Machine Learning

CS4491/CS 7265 BIG DATA ANALYTICS INTRODUCTION TO THE COURSE. Mingon Kang, PhD Computer Science, Kennesaw State University

Compositional Semantics

Language properties and Grammar of Parallel and Series Parallel Languages

Parsing of part-of-speech tagged Assamese Texts

A General Class of Noncontext Free Grammars Generating Context Free Languages

CS 101 Computer Science I Fall Instructor Muller. Syllabus

University of Groningen. Systemen, planning, netwerken Bosman, Aart

AQUA: An Ontology-Driven Question Answering System

Chinese Language Parsing with Maximum-Entropy-Inspired Parser

Context Free Grammars. Many slides from Michael Collins

Applying Learn Team Coaching to an Introductory Programming Course

GACE Computer Science Assessment Test at a Glance

Developing a TT-MCTAG for German with an RCG-based Parser

TOPICS LEARNING OUTCOMES ACTIVITES ASSESSMENT Numbers and the number system

BANGLA TO ENGLISH TEXT CONVERSION USING OPENNLP TOOLS

RANKING AND UNRANKING LEFT SZILARD LANGUAGES. Erkki Mäkinen DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF TAMPERE REPORT A ER E P S I M S

Radius STEM Readiness TM

TEACHING AND EXAMINATION REGULATIONS PART B: programme-specific section MASTER S PROGRAMME IN LOGIC

1.11 I Know What Do You Know?

Informatics 2A: Language Complexity and the. Inf2A: Chomsky Hierarchy

Learning, Communication, and 21 st Century Skills: Students Speak Up For use with NetDay Speak Up Survey Grades 3-5

COMMUNICATION & NETWORKING. How can I use the phone and to communicate effectively with adults?

Instructor: Mario D. Garrett, Ph.D. Phone: Office: Hepner Hall (HH) 100

CS Machine Learning

Lesson plan for Maze Game 1: Using vector representations to move through a maze Time for activity: homework for 20 minutes

Machine Learning and Data Mining. Ensembles of Learners. Prof. Alexander Ihler

Mathematics subject curriculum

A Neural Network GUI Tested on Text-To-Phoneme Mapping

CS 100: Principles of Computing

Self Study Report Computer Science

Course Content Concepts

Parsing with Treebank Grammars: Empirical Bounds, Theoretical Models, and the Structure of the Penn Treebank

The Strong Minimalist Thesis and Bounded Optimality

"f TOPIC =T COMP COMP... OBJ

Notetaking Directions

Designing a Computer to Play Nim: A Mini-Capstone Project in Digital Design I

Developing True/False Test Sheet Generating System with Diagnosing Basic Cognitive Ability

An Introduction to Simio for Beginners

cambridge occasional papers in linguistics Volume 8, Article 3: 41 55, 2015 ISSN

Carolina Course Evaluation Item Bank Last Revised Fall 2009

On the Polynomial Degree of Minterm-Cyclic Functions

Afm Math Review Download or Read Online ebook afm math review in PDF Format From The Best User Guide Database

A Framework for Customizable Generation of Hypertext Presentations

Learning to Think Mathematically With the Rekenrek

Computer Organization I (Tietokoneen toiminta)

BADM 641 (sec. 7D1) (on-line) Decision Analysis August 16 October 6, 2017 CRN: 83777

preassessment was administered)

Software Security: Integrating Secure Software Engineering in Graduate Computer Science Curriculum

Achievement Testing Program Guide. Spring Iowa Assessment, Form E Cognitive Abilities Test (CogAT), Form 7

ENGAGE. Daily Routines Common Core. Essential Question How can you use the strategy draw a diagram to solve multistep division problems?

Physics 270: Experimental Physics

Circuit Simulators: A Revolutionary E-Learning Platform

Treebank mining with GrETEL. Liesbeth Augustinus Frank Van Eynde

Chapter 4 - Fractions

Reinforcement Learning by Comparing Immediate Reward

Data Structures and Algorithms

The open source development model has unique characteristics that make it in some

arxiv: v1 [cs.cv] 10 May 2017

Get with the Channel Partner Program

Backwards Numbers: A Study of Place Value. Catherine Perez

Course Prerequisite: CE 2407 Adobe Illustrator or equivalent experience

The Interface between Phrasal and Functional Constraints

Study Guide for Right of Way Equipment Operator 1

Specification of the Verity Learning Companion and Self-Assessment Tool

systems have been developed that are well-suited to phenomena in but is properly contained in the indexed languages. We give a

Computer Software Evaluation Form

Chunk Parsing for Base Noun Phrases using Regular Expressions. Let s first let the variable s0 be the sentence tree of the first sentence.

PRODUCT PLATFORM DESIGN: A GRAPH GRAMMAR APPROACH

THE IMPORTANCE OF TEAM PROCESS

The New York City Department of Education. Grade 5 Mathematics Benchmark Assessment. Teacher Guide Spring 2013

Improving Conceptual Understanding of Physics with Technology

Learning to Think Mathematically with the Rekenrek Supplemental Activities

Tour. English Discoveries Online

Practical Integrated Learning for Machine Element Design

Test Effort Estimation Using Neural Network

Introduction, Organization Overview of NLP, Main Issues

South Carolina College- and Career-Ready Standards for Mathematics. Standards Unpacking Documents Grade 5

IAT 888: Metacreation Machines endowed with creative behavior. Philippe Pasquier Office 565 (floor 14)

Assignment 1: Predicting Amazon Review Ratings

Loughton School s curriculum evening. 28 th February 2017

Measures of the Location of the Data

DRAFT VERSION 2, 02/24/12

Introducing the New Iowa Assessments Mathematics Levels 12 14

Transcription:

An Interactive Approach to Formal Languages and Automata with JFLAP NSF Grant DUE CCLI-EMD 0442513 Susan H. Rodger Duke University rodger@cs.duke.edu SIGCSE 2011 AlgoViz Workshop March 9, 2011

Formal Languages and Automata Theory Traditionally taught Pencil and paper exercises No immediate feedback Different More mathematical than most CS courses Less hands-on than most CS courses Programming is in most of their CS courses, not here

Why Develop Tools for Automata? Textual Tabular Visual Interactive

Overview of JFLAP Java Formal Languages and Automata Package Instructional tool to learn concepts of Formal Languages and Automata Theory Topics: Regular Languages Context-Free Languages Recursively Enumerable Languages Lsystems With JFLAP your creations come to life!

JFLAP Regular Languages Create DFA and NFA Moore and Mealy regular grammar regular expression Conversions NFA to DFA to minimal DFA NFA regular expression NFA regular grammar

JFLAP Regular languages (more) Simulate DFA and NFA Step with Closure or Step by State Fast Run Multiple Run Combine two DFA Compare Equivalence Brute Force Parser Pumping Lemma

JFLAP Context-free Languages Create Nondeterministic PDA Context-free grammar Pumping Lemma Transform PDA CFG CFG PDA (LL & SLR parser) CFG CNF CFG Parse table (LL and SLR) CFG Brute Force Parser

JFLAP Recursively Enumerable Languages Create Turing Machine (1-Tape) Turing Machine (multi-tape) Building Blocks Unrestricted grammar Parsing Unrestricted grammar with brute force parser

JFLAP - L-Systems This L-System renders as a tree that grows larger with each successive derivation step.

Students love L-Systems

JFLAP s Use Around the World JFLAP web page has over 300,000 hits since 1996 Google Search JFLAP appears on over 9830 web pages Note: search only public web pages JFLAP been downloaded in over 160 countries

Two-year JFLAP Study Fourteen Faculty Adopter Participants -small, large - public, private - includes minority institutions Duke UNC-Chapel Hill Emory Winston-Salem State University United States Naval Academy Rensselaer Polytechnic Institute UC Davis Virginia State University Norfolk State University University of Houston Fayetteville State University University of Richmond San Jose State University Rochester Institute of Technology

Key Findings All the faculty used JFLAP in their courses They used it mostly for homework, some used it for class demonstrations. Students had a high opinion of JFLAP Four-fifths of the students thought JFLAP was easy to use to draw automata, simulate and interpret the results. The majority of students felt that having access to JFLAP made learning course concepts easier, made them feel more engaged in the course and made the course more enjoyable. Over half of the students used JFLAP to study for exams, and thought that the time and effort spent using JFLAP helped them get a better grade in the course. There was a control group in the second year, but the difference in knowledge between the control group and the JFLAP group was not statistically significant.

JFLAP Materials www.jflap.org JFLAP works well with Linz book New CD supplement with JFLAP exercises to go with this book JFLAP online tutorial JFLAP book

JFLAP Examples in Lecture

Example Create a DFA that recognizes strings with an even number of a s and an even number of b s

Example Create a DFA that recognizes strings with an even number of a s and an even number of b s

Example DFA for even binary numbers with an even number of ones

Example DFA for even binary numbers with an even number of ones

Example: Build an NFA for valid integers Example: Valid integers {-3, 8, 0, 456, 13, 500, } Not valid: {006, 3-6, 4.5, }

NFA for all valid integers

DFA annotated and w/shortcut

Example: NFA run and convert to DFA

Corresponding DFA

Minimize DFA First add trap state q7 then build tree of distinguished states

Final Minimal State DFA

What next? Can convert to a regular expression Can convert to an NFA

Using JFLAP during Lecture Use JFLAP to build examples of automata or grammars Use JFLAP to demo proofs Load a JFLAP example and students work in pairs to determine what it does, or fix it if it is not correct.

Example : JFLAP during Lecture Ask students to write on paper an NPDA for palindromes of even length Build one of their solutions using JFLAP Shows students how to use JFLAP

Example 1: JFLAP during Lecture (cont) Run input strings on the NPDA Shows the nondeterminism

Example : JFLAP during Lecture Brute Force Parser Give a grammar with a lambdaproduction and unit production Run it in JFLAP, see how long it takes (LONG) Is aabbab in L? Transform the grammar to remove the lambda and unitproductions Run new grammar in JFLAP, runs much faster!

Example 2 (cont) Parse Tree Results First Grammar 1863 nodes generated Second Grammar 40 nodes generated Parse tree is the same.

With JFLAP, Exploring Concepts too tedious for paper Load a Universal Turing Machine and run it See the exponential growth in an NFA or NPDA Convert an NPDA to a CFG Large grammar with useless rules Run both on the same input and compare Transform grammar (remove useless rules)

NPDA to CFG

JFLAP s use Outside of Class Homework problems Turn in JFLAP files OR turn in on paper, check answers in JFLAP Recreate examples from class Work additional problems Receive immediate feedback

Ordering of Problems in Homework Order questions so they are incremental in the usage of JFLAP 1. Load a DFA. What is the language? Students only enter input strings. 2. Load a DFA that is not correct. What is wrong? Fix it. Students only modifying a small part. 3. Build a DFA for a specific language. Last, students build from scratch.

Is this a TM for anbncn?

Here is the correct TM for anbncn

Why study finite automata? Application: Compiler Compiler identifies your syntax errors Can write a big DFA to identify all words in a Java program integers, doubles, boolean keywords, variable names arithmetic operators, punctuation symbols Example LR Parser

Lsystems Another type of grammar Show a simple L-System Show a tree Show a fractal

Unrestricted Grammar - anbncn

Trace aabbcc

Example - Unrestricted Grammar anbmcndm

Example Unrestricted Grammar (cont)

There are other ways to get interaction in this course besides software

TM for f(x)=2x where x is unary TM is not correct, can you fix it? Then eat it! States are blueberry muffins Interaction in Class Props Edible Turing Machine

Students building DFA with cookies and icing