\begin{slide}{Basic Functional Programming} \slideitem{Designing and Evaluation Simple Recursive Programs} \begin{enumerate} \item representing information and knowledge as data in a programming language \item using data descriptions to develop programs \item programs are algebraic expressions \item program execution is the same as the evaluation of algebraic expressions \item recursion is a good measure of complexity \end{enumerate} \slideitem{Compound Data} \begin{enumerate} \item introducing new data constructors to represent compound data \item programs that produce compound data \end{enumerate} \slideitem{Program Organization} \begin{enumerate} \item {\bf let}-expressions for naming repeated expressions \item {\bf local}-expressions for hiding functions \end{enumerate} \end{slide} \begin{slide}{Generative Recursion} \slideitem{Divide and Conquer} \slideitem{Trial and Error} \end{slide} \begin{slide}{Accumulator-style Programming} \slideitem{Tracking History} \end{slide} \begin{slide}{Functional Abstraction} \slideitem{Functions as Arguments} \slideitem{Mathematical Functions as Results} \slideitem{Abstracting over Design Patterns} \slideitem{Functional Object-Oriented Programming} \end{slide} \begin{slide}{Motivating Imperative Programming} \slideitem{The Need for Imperative Programming} Imperative programming is necessary \begin{enumerate} \item to keep track of the history of a computation \item to model state in the real world \end{enumerate} The first form is typically motivated by the information available at the interface between the program and the ``rest of the world'' (which could be another program). The latter form is useful for simulations. \end{slide} \begin{slide}{Functional Design} \begin{tabular}{|r|l|l|}\hline \multicolumn{2}{c}{Overview of Ideas and Basic Scheme}&{Editing and Evaluating}\\ 1 & {What are Computers, Programs, and Executions?}\\ 2 & {Basic Scheme: Programs, Expressions, and Functions}\\ 3 & {Processing Lists}\\ %% \multicolumn{2}{c}{From Templates to Programs}&{Processing Lists, Hand Evaluation}\\ 4 & {More List Processing} \\ 5 & {Rules I: Syntax and Evaluation}\\ 6 & {Programs that Constructing Lists, Processing Web Pages}\\ %% \multicolumn{2}{c}{More Complex Templates} & {Counting Recursions, Complexity}\\ 7 & {Processing Web Pages, Family Trees} \\ 8 & {Composing Functions, Avoiding Repeated Recursions with LET} \\ 9 & {In-Class Exam} \\ %% \multicolumn{2}{c}{Managing Data, Complex Programs} & {Foo}\\ 10 & {Data Constructors: Web pages, Family Trees revisited} \\ 11 & {Two Functions Process One Argument: Insertion Sort} \\ 12 & {Functions that Process Two Complex Arguments: Shuffle} \\ %% \multicolumn{2}{c}{Generative Recursion} & {Foo}\\ 13 & {Gaussian Elimination} \\ 14 & {Binary Search, Quick Sort} \\ 15 & {Making Change, Planning a Route in a Graph} \\ \hline %% \multicolumn{2}{c}{Accumulators} & {Foo}\\ 16 & {Planning a Route -- With Accumulator} \\ 17 & {Making a Schedule} \\ 18 & {Transforming Numeric Functions into Accumulator-Style} \\ \hline %% \multicolumn{2}{c}{Styles, Functions} & {Foo}\\ 19 & {Comparing Styles, Iterative Evaluation vs Full Recursion} \\ 20 & {Functions are Values: Abstracting out Common Values} \\ 21 & {Abstracting Templates} \\ \hline %% \multicolumn{2}{c}{More on Functions} & {Foo}\\ 19 & {Mathematical First-Class Functions} \\ 20 & {Rules II: Functions and Scope} \\ 21 & {Break} \\ \hline \end{tabular} \end{slide} \end{presentation} \end{document} \begin{tabular}{|r|l|l|} \hline %% % \multicolumn{2}{c} & {Overview} & {Editing and Evaluating}\\ \hline \end{tabular} \end{slide} \begin{tabular}{|r|l|l|} \hline %% \week{Overview of Ideas and Scheme}{Editing and Evaluating} \lecture{What are Computers, Programs, and Executions?} \lecture{Basic Scheme: Programs, Expressions, and Functions} \lecture{Processing Lists} %% \week{From Templates to Programs}{Building, Processing Lists} \lecture{More List Processing} \lecture{Rules I: Syntax and Evaluation} \lecture{Processing Web Pages} %% \week{More Complex Templates and Functions}{} \lecture{Processing Family Trees} \lecture{Functions that Process Two Complex Arguments} \hline \end{tabular} \end{slide} 6: Basic Scheme: Expressions, Functions, Evaluations from arithmetic to Scheme applying the laws of algebra core vs Computing knowledge 9: Lists and List-programming [assignment 1] list of temperature measurements, in Celcius is one of them over 100F? Celcius->Fahrenheit is core knowledge, rest is Computing 11: More List-programming -- Functions are Black Boxes letter grades to numeric grades computing the grade points of a list of letter grades evaluating a function applied to a list the design recipe 13: Rules I: Syntax and Semantics processing nested lists: from data description to templates syntax rules evaluation rules 16: Web-programming [assignment 2] finish evaluation rules nested self-references from data descriptions to templates: cons used twice as a constructor -- distinguish nested lists (TLS S-expressions) family trees 18: Tree-programming from data descriptions to templates: family trees Web pages -- two pages from templates to programs: family trees 20: Functions of Two Complex Arguments a filter function for lists: return lists from function family trees: a path to ancestor with same name collect all names in a family tree: motivate need for 2-arg functions 23: Obscene Programming and Analysis: let [assignment 3] collect all names in a family tree discover need for "append" or "merge" two lists design recipe for function of two arguments 25: EXAM 1 "Recursive Functions and Evaluation" -- in class 27: Managing Data and Programs: define-structure and let OCTOBER 30: Program Decomposition: [assignment 4] insertion sort, permutation 2: Accumulator-style Programs: LOCAL and rules sum of prefixes, indexes, how to find out that you need it 4: Generative Recursion: Gaussian Elimination, Pattern 7: Generative Recursion: [assignment 5] GCD, SmallestDiv, Quicksort 11: Functional Abstraction: Patterns lesser, greater, equals => filter1 filter1 => lesser, greater, equals 14: Functional Abstraction: Mathematical Uses lambda + local => filter2 predicates as closures (lambda (x) (eq? x Name)) scalar*, projection => map map => scalar*, projection sum, product => reduce reduce => sum, product, map, filter 16: Functional Abstraction pragmatics: flexible library functions avoid code repetitions anticipate future changes mathematical abstractions: numerical differencing integrating find root 18: Rules II: Scope and Beta [assignment 6] 21: BREAK BREAK BREAK 23: Functions Aren't Elephants: Remembering History elevator controller with two inputs only remembering the history of function calls via set! 25: Time vs State: New Elements vs Changed Elements inventory controll implementing change of state with set! plus copy versus set-bike-location! 28: Rules, set! vs set-bike-location!, Equality [assignment 7] title, plus definition of intensional and extensionsl equality function 30: History and State, Graphs Discovering Cycles in Graphs 31: EXAM 2 "Program Design and Evaluation" -- evening 1: Path in Graph with Cycles -- Again ?? 4: Imperative Vectors 1 [assignment 8] basics build-vector, reducing a vector 6: InClass Exam Appendix 8: Imperative Vectors 2 reduce-vector affect-vector (fori= ...) ----------------------------------------------------------------------- 11: Inside the Machine levels of abstraction -- little man was sufficient now it's memory, registers, pc, cpu (bunch of little women) evaluating numeric instructions 13: Machine-level Programming (Assembly, Numeric) [assignment 9] translating simple expressions, if's, simple loops 15: More assembly level programming 18: Building a Machine explaining the architecture of the machine 20: C-style Programming in Scheme and C I [assignment 10] from Scheme to C basic C concepts -- what they really mean, what they are advertised as recursion to recursion tail-recursion to loops 22: C-style Programming in Scheme and C II more tail-recursion to loops nested loop ----------------------------------------------------------------------- 25: What is Computer Science? Marx and Hegel 27: C vs Scheme: Implementation/Servics C: placeholders versus Scheme: values implementing numbers and arithmetic implementing vectors and lookups Comparing services from languages DECEMBER 2: Absolute and Physical Limits the halting problem the walk through all floating point numbers vs binary search problem 4: Java I: Formulating Data Descriptions in Java list of nums family tree file system 6: Java II: Deriving Programs from Data Descriptions sum, length on lists search name in family tree determine size of file system 9: Java III: History and State in Java clases with one object as programs: elevator controller elevator with state 10: EXAM 3 "The Machine and Machine-Oriented Programming" -- evening 11: Conclusion [assignment 12] 6: Basic Scheme: Expressions, Functions, Evaluations from arithmetic to Scheme applying the laws of algebra core vs Computing knowledge 9: Lists and List-programming [assignment 1] list of temperature measurements, in Celcius is one of them over 100F? Celcius->Fahrenheit is core knowledge, rest is Computing 11: More List-programming -- Functions are Black Boxes letter grades to numeric grades computing the grade points of a list of letter grades evaluating a function applied to a list the design recipe 13: Rules I: Syntax and Semantics processing nested lists: from data description to templates syntax rules evaluation rules 16: Web-programming [assignment 2] finish evaluation rules nested self-references from data descriptions to templates: cons used twice as a constructor -- distinguish nested lists (TLS S-expressions) family trees 18: Tree-programming from data descriptions to templates: family trees Web pages -- two pages from templates to programs: family trees 20: Functions of Two Complex Arguments a filter function for lists: return lists from function family trees: a path to ancestor with same name collect all names in a family tree: motivate need for 2-arg functions 23: Obscene Programming and Analysis: let [assignment 3] collect all names in a family tree discover need for "append" or "merge" two lists design recipe for function of two arguments 25: EXAM 1 "Recursive Functions and Evaluation" -- in class 27: Managing Data and Programs: define-structure and let OCTOBER 30: Program Decomposition: [assignment 4] insertion sort, permutation 2: Accumulator-style Programs: LOCAL and rules sum of prefixes, indexes, how to find out that you need it 4: Generative Recursion: Gaussian Elimination, Pattern 7: Generative Recursion: [assignment 5] GCD, SmallestDiv, Quicksort 11: Functional Abstraction: Patterns lesser, greater, equals => filter1 filter1 => lesser, greater, equals 14: Functional Abstraction: Mathematical Uses lambda + local => filter2 predicates as closures (lambda (x) (eq? x Name)) scalar*, projection => map map => scalar*, projection sum, product => reduce reduce => sum, product, map, filter 16: Functional Abstraction pragmatics: flexible library functions avoid code repetitions anticipate future changes mathematical abstractions: numerical differencing integrating find root 18: Rules II: Scope and Beta [assignment 6] 21: BREAK BREAK BREAK 23: Functions Aren't Elephants: Remembering History elevator controller with two inputs only remembering the history of function calls via set! 25: Time vs State: New Elements vs Changed Elements inventory controll implementing change of state with set! plus copy versus set-bike-location! 28: Rules, set! vs set-bike-location!, Equality [assignment 7] title, plus definition of intensional and extensionsl equality function 30: History and State, Graphs Discovering Cycles in Graphs 31: EXAM 2 "Program Design and Evaluation" -- evening 1: Path in Graph with Cycles -- Again ?? 4: Imperative Vectors 1 [assignment 8] basics build-vector, reducing a vector 6: InClass Exam Appendix 8: Imperative Vectors 2 reduce-vector affect-vector (fori= ...) ----------------------------------------------------------------------- 11: Inside the Machine levels of abstraction -- little man was sufficient now it's memory, registers, pc, cpu (bunch of little women) evaluating numeric instructions 13: Machine-level Programming (Assembly, Numeric) [assignment 9] translating simple expressions, if's, simple loops 15: More assembly level programming 18: Building a Machine explaining the architecture of the machine 20: C-style Programming in Scheme and C I [assignment 10] from Scheme to C basic C concepts -- what they really mean, what they are advertised as recursion to recursion tail-recursion to loops 22: C-style Programming in Scheme and C II more tail-recursion to loops nested loop ----------------------------------------------------------------------- 25: What is Computer Science? Marx and Hegel 27: C vs Scheme: Implementation/Servics C: placeholders versus Scheme: values implementing numbers and arithmetic implementing vectors and lookups Comparing services from languages DECEMBER 2: Absolute and Physical Limits the halting problem the walk through all floating point numbers vs binary search problem 4: Java I: Formulating Data Descriptions in Java list of nums family tree file system 6: Java II: Deriving Programs from Data Descriptions sum, length on lists search name in family tree determine size of file system 9: Java III: History and State in Java clases with one object as programs: elevator controller elevator with state 10: EXAM 3 "The Machine and Machine-Oriented Programming" -- evening 11: Conclusion [assignment 12]