Presentation is loading. Please wait.

Presentation is loading. Please wait.

Https://www.youtube.com/watch?v=a0YrCABCOEY.

Similar presentations


Presentation on theme: "Https://www.youtube.com/watch?v=a0YrCABCOEY."— Presentation transcript:

1

2 Boathouses and Houseboats

3 Texts and their denotations
7.5 17 CS17 cs17 + * (a b c) (+ 3 7) (a (b c d) e) (* (+ 1 2) 4) The number seven and a half. The number seventeen. The symbol CS17. The symbol cs17 (which is different). The symbol +. The symbol *. The list consisting of three symbols: a, b, and c. The list consisting of: the symbol + and numbers 3 and 7. The list consisting of: the symbol a, the list consisting of symbols b, c, and d, and the symbol e. The list consisting of: the symbol *, the list consisting of symbol + and numbers 1 and 2, and the number 4.

4 Rules of evaluation The value of a number is itself. The value of a Boolean is itself. The value of a symbol is the data object it is bound to. The value of a list is obtained as follows: First evaluate each item in the list. The first item should evaluate to a procedure. Apply the procedure to the values of the rest of the items. The result of the procedure application is the value of the list.

5 Examples (in arithmetic)
The symbol + is bound to the addition procedure. The symbol * is bound to the multiplication procedure. The symbol / is bound to the division procedure. The symbol - is bound to the subtraction procedure.

6 Rules of evaluation The value of a number is itself. The value of a Boolean is itself. The value of a symbol is the data object it is bound to. The value of a list is obtained as follows: First evaluate each item in the list. The first item should evaluate to a procedure. Apply the procedure to the values of the rest of the items. The result of the procedure application is the value of the list. Questions: What does bound to mean? What is a procedure? What does it mean to apply a procedure?

7 Is there something wrong with that definition?
What is an expression? A number, or a Boolean, or a symbol, or a list consisting of one or more items, such that each item is an expression, and the value of the first item is a procedure. Is there something wrong with that definition?

8

9 Richard Stallman’s GNU project
“GNU” is defined as “GNU is not Unix” Richard Stallman started the open-source software movement. Linux is based, technically and philosophically, on GNU. [GNU is] a technical means to a social end. By Thesupermat - Own work, CC BY-SA 3.0,

10 Open Source

11 Other recursive/inductive definitions
A LISP data object is a symbol, number, or Boolean, or a list whose items are LISP data objects. A Foo is “#”, or “*” followed by a Foo, followed by “-”. LISP data objects Quiz: How can you tell whether ************# is a Foo?

12 Recursive/Inductive definition of expression
A number, or a Boolean, or a symbol, or a list consisting of one or more items, such that each item is an expression, and the value of the first item is a procedure. Those items in the list are called subexpressions of whole expression.

13 Evaluation versus a function
Even for a legal input, evaluation can FAIL! A symbol might not be bound to anything. A procedure itself could fail, which causes evaluation to fail.

14 Rules of evaluation The value of a number is itself. The value of a Boolean is itself. The value of a symbol is the data object it is bound to. The value of a list is obtained as follows: First evaluate each item in the list. The first item should evaluate to a procedure. Apply the procedure to the values of the rest of the items. The result of the procedure application is the value of the list. Each procedure has a rule as to what inputs it can be applied to. Examples: The addition procedure can only be applied to numbers. The division procedure can only be applied to numbers, and all but the first must be nonzero.

15 Functions represented as machines
13 7 10 Add 3 16 10 23 For a function, for any legal input there is an output. We say a function is total.

16 Health Get sleep. The main benefit of caffeine is staving off the effects of caffeine withdrawal. Get exercise. At least move around every thirty minutes. Treat others in the community with respect and kindness. If you are sick, take care of yourself (rest up; let the course staff know if you need extension) others (if you are contagious, don’t come to class or lab or TA hours or professor hours) University has resources to help you if you are stressed, etc.


Download ppt "Https://www.youtube.com/watch?v=a0YrCABCOEY."

Similar presentations


Ads by Google