ECS120fundamentals of compiling

Auto-gradedproblemsTheseproblemsarenotrandomized,sothereisnoneedtofirstsubmitafilenamedreq.Eachproblembelowappearsasaseparate“Assignment”inGradescope,beginningwith“HW1:”.1.1DFAsForeachproblem submittoGradescopea.dfafiledescribinga DFA deciding thegivenlanguage.Make surethatitisaplaintextfilethatendsin.dfa(not.txt).UsethefiniteautomatasimulatortotesttheDFAs:http://web.cs.ucdavis.edu/~doty/automata/.Documentation isavailableatthehelplinkatthetopof thatweb page.Do notjustsubmittoGradescopewithouttestingonthesimulator.Thepurposeof thishomework istodevelopintuition.Gradescopewilltellyouwhen yourDFA getsan answerwrong,butitwillnottellyouwhyitwaswrong.You’lldevelopmoreintuitionbyrunningtheDFA in thesimulator,tryingtocomeup withsomeofyourown examplesandseeingwheretheyfail,thanyouwillbyjustusingtheGradescopeautograderasablackbox.Onceyouthinkyoursolutionworks,submittoGradescope.Ifyoufailany testcases,gobacktothesimulatoranduseittoseewhythosecasesfail.During an exam,there’sno autogradertohelpyou figureoutifyouransweriscorrect.Practicerightnow how todetermineforyourself whetheritiscorrect.Gradescopemay givestrangeerrorsifyourfileisnotformattedproperly.Ifyourfileisnotformattedproperly,thesimulatorwilltellyou thiswithmore user-friendlyerrors.Also,ifyou losepointsonaGradescopetestcase,trythattestcaseinthesimulatortoensurethatyourDFA isbehavingasyouexpect.beginandend:{w∈ {0,1}∗|wbeginswith010andendswitha0}atmostthree1s:{w∈{0,1}∗|wcontainsatmostthree1’s}.nosubstring:{w∈{a,b,c}∗|wdoesnotcontainthesubstringacab}.evenodd:{w∈{a,b}∗|wstartswithaandhasevenlength,orwstartswithbandhasoddlength}.mod:{w∈{0,1}∗|wisthebinaryexpansionofn∈Nandn≡3mod 5}.Assumeεrepresents0and thatleading0’sareallowed.A numbern∈Niscongruentto3mod 5(writtenn≡3mod 5)ifnis3greaterthanamultipleof5,i.e.,n= 5k+ 3forsomek∈N.Forinstance,3,8,and13arecongruentto3mod 5.

你可能感兴趣的:(eclipse)