- January 20, 2016
Lecture 1: Introduction: Administrivia, Formal Languages review
SC Ch 1, 2.1, 2.2.1, 2.4.1; ASU Ch 3.1-3.4; or a book about automata theory.
- January 25, 2016
Lecture 2: context-free languages, grammars, deterministic parsing techniques (Top Down;)
covered slides 1-22
SC Ch 2.3; ASU Ch 4.1-4.4;
Changed slide 21 definition of Follow set
Questions to think about:
---Can we write the function signature grammar as a regular expression?
---Try to write a grammar for logical expressions with Boolean variables and the operators
AND, OR, NOT; make sure to impose the right precedence by the grammar rules
- January 27, 2016
Lecture 3: Deterministic parsing techniques, comparison of TD and BU,
Bottom Up (shift-reduce) parsing, ambiguity
covered Formal-2 slides #22-24; Formal-3 slides #1-14
SC Ch 2.3; ASU Ch 4.5, 4.7-4.8;
January 31, 2016: updated sldies to include a new slide #16 with rules for formation
of Follow() sets.
- February 1, 2016
Lecture 4: Bottom up parsing continued SLR(1), LR(k) parsing, overview
of LALR parsing, utiilty of ambiguous grammars in parsers
SC Ch 2.3; ASU Ch 4.5, 4.7-4.8;
---After we do an example of SLR(1) in class, try to write the LR(1) parser for the
same example grammar.
Corrected slide #16 on formation of Follow Sets.
A corrected version of the parser that we did on the board on 2/1/2016.
- February 3, 2016
Lecture 5:
Prolog, logic programming, Prolog syntax, computing with facts,
goal-directed semamtics, lists in Prolog, list membership function,
negation as failure
covered slides #1-20
SC Ch 11
- Turn on the trace command (trace.) and execute the queries for member that
are in the class notes. Make sure your input file has the member clauses in the
same order as was given in class.
- WHat happens if you switch the rule order?
- Add some more parent clauses to the Victoria program to show that Queen Victoria was the child
Prince Edward, Duke of Kent and Stratheam and Princess Victoria of Saxe-Coburg-Saalfed. Add a
grandparent clause to the Prolog program: grandparent(X,Y) means X is the grandparent of Y.
Test your clauses in combination with the rest of the Victoria program from the notes.
This will be easier of you create a file for all the clauses and facts: victoria.pl and then
load it into the Prolog runtime environment using consult("victoria.pl"). command.
Make sure you are in the right home directory before starting off SWI-Prolog.
References
- SWI-Prolog manual and
tutorials online.
- another Prolog online tutorial
and yet another one
- REQUIRED reading for Prolog Assignment:
Logic Programming and Compiler Writing, David H. D. Warren,
published in Software, Practice and Experience, Vol 10, 1980, pp 97—125;
now available online from Wiley publishers online through VT;
DOI: 10.1002/spe.4380100203
- Errata for Warren
Paper
- Algorithm == Logic + Control, Robert Kowalski, CACM, July 1979, vol 22,
no 7. Available in ACM DL from VT.
- February 8, 2016
Lecture 6:
part A negation as failure, search trees
part B tracing in Prolog, data structures: Trees and tree walking,
unification, Cut.
Covered 1st Prolog lecture slides #21-29; 2nd Prolog lecture slides #1-17.
SC Ch 11, S Ch 11 especially 11.5, 11.6
Traces:
Some easy Prolog problems to think about coding as you get started
are listed below. We will be coding some of these today in class.
- Find the last element of a Prolog list.
- Find the i-the element of a Prolog list.
- Build Prolog clauses that will reverse a Prolog list that it is given.
This is where we stopped coding in class...
- A string is a palindrome if it reads the same backwards and
forwards. Here is an example: "Madam I'm Adam". Let's use this idea
with Prolog lists and define a palendrome to be a list that is the
same as its reverse. Write Prolog clauses to check whether or not a
list is a palindrome
- February 10, 2016
Lecture 7: Worked collaboratively on Prolog problems above in class.
Look at the two reverse functions that we wrote in class:
append([],A,A).
append([A|B],C,[A|D]) :- append(B,C,D).
rev([],[]).
rev([W|T],A) :- rev(T,R), append(R,[W],A).
pal(X) :- rev(X,Y), Y = X.
revrse(L1,L2) :- revv(L1, [], L2).
revv([],L,L).
revv([X|L],L2, L3) :- revv(L, [X|L2],L3).
Try to execute these with trace on and see
how the list construction [X|Y] is being used in each.
- February 17, 2016 (Feb 15th-Snow day)
Lecture 8:
Prolog compiler from the Warren paper (see above for reference).
- February 24, 2016
Lecture 9:
Types, static and dynamic type checking, type safe programs,
declared types (i.e., explicit), implicit types, polymorphism, coercion,
generics
SC Ch 7: 7.1,7.2.1-7.2.2, 7.3-7.5; S Ch 4
- February 29, 2016
Lecture 10:
Review of polymorphism, Type reconstruction, How to infer types for an
expression, a function? Curried functions
Type reconstruction handout
Covered Types-2 slides #1-15
SC Ch 7.23-7.24, 7.31-7.32; ASU Ch 6.6
Some type reconstruction problems to think about when looking at
remainder of the slides in this lecture which contain the type
reconstruction algorithm for functions.
how do we type the following functions?
function double(X) { return 2*X }
function abs(X) { if (X<0) then return -X else return X }
- March 2, 2016
Lecture 11:
Recursive algorithm for type reconstruction and examples of its application.
Functional programming
pure functional programming, S-expressions, defining functions
Covered slides #1-7 in Functional-10; fixed slides #10,18,20; last edited 3/21/16
- March 14, 2016
Lecture 12:
Review of type reconstruction, reviewed introduction to functional programming;
SC Ch 11.1-11.3
Covered slides #7-12 in Functional
- March 15, 2016 MIDTERM
- March 21, 2016
Lecture 13:
Examples of deep and shallow recursion, equality testing
Higher order functions
map, apply, reductions: foldr, foldl, lexical scoping in Scheme
SC Ch 11.6, DrRacket tutorials
Covered slides # 12-20 in Functional; covered slides # 1-8 in Functional-2.
Corrected slide #7
DrRacket - how to install and first intro
Try some of the following codes in DrRacket and experiment
with step-ping:
demo
higherOrder
foldll
foldrr
lets
- March 23, 2016
Lecture 14:
reductions: foldr, foldl.
Covered slides #8-16 in Functional-2 (up to the let's)
- March 28, 2016
Lecture 15
Let expressions and lexical scoping in Scheme;
Covered slides #16-18; corrected slide #18 3/29/16;
Functional-3
Static and dynamic scoping, tail recursion
Covered slides #1-19; corrected typo on slide #19 3/29/16
SC 3.3.1-3.3 (scoping), 3.6 (closures), 6.6 (tail recursion)
Examples from lecture
Filter example
- March 30, 2016
Lecture 16
Closures, unbounded streams
streams examples
Semantic foundations of abstract data types
- Barbara Liskov and John Guttag's seminal work;
defining semantics of methods, mutability,
concrete representation of abstract datatype and
translations between them, equality checking
Covered #19-25 Functional-12; #1-16 OOPLsFoundations.
more about Clu
Wikipedia
in ACM Digital Library
Abstraction Mechanisms in CLU, Barbara Liskov, Alan Snyder, Russell Atkinson, Craig Shaffert,
CACM vol 20, no 8, August 1977.
- April 3, 2016
Lecture 17
collections and iterations in C++ and Java
More on CLU;
Call graph construction in OOPLs
Type-based techniques (CHA)
Covered iterators in OOPLsFoundations -- slides #17-23, all of CLU, and overview of
reference analysis
plus Class Hierarchy Analysis from OOPLs-CallGraphConstr -- slides #1-9; changed slides #36,38
in OOPLs-CallGraphConstr.
- April 5, 2016
Lecture 18: Call graph construction in OOPLs
Type-based techniques (RTA), flow-based techniques (based on
points-to analysis of C, Steensgaard's points-to analysis for C;
Covered slides #10-29; changed slides #36,38 in OOPLs-CallGraphConstr.
- April 11, 2016
Lecture 19
Field-sensitive points-to analysis for Java, flow sensitivity, context sensitivity
Covered slides #29-39; changed slides #36,38 in OOPLs-CallGraphConstr.
method resolution in Java -- overriding and overloading
Covered slides #1-10
- April 13, 2016
Lecture 20
finish up method resolution in Java -- overriding and overloading
Covered slides #11-20;
Python - a modern scripting PL
basic statements, basic datatypes and their operations, functions, strings
Covered slides #1-11; changed slide #11 and aded new slides passed #11.
SC Ch 14.1,14.2,14.4
Here are
bare bones notes from Dr. Kafura's class on computational
thinking about the Spyder graphical Python environment
and also the
Spyder documentation.
Also available is
the most current documentation of Python 3.5.1 on python.org
and a helpful online book for Python 3
Dive into Python 3.
In addition, if you learned Python 2.x and now are trying to understand differences
betweem Python 2.x versus Python 3.x,
this document is a very good guide.
- April 18, 2016
Lecture 21
Python-a modern scription PL (cont),
Dictionaries, functions, list comprehensions, beginner mistakes
Python- part 2 the NONE value, iterators and generators, exceptions,
module, using file I/O, walking a directory structure with os module,
using regular expressions with the re module.
Covered slides #12-18 in Python-1; slides #1-19 in Python-2; changed slide #9 Python-2
- April 20, 2016
Lecture 22
Lambda calculus - an introduction, substitution, reductions, function abstraction (definition),
function application, free variables, bound variables.
Covered slides #1-16.
S Ch 14.1-14.3 out of print, but available
here.
- April 25, 2016
Lecture 23
more on free variables and bound variables, careful definitions of
substitution rules, normal form of an lambda expresison
Covered slides #16-25.
Lambda Calculus-2
Church-Rosser Theorem, normal form of a lambda expresssion
Covered slides #1-3.
S Ch 14.1-14.3 out of print, but available
here.
- April 27, 2016
Lecture 24
normal forms, how to check lambda term equality? call by name versus call by value,
call by need, reduction order.
S Ch 14.1-14.3 out of print, but available
here.
- May 2, 2016
Lecture 25
Inheritance in OOPLs: Questions about inheritance design, class-based versus
delegation, is-a versus code reuse, different choices for subclass behavior relationship
to parent class behavior
Covered slides #1-8; changed sldies 9,14,16,18,24
- May 4, 2016
Lecture 26
class-based versus inheritance-based delegation, choices in controlling visibility
of inherited members and methods, inheritance as subtyping versus code reuse, multiple
versus single inheritance, mix-in multiple inheritance (in C++, in Java)