91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代寫CMSC 323、代做Java/Python編程

時間:2024-03-07  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯



CMSC **3: Design and Implementation of Programming Languages
HW 3: Functions that accept multiple arguments.
Due Date: 03-07-24
Total Points: 100
1. Functions that Accept Multiple Arguments
Start with the F1WAE interpreter (the version that uses subst. See starter code.), and extend
the implementation to support any number of parameters to a function (including zero), and any
number of arguments (including zero) in a function application:
 <FunDef> = {deffun {<id> <id>*} <FnWAE>}
 <FnWAE> = <num>
 | {+ <FnWAE> <FnWAE>}
 | {- <FnWAE> <FnWAE>}
 | {with {<id> <FnWAE>} <FnWAE>}
 | <id>
 | {<id> <FnWAE>*}
Since you must change the F1WAE datatype, and since different people may change it in
different ways, you must provide a parse function this time, which accepts a quoted expression
and produces an FnWAE value. For parsing, assume that any symbol other than '+, '-, or 'with can
be a function name for a function call. Also, you must provide a parse-defn function that takes one
(quoted) deffun and produces a FunDef value.
Some examples:
(test (interp (parse `{f 1 2})
 (list (parse-defn `{deffun {f x y} {+ x y}})))
 3)
(test (interp (parse `{+ {f} {f}})
 (list (parse-defn `{deffun {f} 5})))
 10)
Hint: remember that the PLAIT language provides the following useful functions:
map: takes a function and a list and applies the function to each element in the list, returning a list
of results. For example, if sexps is a list of S-expressions to parse, (map parse sexps) produces a
list of fnWAEs by parsing each S-expression.
foldl: applies a function to an initial accumulated value and elements in a list, each time
obtaining a new accumulated value.
2
pair: creates a tuple. Use fst and snd to access items in the pair.
map2: applies a function, in order, to each pair of elements from two lists in “parallel,” forming a
new list with the results.
2. Errors
At run-time, a new error is now possible: a function application with the wrong number of
arguments. Your interp function should detect this mismatch and report an error that includes the
words “wrong arity”.
As with the interpreter from class, the free variable error is still also possible and must be
detected. Your interp function should detect free variables and report an error that includes the
words “free identifier”.
A function will be ill-defined if two of its arguments <id>s were the same. To prevent this
problem, your parse-defn function should detect this problem and report a “bad syntax” error. For
example, (parse-defn `{deffun {f x x } x}) should report a “bad syntax” error, while (parse-defn
`{deffun {f x y} x}) should produce a FunDef value.
Similarly, your interpreter must check to see if the function in an application is defined before
evaluating the arguments. If not, an “undefined function” error should be raised.
Some examples:
(test/exn (interp (parse `{with {x y} 1}) '()) "free identifier")
(test/exn (interp (parse `{f 1 2}) (list (parse-defn `{deffun {f x x} {+ x x}}))) "bad syntax")
(test/exn (interp (parse `{f x}) (list (parse-defn `{deffun {g a b c} c}))) "undefined function")
(test/exn (interp (parse `{f 1}) (list (parse-defn `{deffun {f x y} {+ x y}}))) "wrong arity")
Your interpreter must evaluate all the argument expressions in an application expression before
signaling any arity errors. For example:
(test/exn (interp (parse `{f x}) (list (parse-defn `{deffun {f a b c} c})))"free identifier")
So overall, the order in which errors should be raised for a given function call is:
• First, “bad syntax”
• Second, “undefined function”
• Third, any errors that are raised while evaluating arguments.
• Fourth, “wrong arity”
• Last, any errors that are raised while evaluating the function body.
3
If the list of definitions contains multiple definitions with the same name, use just the first one
(ignoring the others). In particular, there is no overload in this language: if there are two
definitions with the same name and different arities, the first definition is always used regardless.
For example, if you have the following definitions and program:
(test/exn (interp (parse `{f 3 4})
 (list (parse-defn `{deffun {f a} 5})
 (parse-defn `{deffun {f a b} {+ a b}})))
 "wrong arity")
Since the first definition of f takes a single argument, this program should raise a “wrong arity”
error. The fact that another definition for f that takes two argument exists doesn’t matter.
Your interpreter and parser will not be given any other kinds of erroneous programs besides the
ones described in this section.
3. Handin Instructions
• Provide definitions for parse, parse-defn, and interp, as above.
• Include a contract and comments before each function.
• Your submission must include your test cases. They should not be commented out.
• Include your name as a comment in your submission file.
• Save your homework file in the following format hw3<first_name><last_name>.
請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp

掃一掃在手機打開當(dāng)前頁
  • 上一篇:AERO20542代做、代寫Python/Java編程
  • 下一篇:莆田鞋購買渠道(盤點10個莆田鞋微商前十名)
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)/客戶要求/設(shè)計優(yōu)化
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發(fā)動機性能
    挖掘機濾芯提升發(fā)動機性能
    海信羅馬假日洗衣機亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区
    欧美久久久久久久久中文字幕| 欧美一区二区三区系列电影| 国产精品视频一二三区| 国产成人亚洲综合a∨婷婷| 久久成人免费| 自拍偷拍国产精品| 午夜国产精品视频| 久久中文娱乐网| 成人一区二区视频| 91精品久久久久久久久99蜜臂| 日本不卡在线视频| 在线视频观看一区| 日韩二区三区在线观看| 久久精品午夜| 亚洲午夜视频在线| 亚洲在线观看| 亚洲成av人综合在线观看| 一区二区三区成人精品| 亚洲激情男女视频| 国产精品亚洲综合色区韩国| 夜夜操天天操亚洲| 久久国产精品久久w女人spa| 午夜精品影院在线观看| 色婷婷久久久亚洲一区二区三区 | 久久婷婷色综合| 99在线精品观看| 久久精品一区二区| 欧美日韩视频| 亚洲欧美日韩精品久久久久| 国产亚洲欧洲| 日本不卡一二三区黄网| 欧美色倩网站大全免费| 国产一区二区三区国产| 日韩亚洲欧美在线| 成人18视频在线播放| 久久新电视剧免费观看| 伊人激情综合| 一区二区三区日韩精品| 久久永久免费| 国产一区二区女| 精品国产乱码久久久久久夜甘婷婷| 99久久婷婷国产| 国产精品福利一区| 国产日韩综合| 日韩国产成人精品| 91精品国产乱码久久蜜臀| av高清不卡在线| 亚洲视频中文字幕| 久久精品麻豆| 欧美在线免费观看视频| 欧美日韩国产经典色站一区二区三区| 色综合久久六月婷婷中文字幕| 久久久久久**毛片大全| 亚洲国产精品一区制服丝袜| 久久久www成人免费无遮挡大片| 日韩一区二区三| 久久av免费一区| 国产精品久久久久久久久动漫| 国产精品久久| 亚洲地区一二三色| 欧美视频中文一区二区三区在线观看| 国产剧情一区在线| 国产精品丝袜在线| 色狠狠一区二区三区香蕉| 国产精品99久久久久久久女警 | 国精品一区二区| 午夜精彩视频在线观看不卡| 欧美嫩在线观看| 欧美人与禽性xxxxx杂性| 日韩黄色小视频| 精品日韩在线观看| 国产精品外国| 国产91高潮流白浆在线麻豆| 亚洲欧美日韩国产一区二区三区 | 亚洲制服av| 成人黄色软件下载| 亚洲图片自拍偷拍| 欧美日韩中文精品| 在线观看一区欧美| 韩国午夜理伦三级不卡影院| 国产精品毛片a∨一区二区三区| 色天使久久综合网天天| 色综合天天综合| 免费成人在线视频观看| 国产日韩三级在线| 欧美色综合久久| 在线观看成人av电影| 国产乱妇无码大片在线观看| 亚洲日本在线天堂| 欧美tk丨vk视频| 色国产精品一区在线观看| 欧美精品一区二区三区在线看午夜| 日韩电影一区二区三区四区| 中文字幕在线视频一区| 91精品中文字幕一区二区三区| 国内精品美女在线观看| 国产精品一区二区你懂的| 亚洲一区在线视频观看| 久久久精品国产免大香伊| 欧美日韩一区二区在线视频| 中文国产一区| 欧美一区免费视频| 国产伦精一区二区三区| 亚洲五码中文字幕| 国产欧美精品一区二区三区四区| 欧美日韩www| 一本色道久久综合狠狠躁的推荐 | 在线欧美一区| 99久久精品免费精品国产| 精品亚洲porn| 亚洲va欧美va人人爽午夜| 亚洲视频1区2区| 日本一区二区三区四区| 日韩精品在线一区二区| 欧美日韩免费观看一区三区| 久久av一区二区三区亚洲| 黄色亚洲大片免费在线观看| caoporm超碰国产精品| 国产一区二三区| 精品无人码麻豆乱码1区2区| 日本不卡一区二区| 亚洲国产精品视频| 又紧又大又爽精品一区二区| 国产精品久久久久四虎| 中文字幕国产一区二区| 国产喂奶挤奶一区二区三区| 欧美精品一区二区三区视频| 日韩精品影音先锋| 日韩欧美www| 欧美大片在线观看| 欧美成人午夜电影| 日韩午夜av电影| 欧美一区二区三区免费视频| 在线播放一区二区三区| 5566中文字幕一区二区电影| 欧美妇女性影城| 欧美一级专区免费大片| 日韩亚洲欧美综合| 欧美大片顶级少妇| 2021中文字幕一区亚洲| 国产亚洲一区字幕| 国产精品毛片高清在线完整版| 国产精品久久久久久户外露出| 中文字幕欧美一| 一区二区三区日韩欧美精品| 亚洲国产乱码最新视频| 青青草一区二区三区| 免播放器亚洲一区| 国内精品久久久久影院色| 国产成人99久久亚洲综合精品| 成人午夜视频福利| 91蜜桃传媒精品久久久一区二区| 欧美阿v一级看视频| 国产精品国产三级欧美二区| 国产亚洲一区在线播放| 色猫猫国产区一区二在线视频| 精品视频资源站| 欧美电影免费观看高清完整版在 | 亚洲综合一区二区三区| 日韩一区精品字幕| 国产一区999| 91丝袜美腿高跟国产极品老师| 激情自拍一区| 久久国产精品久久久久久电车| 欧美视频一区在线| 26uuu色噜噜精品一区| 亚洲三级理论片| 蜜乳av一区二区三区| 国产精品性做久久久久久| 欧美1区3d| 新67194成人永久网站| 在线不卡欧美精品一区二区三区| 久久久久久免费网| 亚洲制服丝袜在线| 国产一区二区三区在线观看精品 | 久久综合九色综合欧美就去吻| 亚洲人成7777| 久久草av在线| 欧美精品一级| 日本黄色一区二区| 精品国产sm最大网站| 亚洲黄色小说网站| 国产精品1区2区3区| 亚洲婷婷免费| 欧美色视频在线| 国产精品嫩草影院com| 日本欧美久久久久免费播放网| 99久久婷婷国产精品综合| 亚洲欧美清纯在线制服| 欧美成人综合网站| 亚洲综合视频网| 成人福利视频网站| 久久国产欧美精品| 欧美成人乱码一区二区三区| 一区二区三区 在线观看视频| 国产精品一区二区在线观看网站| 亚洲午夜精品一区二区| 正在播放亚洲一区| 一区二区三区中文字幕| 成人午夜短视频|