CSE 340 Fall 2015
HOMEWORK 4
Assigned 11/4/2015
Due 11/16/2015 by 11:59:59 pm on Blackboard
Remember that late submissions are not accepted
for homework.
For all answers, show your work for partial credit.
All submissions should be typed. Excepti
CSE 340 FALL 2015
HOMEWORK 2
Assigned 9/9/2015
Due 9/23/2015 by 11:59:59 pm on blackboard
Remember that late submissions are not accepted for homework.
All submissions should be typed. Exception can only be made
mom MW w/w/is
Arizona State University
Computer Science and Engineering
CSE 340 F15 — Practice Midterm 2
T€§+1/\c\r>. marl everything carefully. Some statements can be tricky. l C :1 {A 7L
PROBLEM 1
fun f (a, b, c, d) = 1.0 + (if a then b[c] (1) else d[c]
Arizona State University
Computer Science and Engineering
CSE 340 F15 - Practice Midterm Exam 1
Q/ﬁ/l 5 Lat/r6 I eat] everything carefully. Some statements can be tricky.
PROBLEM I Consider the following regular expressions
1.letter=a|b|c|d LA
(2: «AIM?
Arizona State University
Computer Science and Engineering
CSE 340 F15 - Practice Midterm 2
1
Read everything carefully. Some statements can be tricky.
PROBLEM 1
fun
f (a, b, c, d) = 1.0 + (if a then b[c](d) else d[c](a)
The abstract syntax tree of f is th
CSE 340 Fall 2015
HOMEWORK 6 (MAKEUP)
Assigned 12/1/2015
Due 12/6/2015 by 11:59:59 pm on Blackboard
Remember that late submissions are not accepted for homework.
Note that this is a makeup homework, so your score on this homework will be multiplied
Arizona State University
Computer Science and Engineering
CSE 340 F15 - Practice Midterm Exam 1
1
Read everything carefully. Some statements can be tricky.
PROBLEM I Consider the following regular expressions
1. letter = a | b | c | d
2. LETTER = A | B |
CSE 340 Fall 2015
HOMEWORK 5
Assigned 11/30/2015
Due 12/5/2015 by 11:59:59 pm on Blackboard
Remember that late submissions are not accepted for homework.
For all answers, show your work for partial credit.
All submissions should be typed. Exceptio
CSE 340 FALL 2015
HOMEWORK 3:
Hindley Milner type checking
Problem 1. Consider the following declaration
fun f(a,b,c) = if b(a) then c(a)
else
c(b)
using Hindley-Milner type inference, determine the types of f.
Solution
Consider the following initial type
CSE 340 Fall 2015
HOMEWORK 5
Assigned 11/30/2015
Due 12/5/2015 by 11:59:59 pm on Blackboard
Remember that late submissions are not accepted for homework.
For all answers, show your work for partial credit.
All submissions should be typed. Exceptio
Problem 1 Version 2
Compute FIRST and FOLLOW sets for the following grammar.
S aAB | CD
A CD | SE |
B aSB | DS
C cC |
D DdC |
E eFg
F Fg |
Solution: Let us represent the grammar
CSE 340 Fall 2015
HOMEWORK 4
Assigned 11/4/2015
Due 11/16/2015 by 11:59:59 pm on Blackboard
Remember that late submissions are not accepted for homework.
For all answers, show your work for partial credit.
All submissions should be typed. Exceptio