학교47 CPL 2-3: Higher Order Functions 목차 Abstract Syntax Tree (ASTs) context-free syntax Expr.NumExt = INT // integer literals Expr.TrueExt = [true] Expr.FalseExt = [false] Expr.IdExt = ID Expr.UnOpExt = [([UnOp] [Expr])] Expr.BinOpExt = [([BinOp] [Expr] [Expr])] UnOp.MIN = [-] UnOp.NOT = [not] UnOp.HEAD = [head] UnOp.TAIL = [tail] UnOp.ISNIL = [is-nil] UnOp.ISLIST = [is-list] BinOp.PLUS = [+] BinOp.MULT = [*] BinOp.MINUS = [-] BinO.. 2024. 3. 27. Lecture 4: Functions 목차 Learning Objectives- Explain what a higher-order function is; motivate usefulness- Explain what a lambda(λ) is; motivate usefulness- Explain the difference between val and def in Scala- Write simple programs involving lambdas- Explain how function application works by substituting parameters for arguments- Execute simple programs involvnig lambdas Why Higher-Order Functions?Higher-Order Func.. 2024. 3. 27. Lecture 8: Negotiation 목차 Why negotiate? Positive sitation: - Win-win opportunities - Short term relations (buying car, bike, etc...) - Long term relations Opposing interests, but also: - Power play (or war) will not lead to a solution (전쟁 등이 해결책으로 이어지지는 않음) - All parties need a solution (common interest) - All parties need to at least pretend to be willing Definitions (외워야 함) Party or Stakeholder - someone that has a.. 2024. 3. 26. CPL 1-2: Semantics and Transformations 목차 Translating from Java to Paret Example 1) Example 2) Example 3) Example 4) Mandatory Assignment desugar takes an abstract syntax tree (ExprExt) as input, and returns a core syntax tree (ExprC). interp takes a core syntax tree (ExprC) as input, and returns a value (Value). 1. Basics desugar: case TrueExt() => TrueC() case FalseExt() => FalseC() case NumExt(n) => NumC(n) case NilExt() => NilC().. 2024. 3. 26. 이전 1 ··· 3 4 5 6 7 8 9 ··· 12 다음 반응형