- 2024-10-08Cornell cs3110 - Chapter9 Lessons
使用Menhir构建SimPL的编译器LexerandParser语法分析模块Lexer,Parser,AST是三个依次耦合的模块,可以这么描述三者的关系:Lexer---tokens-->Parser---nodes-->AST相对于上面的图像化描述,cs3110反过来构建整个Lexer和Parser的结构在ast.ml中,定义了AST上
- 2024-10-05Cornell cs3110 - Chapter7 Exercises
(*Exercise:mutablefields*)typestudent={name:string;mutablegpa:float;}letstuA={name="Alice";gpa=3.7}let()=stuA.gpa<-4.0(*Exercise:intfun*)letinc=ref(funx->x+1)letnum=!inc3109(*Exercise:a
- 2024-10-04Cornell cs3110 - Chapter6 Exercises
(*Exercise:specgame*)(*Whereisanotherprogrammer?*)(*Exercise:polyspec*)(*[Poly]representsimmutablepolynomialswithintegercoeffcients*)moduletypePoly=sig(*[t]isthetypeofpolynomials*)typet(*[evalxp]is[p]e
- 2024-10-03Cornell cs3110 - Chapter5 Exercises
(*Exercise:complexsynonym*)moduletypeComplexSig=sigtypecomplexvalzero:complexvaladd:complex->complex->complexend(*Exercise:complexencapsulation*)moduleComplex:ComplexSig=structtypecomplex=float*flo
- 2024-10-02Cornell cs3110 - Chapter4 Exercises
(*Exercise:mysteryoperator1*)let($)fx=fx;;(*使得函数的连续调用具有一部分右结合的特质square$2+2与square2+2的运行结果分别是16和6*)(*Exercise:repeat*)letrecrepeatfnx=matchnwith|0->x|_->repeatf(n-1)
- 2024-10-02Cornell cs3110 - Chapter3 Exercises
(*Exercise:listexpressions*)letlist1=[1;2;3;4;5];;letlist2=1::2::3::4::5::[];;letlist3=[1]@[2;3;4;]@[5];;(*Exercise:product*)letrecproductl=matchlwith|[]->1|h::t->h*productt;;(*
- 2024-10-01Cornell University's Textbook Reading Systems(教科书阅读系统-康奈尔大学)
TextbookReadingSystemsTextbookreadingsystemshelpyouinteractwiththeinformationintextbookssothatyoucanbetterinternalizeandlearnSQ3RTheSQ3Risasystematicmethoddesignedforstudyingatextbook.DevelopedbyFrancisP.Robinson,
- 2024-08-14三种高效学习方法及资料推荐:提高学习效率的秘诀
1.费曼学习法(FeynmanTechnique)简介:费曼学习法是一种通过教授他人来巩固自己所学知识的方法。这种方法要求学习者将复杂的概念简化成易于理解的形式,并能够向他人清晰地解释这些概念。如果在解释过程中遇到困难,则返回原点,深入学习直至完全理解。步骤:选择一个概念。假设