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

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

COMP4233代做、代寫Python/Java程序
COMP4233代做、代寫Python/Java程序

時間:2025-06-04  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



COMP4233 25S
Programming Assignment
Introduction
In Lecture 11, we implement an integer calculator, which consists of 
- int : the only data type for integers
- + : binary operator for integer addition
- * : binary operator for integer multiplication
- ( ) : parentheses for force parsing
- parser and evaluator of the expressions in this language.
In Lab 11, we extend the language by let expression, identifiers and its evaluator in the 
substitution model. This upgrade implements a naming system for the language.
Syntax
In this programming assignment, you need to further extend the language with following 
features.
1. if … then … else … : the “if” expression, which can branch computations under 
some conditions.
2. fun … -> … : function definitions, which can also be with let to name them.
To make if statement work properly, we also need 
3. a new data type bool, the guard in if;
4. constants in bool are either true or false;
5. Boolean binary operator ^, boolean conjunction;
6. bool can be constructed from the relational operator <=, integer “less or equal to”.
We want to add a little bit more complex structure into our language, which are
7. a new data type list with only one constant list [] – the empty list; and
8. lists can be constructed by binary operator ::, which is right associative.
Combining everything above, the entire grammar is
<prog> -> <expr> EOF
<expr> -> int
 | <expr> + <expr>
 | <expr> * <expr>
 | ( <expr> )
 | id
 | let id = <expr> in <expr>
 | fun id -> <expr>
 | <expr> <expr>
 | if <expr> then <expr> else <expr>
 | bool
 | <expr> <= <expr>
 | <expr> ^ <expr>
 | []
 | <expr> :: <expr>
Note that <expr> -> <expr> <expr> is the syntax for function application.
For the precedence of operators, we only specify + is lower than *. Others will be guaranteed 
by parentheses. For example, ambiguous expressions like fun a -> a 1 will be excluded 
from testcases. This expression has to be either fun a -> (a 1) or (fun a -> a) 1.
Typing
To make your life easy, type system is excluded from this project. Thus, expressions with 
type errors, like 1 + true are excluded from testcases.
Evaluation
The evaluation for operators simply follows their behaviors in mathematics. Students should 
understand them easily. But if a student insists true ^ true --> false, marks will be 
remove. Goliath does not want to argue.
The evaluation for let expression is implemented by substitution model and already given in 
Lab 11.
let <x> = v in <expr> --> <e>{v / <x>}
(let <x> = v in <expr>){v / <y>} -->
if <x> = <y> then (let <x> = <expr>)
else (let <x> = <expr>{v / <y>}
Students should figure out the substitutions for functions, function applications, and lists by 
themselves, which is interesting and not difficult. Furthermore, we also guarantee that 
function arguments are of distinct names. Expressions like let x = z in (fun z -> x)
are excluded from testcases. The following substitution is naïve and not correct.
let x = z in (fun z -> x)
 --> (fun z -> x) {z / x}
 --> fun z -> x {z / x}
 --> fun z -> z
 -/->
Output
To printout an AST, two functions string_of_val and string_of_bop are defined in 
main.ml. You can also apply these functions to see if your implementation works normally.
Example
Here is one example, 
let x=(fun a -> (if (a <= 1) then true else false)) in ((x 1) :: [])
is parsed into 
and evaluated as
let x=(fun a -> (if (a <= 1) then true else false)) in ((x 1) :: [])
--> ((x 1) :: []){fun a -> .. /x}
--> ((x 1){fun a -> .. /x} :: []{fun a -> .. /x}
--> ((x{fun a -> .. /x} 1{fun a -> .. /x}) :: []{fun a -> .. /x})
--> (((fun a -> ..) 1{fun a -> .. /x}) :: []{fun a -> .. /x})
--> (((fun a -> ..) 1) :: []{fun a -> .. /x})
--> (((fun a ->(if (a<=1) then true else false) 1) :: [])
--> ((if (a <= 1) then true else false){1/a} :: [])
--> ((if (a <= 1){1/a} then true{1/a} else false{1/a}) :: [])
--> ((if (a{1/a} <= 1{1/a}) then true{1/a} else false{1/a}) :: [])
--> ((if (1 <= 1{1/a}) then true{1/a} else false{1/a}) :: [])
--> ((if (1 <= 1) then true{1/a} else false{1/a}) :: [])
--> ((if true then true{1/a} else false{1/a}) :: [])
--> (true{1/a} :: [])
--> (true :: [])
-/-> 
Submission
ast.ml and lexer.mll are given in the package. You only need to implement 
parser.mly and main.ml. You don’t need to change anything else, including file names.
Grade distribution
- Submission 5%
- Compilation 5%
- parsing if statements 15%
- evaluating if statements 10%
- parsing functions and function applications 15%
- evaluating functions and function applications 10%
- parsing & evaluating relational operator <= 10%
- parsing & evaluating Boolean conjunction ^ 10%
- parsing lists 10%
- evaluating lists 10%
Select the features that you have implemented in check_list.md by [x].

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

掃一掃在手機打開當前頁
  • 上一篇:代做159.342 、代寫Operating Systems 編程設計
  • 下一篇:代寫MIT203、代做SQL編程設計
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 trae 豆包網頁版入口 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

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

          9000px;">

                国产精品入口麻豆原神| 久久se精品一区精品二区| 亚洲色图欧美在线| 91网站最新地址| 日韩美女视频在线| 精品亚洲aⅴ乱码一区二区三区| 欧美三级一区二区| 性欧美疯狂xxxxbbbb| 日韩精品中文字幕在线一区| 高清国产午夜精品久久久久久| 国产网站一区二区| 91免费视频观看| 一区二区久久久久久| 欧美一区二区三区在线视频| 精品系列免费在线观看| 国产色一区二区| 色婷婷av一区| 亚洲成人手机在线| 精品女同一区二区| 99国产精品久久久久久久久久久 | 国产欧美久久久精品影院| 国产传媒日韩欧美成人| 亚洲少妇30p| 91精品国产高清一区二区三区| 国产自产2019最新不卡| 一区二区三区欧美亚洲| 51精品视频一区二区三区| 99精品热视频| 麻豆视频观看网址久久| 亚洲裸体xxx| 91精品国产欧美一区二区18| 93久久精品日日躁夜夜躁欧美| 美女精品一区二区| 婷婷中文字幕一区三区| 一区二区高清在线| 亚洲欧美日韩小说| 中文字幕中文在线不卡住| 欧美精品123区| 成人美女在线观看| 久色婷婷小香蕉久久| 亚洲中国最大av网站| 久久综合色播五月| 欧美视频一区在线| 欧美三级资源在线| 欧美日韩中文精品| 欧美日韩精品一区二区三区蜜桃| 91视频一区二区三区| 久久精品久久久精品美女| 亚洲gay无套男同| 欧美日韩综合在线免费观看| 五月婷婷综合在线| 欧美日韩国产成人在线免费| 国产精品亚洲专一区二区三区| 亚洲黄色免费网站| 国产亚洲欧美色| 日本中文字幕一区二区有限公司| 日韩视频在线一区二区| 欧美欧美欧美欧美首页| 在线观看一区二区视频| 97久久精品人人澡人人爽| 蜜桃视频在线观看一区二区| 美女在线视频一区| 国产一区二三区好的| 日韩高清一区在线| 精品系列免费在线观看| 麻豆久久久久久| 日韩成人av影视| 国产资源在线一区| 大尺度一区二区| 色哟哟精品一区| 在线播放中文一区| www国产成人免费观看视频 深夜成人网| 欧美精品一区二区三| 亚洲国产精品高清| 亚洲一区二区综合| 男女性色大片免费观看一区二区 | 91免费看`日韩一区二区| 欧洲一区二区av| 欧美一区二区三区白人| 久久精品夜色噜噜亚洲a∨ | 中文字幕乱码久久午夜不卡| 日韩一区日韩二区| 亚洲va在线va天堂| 国产一区二区三区免费观看| 91影院在线观看| 欧美视频精品在线| www日韩大片| 国产精品久久国产精麻豆99网站| 一区二区三区高清| 麻豆精品在线视频| 风间由美中文字幕在线看视频国产欧美| 99久久免费视频.com| 91精品欧美福利在线观看| 久久亚洲春色中文字幕久久久| 久久久久久毛片| 久久久www成人免费毛片麻豆| 一区二区三区加勒比av| 国内精品伊人久久久久av一坑| 成人一区二区三区在线观看 | 51精品秘密在线观看| 欧美成人高清电影在线| 中文字幕亚洲电影| 免费观看久久久4p| 欧美日韩中文国产| 久久精品视频免费| 日韩av午夜在线观看| a在线播放不卡| 欧美高清在线一区| 视频一区二区不卡| 春色校园综合激情亚洲| 91精品黄色片免费大全| 亚洲免费看黄网站| 北条麻妃国产九九精品视频| 欧美日韩国产高清一区二区| 国产精品国产三级国产三级人妇| 国产一区二区美女诱惑| 欧美日韩午夜在线| 中文字幕亚洲电影| 成人午夜看片网址| 制服丝袜日韩国产| 日本亚洲视频在线| 欧美精品777| 日本aⅴ免费视频一区二区三区| 欧洲精品在线观看| 一区二区高清视频在线观看| 91年精品国产| 亚洲一区二区三区在线播放| 欧美亚洲禁片免费| 无吗不卡中文字幕| 91麻豆精品国产| 裸体在线国模精品偷拍| 91精品国产高清一区二区三区蜜臀| 天天色图综合网| 精品人在线二区三区| 国产一区二区三区综合| 欧美电影精品一区二区| 美腿丝袜亚洲一区| 久久精品男人天堂av| 成人午夜激情影院| 亚洲精品国产高清久久伦理二区| 91成人在线免费观看| 亚洲国产精品久久一线不卡| 欧美片网站yy| 大陆成人av片| 亚洲午夜精品一区二区三区他趣| 欧美一级精品在线| 成人午夜视频福利| 亚洲一区二区3| 精品久久一区二区| 99国内精品久久| 天天影视涩香欲综合网| 国产日韩欧美精品综合| 91麻豆文化传媒在线观看| 一区二区三区中文免费| 日韩一区二区在线观看视频| 国产成都精品91一区二区三| 亚洲欧美国产三级| 欧美一区日韩一区| 国产精品综合av一区二区国产馆| 亚洲男人天堂av网| 亚洲精品一线二线三线| 91麻豆国产精品久久| 韩国精品主播一区二区在线观看| 国产精品久久网站| 欧美zozozo| 欧美又粗又大又爽| 国产精品亚洲人在线观看| 亚洲高清免费在线| 国产亚洲精品精华液| 欧美日韩一区二区三区在线| 麻豆成人久久精品二区三区红| 亚洲免费观看在线视频| 日韩免费视频一区二区| av影院午夜一区| 国产在线播放一区二区三区| 亚洲va欧美va人人爽| 中文字幕一区二区三区四区不卡| 日韩欧美久久一区| 欧美绝品在线观看成人午夜影视| 国产成人鲁色资源国产91色综 | 欧美怡红院视频| 成人高清视频免费观看| 奇米精品一区二区三区四区| 中文字幕亚洲一区二区va在线| 国产亚洲短视频| 欧美mv日韩mv| 91精品麻豆日日躁夜夜躁| 在线亚洲精品福利网址导航| 成人精品亚洲人成在线| 国产91精品入口| 精品一二线国产| 日韩精品免费视频人成| 天天色天天操综合| 婷婷国产在线综合| 五月综合激情网| 日韩精品三区四区| 亚洲午夜久久久久久久久电影院 | 日本怡春院一区二区| 中文字幕一区视频| 亚洲国产精品二十页|