99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

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

代寫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

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                国产精品99久久久久久宅男| 欧美videos大乳护士334| 欧美日韩色一区| 精品美女在线观看| 亚洲另类色综合网站| 欧美人xxxx| 亚洲三级视频在线观看| 亚洲成av人片在线观看无码| 狠狠色综合日日| 欧洲精品在线观看| 久久精品一区二区三区av| 亚洲电影一级黄| 不卡的av电影| 精品久久人人做人人爽| 日日骚欧美日韩| 91老司机福利 在线| 精品99999| 丝袜亚洲精品中文字幕一区| 91色综合久久久久婷婷| 国产欧美一区二区三区鸳鸯浴| 日本系列欧美系列| 欧美精品v国产精品v日韩精品| 亚洲免费观看高清完整| 成人免费毛片嘿嘿连载视频| 精品欧美一区二区在线观看| 日韩一区精品视频| 在线这里只有精品| 亚洲丝袜自拍清纯另类| 成人国产在线观看| 国产丝袜欧美中文另类| 国产一区三区三区| 精品噜噜噜噜久久久久久久久试看 | 欧美三级视频在线观看| 亚洲色图视频免费播放| 91丝袜高跟美女视频| 国产精品午夜春色av| 成人免费毛片嘿嘿连载视频| 国产精品欧美一区二区三区| 国产成+人+日韩+欧美+亚洲| 国产婷婷色一区二区三区在线| 国产伦精品一区二区三区视频青涩 | 日韩欧美国产一区二区三区| 老司机午夜精品| 精品久久久久久亚洲综合网| 韩国av一区二区| 久久精品视频网| 成人美女视频在线观看18| 国产精品久久一级| 91免费国产视频网站| 一区二区理论电影在线观看| 欧美综合一区二区三区| 免费一级片91| 2023国产精品自拍| jiyouzz国产精品久久| 亚洲在线观看免费视频| 日韩av成人高清| 水野朝阳av一区二区三区| 欧美一区二区在线观看| 精品在线亚洲视频| 久久噜噜亚洲综合| 色综合久久88色综合天天免费| 亚洲综合在线观看视频| 4hu四虎永久在线影院成人| 激情综合五月天| 国产精品久久久一本精品| 欧美视频一区在线观看| 免费成人在线观看视频| 精品国产免费久久| 一本大道久久a久久综合| 日韩电影在线一区二区三区| 久久久久久久久久久久久女国产乱| 9人人澡人人爽人人精品| 亚洲网友自拍偷拍| 国产欧美日韩综合精品一区二区| 色老汉一区二区三区| 捆绑调教美女网站视频一区| 1区2区3区国产精品| 亚洲成年人影院| 成人一区二区三区中文字幕| 亚洲情趣在线观看| 91麻豆精品91久久久久同性| 成人听书哪个软件好| 日韩精品乱码免费| 1024成人网| 久久久一区二区三区| 欧美午夜视频网站| 丁香一区二区三区| 美女任你摸久久| 亚洲主播在线观看| 国产精品丝袜久久久久久app| 5月丁香婷婷综合| 日本精品一区二区三区四区的功能| 看片的网站亚洲| 洋洋av久久久久久久一区| 日本一区二区三区高清不卡| 欧美一二三区在线观看| 91久久线看在观草草青青| 国产成人超碰人人澡人人澡| 免费欧美高清视频| 亚洲国产日韩综合久久精品| 亚洲女子a中天字幕| 成人av在线播放网址| 亚洲综合小说图片| 国产精品女主播av| 久久综合色婷婷| 日韩欧美高清dvd碟片| 欧美日韩专区在线| 色婷婷综合久久久久中文| 成人性色生活片| 成人av一区二区三区| 国产激情一区二区三区桃花岛亚洲| 九九热在线视频观看这里只有精品| 午夜精品福利一区二区三区av| 亚洲最大色网站| 亚洲国产精品久久艾草纯爱| 亚洲地区一二三色| 亚洲国产综合色| 日本在线不卡视频| 奇米一区二区三区av| 久久99国产精品久久99| 国产伦精品一区二区三区视频青涩 | 午夜精品免费在线| 亚洲欧美另类小说视频| 中文字幕一区三区| 国产精品不卡在线| 亚洲欧美国产三级| 一区二区三区四区不卡视频| 一区二区三区中文在线| 一区二区三区四区高清精品免费观看| 亚洲精品欧美综合四区| 一区二区三区四区高清精品免费观看 | 91视频免费播放| 色国产精品一区在线观看| 色吊一区二区三区 | 成人精品鲁一区一区二区| 成人亚洲一区二区一| 一本大道久久a久久综合| 欧美日韩国产色站一区二区三区| 欧美日韩一区成人| 日韩精品一区在线| 国产精品毛片大码女人| 亚洲韩国一区二区三区| 国产呦萝稀缺另类资源| 欧美日韩免费电影| 国产成人一区在线| 波多野结衣中文字幕一区二区三区| 成人国产精品免费| 欧美综合欧美视频| 日韩美女主播在线视频一区二区三区| 久久久99久久精品欧美| 中文字幕一区二区三区乱码在线| 亚洲高清视频的网址| 国产裸体歌舞团一区二区| 色狠狠综合天天综合综合| 欧美成人一区二区三区片免费| 日本一区二区三区视频视频| 五月天激情综合网| 成人午夜视频在线观看| 91精品国产高清一区二区三区蜜臀 | 国产麻豆日韩欧美久久| 欧美午夜精品一区二区蜜桃 | 色欧美日韩亚洲| 久久香蕉国产线看观看99| 亚洲人成精品久久久久| 久久国产福利国产秒拍| 成人午夜短视频| 91精品一区二区三区在线观看| 国产欧美日韩中文久久| 日韩av二区在线播放| 一本一本大道香蕉久在线精品 | 亚洲精品老司机| 国产成人午夜99999| 6080日韩午夜伦伦午夜伦| 国产精品国产精品国产专区不蜜| 久久99精品久久久久久久久久久久| 色综合色狠狠综合色| 中文字幕va一区二区三区| 奇米色一区二区| 欧美精品国产精品| 一区二区在线观看不卡| www..com久久爱| 国产日韩欧美在线一区| 国产精品99久久久久| 日韩免费在线观看| 免费不卡在线视频| 91精品在线一区二区| 丝袜美腿亚洲综合| 欧美精品久久99| 午夜精品国产更新| 欧美日韩国产美| 亚洲成在人线在线播放| 欧美在线免费观看视频| 日本系列欧美系列| 日本国产一区二区| 国产精品第13页| 成人教育av在线| 中文字幕一区视频| 91亚洲男人天堂| 亚洲品质自拍视频网站| 一本久久精品一区二区|