for friday no reading (other than handout) homework: –chapter 2, exercises 5 and 6 –lisp handout...

19
For Friday • No reading (other than handout) • Homework: – Chapter 2, exercises 5 and 6 – Lisp handout 1

Upload: angelina-hunter

Post on 17-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

For Friday

• No reading (other than handout)

• Homework:– Chapter 2, exercises 5 and 6– Lisp handout 1

Page 2: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

What Do You Know?

• Examples of artificial intelligence in your life?

Page 3: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

Views of AI

• Weak vs. strong

• Scruffy vs. neat

• Engineering vs. cognitive

Page 4: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

What Is an Agent?• In this course (and your textbook):

– An agent can be viewed as perceiving its environment• Note that perception and environment may be very limited

– An agent can be viewed as acting upon it environment (presumably in response to its perceptions)

• Agent is a popular term with nebulous meaning--so don’t expect it to mean the same thing all of the time in the literature

Page 5: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

Rational Agents

• Organizing principle of textbook

• A rational agent is one that chooses the best action based on its perceptions

• This does not have to be the best action that could have been taken--perception may be limited

Page 6: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

Determining Rationality

• Must have a performance measure.

• Rationality depends on– The performance measure.– Agent’s prior knowledge.– Agent’s possible actions.– Agent’s percept sequence to date.

Page 7: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

Issues in Determining Rationality

• Omniscience

• Autonomy

Page 8: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

Task Environment Specification

• Performance measure

• Environment

• Actuators

• Sensors

Page 9: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

Environment Issues

• Observability

• Deterministic or stochastic

• Episodic or not

• Static or dynamic

• Discrete or continuous

• Single or multi-agent

Page 10: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

Types of Agents

• Simple Reflex

• Model-based Reflex

• Goal-based

• Utility-based

• Learning

Page 11: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

LISP

• LISt Processing

• Functional Language– Pure LISP doesn’t use things like assignment

statements or other imperative statements (though LISP does have extensions that allow you to use such techniques)

• Typically run in an interactive environment

Page 12: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

Running LISP

• Log in to one of the Suns

• At the prompt, type clisp

• You’re now in a LISP environment

• To get out: type (QUIT)

• clisp is available for DOS and linux

Page 13: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

The Lisp Interpreter

• When you start Lisp, you’re in an interpreter

• Anytime you type something in, Lisp assumes that you want it to evaluate what you just typed

• What Lisp does depends on what you typed

Page 14: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

Atoms

• The simplest thing in Lisp is an atom

• Numbers are atoms

• Anything that would be a standard identifier in C++, etc., is also an atom.

• But alphanumeric atoms must be quoted when we refer to them (otherwise Lisp assume that they are variable names and tries to evaluate them by finding their contents--which may not exist)

Page 15: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

Evaluating Atoms

> 9

9

> 32.0

32.0

> 43.2e02

4320.0

> 1000000000000

1000000000000

> abc

*** - EVAL: variable ABC has no value

> 'abc

ABC

> 'fred

FRED

> 'H2O

H2O

Page 16: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

Lists

• Lists are the crucial data structure in LISP

• They look like a list of atoms (or lists) enclosed in parentheses:

(a b c 24 (a b))

• The list above has 5 members, one of them a list with two members

• Like alphanumeric atoms, lists must be quoted when you type them in to the interpreter to keep Lisp from evaluating them

Page 17: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

nil

• nil or () is the empty list

• It is the only item in Lisp which is both an atom and a list (at the same time)

• It is also Lisp’s value for FALSE (just like 0 is the value for FALSE in C and C++

• Note that Lisp also has a value for true: it is t

Page 18: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

More Examples

> '(a b c)

(A B C)

> ()

NIL

• Note that Lisp is not case sensitive. clisp echoes everything in uppercase. Some Lisps use lower case.

Page 19: For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1

Function Calls in Lisp

• (functionname parameter1 parameter2 ...)

• (+ 3 5)

• All functions return values