Teaching Finite Automata with AutomataTutor Rajeev Alur (Penn), Loris D’Antoni (Penn), Sumit Gulwani (MSR), Bjoern Hartmann (Berkeley), Dileep Kini (UIUC),

Slides:



Advertisements
Similar presentations
CSE 311 Foundations of Computing I
Advertisements

4b Lexical analysis Finite Automata
Lecture 24 MAS 714 Hartmut Klauck
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
Regular Expressions and DFAs COP 3402 (Summer 2014)
Automated Grading of DFA Constructions Rajeev Alur (Penn), Loris D’Antoni (Penn), Sumit Gulwani (MSR), Bjoern Hartmann (Berkeley), Dileep Kini (UIUC),
DFA Minimization Jeremy Mange CS 6800 Summer 2009.
Finite Automata CPSC 388 Ellen Walker Hiram College.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
CS5371 Theory of Computation
Homework #2 Solutions.
Fall 2004COMP 3351 Single Final State for NFA. Fall 2004COMP 3352 Any NFA can be converted to an equivalent NFA with a single final state.
CS 310 – Fall 2006 Pacific University CS310 Decidability Section 4.1/4.2 November 10, 2006.
1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state.
Supplementing lectures with additional online materials Matthew Juniper, CUED June 2007.
Snick  snack CPSC 121: Models of Computation 2010 Winter Term 2 DFAs in Depth Benjamin Israel Notes heavily borrowed from Steve Wolfman’s,
LING 438/538 Computational Linguistics Sandiway Fong Lecture 12: 10/5.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
1 Non-Deterministic Automata Regular Expressions.
Automating Construction of Lexers. Example in javacc TOKEN: { ( | | "_")* > | ( )* > | } SKIP: { " " | "\n" | "\t" } --> get automatically generated code.
CS Chapter 2. LanguageMachineGrammar RegularFinite AutomatonRegular Expression, Regular Grammar Context-FreePushdown AutomatonContext-Free Grammar.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)
1 A Single Final State for Finite Accepters. 2 Observation Any Finite Accepter (NFA or DFA) can be converted to an equivalent NFA with a single final.
CSE 311: Foundations of Computing Fall 2014 Lecture 23: State Minimization, NFAs.
Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { ‘{‘, ‘}’ } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite language,
Remaining Topics Decidability Concept 4.1 The Halting Problem 4.2
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
NFA ε - NFA - DFA equivalence. What is an NFA An NFA is an automaton that its states might have none, one or more outgoing arrows under a specific symbol.
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
REGULAR LANGUAGES.
Minimization of Symbolic Automata Presented By: Loris D’Antoni Joint work with: Margus Veanes 01/24/14, POPL14.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Lexical Analysis Constructing a Scanner from Regular Expressions.
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CHAPTER 1 Regular Languages
CS 3240 – Chapter 4.  Closure Properties  Algorithms for Elementary Questions:  Is a given word, w, in L?  Is L empty, finite or infinite?  Are L.
CMSC 330: Organization of Programming Languages Finite Automata NFAs  DFAs.
CMSC 330: Organization of Programming Languages Theory of Regular Expressions NFAs  DFAs.
Regular Expressions Fundamental Data Structures and Algorithms Peter Lee March 13, 2003.
CSCI 3130: Formal languages and automata theory Tutorial 3 Chin.
Theory of Computing CSCI 356/541 Lab Session. Outline Lab 1: Finite Automata  Construct and Run Construct and Run  Manipulating Transitions Manipulating.
MA/CSSE 474 Theory of Computation Minimizing DFSMs.
Finite Automata Chapter 1. Automatic Door Example Top View.
Regular Language Algorithms. Algorithms We have seen many algorithms for manipulating computational systems for the regular languages. Each treats these.
1 Chapter Constructing Efficient Finite Automata.
CSE 311 Foundations of Computing I Lecture 24 FSM Limits, Pattern Matching Autumn 2011 CSE 3111.
Jianguo Lu : Lab 3 Jan 30, Winter 2004.
Finite Automata Great Theoretical Ideas In Computer Science Victor Adamchik Danny Sleator CS Spring 2010 Lecture 20Mar 30, 2010Carnegie Mellon.
LECTURE 5 Scanning. SYNTAX ANALYSIS We know from our previous lectures that the process of verifying the syntax of the program is performed in two stages:
1 Section 11.3 Constructing Efficient Finite Automata First we’ll see how to transform an NFA into a DFA. Then we’ll see how to transform a DFA into a.
What do we know? DFA = NFA =  -NFA We have seen algorithms to transform DFA to NFA (trival) NFA to  NFA (trivial) NFA to DFA (subset construction)
Theory of Computation Automata Theory Dr. Ayman Srour.
CS412/413 Introduction to Compilers Radu Rugina Lecture 3: Finite Automata 25 Jan 02.
More on scanning: NFAs and Flex
Lexical analysis Finite Automata
CSE 105 theory of computation
Recognizer for a Language
4. Properties of Regular Languages
4b Lexical analysis Finite Automata
4b Lexical analysis Finite Automata
Instructor: Aaron Roth
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

Teaching Finite Automata with AutomataTutor Rajeev Alur (Penn), Loris D’Antoni (Penn), Sumit Gulwani (MSR), Bjoern Hartmann (Berkeley), Dileep Kini (UIUC), Mahesh Viswanathan (UIUC)

Why finite automata? Part of any CS curriculum Regexp and other models build on automata Students don’t like Automata Hard and tedious to grade

Draw the DFA accepting the language: { s | ‘ab’ appears in s exactly 2 times } Teaching Assistant +=

Teaching Assistant + = Teaching Assistant + +=

automatatutor.com

Draw the DFA accepting the language: { s | ‘ab’ appears in s exactly 2 times } Solution:

Your DFA accepts the language { s | ‘ab’ appears in s at least 2 times } Grade: 6/10

You need to change the acceptance condition of one state Grade: 9/10

How does it work?

3 types of mistakes: 1.Problem syntactic mistake You solved a slightly different problem 2.Solution syntactic mistake There is a typo in your solution 3.Solution semantic mistake Your solution is wrong on few test cases

1. Problem Syntactic Mistake The problem description was { s | ‘ab’ appears in s exactly 2 times } The student instead drew DFA for { s | ‘ab’ appears in s at least 2 times } INTUITION: find the distance between the two language descriptions

Feedback via Synthesis { s | ‘ab’ appears in s at least 2 times } indOf(ab)=2indOf(ab)≥2 SYNTHESIZE LOGIC DESCRIPTION Replace ≥ with = FIND MINIMAL EDIT CONVERT TO ENGLISH

indOf(‘ab’)=2 Classical algorithm from MSO to DFA ??

From DFA to Logic 1.Enumerate all the predicates 2.For each predicate build DFA 3.Check for equivalence with target DFA Search pruning and speeding: Avoid trivially equivalent predicates (A V B, B V A) Approximate equivalence using set of test strings

2. Solution Syntactic Mistake The student forgot one final state INTUITION: find the smallest number of syntactic modification to fix solutions

DFA Edit Difference Compute DFA edit distance: – Number of edits necessary to transform the DFA into a correct one An edit is – Make a state (non)final – Add a new state – Redirect a transition

DFA Edit Difference: How to compute it? We try every possible edit and check for equivalence Speed up equivalence by using test set of strings The problem of finding DFAED is in NP (is it NP-hard?)

3. Solution Semantic Mistake The student didn’t see that the ‘a’ loop might not be traversed INTUITION: find on how many strings the student is wrong

Approximate Density S = correct solution A = student attempt Compute Symmetric Difference: D = S\A U A\S Measure relative size of D with respect to S Size(D,S) = lim n->∞ D n /S n Size(D,S) is not computable in general (the limit oscillates) Approximate the limit to finite n

Does it work?

Are the computed grades fair? YES [IJCAI13] Is the computed feedback helpful? YES (in some sense) [submitted to TOCHI14] Is anyone else (beside me) going to use the tool? It seems like a YES (Penn, UIUC, Reykjavik)

Are the computed grades fair?

Grades Evaluation 1/2 H1, H2 = human graders N =naïve grader T = tool Tool is closer to humans than humans are to each other

Grades Evaluation 2/2 H1, H2 = human graders N =naïve grader T = tool Tool and humans look indistinguishable

Pro’s and Cons Pros: On disagreeing cases, human grader often realized that his grade was inaccurate Identical solutions receive same grades and correct attempts awarded max score (unlike human) Cons: For now limited to small DFAs When two types of mistakes happen at same time, the tool can’t figure it out

Is the computed feedback helpful?

Setup: 4 mandatory homework problems 18 practice problems Question: How often does a student give up on a practice problem based on his type of feedback? Results: Binary Feedback: 44 % of the time Counterexample: 27 % of the time Hint Feedback: 33 % of the time How to test whether students are engaged?

Is anyone else (besides me) going to use the tool?

Univ. of Reykjavik test We used the previous experiment’s results to improve the tool and we removed sources of confusion.

Univ. of Reykjavik test It helped me solve a couple of exercises, helped me with the extreme/end cases. I thought the feedback was absolutely Excellent. It was short, simple and to the point! I liked its subtle hints. Sometimes the feedback was confusing … This is a far superior way to learn new things rather than read about something … I hope this way of teaching will be implemented in all schools

What’s next?

A tutoring system? A student (Alexander Weinert) worked on it at Berkeley as part of Sanjit Seshia’s class NFA constructions? A student (Matt Weaver) is working on it over the summer at Penn Regular expressions?

Conclusions AutomataTutor.com: a tool that grades DFA constructions fully automatically and provides students with personalized feedback We will fully deploy it by Fall14.