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

                北条麻妃国产九九精品视频| 美女免费视频一区| 在线观看亚洲成人| 成人动漫av在线| 国产一区二区伦理| 久久99精品国产麻豆婷婷洗澡| 有坂深雪av一区二区精品| 欧美激情一区二区三区在线| 久久亚洲一区二区三区四区| 欧美一区二区三区视频免费播放| 欧美性受极品xxxx喷水| 91福利视频网站| 欧美日韩一级黄| 欧美私人免费视频| 欧美剧情片在线观看| 欧美二区乱c少妇| 91精品国产综合久久久久久久久久| 欧美日韩国产欧美日美国产精品| 在线不卡免费av| 2023国产一二三区日本精品2022| 国产欧美视频一区二区| 综合av第一页| 亚洲二区在线视频| 日本网站在线观看一区二区三区| 久久精品国产一区二区三 | 欧美综合在线视频| 欧美中文字幕一二三区视频| 91精品国产丝袜白色高跟鞋| www激情久久| 中文字幕中文字幕中文字幕亚洲无线| 一区二区在线观看视频| 久久精品国产一区二区| 成人动漫视频在线| 欧美日韩国产小视频| 久久亚洲综合色| 亚洲少妇最新在线视频| 日本不卡一区二区三区| 成人性视频免费网站| 欧美日本在线看| 久久精品亚洲精品国产欧美kt∨| 亚洲色图清纯唯美| 玖玖九九国产精品| 99久久er热在这里只有精品66| 91成人在线精品| 久久免费视频色| 亚洲1区2区3区4区| 成人不卡免费av| 日韩欧美高清在线| 亚洲精品乱码久久久久久久久 | 久久网这里都是精品| 亚洲女同女同女同女同女同69| 日韩国产一二三区| 一本色道久久综合亚洲aⅴ蜜桃| 日韩一区二区麻豆国产| 亚洲色图另类专区| 国产一区二区女| 欧美日韩亚州综合| 国产精品每日更新| 国模无码大尺度一区二区三区| 色哟哟一区二区三区| 久久久久久久久久美女| 蜜桃精品视频在线| 欧美日韩一区成人| 一区二区三区在线播| 成人一级黄色片| 精品999在线播放| 三级久久三级久久| 欧洲精品在线观看| 亚洲免费在线视频| 91视频在线观看免费| 久久久久国产精品厨房| 美女网站色91| 欧美一区二区三区视频免费| 亚洲va欧美va人人爽午夜| jvid福利写真一区二区三区| 精品91自产拍在线观看一区| 日韩一区精品视频| 6080日韩午夜伦伦午夜伦| 亚洲国产乱码最新视频| 欧美在线视频日韩| 亚洲一区二区三区三| 一本一道久久a久久精品综合蜜臀 一本一道综合狠狠老 | 69堂精品视频| 视频精品一区二区| 欧美精品电影在线播放| 亚洲综合一区二区| 欧洲亚洲精品在线| 亚洲不卡av一区二区三区| 欧洲亚洲国产日韩| 午夜视频在线观看一区| 欧美日本在线一区| 亚洲成人精品一区| 日韩三级在线免费观看| 男男视频亚洲欧美| 精品日本一线二线三线不卡| 日韩电影免费在线观看网站| 欧美精品丝袜中出| 久久精品国产亚洲一区二区三区 | 亚洲人成精品久久久久久| av中文一区二区三区| 中文字幕亚洲一区二区va在线| www.亚洲免费av| 一区二区三区中文字幕| 欧美男同性恋视频网站| 另类欧美日韩国产在线| 欧美mv日韩mv| 国产精品一区二区三区四区| 不卡电影一区二区三区| 成人做爰69片免费看网站| 国产精品久久久久久久岛一牛影视| 成人亚洲一区二区一| 亚洲视频在线一区| 色婷婷综合激情| 亚洲国产日韩在线一区模特| 这里是久久伊人| 国产成人免费在线观看不卡| 自拍偷在线精品自拍偷无码专区| 欧美日韩精品是欧美日韩精品| 欧美日韩高清一区二区不卡| 国产精品精品国产色婷婷| 国产精品久久久久久久久晋中 | 一本久久a久久精品亚洲| 亚洲色欲色欲www在线观看| 欧美三级中文字幕在线观看| 美女久久久精品| 国产精品久久久久久久久免费樱桃| 色88888久久久久久影院野外| 日韩在线一二三区| 欧美韩日一区二区三区| 欧美酷刑日本凌虐凌虐| 成人av影视在线观看| 天堂成人免费av电影一区| 久久久美女艺术照精彩视频福利播放| 91丨porny丨国产入口| 九九九精品视频| 亚洲电影在线免费观看| 中文字幕乱码一区二区免费| 欧美精品aⅴ在线视频| jiyouzz国产精品久久| 久久国产人妖系列| 亚洲国产视频a| 亚洲日本丝袜连裤袜办公室| 26uuu色噜噜精品一区二区| 欧美午夜片在线观看| 国产成人av一区| 精品一区二区三区在线观看| 亚洲在线观看免费视频| 国产精品欧美久久久久无广告| 日韩视频在线永久播放| 欧美亚一区二区| 91污在线观看| 成人黄色av电影| 国产精品中文字幕日韩精品| 奇米色777欧美一区二区| 亚洲国产另类av| 依依成人精品视频| 综合色天天鬼久久鬼色| 国产精品久久久久久久久免费相片| 久久久久国产精品麻豆| 久久久久久久综合日本| 亚洲欧美国产77777| 国产女人aaa级久久久级| 精品精品国产高清a毛片牛牛| 欧美日本乱大交xxxxx| 在线观看视频欧美| 色偷偷久久人人79超碰人人澡 | 色香蕉久久蜜桃| 一本一道久久a久久精品| 91麻豆精品在线观看| 91老师片黄在线观看| 色综合久久中文综合久久97| 成人黄色在线视频| 91视频免费观看| 欧美亚洲禁片免费| 欧美精品v国产精品v日韩精品| 正在播放一区二区| 精品国产麻豆免费人成网站| 2023国产精华国产精品| 久久精品网站免费观看| 国产日韩综合av| 亚洲麻豆国产自偷在线| 亚洲一区在线视频观看| 午夜久久电影网| 国产中文字幕精品| 丁香六月综合激情| 91在线一区二区| 欧美色区777第一页| 日韩女优电影在线观看| 国产三级欧美三级日产三级99 | 亚洲狠狠丁香婷婷综合久久久| 亚洲一线二线三线视频| 免费成人在线视频观看| 国产成人精品网址| 日本二三区不卡| 欧美一区二区免费| 国产日产欧美一区二区三区| 一区二区三区欧美日| 精品一区二区三区免费播放| eeuss鲁片一区二区三区| 欧美日韩中文精品|