日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

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

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號線
  • 短信驗證碼 目錄網 排行網

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

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

    日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

      <em id="rw4ev"></em>

        <tr id="rw4ev"></tr>

        <nav id="rw4ev"></nav>
        <strike id="rw4ev"><pre id="rw4ev"></pre></strike>
        国产九区一区在线| 国产自产在线视频一区| 亚洲精品在线视频观看| 欧美激情综合| 国产精品成人观看视频国产奇米| 国产无一区二区| 亚洲视频一二| 欧美国产一区二区三区激情无套| 亚洲乱码国产乱码精品精98午夜| 国产精品爽爽爽| 国产一区二区三区直播精品电影| 国产伦精品一区二区三区照片91| 久久久噜噜噜久久中文字幕色伊伊| 国产日韩欧美一区二区| 久久久久久免费| 伊人婷婷欧美激情| 亚洲天堂av综合网| 久久久精品国产免费观看同学| 小黄鸭视频精品导航| 欧美一区二区三区免费看| 中日韩在线视频| 亚洲一区免费视频| 欧美日韩专区在线| 香蕉乱码成人久久天堂爱免费| 国产日韩av一区二区| 欧美成在线观看| 久久综合伊人| 国产麻豆精品theporn| 亚洲激情第一区| 一本大道av伊人久久综合| 国产精品成av人在线视午夜片| 欧美激情视频在线播放| 一本久久综合| 亚洲婷婷综合色高清在线| 亚洲精品乱码久久久久久黑人| 久久久久国产一区二区三区四区| 国产三区精品| 亚洲第一网站免费视频| 亚洲成人在线网站| 亚洲一级影院| 欧美福利电影在线观看| 亚洲视频一区二区在线观看| 国产精品美女久久| 亚洲天堂av电影| 久久亚洲精选| 欧美日韩国产一区二区三区| 雨宫琴音一区二区在线| 国产精品xvideos88| 久久综合色88| 亚洲三级毛片| 亚洲欧洲在线视频| 国产一区二区成人| 亚洲国产精品高清久久久| 国产精品免费福利| 亚洲精品少妇网址| 欧美性感一类影片在线播放| 欧美日韩一区二区三区在线视频| 欧美怡红院视频| 亚洲一区在线观看视频| 尤物视频一区二区| 欧美黄免费看| 在线观看久久av| 久久免费高清| 在线一区亚洲| 欧美日韩精品久久久| 国产欧美在线观看一区| 欧美精品福利| 国产精品99久久不卡二区| 欧美成年人在线观看| 亚洲精品国产品国语在线app| 亚洲精品久久在线| 欧美大片在线影院| 欧美日本免费一区二区三区| 久热国产精品视频| 开心色5月久久精品| 亚洲电影有码| 欧美大胆a视频| 久久一区二区三区国产精品| 毛片基地黄久久久久久天堂| 久久久99久久精品女同性| 亚洲精品中文字幕有码专区| 欧美日韩在线观看视频| 国产亚洲欧美一区二区| 欧美日韩免费观看一区| 久久人91精品久久久久久不卡| 欧美日本免费一区二区三区| 国产精品亚洲综合一区在线观看| 久久夜色精品国产亚洲aⅴ| 狠狠色香婷婷久久亚洲精品| 日韩手机在线导航| 久久偷看各类wc女厕嘘嘘偷窃| 国产三级精品三级| 国产一区二区三区网站| 欧美成人视屏| 欧美日韩一区三区| 欧美v国产在线一区二区三区| 久久国产精品一区二区三区| 久久中文在线| 亚洲欧洲三级| 久久综合久久美利坚合众国| 99国产一区二区三精品乱码| 亚洲精品乱码视频| 久久精品一区二区三区四区| 日韩视频在线观看国产| aaa亚洲精品一二三区| 欧美四级在线观看| 亚洲欧美日本精品| 久久中文精品| 国产一区二区精品久久99| 欧美日韩精品福利| 永久久久久久| 亚洲一二三四久久| 亚洲午夜激情网页| 在线观看日韩www视频免费| 久久久另类综合| 久久噜噜亚洲综合| 91久久精品日日躁夜夜躁国产| 欧美日韩极品在线观看一区| 国产精品99免费看| 国产日韩精品视频一区二区三区| 亚洲欧美日韩国产中文| 久久久亚洲高清| 欧美三区免费完整视频在线观看| 国内精品模特av私拍在线观看| 午夜视频在线观看一区| 久久尤物视频| 亚洲一二三区精品| 亚洲国产精品成人一区二区| 亚洲一区在线观看视频| 欧美视频免费在线| 欧美精品videossex性护士| 欧美中文字幕在线观看| 最新成人av在线| 国产精品影院在线观看| 国产一区二区在线观看免费| 亚洲一区中文| 国内久久精品| 欧美激情自拍| 欧美日韩国产经典色站一区二区三区| 一区二区三区欧美成人| 欧美午夜不卡影院在线观看完整版免费| 欧美在线免费观看亚洲| 国产精品极品美女粉嫩高清在线| 亚洲影院在线观看| 欧美日韩在线视频首页| 日韩亚洲欧美一区| 国模精品娜娜一二三区| 午夜视频精品| 亚洲精品日韩精品| 国产一区二区在线观看免费| 黄色一区二区在线| 性色av一区二区三区在线观看| 亚洲愉拍自拍另类高清精品| 伊人成人开心激情综合网| 国产精品国产成人国产三级| 一本久道综合久久精品| 亚洲一级免费视频| 一区二区三区高清| 欧美在线视频在线播放完整版免费观看| 久久久久久久波多野高潮日日| 国产精品欧美风情| 欧美日韩国产三级| 激情综合色综合久久| 欧美成人在线免费观看|