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综合_亚洲视频一区二区三区
    椎名由奈av一区二区三区| 免费成人你懂的| 久久久91精品国产一区二区精品| 在线免费观看日本一区| 色av成人天堂桃色av| 久久在线视频| 精品视频色一区| 欧美美女一区二区三区| 欧美福利电影网| 精品播放一区二区| 国产精品欧美极品| 亚洲免费伊人电影| 成人av在线资源网| 国产精品资源在线| 成人精品视频一区二区三区| 91在线视频18| 99香蕉国产精品偷在线观看| 亚洲一区二区三区免费观看| 久久综合影音| 91精品婷婷国产综合久久| 26uuu亚洲综合色| 中文字幕一区不卡| 亚洲成人av一区二区三区| 久久国产精品99久久久久久老狼| 久久99国产精品麻豆| 成人黄色小视频| 亚洲国产高清视频| 91福利视频网站| 精品国产一区二区三区久久影院| 国产精品天美传媒沈樵| 亚洲成人av一区二区| 精品一二三四区| 午夜精品剧场| 一本一道波多野结衣一区二区| 欧美妇女性影城| 亚洲国产精品精华液2区45| 亚洲午夜羞羞片| 国产自产2019最新不卡| 亚洲特级毛片| 91成人国产精品| 国产婷婷色一区二区三区在线| 亚洲图片有声小说| 国产91对白在线观看九色| 99在线精品免费视频九九视| 欧美老年两性高潮| 亚洲你懂的在线视频| 国产制服丝袜一区| 亚洲经典在线| 日韩欧美卡一卡二| 亚洲一区在线电影| 91免费国产视频网站| 久久综合精品一区| 国产精品沙发午睡系列990531| 日本欧美一区二区在线观看| 欧美午夜精品| 欧美一区二区三区在线电影| 一级日本不卡的影视| 99视频精品在线| 欧美性受xxxx黑人xyx性爽| 久久九九99视频| 激情深爱一区二区| 欧美专区18| 国产精品高潮久久久久无| 国产成人自拍网| 久久最新视频| 亚洲日穴在线视频| 91影院在线观看| 91精品国产综合久久久久久漫画 | 欧美日韩精品免费观看| 88在线观看91蜜桃国自产| 天天亚洲美女在线视频| 亚洲人成免费| 国产拍欧美日韩视频二区| 国产成人亚洲综合a∨婷婷| 久久人人97超碰国产公开结果| 亚洲欧洲av在线| 欧美综合天天夜夜久久| 亚洲色图19p| 欧美日韩一区二区三区在线视频 | 亚洲国产精品精华液ab| 成人污污视频在线观看| 欧美性感一区二区三区| 亚洲成人在线观看视频| 激情视频一区二区三区| 国产欧美日韩在线看| 成人免费高清在线| 制服视频三区第一页精品| 麻豆国产91在线播放| 一本一道综合狠狠老| 五月天中文字幕一区二区| 国产精品普通话对白| 亚洲欧美激情视频在线观看一区二区三区 | 日韩亚洲国产中文字幕欧美| 狠狠色狠狠色综合| 欧美日韩情趣电影| 久久国产精品99久久久久久老狼| 色综合久久九月婷婷色综合| 日日摸夜夜添夜夜添精品视频| 国产视频一区三区| 亚洲美女屁股眼交3| 日韩视频精品| 亚洲国产视频直播| 麻豆成人精品| 男女男精品网站| 欧美日韩精品久久久| 国产精品资源在线| 精品国产青草久久久久福利| 波多野结衣中文字幕一区| 久久久精品影视| 在线国产欧美| 丝袜诱惑制服诱惑色一区在线观看 | 色综合久久99| 国产剧情一区在线| 久久精品男人天堂av| 国色天香一区二区| 亚洲国产日韩a在线播放| 色就色 综合激情| 国产一区二区剧情av在线| 精品国产一区二区精华| 欧美日韩一区二区三| 亚洲国产精品久久久男人的天堂| 一本大道久久a久久精品综合| 精品午夜久久福利影院 | 久久97超碰色| 欧美精品一区二区久久婷婷| 国产精品国码视频| 亚洲.国产.中文慕字在线| 7777精品伊人久久久大香线蕉完整版| 国产成人高清视频| 国产精品久久久久毛片软件| 老鸭窝91久久精品色噜噜导演| 精品夜夜嗨av一区二区三区| 久久精品视频在线看| 国产麻豆日韩| 国产精品综合视频| 中文字幕一区二区在线观看 | 婷婷开心久久网| 精品黑人一区二区三区久久| 激情欧美丁香| 国产在线视频精品一区| 中文字幕在线播放不卡一区| 色天天综合久久久久综合片| zzijzzij亚洲日本少妇熟睡| 一区二区三区波多野结衣在线观看| 欧美三级在线看| 亚洲视频一二| 国产精品资源在线看| 夜夜嗨av一区二区三区网页| 欧美一区2区视频在线观看| 欧美视频福利| 九九视频精品免费| 亚洲欧美另类久久久精品| 成人欧美一区二区三区视频网页| 亚洲欧美国产不卡| 99久久久精品| 久久国产精品一区二区| 亚洲欧美怡红院| 精品少妇一区二区三区日产乱码| 国产精品免费区二区三区观看| 成人app在线| 日本欧美一区二区| 亚洲欧美综合在线精品| 日韩一区二区高清| 久久久久久一区| 亚洲高清成人| 97精品电影院| 国产精品中文字幕日韩精品| 亚洲一区在线观看免费 | 91在线一区二区三区| 国产自产2019最新不卡| 亚洲国产综合91精品麻豆| 国产精品乱子久久久久| 日韩免费看的电影| 欧美日韩aaaaa| 久久一本综合频道| 亚洲精品日本| 欧美日韩午夜| 91视频观看视频| 成人黄色一级视频| 国产 日韩 欧美大片| 国产在线精品一区二区三区不卡 | 高清国产一区二区| 狠狠狠色丁香婷婷综合激情 | 欧美三区在线| 91免费视频观看| av电影在线观看一区| 国产91精品一区二区麻豆亚洲| 麻豆国产精品一区二区三区 | 成人深夜在线观看| 国产精品亚洲一区二区三区妖精 | 欧美日韩精品伦理作品在线免费观看| 成人美女在线视频| 成人动漫av在线| 福利电影一区二区三区| 国产福利91精品一区二区三区| 国内精品伊人久久久久av影院| 久久国产视频网| 国产资源精品在线观看| 国产精品一区二区91| 国产激情视频一区二区三区欧美 |