加勒比久久综合,国产精品伦一区二区,66精品视频在线观看,一区二区电影

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

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

時間:2024-03-07  來源:合肥網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

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

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

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    高清一区二区三区av| 亚洲一二三四| 久久国产精品免费一区二区三区| 91欧美在线| 牛夜精品久久久久久久99黑人| 日韩av影院| 亚洲麻豆一区| 国产一区二区三区| 久久久久久夜| 亚洲激情视频| 999久久久免费精品国产| 久久99视频| 麻豆国产欧美一区二区三区| 成年男女免费视频网站不卡| 欧美女人交a| 久久狠狠婷婷| 日本在线一区二区三区| 久久夜色电影| 久久国产欧美日韩精品| 免费成人在线电影| 三级在线观看一区二区| 欧美在线网站| 国产一在线精品一区在线观看| 亚洲一区二区三区在线免费| 欧美视频二区欧美影视| 日韩高清国产一区在线| 免费在线观看一区| av日韩中文| 免费不卡在线视频| 亚洲欧美bt| 国产精品女主播一区二区三区| 欧美日韩一区二区三区视频播放| 一区二区在线视频观看| 亚洲永久精品唐人导航网址| 国内视频精品| 日本成人在线电影网| 久久这里有精品15一区二区三区| 日韩在线观看不卡| 精精国产xxx在线视频app| 国产免费拔擦拔擦8x在线播放| 天堂va蜜桃一区二区三区| 日韩午夜一区| 亚洲资源av| 日韩中文字幕一区二区三区| 免费精品视频| 蜜臀a∨国产成人精品| 狂野欧美一区| 免费高清在线一区| 免费av成人在线| 91免费精品| 免费看男女www网站入口在线| 国产剧情av在线播放| a一区二区三区| 亚洲私拍视频| 久久精品国产精品青草| 亚洲高清在线| 欧美激情无毛| 欧美日韩中出| 伊人精品综合| 精品中国亚洲| 91成人精品视频| 亚洲免费成人| 蜜桃传媒麻豆第一区在线观看| 四虎成人av| 欧美a级在线观看| 色噜噜成人av在线| 亚洲国产午夜| 亚洲成人一品| 国产精品高潮呻吟久久久久| 精品国产中文字幕第一页| 国产一区二区三区自拍| 日韩午夜电影| 在线天堂新版最新版在线8| 日韩欧美一区二区三区在线观看| 欧美影院一区| 国产永久精品大片wwwapp| 久久国产精品美女| 久久久影院免费| 国产亚洲在线观看| 中文字幕成在线观看| 一区二区高清| 亚欧日韩另类中文欧美| 国产suv精品一区二区四区视频| 久久国产综合| 久久国产福利| 青草综合视频| 国产精品亚洲一区二区在线观看| 日本精品一区二区三区在线观看视频| 成人毛片在线| 免费观看在线色综合| 欧美国产日韩电影| 欧美视频精品全部免费观看| 超碰地址久久| 国产女优一区| 日韩一级特黄| 亚洲黄页在线观看| 激情久久久久久| 日本在线高清| 国产成人黄色| 亚洲韩日在线| 在线天堂中文资源最新版| 日本不卡的三区四区五区| 国产色99精品9i| 国产精品毛片| 亚洲国产高清一区| 日韩二区在线观看| 欧美在线资源| 国产成人77亚洲精品www| 国产va免费精品观看精品视频 | 美女久久久久久| 偷拍视屏一区| 日韩香蕉视频| 精品美女一区| 欧美日韩网站| 日韩成人a**站| 99久久这里有精品| 欧美亚洲激情| av成人亚洲| 免费观看亚洲天堂| 久久国产福利| 综合一区在线| 精品中文字幕一区二区三区av| 在线天堂中文资源最新版| 欧美日韩黄网站| 在线综合亚洲| 另类中文字幕网| 天堂资源在线亚洲| 国产精品久久亚洲不卡| 美女久久精品| 色婷婷亚洲mv天堂mv在影片| 国产麻豆精品| 99精品福利视频| 亚洲日本久久| 性欧美欧美巨大69| 99精品视频网| 激情欧美一区| 欧美在线三区| 91精品啪在线观看国产18| 欧美伊人亚洲伊人色综合动图| 午夜日韩影院| 日韩免费在线| 精品国产91久久久久久浪潮蜜月| 国产黄大片在线观看| 日韩av午夜| 高潮一区二区| 成人性生交大片免费看96| 成人欧美一区二区三区的电影| 日韩成人伦理电影在线观看| 蜜桃视频第一区免费观看| 国内不卡的一区二区三区中文字幕| 黄色综合网站| 国产精品久一| 国产精品久久久久久| 欧州一区二区三区| 日韩专区一卡二卡| 日韩中文一区二区| 日韩中文影院| 久久人人97超碰国产公开结果| 美女性感视频久久| 婷婷亚洲五月色综合| 亚洲欧美在线专区| 免费日韩精品中文字幕视频在线| 精品一区二区三区中文字幕在线 | 久久精品国产亚洲5555| 亚洲国产高清一区二区三区| 国户精品久久久久久久久久久不卡| 麻豆精品新av中文字幕| 日韩视频一区| 精品国模一区二区三区欧美| 韩日毛片在线观看| 久久久青草婷婷精品综合日韩| 麻豆视频观看网址久久| 国产色综合网| 51vv免费精品视频一区二区| 国产成人77亚洲精品www| 欧美va天堂在线| 久久av免费| 成人在线视频观看| 狠狠入ady亚洲精品经典电影| 国产精品最新| 欧美一区=区三区| 午夜精品免费| 4438全国亚洲精品观看视频| 国产第一亚洲| 噜噜噜在线观看免费视频日韩| 99精品在免费线中文字幕网站一区| 欧美成人毛片| 狂野欧美性猛交xxxx巴西| 精品久久久中文字幕| 欧美激情日韩| 日韩大片在线播放| 91久久中文| 欧美视频亚洲视频| 亚洲一区二区小说| 日韩欧美高清| 亚洲免费在线| 亚洲二区精品| 免费观看亚洲视频大全| 中文字幕免费一区二区三区| 免费看男女www网站入口在线|