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編程設計
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網

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

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

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

          久久人人97超碰精品888| 女生裸体视频一区二区三区| 欧美日韩综合| 亚洲精品一区二区三区不| 亚洲婷婷综合久久一本伊一区| 国产一级揄自揄精品视频| 亚洲国产二区| 欧美激情在线免费观看| 午夜亚洲精品| 99国产精品99久久久久久粉嫩| 久久婷婷国产麻豆91天堂| 国产日韩欧美精品| 亚洲欧美清纯在线制服| 国产精品美女www爽爽爽| 亚洲网站在线播放| 国产精品呻吟| 先锋影音网一区二区| 国产精品卡一卡二| 午夜伦欧美伦电影理论片| 国产精品影院在线观看| 亚洲自拍偷拍一区| 欧美视频在线观看| 亚洲一区观看| 国产亚洲欧美在线| 久久久天天操| 亚洲夫妻自拍| 欧美日韩亚洲免费| 亚洲午夜高清视频| 国产拍揄自揄精品视频麻豆| 欧美一级一区| 亚洲高清免费| 欧美私人网站| 欧美在线影院在线视频| 韩日在线一区| 欧美激情在线狂野欧美精品| 亚洲视频每日更新| 国产欧美视频一区二区三区| 久久人人爽国产| 亚洲精品乱码久久久久久| 欧美午夜精品伦理| 久久久另类综合| 日韩一级精品| 国产欧美三级| 欧美大片免费观看| 亚洲欧美国产另类| 在线欧美日韩精品| 欧美视频1区| 久久久久综合一区二区三区| 亚洲精品你懂的| 国产精品一区二区你懂得| 麻豆九一精品爱看视频在线观看免费| 99国产精品久久久久久久久久| 国产精品综合网站| 欧美电影在线观看| 欧美亚洲在线观看| 99精品国产在热久久下载| 国产日韩精品在线观看| 欧美另类一区二区三区| 久久国产一区二区| 在线一区观看| 亚洲电影av| 国产精品视频内| 欧美日韩精品免费观看视频| 久久精品国产v日韩v亚洲| 夜夜嗨av色一区二区不卡| 原创国产精品91| 欧美日韩亚洲视频| 久久国产高清| 国产视频久久| 99成人在线| 美女成人午夜| 国产专区欧美精品| 欧美xart系列高清| 欧美日本中文| 国产日本欧美视频| 国产婷婷色一区二区三区在线| 欧美在线视频观看免费网站| 国产精品s色| 亚洲国产精品一区二区第一页| 久久亚洲欧美| 麻豆精品精华液| 久久中文字幕导航| 久久久久久久综合色一本| 国产一区导航| 亚洲一区在线免费观看| 欧美日本一区二区高清播放视频| 欧美日韩一区在线视频| 亚洲第一级黄色片| 国产精品日韩在线观看| 欧美日本国产视频| 狠狠色综合网| 欧美寡妇偷汉性猛交| 99国内精品久久久久久久软件| 欧美日韩国产专区| 你懂的国产精品| 久久只有精品| 欧美日本三区| 欧美偷拍另类| 日韩视频二区| 欧美午夜精品久久久久久人妖 | 激情久久久久久久| 国产主播喷水一区二区| 国产一区二区高清| 国产字幕视频一区二区| 最新亚洲视频| 在线亚洲一区二区| 亚洲在线第一页| 欧美一区永久视频免费观看| 日韩亚洲一区二区| 国内精品一区二区| 欧美日本高清视频| 亚洲欧美中文日韩在线| 亚洲蜜桃精久久久久久久| 国产精品一区在线观看你懂的| 亚洲精品欧美激情| 亚洲三级视频| 一区二区三区国产| 亚洲欧美日韩国产综合| 亚洲视频视频在线| 久久久久久久综合狠狠综合| 亚洲福利在线看| 999在线观看精品免费不卡网站| 亚洲美女少妇无套啪啪呻吟| 99精品视频免费全部在线| 亚洲欧美日韩在线| 久久夜色精品国产噜噜av| 欧美伦理视频网站| 国产精品久久久久久久久婷婷 | 国产一区二区三区丝袜| 国产精品视区| 国产偷国产偷亚洲高清97cao| 亚洲精品国产精品久久清纯直播| 欧美主播一区二区三区美女 久久精品人 | 久久久久久97三级| 久久久久se| 欧美成年人视频网站| 国产精品人人爽人人做我的可爱| 国产午夜精品久久久久久免费视| 亚洲日本va午夜在线电影| 亚洲一区自拍| 国产精品视频yy9099| 黑丝一区二区三区| 在线观看亚洲a| 夜夜狂射影院欧美极品| 在线日韩日本国产亚洲| 99在线热播精品免费99热| 亚洲精品美女久久久久| 亚洲精选大片| 久久免费黄色| 国产精品久久午夜夜伦鲁鲁| 亚洲国产日韩美| 玖玖精品视频| 欧美午夜免费| 在线观看日韩一区| 久久综合色88| 亚洲黄色免费电影| 欧美成人亚洲| 欧美亚洲综合久久| 韩国美女久久| 久久综合一区| 99在线观看免费视频精品观看| 牛牛国产精品| 亚洲一区日韩| 国产一区二区高清视频| 久热精品视频在线| 日韩一级欧洲| 国产一区在线观看视频| 美女黄毛**国产精品啪啪 | 国产喷白浆一区二区三区| 久久激情网站| 性欧美videos另类喷潮| 国产欧美一区二区视频| 99亚洲一区二区| 久久性色av| 亚洲一区二区三区免费视频| 久久精品国产久精国产思思| 国产欧美综合一区二区三区| 性做久久久久久久免费看| 国产伦理精品不卡| 久久xxxx精品视频| 在线视频欧美日韩精品| 国产在线乱码一区二区三区| 欧美风情在线观看| 久久精品青青大伊人av| 欧美在线免费一级片| 国产精品日韩二区| 一个色综合导航| 国产麻豆日韩欧美久久| 亚洲免费一区二区| 亚洲第一页中文字幕| 欧美日韩mv| 国产精品theporn88| 久久免费国产精品| 欧美一区二区久久久| 欲色影视综合吧| 国内伊人久久久久久网站视频 | av成人免费观看| 99精品国产一区二区青青牛奶| 在线观看欧美日韩| 1769国产精品|