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爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          99re热精品| 欧美日韩在线影院| 亚洲肉体裸体xxxx137| 国产精品美女久久久| 久久综合一区二区| 亚洲欧美在线看| 中文精品视频| 亚洲国产小视频在线观看| 国产美女精品| 国产精品乱码| 欧美午夜影院| 欧美日本三级| 欧美精品一区二区三区四区| 欧美一区二区免费视频| 在线视频欧美精品| 中文av一区特黄| 一区二区欧美日韩视频| 欧美精品一区二区蜜臀亚洲| 小辣椒精品导航| 99精品欧美一区| 亚洲国产精品va| 黄色免费成人| 一区在线影院| 亚洲国产裸拍裸体视频在线观看乱了中文 | 亚洲国产成人在线| 在线观看视频一区二区欧美日韩 | 亚洲一区二区高清| 亚洲精品乱码| 一本到12不卡视频在线dvd| 亚洲高清不卡在线| 亚洲国产精品va| 先锋影音一区二区三区| 亚洲三级国产| 亚洲精品乱码久久久久久按摩观| 国产中文一区二区| 国内视频精品| 亚洲精品少妇| 制服丝袜激情欧洲亚洲| 亚洲综合国产| 国产精品xxx在线观看www| 毛片基地黄久久久久久天堂 | 久久一区精品| 另类天堂av| 欧美日韩一二三四五区| 国产精品久久国产精品99gif | 欧美午夜精品一区二区三区| 欧美日韩国产一区精品一区| 欧美视频中文一区二区三区在线观看| 欧美精品在线免费| 国产亚洲精品v| 激情国产一区| 日韩写真在线| 性久久久久久久久| 欧美国产精品| 国产区精品视频| 91久久精品美女高潮| 亚洲一区二区三区在线看 | 中文久久精品| 久久久国产精品一区| 欧美精品成人在线| 国产亚洲激情| 一区二区三区国产在线| 欧美在线观看视频一区二区| 欧美激情视频网站| 亚洲国产精品成人va在线观看| 亚洲自拍三区| 美女图片一区二区| 欧美视频在线一区| 黑人极品videos精品欧美裸| 9色国产精品| 欧美不卡高清| 黄色一区二区在线| 宅男噜噜噜66一区二区| 欧美69视频| 精品不卡一区| 久久久av毛片精品| 国产农村妇女精品一区二区| 一区二区免费在线视频| 欧美va天堂va视频va在线| 国内成人自拍视频| 性伦欧美刺激片在线观看| 欧美四级在线观看| 亚洲黄色一区二区三区| 久久免费的精品国产v∧| 国产三级欧美三级| 亚洲直播在线一区| 国产精品a久久久久久| 99精品久久久| 欧美日韩一级片在线观看| 91久久久精品| 欧美va亚洲va国产综合| 亚洲高清久久| 美乳少妇欧美精品| 亚洲国产精品成人| 欧美福利电影在线观看| 亚洲国产日韩欧美在线图片| 久久一区二区精品| 亚洲大片在线观看| 欧美国产一区二区三区激情无套| 在线电影国产精品| 欧美高清视频在线播放| 亚洲国产精品一区制服丝袜| 猛干欧美女孩| aa日韩免费精品视频一| 欧美日韩在线观看一区二区| 一区二区三区国产在线| 国产精品爱啪在线线免费观看| 亚洲色诱最新| 国产一区二区高清视频| 久久乐国产精品| 亚洲国产精品久久精品怡红院| 99精品久久| 国产精品久久一卡二卡| 亚洲在线免费| 韩国在线视频一区| 欧美黄色一级视频| 一区二区三区免费网站| 国产精品无人区| 久久久爽爽爽美女图片| 亚洲人精品午夜| 国产精品一二三四| 久久午夜羞羞影院免费观看| 日韩亚洲在线| 国产在线高清精品| 欧美精品在线免费| 性8sex亚洲区入口| 最新高清无码专区| 国产欧美91| 欧美精选一区| 久久久精品动漫| 亚洲精品中文字幕有码专区| 国产精自产拍久久久久久| 美女免费视频一区| 亚洲午夜三级在线| 18成人免费观看视频| 午夜在线不卡| 亚洲精品欧洲| 国产精品青草久久| 欧美a级片网站| 亚洲欧美日韩国产中文| 亚洲精品久久久一区二区三区| 国产精品视频内| 欧美日韩网站| 欧美刺激性大交免费视频| 久久精品99久久香蕉国产色戒| 99精品国产高清一区二区| 一区在线视频| 国产午夜久久| 国产精品一二三视频| 欧美连裤袜在线视频| 免费观看成人| 久久久精彩视频| 久久gogo国模裸体人体| 亚洲欧美精品suv| 亚洲视频在线观看| av成人免费观看| 亚洲乱码日产精品bd| 亚洲高清免费视频| 亚洲成人在线观看视频| 尤物在线精品| 1024成人网色www| 亚洲精品国产精品久久清纯直播| 国产美女一区| 国产情人节一区| 国产精品免费小视频| 国产精品久久二区二区| 欧美日韩在线一区| 欧美日韩精品在线视频| 欧美日韩免费高清| 欧美午夜免费影院| 国产精品久久一级| 国产精品热久久久久夜色精品三区| 欧美精品一卡| 国产精品二区影院| 国产欧美日韩激情| 激情欧美一区二区三区在线观看| 激情视频一区二区三区| 一区二区视频欧美| 亚洲三级免费| 亚洲视频免费| 久久国产婷婷国产香蕉| 久久久噜噜噜久久狠狠50岁| 免费在线亚洲欧美| 欧美日韩国产综合在线| 国产精品h在线观看| 国产婷婷色一区二区三区四区| 黄色亚洲在线| 国产一区二区三区在线观看精品 | 欧美日韩综合另类| 欧美性淫爽ww久久久久无| 国产精品国产三级国产普通话99 | 国产欧美日韩在线| 欧美.com| 国产精品久久久一区二区| 国产日韩1区| 亚洲精品一区二区三区不| 亚洲午夜极品| 久久久免费av| 欧美日韩在线免费观看| 国产香蕉久久精品综合网|