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

          欧美日韩国产首页| 99综合精品| 国产精品每日更新| 久久久五月天| 亚洲一级在线| 亚洲乱码国产乱码精品精天堂| 国产欧美日韩综合精品二区| 欧美精品七区| 欧美不卡视频| 久久一区二区视频| 午夜精品亚洲一区二区三区嫩草| 最新国产拍偷乱拍精品| 国产一区二区三区观看 | aa成人免费视频| 在线视频成人| 一区视频在线看| 国产综合网站| 黄色欧美成人| 韩曰欧美视频免费观看| 国产欧美日韩麻豆91| 欧美视频日韩视频| 欧美性猛交一区二区三区精品| 欧美国产日韩在线| 欧美二区在线观看| 麻豆成人91精品二区三区| 久久久久.com| 快she精品国产999| 久久婷婷国产综合国色天香| 久久一区二区三区国产精品| 久久精品久久综合| 久久人91精品久久久久久不卡| 久久久7777| 蜜臀99久久精品久久久久久软件| 久久久久久久久久久久久女国产乱| 久久国产精品久久久久久电车| 欧美一区二区三区精品| 久久国产精品亚洲va麻豆| 久久国产欧美| 麻豆免费精品视频| 欧美日韩成人网| 国产精品毛片大码女人| 国产亚洲毛片| 亚洲黄一区二区三区| 91久久综合| 亚洲一区二区在线播放| 午夜欧美精品| 欧美成人中文| 国产精品v欧美精品v日本精品动漫| 国产精品久久久久久福利一牛影视 | 欧美不卡在线| 欧美三级电影大全| 国产视频亚洲精品| 亚洲国产欧美在线| 亚洲欧美国产va在线影院| 久久丁香综合五月国产三级网站| 久久亚洲色图| 国产精品红桃| 亚洲国产精品专区久久| 在线视频欧美精品| 久久久精品五月天| 欧美日韩亚洲免费| 国产真实精品久久二三区 | 欧美夫妇交换俱乐部在线观看| 欧美日本亚洲| 国内精品久久久久久久影视麻豆| 亚洲精品久久久一区二区三区| 亚洲欧美在线aaa| 欧美激情亚洲精品| 国产综合亚洲精品一区二| 一区二区欧美精品| 蜜桃久久精品一区二区| 国产欧美日韩综合| 亚洲免费观看| 久久精品久久99精品久久| 国产精品jvid在线观看蜜臀 | 久久久久久尹人网香蕉| 欧美日韩精品一区| 极品尤物久久久av免费看| 亚洲一区二区三区高清| 欧美另类视频| 亚洲精品国产精品乱码不99| 欧美一区二区三区在| 国产精品wwwwww| 亚洲美女av在线播放| 嫩模写真一区二区三区三州| 国产欧美日韩一区二区三区在线| 亚洲色图在线视频| 欧美喷水视频| 一本久久知道综合久久| 欧美激情一区二区三级高清视频| 韩日精品视频| 久久久久青草大香线综合精品| 国产乱码精品一区二区三区av| 亚洲一区二区三区三| 欧美日韩国产区一| 99精品欧美一区二区三区综合在线| 欧美99在线视频观看| 亚洲狠狠丁香婷婷综合久久久| 久久精品欧美| 精品成人a区在线观看| 久久人人97超碰国产公开结果| 国户精品久久久久久久久久久不卡| 欧美伊人久久大香线蕉综合69| 国产视频一区二区在线观看| 午夜亚洲伦理| 激情婷婷欧美| 欧美成人国产一区二区| 亚洲精品视频在线| 欧美天天影院| 午夜视黄欧洲亚洲| 激情成人中文字幕| 欧美精选午夜久久久乱码6080| 在线亚洲免费| 国产欧美va欧美不卡在线| 久久久久一区二区三区四区| 韩国av一区| 欧美精品在线观看| 亚洲免费中文字幕| 影院欧美亚洲| 国产精品国产三级欧美二区| 欧美一区二区| 亚洲精品九九| 国产精品一区二区久久国产| 久久久久综合网| 一区二区高清在线观看| 国产精品久久久久毛片软件| 久久激情网站| 亚洲少妇自拍| 在线日韩中文字幕| 国产精品国产三级国产普通话99| 午夜日韩视频| 日韩午夜黄色| 激情五月综合色婷婷一区二区| 欧美人成网站| 久久久蜜桃精品| 亚洲午夜av| 亚洲国产精品视频一区| 国产精品主播| 欧美日韩福利| 欧美成人69| 久久久久久久网| 亚洲色图制服丝袜| 亚洲激情啪啪| 国产综合色在线视频区| 国产精品久久一卡二卡| 欧美国产日韩一二三区| 久久九九热免费视频| 亚洲一级二级在线| 亚洲看片一区| 亚洲国产精品va在看黑人| 国产欧美欧美| 国产精品美女主播| 欧美区国产区| 欧美日本精品| 欧美激情精品| 欧美高清在线一区二区| 久久男人资源视频| 久久九九免费视频| 久久精品视频导航| 久久精品道一区二区三区| 午夜精品一区二区在线观看 | 亚洲免费视频中文字幕| 亚洲日韩欧美视频| 亚洲激情视频在线播放| 尹人成人综合网| 影音先锋亚洲精品| 尤物九九久久国产精品的分类| 国产亚洲精品高潮| 国产婷婷色一区二区三区| 国产精品丝袜白浆摸在线| 国产精品成人一区二区三区夜夜夜| 欧美日韩国产91| 国产精品二区三区四区| 国产精品欧美经典| 国产视频久久| 黄色成人在线| 亚洲第一精品电影| 最新国产精品拍自在线播放| 最新国产乱人伦偷精品免费网站 | 99精品欧美| 在线中文字幕不卡| 午夜欧美理论片| 久久精品视频网| 欧美大片91| 国产精品国产一区二区 | 久久久久久久高潮| 美女亚洲精品| 欧美体内she精视频| 国产日产欧产精品推荐色| 影音先锋中文字幕一区二区| 亚洲第一精品久久忘忧草社区| 亚洲国产综合91精品麻豆| 日韩视频免费观看| 亚洲欧美日韩区| 久久综合一区二区三区| 欧美日韩一区二区精品| 国产日韩欧美黄色| 亚洲日本va午夜在线影院| 午夜亚洲精品| 欧美成人午夜激情在线|