CS 310 – Fall 2006 Pacific University CS310 Homework 2 & JFLAP September 22, 2006.
Turing Machine Building Blocks in JFLAP
Transcript of Turing Machine Building Blocks in JFLAP
Turing Machine Building Blocks in JFLAP
Susan Rodger, Bart Bressler,and Stephen Reading
Duke University
Thanks to National Science Foundation, grant NSF CCLI-EMD 0442513
Turing Machine Building Blocks• First, a problem.• f(w) = number of a’s in w, = {a,b}• Examples:
– f(aabab) = 111– f(bbbaab) = 11
Turing Machine Building Blocks
• Building Block– Build a Turing machine with a specific purpose– Name it and save it– Use it as a BlackBox in another Turing machine
• Special Symbols~ ignore read or write !x matches all symbols except for x
Simple Building Blocks
• start• R – move right
• R_blnk – move right once, keep moving right until reach a blank
Simple Building Blocks (cont)• R_not_a – move right once, keep moving
until not an “a”
• a - write “a” and stay put
Create & Combine Building Blocks• New Buttons
• Conditional – if the current symbol is b, move to the next block (tape head not moving)
• Move to the next block – use ~– Ignore read, ignore write, stay put
Load BB
BB transition
Combine Building Blocks w/ variables• Variables in transitions
If ai is the current symbol, replace v with ai each time v appearsa1, a2, a3, … an } v
• Example