EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
Python代写
您的位置: 主页 > 编程案例 > Python代写 >
代写Python:lambda-calculus代写 programming language代写 function代写 - Python代写
发布时间:2021-07-25 21:34:02浏览次数:
CM20256 / CM50262 Functional Programminlambda-calculus代写 This coursework is about using the lambda-calculus as a programming language. Your so- lutions should be submittedCoursework 2 – CM50262 versionDue: 6pm Wednesday May 2nd 2018 This coursework is about using the lambda-calculus as a programming language. Your so- lutions should be submitted via Moodle as a PDF file. You may write the solutions using appropriate software (LATEX, Word, etc.) or as a clearly legible handwritten document that you scan to PDF (the University printers have a scanning function). Throughout this assign- ment, you could of course write your solutions as pure lambda-terms, but that would be very hard to read. Make use of abbreviations to ensure that your solutions to these exercises are readable!lambda-calculus代写lambda-calculus代写 Part 1 (Ordered triples 10%):lambda-calculus代写 It is useful in programming to collect multiple terms together as pairs, triples etc. Ordered triples may be encoded in the lambda-calculus as follows:hM1, M2, M3i , Lp.p M1 M2 M3The idea is that the variable p will be bound to a “projection” operator which will select one of M1 , M2 or M3  when the programmer wants to retrieve one of the elements of the  triple.a)Show that the following term Ø -reduces to M2:hM1, M2, M3i (Lx.Ly.Lz.y)You may assume that the terms M1 , M2 and M3 do not contain x , y or z as free variables.lambda-calculus代写b)Defineterms ⇡1 , ⇡2 and ⇡3 such that for any terms M1 , M2 and M3 ,⇡i hM1, M2, M3i !⇤Ø Mifor i = 1, 2, 3 and demonstrate that ⇡2 works as intended.Part 2 (Working with numbers – 40%): We will now employ our ordered triples to define some useful functions that operate on the Church numerals.a)Define a function T that operates on triples of Church numerals suchthatTha, b, ci !⇤Ø hb, c, c + 1iand show that it works. You may make use of the successor function succ without explanation, as well as the ⇡i functions defined above.b)Prove by induction on n that, for all Church numerals n,lambda-calculus代写The.operation is subtraction curtailed at zero, that is:Part 3 (Fibonacci numbers – 10%):lambda-calculus代写 Below is the definition of a Haskell function that com- putes the Fibonacci numbers.fib :: Int -  Int fib 0 = 1fib 1 = 1fib n = fib (n-1) + fib (n 2)Define a lambda-term F which implements this function, making use of the Y combinator to implement recursion and your function T to implement the calculations of  n — 1 and n — 2 . You may make use of the following operations on Church numerals and Booleansfrom the lectures: addition, test for zero, if-then-else.lambda-calculus代写Part 4 (Research question – 40%):lambda-calculus代写 Write a short essay (around 2 pages) on combinatory logic and its relationship with the lambda-calculus and functional programming. You should:give a definition of what the combinators S , K and I are — this can be in terms of lambda-calculus if youlikeargue that the combinators are as powerful as the full L-calculusprovide some historical background on the discovery of combinatorylogicbriefly discuss how combinators are relevant to the implementation of functional pro- gramminglanguagesgive references to support your claims and fifindings.lambda-calculus代写This is a research question which deliberately goes beyond what we are covering in lec- tures. Please conduct your own research to find sources and material to help you answer it. Wikipedia is a good place to start, but you should avoid using it as a definitive reference. A really good answer would go beyond the material covered by the obvious Wikipedia pages.lambda-calculus代写更多其他:C++代写 java代写 r代写 Data Analysis代写 代码代写 金融代写  python代写 金融经济统计代写 web代写 物理代写 数学代写 考试助攻合作平台:Essayghost 315代写 写手招聘 Essay代写

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。