CS 135. Designing Functional Programs

Similar documents
CS187 - Science Gateway Seminar for CS and Math

Automata Theory. Definition. Computational Complexity Theory. Computability Theory

CS 301. Lecture 17 Church Turing thesis. Stephen Checkoway. March 19, 2018

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

The Legacy of Hilbert, Gödel, Gentzen and Turing

The roots of computability theory. September 5, 2016

Computer Organization: Boolean Logic

Lecture 24. A Brief History of Computer Science (with thanks to Prabhakar Ragde) CS125 Course Notes Lecture 24, Slide 1

Great Ideas in Theoretical Computer Science

Unit 4: Computer as a logic machine

The Search for the Perfect Language

Handouts. CS701 Theory of Computation

Intro To Digital Logic

Implementation of Boolean Logic by Digital Circuits

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

complex networks and systems i609: advanced PhD seminar I Informatics luis rocha 2019 INDIANA UNIVERSITY

Church s undecidability result

Prime Clocks. Michael Stephen Fiske. 10th GI Conference on Autonomous Systems October 23, AEMEA Institute. San Francisco, California

Models. Models of Computation, Turing Machines, and the Limits of Turing Computation. Effective Calculability. Motivation for Models of Computation

The Limit of Humanly Knowable Mathematical Truth

Propositions as Types

Introduction to Computer Systems

Introduction to Turing Machines

CSC103 How Computers Work

Fundamentals of Computer Science

MAA509: Quantum Computing and Information Introduction

Decidable Languages - relationship with other classes.

CS 173 Lecture 2: Propositional Logic

Why digital? Overview. Number Systems. Binary to Decimal conversion

Computation. Some history...

! Chris Diorio. ! Gaetano Borrielo. ! Carl Ebeling. ! Computing is in its infancy

2. Associative Law: A binary operator * on a set S is said to be associated whenever (A*B)*C = A*(B*C) for all A,B,C S.

4 Switching Algebra 4.1 Axioms; Signals and Switching Algebra

Gottfried Wilhelm Leibniz (1666)

Unit 8A Computer Organization. Boolean Logic and Gates

Complexity Theory. Ahto Buldas. Introduction September 10, Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach.

Turing Machines. Lecture 8

Logic Design. Chapter 2: Introduction to Logic Circuits

Boolean Algebra & Digital Logic

CS/COE0447: Computer Organization and Assembly Language

Introduction to Quantum Computation

ECE/CS 250 Computer Architecture

CSE370: Introduction to Digital Design

2009 Spring CS211 Digital Systems & Lab CHAPTER 2: INTRODUCTION TO LOGIC CIRCUITS

Keith Fligg. 03-April-07

Outline. policies for the first part. with some potential answers... MCS 260 Lecture 10.0 Introduction to Computer Science Jan Verschelde, 9 July 2014

Binary addition example worked out

CST Part IB. Computation Theory. Andrew Pitts

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65

Epistemological and Computational Constraints of Simulation Support for OR Questions

Great Theoretical Ideas

ECE/CS 250: Computer Architecture. Basics of Logic Design: Boolean Algebra, Logic Gates. Benjamin Lee

CS 275 Automata and Formal Language Theory

CS 126 Lecture T6: NP-Completeness

ECE 250 / CPS 250 Computer Architecture. Basics of Logic Design Boolean Algebra, Logic Gates

BOOLEAN ALGEBRA INTRODUCTION SUBSETS

Lecture 14 Rosser s Theorem, the length of proofs, Robinson s Arithmetic, and Church s theorem. Michael Beeson

Boolean Algebra. The Building Blocks of Digital Logic Design. Section. Section Overview. Binary Operations and Their Representation.

1.10 (a) Function of AND, OR, NOT, NAND & NOR Logic gates and their input/output.

Limits of Computation. Antonina Kolokolova

Chapter 01: Introduction. Lesson 01 Evolution Computers Part 1: Mechanical Systems, Babbage method of Finite Difference Engine and Turing Hypothesis

The Turing machine model of computation

The universal computer

CS 275 Automata and Formal Language Theory

Decidability: Church-Turing Thesis

Introduction. Foundations of Computing Science. Pallab Dasgupta Professor, Dept. of Computer Sc & Engg INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

CS/COE0447: Computer Organization

Introduction to Logic

CS/COE1541: Introduction to Computer Architecture. Logic Design Review. Sangyeun Cho. Computer Science Department University of Pittsburgh

The Basics COPYRIGHTED MATERIAL. chapter. Algebra is a very logical way to solve

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Dr Prya Mathew SJCE Mysore

CSCB58:Computer Organization

Adders, subtractors comparators, multipliers and other ALU elements

Handbook of Logic and Proof Techniques for Computer Science

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

Chapter 1 :: From Zero to One

Logic design? Transistor as a switch. Layered design approach. CS/COE1541: Introduction to Computer Architecture. Logic Design Review.

Digital Logic (2) Boolean Algebra

17.1 The Halting Problem

Class 23: Gödel s Theorem

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18

Gates and Logic: From Transistors to Logic Gates and Logic Circuits

Computability Theory. CS215, Lecture 6,

Models of Computation

The Arithmetic of Reasoning. Chessa Horomanski & Matt Corson

COT 5407:Introduction to Algorithms. 1 Introduction. 2 History of Algorithms

CS/COE0447: Computer Organization

Quantum Computing 101. ( Everything you wanted to know about quantum computers but were afraid to ask. )

ELEC Digital Logic Circuits Fall 2014 Switching Algebra (Chapter 2)

ELCT201: DIGITAL LOGIC DESIGN

Universality and Computability

Understanding Computation

Contents Part A Number Theory Highlights in the History of Number Theory: 1700 BC 2008

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Digital Logic

MthEd/Math 300 Williams Fall 2011 Midterm Exam 2

Linear Algebra Fall mathx.kaist.ac.kr/~schoi/teaching.html.

Self-reproducing programs. And Introduction to logic. COS 116, Spring 2012 Adam Finkelstein

1 The fact that the word algorithm is a close anagram of the Greek derived word logarithm

Transcription:

CS 135 Designing Functional Programs

ADMINISTRATIVA HISTORY HISTORY NOVEMBER 29, 2018 2

Administrativa This is the last CS 135 lecture. Last CS 135 tutorials tomorrow. Don t forget about A9 (deadline Mon, Dec 3)!

Computers Mathematics + Theory on Computation + Engineering

Mathematics Counting The Túngara frog understands (add1 ) Early humans (apx. 19,000 BC) did some basic (?) mathematical operations (Ishango bones).

Mathematics Calculations With the advent of complex societies arose the need for record-keeping: Old Kingdom, apx. 2,600 BC the need for land-surveys: Third Dynasty of Ur, apx. 2,000 BC the demand for mysticism: Vedic period, apx. 1,200 BC; Shang Dynasty, apx. 1,200 BC

Mathematics Formal systems First mathematical system Euclidean geometry: Euclid of Alexandria, apx. 300 BC Number systems First decimal positional system: Archimedes of Syracuse, apx. 250 BC; Muhammad ibn Musa al- Khwarizmi apx. 800 AD

Mathematics Formal systems Differential and Integral Calculus Newton, (1666) & 1693 & 1704 Leibniz, (1674) & 1684 You stole my idea!!! How could I??? You didn t tell anyone!!!

Language [English] Compute: calculate [French] computer: drawing calendars according to astronomical data [Latin] com puto: arranging together I have read the truest computer of times (Richard Brathwait, The Yong Mans Gleanings, 1613) Until the late 1800s, a computer was strictly a person, not a device.

Engineering Basic operations Abacus: Invented by most civilizations (e.g., Incan Quipu, Chinese Suanpan) Manual operation Adding, subtraction, multiplication, division Data storage (memory)

Engineering Specific operations Clocks, astrolabe Invented by many civilizations (e.g., France, apx. 1600) Mechanical (gears) Telling time, longitude, latitude

Engineering Calculators Step reckoner Leibnitz (1694): It is beneath the dignity of excellent men to waste their time in calculation when any peasant could do the work just as accurately with the aid of a machine. Mechanical (gears) Adding, subtraction, multiplication, division

Engineering Calculators Mathematical tables Pre-calculated lookup values for common complex operations Trigonometry, logarithms

Engineering Advanced operations Slide rule Invented apx. 1620 by William Oughtred, possibly earlier Manual operation Multiplication, division, exponentials, logarithms

Engineering Advanced calculators Difference Engine, 1822 Charles Babbage Mechanical (gears) +, -,, /, exponentials, logarithms, trigonometry, solving polynomials Never built

Engineering Programmable calculators Analytical Engine, 1837 Charles Babbage Mechanical (gears) +, -,, /, exponentials, logarithms, trigonometry, solving polynomials Programmable: could be given data & a sequence of operations Never built

Engineering Programmable Calculators Programming the Analytical Engine Ada King, Countess of Lovelace (1843): A new, a vast, and a powerful language is developed for the future use of analysis

Engineering Elec-mech calculators Tabulating machine, 1890 Herman Hollerith Electro-mechanical (gears and mercury) Adding 10 x faster than manual tabulation

Engineering Elec-mech calculators In 1896, Herman Hollerith founded the Tabulating Machine Company which got amalgamated in 1911 into the Computing-Tabulating-Recording Company which was renamed in 1924 to International Business Machines Corporation

Engineering First crisis of mechanics Analog computers (e.g., computers that use cogs internally) were too slow due to physical constraints of the gearboxes (e.g., momentum, friction). Digital computers had to be designed. Problems: How to represent data? How to build the required circuitry?

Engineering Analog to digital Voltage as data: associate certain voltage ranges with certain discrete values U How many ranges should there be? t

Engineering Analog to digital Voltage as data: quinary computer U 1 2 4 3 0 1 3 t

Engineering Analog to digital Quinary computer (5 levels): not stable U 1 2 43 34 01 10 3 t

Engineering Analog to digital Binary computer (2 levels): (more) stable U 0 0 1 1 0 1 0 t

Mathematics Boolean algebra Binary (Boolean) algebra George Boole, The Laws of Though, 1854 Extension of Aristotle s logic with the goal to allow truth to be systematically and formally proven. Operators: and or not xor: (or (and (not x) y) (and x (not y)))

Engineering Boolean algebra Switch Allows for manual control of electricity: a human operator closes or opens a lever Relay Allows for electric control of electricity: a control current closes or opens a lever

Engineering Boolean algebra Relay, early 1830s Maybe Gauss invented it? With relays, the output of one relay can be the control for another!

Engineering Digital computers Z3, 1941 Konrad Zuse Electro-mechanical (relays) +, -,, /, sqrt Digital Programmable 1.2 Hz (+), 0.3 Hz ( )

Engineering Digital computers Harvard Mark I, 1944 John von Neumann Electro-mechanical (relays) +, -,, /, logarithms, trigonometry Digital Programmable 3 Hz (+), 0.15 Hz ( )

Engineering Digital computers Grace Hopper Programmer for the Harvard Mark I Coined the term bug

Engineering Second crisis of mechanics Electro-mechanical computers (e.g., computers that use relays internally) were too slow due to physical constraints of the relays (e.g., momentum, friction). Fully electric computers had to be designed. Problems: How to construct gates?

Engineering Boolean algebra Relay Allows for electric control of electricity: a control current closes or opens a lever Vacuum tube Allows for electric control of electricity: a control current makes a section of the circuit conductive or not

Engineering Electronic computers Colossus, 1943 Alan Turing Electronic (vacuum tubes) Inverting Lorenz SZ40 operations Digital Programmable Apx. 5 khz

Mathematics The Foundational Crisis Foundational Crisis of Mathematics, 1900s Mathematicians were not able to express the axioms of mathematics within themselves. E.g., Russell s Paradox, Bertrand Russell, 1901 Lol, I broke math.

Mathematics The Foundational Crisis David Hilbert: (Hilbert s Axioms, 1899: New set of axioms to describe Euclidean Geometry) (Hilbert s Problems, 1900: 23, partially still unanswered, problems of mathematics.) Hilbert s Program, 1920s Attempt to find a new set of axioms of mathematics that are complete and consistent. Np, I ll fix it! Also, check out my cool hat.

Mathematics The Foundational Crisis Complete: for any formula φ, if φ is true, then φ is provable. Consistent: for any formula φ, there are no proofs of both φ and (not φ).

Mathematics Gödel s Proof Complete: for any formula φ, if φ is true, then φ is provable. Kurt Gödel, 1931: Any axiom system powerful enough to describe arithmetic on integers is not complete. Never! (And I can prove it ) Consistent: for any formula φ, there are no proofs of both φ and (not φ). Kurt Gödel, 1931: If an axiom system is consistent, its consistency cannot be proved within the system.

Mathematics Gödel s Proof (www.youtube.com/watch?v=o4ndidcdsgc)

Mathematics Hilbert s questions Hilbert s Entscheidungsproblem, 1928 Does an algorithm exist that takes a logic statement as input and produces Yes if that statement is valid and No otherwise? First raised by Leibnitz in the 1670s.

Theory on Computation Hilbert s questions Hilbert s Entscheidungsproblem, 1928 Alonzo Church, 1936 Not solvable when using lambda-calculus. Alan Turing, 1936 Not solvable when using a Turing machine. Booth proofs are equivalent (Church Turing thesis), but Turing s is better.

Theory on Computation Lambda calculus (www.youtube.com/watch?v=eis11j_igms)

Theory on Computation The Turing Machine (www.youtube.com/watch?v=dnrdvlacg5q)

Theory on Computation The Halting Problem (www.youtube.com/watch?v=macm_mts_w4)

CQ1 Who is your CS 135 instructor? A. Alan Turing B. Alonzo Church C. Adrian Reetz D. Byron Weber Becker E. Mr. Fancy Pants F. None of the above G. All of the above H. Donald Trump

Theory on Computation Formal Grammar Noam Chomsky Father of modern linguistics Chomsky hierarchy, 1956 Classifies formal languages into 4 categories: Type-0 to Type-3 Turing machine implements a Type-0 language Important to answer questions regarding computability, complexity, etc. More to come

Engineering Hardware architecture Alan Turing Automatic Computing Engine, 1945 John von Neumann Von-Neumann Architecture, 1945 Processing unit Control unit Memory for data and instructions Mass storage Input and output

Engineering Third crisis of mechanics Vacuum tubes break too easily and burn out too quickly Solution: Solid state semiconductors, a.k.a. transistors, 1947 First transistor, 1947 Intel 8088, 1979: 29k trans. Intel Core i7, 2008: 730M trans.

Engineering Software Grace Hopper Proposed the idea of high-level programming languages, 1950 Proposed the idea of compilers, 1952 Developed the first programming language (FLOWMATIC, for the UNIVAC I computer), 1955

Hardware-inspired Math-inspired

Hardware-inspired Math-inspired

Summing up CS 135 With only a few language constructs (define, cond, define-struct, cons, local, lambda) we have described and implemented ideas from introductory computer science in a brief and natural manner. We have done so without many of the features (static types, mutation, I/O) that courses using conventional languages have to introduce on the first day. The ideas we have covered carry over into languages in more widespread use.

Summing up CS 135 We hope you have been convinced that the goal of computer science is to implement useful computation in a way that is correct and efficient as far as the machine is concerned, but that is understandable and extendable as far as other humans are concerned. These themes will continue in CS 136, but new themes will be added, and a new programming language using a different paradigm (though we will continue to use Racket as well).

Looking ahead to CS 136 We have been fortunate to work with very small languages (the teaching languages) writing very small programs which operate on small amounts of data. In CS 136, we will broaden our scope, moving towards the messy but also rewarding realm of the real world. The main theme of CS 136 is scalability: what are the issues which arise when things get bigger, and how do we deal with them?

Looking ahead to CS 136 How do we organize a program that is bigger than a few screenfuls? How do we reuse and share code, apart from cutting-and-pasting it into a new program file? How do we design programs so that they run efficiently? What changes might be necessary to our notion of types and to the way we handle errors when there is a much greater distance in time and space between when the program is written and when it is run?

Looking ahead to CS 136 When is it appropriate to abstract away from implementation details for the sake of the big picture, and when must we focus on exactly what is happening at lower levels for the sake of efficiency? These are issues which arise not just for computer scientists, but for anyone making use of computation in a working environment. We can build on what we have learned this term in order to meet these challenges with confidence.