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

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

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

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

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優(yōu)化
    急尋熱仿真分析?代做熱仿真服務+熱設計優(yōu)化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發(fā)動機性能
    挖掘機濾芯提升發(fā)動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機亮相AWE 復古美學與現(xiàn)代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網(wǎng)

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

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

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

          9000px;">

                国产精品久99| 亚洲伊人伊色伊影伊综合网| 亚洲蜜臀av乱码久久精品蜜桃| 久久99国产精品久久99| 欧美高清视频www夜色资源网| 一区二区三区中文字幕精品精品| 在线欧美日韩国产| 亚洲综合色自拍一区| 色视频成人在线观看免| 日韩综合在线视频| 欧美精品在线观看一区二区| 亚洲不卡在线观看| 2024国产精品| 国产精品一区一区三区| 久久精品二区亚洲w码| 国产日韩欧美高清| 99视频热这里只有精品免费| 午夜精品123| 日韩美女视频在线| 国产精品 欧美精品| 偷拍自拍另类欧美| 日韩一区二区在线观看视频| 99久久精品国产毛片| 亚洲另类春色国产| 久久久久九九视频| 在线视频国产一区| 国产成人av一区二区三区在线观看| 中文字幕国产一区| 一区二区三区**美女毛片| 制服丝袜亚洲播放| 国产露脸91国语对白| 五月激情丁香一区二区三区| 久久综合九色欧美综合狠狠 | 欧美精品视频www在线观看| 韩国理伦片一区二区三区在线播放 | 欧美成人一区二区三区| 国产传媒日韩欧美成人| 亚洲成人自拍偷拍| 亚洲免费观看高清完整版在线观看熊 | 亚洲午夜av在线| 日韩视频123| 91在线观看美女| 日本强好片久久久久久aaa| 国产亚洲精品资源在线26u| 91传媒视频在线播放| 亚洲国产视频a| 国产蜜臀av在线一区二区三区| 欧美午夜寂寞影院| 在线成人av网站| 色综合夜色一区| 91视频www| 国产精品99久久久久久久vr| 国内外成人在线| 日本91福利区| 国产三级久久久| 中文在线一区二区| 日韩精品资源二区在线| 欧美变态口味重另类| 欧美精品久久久久久久多人混战 | 久久久不卡网国产精品二区 | 久久精品国产精品亚洲红杏| 亚洲柠檬福利资源导航| 精品成人一区二区三区| 欧美日韩激情一区二区| 色综合色综合色综合色综合色综合 | 色噜噜狠狠一区二区三区果冻| 成人免费毛片片v| 久久精品国产99国产精品| 国产又粗又猛又爽又黄91精品| 麻豆成人在线观看| 日本成人超碰在线观看| 国产美女在线观看一区| 久久er99热精品一区二区| 久久99精品久久只有精品| 日本强好片久久久久久aaa| 国产人妖乱国产精品人妖| 精品国一区二区三区| 日韩精品在线一区| 亚洲国产精品t66y| 国产精品视频第一区| 色爱区综合激月婷婷| 欧美一区二区视频观看视频| 91精品国产高清一区二区三区蜜臀| 精品国产制服丝袜高跟| 国产午夜亚洲精品羞羞网站| 欧美日韩国产一二三| 欧美成人一区二区三区在线观看| 日韩小视频在线观看专区| 中文字幕精品一区二区三区精品| 亚洲欧洲精品天堂一级| 精品久久久网站| 亚洲六月丁香色婷婷综合久久| 欧美色男人天堂| 久久 天天综合| 在线视频亚洲一区| 欧美久久高跟鞋激| 国产精品久久久久久久久久免费看 | 色先锋aa成人| 欧美男男青年gay1069videost| 日韩欧美一区二区久久婷婷| 国产三区在线成人av| 天天综合日日夜夜精品| 国产一区二区三区精品欧美日韩一区二区三区 | 久久亚洲一级片| 亚洲人吸女人奶水| 亚洲欧美欧美一区二区三区| 午夜精品久久久久久久久久| 国产一区二区三区综合| 欧美日韩成人一区| 中文久久乱码一区二区| 久久激情五月婷婷| 91麻豆.com| 久久久噜噜噜久久人人看 | 欧美三级午夜理伦三级中视频| 精品国产3级a| 樱桃视频在线观看一区| 成人免费不卡视频| 欧美一级久久久| 在线亚洲+欧美+日本专区| 精品国产一区二区三区忘忧草| 亚洲一区免费观看| 欧美亚洲一区三区| 亚洲三级小视频| 91欧美一区二区| 国产日韩欧美精品在线| 人人爽香蕉精品| 日韩欧美高清dvd碟片| 性久久久久久久| 欧美日韩国产免费一区二区| 亚洲欧美日韩电影| 精品一区二区三区香蕉蜜桃| 欧美日韩aaaaaa| 欧美日韩日日骚| 亚洲一区二区三区四区五区黄| 99国产麻豆精品| 欧美精品免费视频| 日本在线不卡视频| 欧美人妇做爰xxxⅹ性高电影| 午夜欧美一区二区三区在线播放| 日本韩国一区二区| 一本色道久久综合精品竹菊| 亚洲精品成a人| 91色乱码一区二区三区| 亚洲一区二区三区四区中文字幕| 一本大道久久a久久精二百| 亚洲一区二区视频在线| 色伊人久久综合中文字幕| 亚洲色欲色欲www| 欧美午夜精品免费| 亚洲h动漫在线| 精品国产91乱码一区二区三区| 美国一区二区三区在线播放| 久久久99精品久久| 国产精品自在在线| 亚洲国产激情av| 91啪亚洲精品| 亚洲午夜在线观看视频在线| 日韩三级.com| 成人免费一区二区三区在线观看 | 精品噜噜噜噜久久久久久久久试看| 视频一区中文字幕| 国产精品丝袜久久久久久app| 成人精品国产免费网站| 久久久久久久综合色一本| 91在线国产观看| 午夜日韩在线观看| 久久久99精品免费观看| 成人精品小蝌蚪| 亚洲.国产.中文慕字在线| 日韩欧美国产不卡| 国产成人在线观看| 日本不卡中文字幕| 国产欧美视频一区二区| 欧美裸体一区二区三区| 国产精品77777| 日本亚洲三级在线| 国产视频一区不卡| 天天色天天操综合| 久久久三级国产网站| 色94色欧美sute亚洲线路一久| 久久99蜜桃精品| 亚洲免费观看高清完整版在线观看| 久久精品一区二区三区不卡牛牛| av电影在线观看不卡| 综合中文字幕亚洲| 国产欧美一区二区三区鸳鸯浴 | 亚洲国产日日夜夜| 风间由美一区二区av101| 天天色综合成人网| 国产精品久久精品日日| 久久精品国产免费| 免费av成人在线| 亚洲免费观看高清完整版在线观看熊 | 天堂久久一区二区三区| 欧美日本精品一区二区三区| 国产剧情在线观看一区二区| 中文字幕av一区二区三区高| 精品99999| 日韩一区二区三区四区| 欧美一区二区久久|