代做CS 320作业、代写Python,c/c++编程设计作业、代做Java程序作业、代写desktop scanner作业代写Python编程|代做留学生P

CS 320—Week 8 Homework—Due W 3/27 11:59pmWrite your answers to the problems in the space indicated. Scan your solution and submitto Gradescope as a PDF file. You will receive an email about the Gradescope account.You may do this from your phone using free scanning apps, or with a desktop scanner.Do NOT edit this file and move things around, the format must remain the same.Problem One (Monad Do Expressions)This problem will exercise your understanding of the “assembly language” of Haskell’s doexpression syntax. “Translation” in this exercise refers to converting between the forms(i), (ii) and (iii) shown on the last page. Use bound variables x, y, and z (as necessary).(A) Show what phase (i) of the translation for example ex9’ inMonadLectureCode2.hs would look like (this is in the Maybe Monad).(B) Show what phases (i) and (ii) of the translation for example ex14 inMonadLectureCode2.hs would look like (this is in the Maybe Monad).(C) Show what phases (i) and (ii) of the translation for example ex4 inMonadLectureCode3.hs would look like (this is in the Checked Monad).Name: BU ID (no dashes): S -> EE -> E + T | TT -> T * F | FF -> P ^ F | PP -> - PP -> 1 | 2 | 3Problem Two (Derivations and Parse Trees)This problem concerns context-free grammars and the relationship betweenparse trees and derivations, using the grammar shown at right.(A) Give a left-most derivation of the string 3 * 2 + - 3 ^ 1 .(B) Give a right-most derivation of the string 3 * 2 + - 3 ^ 1 .(D) Suppose we consider the parse tree you created in part(C). If you walk around the tree in preorder, and each timeyou touch a non-terminal, you add a derivation step to aderivation, what kind of derivation would result?(E) Considering the same process as in (D), what kind of traversal of a tree wouldcorrespond to a right-most derivation (see at the link on traversals posted with lecture 2)?(F) Give a short, informal proof of the following statement: If a grammar is notambiguous, then for any string w in the language, every derivation of w has the samelength (same number of derivation steps). Hint: think about the relationship betweenderivations and parse trees.In (A) and(B) you donot need togive thenumber ofthe rule, norunderlinethe nonterminalbeingrewritten ateach step.See the YTvideo forhints onhow to do(D) and (E).(C) Give a parse tree for the string 3 1 + - 2 .Problem Three (Context-Free Grammars and Languages)This problem will have you write context-free grammars and also think about how tocharacterize context-free languages.For parts (A) and (B), give an intuitive description of the language generated by the givencontext-free grammars, where T = { a, b }.(A) S -> a A | b A -> a S | b A | ?(B) S -> a S b S | b S a S | ?For parts (C) and (D), give a context-free grammar for the language specified.(C) The language of matching delimiters over the alphabet: { } [ ] ( )The following are in the language: (()) ({}) {()}{}and the following are not: ({)} {{{}}) ?(D) The language { an bm an | n ≥ 0 and m>1}, i.e., strings aaa..abbb…baaa..a with at leastone b, and starting and ending with substrings of a’s of the same length.The following are in the language: b abbbba aaabbaaaand the following are not: aaba aaaa (i) =>(ii) =>(iii) =>This page for reference ONLY, please do not scan and submit this page!本团队核心人员组成主要包括硅谷工程师、BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected] 微信:codehelp

你可能感兴趣的:(代做CS 320作业、代写Python,c/c++编程设计作业、代做Java程序作业、代写desktop scanner作业代写Python编程|代做留学生P)