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;">

                欧美日韩国产经典色站一区二区三区| 狠狠色狠狠色综合系列| 在线观看国产一区二区| 国产精品一区一区三区| 免费国产亚洲视频| 久久九九国产精品| 欧美精品一区二区三区四区| 日韩一区二区三| 日韩一级在线观看| 欧美日韩精品欧美日韩精品一 | 成人黄色免费短视频| 国产乱码一区二区三区| 国产精品1024| 99麻豆久久久国产精品免费 | 日韩精品一二三| 在线观看亚洲精品| www.欧美精品一二区| 粉嫩一区二区三区性色av| 国产成人在线免费| 欧美无人高清视频在线观看| 亚洲欧美日韩一区二区| 这里只有精品视频在线观看| 成人午夜av在线| 免费在线欧美视频| 中文字幕一区二区在线播放| 宅男在线国产精品| 成人网在线免费视频| 欧美日韩精品一二三区| 欧美伊人久久大香线蕉综合69 | 日韩欧美一卡二卡| 精品成人佐山爱一区二区| 久久一区二区三区四区| 国产精品美女久久久久久久| 久久国产精品第一页| 国产一区二区三区国产| 91美女福利视频| 欧美一级欧美三级| 久久久99久久精品欧美| 综合久久久久久| 日韩成人av影视| 99re亚洲国产精品| 日韩欧美在线123| 国产精品―色哟哟| 午夜久久久影院| 国产高清精品在线| 欧美福利视频一区| 国产丝袜美腿一区二区三区| 夜夜嗨av一区二区三区网页| 麻豆精品一区二区三区| 成人aaaa免费全部观看| 欧美日韩你懂的| 久久新电视剧免费观看| 午夜久久久久久| 972aa.com艺术欧美| 精品国产区一区| 亚洲精品欧美专区| 成人短视频下载| 精品国内片67194| 日韩和的一区二区| 欧美伊人久久久久久久久影院| 国产日韩高清在线| 国产曰批免费观看久久久| 欧美放荡的少妇| 亚洲综合激情另类小说区| 成人一区在线看| 久久亚洲一级片| 日韩精品一区国产麻豆| 丁香天五香天堂综合| 亚洲高清视频的网址| 久久久久久电影| 美腿丝袜在线亚洲一区| 色婷婷激情一区二区三区| 欧美极品xxx| 国精产品一区一区三区mba桃花| 欧美精品一区男女天堂| 久久青草欧美一区二区三区| 国产午夜精品美女毛片视频| 中文字幕av一区二区三区免费看| 1区2区3区欧美| 一二三区精品福利视频| 精品剧情在线观看| 一区在线观看免费| 成人黄动漫网站免费app| 欧美激情综合在线| jlzzjlzz亚洲日本少妇| 中文字幕的久久| 色综合天天综合狠狠| 国产精品黄色在线观看| 成人免费高清视频| 国产精品免费aⅴ片在线观看| 国产福利一区二区| 国产免费观看久久| 99精品久久只有精品| 亚洲精品国产无套在线观 | 91亚洲午夜精品久久久久久| 亚洲图片激情小说| 在线免费观看一区| 日本aⅴ亚洲精品中文乱码| 欧美成人vps| 国产美女在线精品| 亚洲色图都市小说| 欧美日韩国产综合一区二区三区| 视频一区二区中文字幕| 精品久久久久香蕉网| 懂色av一区二区三区免费观看 | 日韩一区二区三区在线| 国产在线播放一区三区四| 中文字幕日本不卡| 欧美三级电影在线看| 久久国产精品72免费观看| 国产精品久久久久影院亚瑟| 在线一区二区视频| 另类小说综合欧美亚洲| 国产精品久久一卡二卡| 欧美日免费三级在线| 激情深爱一区二区| 亚洲精品大片www| 欧美本精品男人aⅴ天堂| 成人动漫av在线| 日本成人在线看| 中文字幕一区二区三| 欧美一区二区三区人| av午夜一区麻豆| 久久精品国产免费| 一区二区三区中文免费| 久久久久99精品一区| 欧美日韩精品欧美日韩精品一综合| 国产成人在线色| 日本亚洲一区二区| 亚洲人妖av一区二区| 欧美一区二区三区视频免费| 99久久精品免费| 国产激情视频一区二区在线观看 | 精品国产露脸精彩对白| 国产一区二区三区观看| 国产毛片精品视频| 国产精品综合av一区二区国产馆| 99久久综合国产精品| 欧美国产精品一区| 波多野结衣视频一区| 一片黄亚洲嫩模| 欧美一区二区在线视频| 国产乱码一区二区三区| 欧美日本一区二区| 天天综合色天天综合| 最新不卡av在线| 日本一区二区电影| wwwwxxxxx欧美| 日韩视频免费直播| 欧美日韩日日摸| 欧美性xxxxxx少妇| 在线视频亚洲一区| 在线观看国产一区二区| 日本道免费精品一区二区三区| 国产精品亚洲人在线观看| 狠狠狠色丁香婷婷综合激情| 麻豆91免费看| 激情综合一区二区三区| 裸体在线国模精品偷拍| 日精品一区二区三区| 亚洲国产成人av网| 亚洲一区欧美一区| 亚洲chinese男男1069| 性久久久久久久| 日韩精品一二三四| 久久成人免费电影| 国产精品自拍一区| 国产黄色精品视频| 成人亚洲一区二区一| 成人午夜视频在线| av网站一区二区三区| 在线亚洲人成电影网站色www| 在线一区二区观看| 欧美一区二区三区四区视频| 日韩无一区二区| 久久噜噜亚洲综合| 中文字幕亚洲一区二区av在线| 国产精品色婷婷| 亚洲精品欧美二区三区中文字幕| 一级精品视频在线观看宜春院| 天天综合网天天综合色| 麻豆精品视频在线| 成人动漫在线一区| 91福利小视频| 日韩欧美一区二区不卡| 亚洲国产成人自拍| 亚洲综合色自拍一区| 日本午夜一本久久久综合| 国产综合久久久久久久久久久久| 国产999精品久久久久久| 91香蕉视频黄| 日韩一本二本av| 中文字幕一区二区三区精华液| 午夜国产精品一区| 国产福利一区在线| 在线观看av一区二区| 日韩亚洲欧美成人一区| 日韩精品一区二区三区四区| 蜜臀av一区二区| 欧美精品精品一区|