55
CMSC 471 CMSC 471 Fall 2011 Fall 2011 Class #1 Class #1 Thu 9/1/11 Thu 9/1/11 Course Overview / Lisp Course Overview / Lisp Introduction Introduction Professor Marie desJardins, [email protected] , ITE 337, x53967 TA: Yasaman Haghpanah, [email protected]

CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, [email protected], ITE 337, [email protected]

Embed Size (px)

Citation preview

Page 1: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

CMSC 471CMSC 471Fall 2011Fall 2011

Class #1Class #1

Thu 9/1/11 Thu 9/1/11 Course Overview / Lisp IntroductionCourse Overview / Lisp Introduction

Professor Marie desJardins, [email protected],ITE 337, x53967

TA: Yasaman Haghpanah, [email protected]

Page 2: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Today’s Class

• Course overview• Introduction

– Brief history of AI– What is AI? (and why is it so cool?)– What’s the state of AI now?

• Lisp – a first look

Page 3: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Course OverviewCourse Overview

Page 4: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Course Materials

• Course website: http://www.cs.umbc.edu/courses/undergraduate/471/fall11/– Course description and policies (main page)– Course syllabus, schedule (subject to change!), and slides– Pointers to homeworks and papers (send me URLs for interesting / relevant

websites, and I’ll add them to the page!)

• Course mailing list: [email protected]– Visit http://lists.umbc.edu– Search for cmsc471– Click “Subscribe” link– Send general questions to the list– Requests for extensions, inquiries about status, requests for appointments

should go directly to Prof. desJardins and/or the TA

Page 5: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Coursework

• Homeworks (40%)

• Final project (25%)

• Midterm (10%)

• Final exam (20%)

• Class participation (5%)

Page 6: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Homework and Grading Policies

• Six homework assignments (mix of written and programming)• Due every other week (approximately) at the beginning of class• Everyone gets one free late homework (up to one week late)• No other late homeworks will be accepted• Additional requests for extensions will be denied other than in extraordinary

circumstances (documented illness, death in the family, etc.)• “I have other projects due” is not an extraordinary circumstance

• Nor is “I didn’t start early enough”

• All inquiries about homework grading (including requests for regrading or grade adjustments) should be brought to the TA first

Page 7: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Academic Integrity• Instructor’s responsibilities:

– Be respectful

– Be fair

– Be available

– Tell the students what they need to know and how they will be graded

• Students’ responsibilities:– Be respectful

– Do not cheat, plagiarize, or lie, or help anyone else to do so

– Do not interfere with other students’ academic activities

Page 8: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Academic Integrity Policy

“By enrolling in this course, each student assumes the responsibilities of an active participant in UMBC’s scholarly community, in which everyone’s academic work and behavior are held to the highest standards of honesty. Cheating, fabrication, plagiarism, and helping others to commit these acts are all forms of academic dishonesty, and they are wrong. Academic misconduct could result in disciplinary action that may include, but is not limited to, suspension or dismissal.”

[Statement adopted by UMBC’s Undergraduate Council and Provost’s Office]

Page 9: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Plagiarism

• REPRESENTING SOMEBODY ELSE’S WORDS AS YOUR OWN IS PLAGIARISM.• “But I listed the reference in the bibliography.”

• If you didn’t explicitly quote the text you used, and cite the source where you used the text, it is plagiarism.

• “But I only used some of the words.”• Scattering some of your own words and rephrasing isn’t

enough; if the ideas are not restated entirely in your own words, it is plagiarism.

Page 10: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Plagiarism

• “But only the introduction and background material are borrowed; all of the original research is mine.”• If somebody else’s words appear in any document that you

have represented to be written by you, it is plagiarism.

• “But it was only a draft / not an official classroom assignment, so I didn’t think it counted.”• If you represented somebody else’s words as your own, even

in an informal context, it is plagiarism.

Page 11: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Plagiarism

• “But the professor told me to use that source!”• Unless you are explicitly told to copy a quote from a

source, you must write your answers in your own words even if you use a specified source. If somebody else’s words appear in your assignment without correct attribution (quotation marks and citation at the point of the quote), it is plagiarism.

• Sometimes attribution gets overlooked through oversight, but it is your responsibility to minimize the possibility that this can happen.

Page 12: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Original passage:I pledge allegiance to the flag of the United States of

America, and to the republic for which it stands, one nation, indivisible, with liberty and justice for all.

Unacceptable summary:I promise loyalty to the United States flag, and to the

country for which it stands, one nation, with freedom and fairness for all.

Plagiarism Exercise

Page 13: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Plagiarism Exercise II

Original passage:I pledge allegiance to the flag of the United States of

America, and to the republic for which it stands, one nation, indivisible, with liberty and justice for all.

Acceptable summary:The Pledge of Allegiance represents a promise to be loyal

to the United States of America, and restates the premises of American government: independent states united by the ideals of freedom and democracy.

Page 14: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Abetting

• Helping another student to cheat, falsify, or plagiarize will generally result in your receiving the same penalty

• Know what your project partners are doing; if you turn a blind eye to their cheating, you may be hurting yourself

Page 15: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Penalties

• I take cheating and plagiarism very seriously

• Typical penalties depend on the severity, and whether it is a first offense. The minimum penalties are:• Receiving a zero on an assignment (even if only part of the assignment

was plagiarized or copied)

• Being required to redo the assignment, without credit, in order to pass the class

• Additional penalties may include:• Receiving a full grade reduction in the class (e.g., an A becomes a B, a

B becomes a C)

• Failing the class (without possibility of dropping it)

• Suspension or expulsion from the university

Page 16: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

About Groupwork• Study groups are encouraged! The material is much easier to learn if

you are discussing it with other students

• Talking about the homework is completely acceptable

• Certain homeworks (or parts of homeworks) may be designated explicitly as group submissions (2-3 students)

• The class project is a group project

• For all other assignments, copying a group answer is unacceptable

• Having somebody else write or debug code for you is unacceptable

• When you go to write your answers or your code, you should be by yourself, and you should be recording your own understanding of the solution, not regenerating something that is not your own personal work.

Page 17: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Course Staff Availability

• Prof. Marie desJardins– [email protected]

– Official office hours: Tue. 1:30-2:30, Thu. 10:30-11:30 (ITE 337)

– Appointments may also be made by request (at least 24 hours notice is best)

– Drop in whenever my door is open (see posted “semi-open door policy”)

– Will try to respond to e-mail within 24 hours on weekdays

– Direct general questions (i.e., those that other students may also be wondering about) to the class mailing list

• TA Yasaman Haghpanah– [email protected]

– Office hours/office TBA

Page 18: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

What is AI??What is AI??

Page 20: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Represent and store knowledge

Retrieve and reason about knowledge

Behave intelligently in complex environments

Develop interesting and useful applications

Interact with people, agents, and the environment

Main Goals of AI

Page 21: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Why AI?

• Engineering: To get machines to do a wider variety of useful things– e.g., understand spoken natural language, recognize individual people in

visual scenes, find the best travel plan for your vacation, etc.

• Cognitive Science: As a way to understand how natural minds and mental phenomena work– e.g., visual perception, memory, learning, language, etc.

• Philosophy: As a way to explore some basic and interesting (and important) philosophical questions– e.g., the mind body problem, what is consciousness, etc.

Page 22: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Foundations of AIComputerScience &

Engineering

AI

Mathematics

CognitiveScience

Philosophy

Psychology Linguistics

BiologyEconomics

Page 23: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

History

• 1997: Deep Blue beats Garry Kasparov (world champion)• 1998: Founding of Google• 2000: Interactive robot pets• 2004: First DARPA Grand Challenge robot race• 2004: Commercial recommender systems (TIVO, amazon.com)• 2007: Checkers is solved!• 2011: An AI named Watson beats the top Jeopardy! champions• 2010: Google self-driving cars reach their 1000th mile

Page 24: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Eliza• ELIZA: A program that simulated a psychotherapist interacting with a

patient and successfully passed the Turing Test.

• Coded at MIT during 1964-1966 by Joel Weizenbaum.

• First script was DOCTOR. – The script was a simple collection of syntactic patterns not unlike regular

expressions

– Each pattern had an associated reply which might include bits of the input (after simple transformations (my your)

• Weizenbaum was shocked at reactions: – Psychiatrists thought it had potential.

– People unequivocally anthropomorphized.

– Many thought it solved the NL problem.

Page 25: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Eliza• I am the psychotherapist. Please, describe your problems. Each

time you are finished talking, type RET twice.• i'm having a hard time with my students• Why do you say that?• well, they keep asking me for money• Maybe your plans have something to do with this.• what plans?• Is it because of your life that you say what plans?• No, it's because I didn't know what you were talking about• Is it because you didn't know what I was talking about that you

came to me?• no, it's because i wanted to see if you could pass the turing test• Does it bother you that you wanted to see if I could really pass

the turing test?• …..• How do you reconcile problems at school?• This is a waste of time. Good bye• My secretary will send you a bill.

• I am the psychotherapist. Please, describe your problems. Each time you are finished talking, type RET twice.

• i'm having a hard time with my students• Why do you say that?• well, they keep asking me for money• Maybe your plans have something to do with this.• what plans?• Is it because of your life that you say what plans?• No, it's because I didn't know what you were talking about• Is it because you didn't know what I was talking about that you

came to me?• no, it's because i wanted to see if you could pass the turing test• Does it bother you that you wanted to see if I could really pass

the turing test?• …..• How do you reconcile problems at school?• This is a waste of time. Good bye• My secretary will send you a bill.

• This is a transcript of a conversation with an Eliza-like program found in Emacs

• Try typing

Meta-x doctor

in your favorite Emacs.

Page 26: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Colby’s PARRY

• Kenneth Colby modeled a paranoid using the same techniques circa 1968.

• PARRY has basic emotions. If it gets angry, its replies become more hostile.

• In a Turing test, expert psychiatrists were unable to distinguish PARRY’s ramblings from those of real paranoids.

H: Good afternoon. My name is Doctor Jones. P: Pleased to meet you. H: How are you? P: All right I guess. H: Could you tell me your name? P: Pat Smith. H: I though you might have some problems. P: I've been upset lately. H: By what? P: People get on my nerves sometimes. H: Tell me more. P: Do you know anything about bookies? ...

H: Good afternoon. My name is Doctor Jones. P: Pleased to meet you. H: How are you? P: All right I guess. H: Could you tell me your name? P: Pat Smith. H: I though you might have some problems. P: I've been upset lately. H: By what? P: People get on my nerves sometimes. H: Tell me more. P: Do you know anything about bookies? ...

Page 27: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Parry Meets Eliza

P: I don't understand your motives.

E: Why don't you understand my motives?

P: Shouldn't I be?

E: Why do you say that just now?

P: That's just the way it is.

E: Suppose that's the way it were not.

P: So?

E: I am not sure I understand you fully.

P: You harp on the same questions too much.

E: What does that similarity suggest to you?

P: I don't get you.

E: Do you wish that you did get I?

P: I don't understand your motives.

E: Why don't you understand my motives?

P: Shouldn't I be?

E: Why do you say that just now?

P: That's just the way it is.

E: Suppose that's the way it were not.

P: So?

E: I am not sure I understand you fully.

P: You harp on the same questions too much.

E: What does that similarity suggest to you?

P: I don't get you.

E: Do you wish that you did get I?

Page 29: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Big Questions

• Can machines think?

• If so, how?

• If not, why not?

• What does this say about human beings?

• What does this say about the mind?

Page 30: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

What’s Easy and What’s Hard?• It’s been easier to mechanize many of the high-level tasks we usually

associate with “intelligence” in people

– e.g., symbolic integration, proving theorems, playing chess, medical diagnosis

• It’s been very hard to mechanize tasks that lots of animals can do– walking around without running into things

– catching prey and avoiding predators

– interpreting complex sensory information (e.g., visual, aural, …)

– modeling the internal states of other animals from their behavior

– working as a team (e.g., with pack animals)

• Is there a fundamental difference between the two categories?

Page 31: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Turing Test

• Three rooms contain a person, a computer, and an interrogator.

• The interrogator can communicate with the other two by teleprinter.

• The interrogator tries to determine which is the person and which is the machine.

• The machine tries to fool the interrogator into believing that it is the person.

• If the machine succeeds, then we conclude that the machine can think.

Page 32: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

The Loebner Contest • A modern version of the Turing Test, held annually, with a $100,000 cash

prize.

• Hugh Loebner was once director of UMBC’s Academic Computing Services (née UCS)

• http://www.loebner.net/Prizef/loebner-prize.html

• Restricted topic (removed in 1995) and limited time.

• Participants include a set of humans and a set of computers and a set of judges.

• Scoring

– Rank from least human to most human.

– Highest median rank wins $2000.

– If better than a human, win $100,000. (Nobody yet…)

Page 33: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

What Can AI Systems Do?Here are some example applications

• Computer vision: face recognition from a large set

• Robotics: autonomous (mostly) automobile

• Natural language processing: simple machine translation

• Expert systems: medical diagnosis in a narrow domain

• Spoken language systems: ~1000 word continuous speech

• Planning and scheduling: Hubble Telescope experiments

• Learning: text categorization into ~1000 topics

• User modeling: Bayesian reasoning in Windows help (the infamous paper clip…)

• Games: Grand Master level in chess (world champion), perfect play in checkers, professional-level Go players

Page 34: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

What Can’t AI Systems Do Yet?• Understand natural language robustly (e.g., read and understand articles

in a newspaper)

• Surf the web

• Interpret an arbitrary visual scene

• Learn a natural language

• Play Go as well as the best human players

• Construct plans in dynamic real-time domains

• Refocus attention in complex environments

• Perform life-long learning

Page 35: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Who Does AI?

• Academic researchers (perhaps the most Ph.D.-generating area of computer science in recent years)– Some of the top AI schools: CMU, Stanford, Berkeley, MIT, UIUC, UMd,

U Alberta, UT Austin, ... (and, of course, UMBC!)

• Government and private research labs– NASA, NRL, NIST, IBM, AT&T, SRI, ISI, MERL, ...

• Lots of companies!– Google, Microsoft, Honeywell, Teknowledge, SAIC, MITRE, Fujitsu,

Global InfoTek, BodyMedia, ...

Page 36: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Evolutionary Optimization

• MERL: evolving ‘bots

Page 37: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

AI and Art: NEvAr

• See http://eden.dei.uc.pt/~machado/NEvAr

Page 38: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Protein Folding

• MERL: constraint-based approach

Page 39: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Interaction: Sketching

• MIT sketch tablet

Page 40: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Possible Approaches

Think

Act

Like humans Well

GPS

Eliza

Rationalagents

Heuristicsystems

AI tends to work mostly in this area

Page 41: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Think Well

• Develop formal models of knowledge representation, reasoning, learning, memory, and problem solving, that can be rendered in algorithms.

• There is often an emphasis on systems that are provably correct, and guarantee finding an optimal solution.

Think

Act

Like humans Well

GPS

Eliza

Rationalagents

Heuristicsystems

Page 42: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Act Well

• For a given set of inputs, generate an appropriate output that is not necessarily correct but gets the job done.

• A heuristic (heuristic rule, heuristic method) is a rule of thumb, strategy, trick, simplification, or any other kind of device which drastically limits search for solutions in large problem spaces.

• Heuristics do not guarantee optimal solutions; in fact, they do not guarantee any solution at all: all that can be said for a useful heuristic is that it offers solutions which are good enough most of the time.– Feigenbaum and Feldman, 1963, p. 6

Think

Act

Like humans Well

GPS

Eliza

Rationalagents

Heuristicsystems

Page 43: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Think Like Humans

• Cognitive science approach

• Focus not just on behavior and I/O but also look at reasoning process.

• Computational model should reflect “how” results were obtained.

• Provide a new language for expressing cognitive theories and new mechanisms for evaluating them

• GPS (General Problem Solver): Goal not just to produce humanlike behavior (like ELIZA), but to produce a sequence of steps of the reasoning process that was similar to the steps followed by a person in solving the same task.

Think

Act

Like humans Well

GPS

Eliza

Rationalagents

Heuristicsystems

Page 44: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Act Like Humans

• Behaviorist approach.

• Not interested in how you get results, just the similarity to what human results are.

• Exemplified by the Turing Test (Alan Turing, 1950).

Think

Act

Like humans Well

GPS

Eliza

Rationalagents

Heuristicsystems

Page 45: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

LISPLISP

Page 46: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Why Lisp?

• Because it’s historically the most widely used AI programming language

• Because Prof. desJardins likes using it

• Because it’s good for writing production software (Graham article)

• Because it’s a functional programming language, and has lots of features that other languages don’t• Functional programming is great for designing distributed software

• Because you can write new programs and extend old programs really, really quickly in Lisp

Page 47: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Why All Those Parentheses?

• Surprisingly readable if you indent properly (use built-in Lisp editor in emacs!)

• Makes prefix notation manageable

• An expression is an expression is an expression, whether it’s inside another one or not

(+ 1 2)

(* (+ 1 2) 3)

(list (* 3 5) ‘atom ‘(list inside a list) (list 3 4) ‘(((very) (very) (very) (nested list))))

Page 48: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Functional Programming

• Computation == Evaluation of expressions• Everything is an expression...

• ...even a function!

• Avoid the use of state (global and local variables) and side effects – “pure” I/O definition of functional behavior

• Lambda calculus: Formal language for defining and manipulating functions

• Recursion is a natural way of thinking in functional programming languages

• Truly functional programs are highly parallelizable

Page 49: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Cool Things About Lisp

• Functions as objects (pass a function as an argument)

• Lambda expressions (construct a function on the fly)

• Lists as first-class objects

• Program as data

• Macros (smart expansion of expressions)

• Symbol manipulation

Page 50: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Basic Lisp Types• Numbers (integers, floating-point, complex)

• Characters, strings (arrays of chars)

• Symbols, which have property lists

• Lists (linked cells)• Empty list: nil• cons structure has car (first) and cdr (rest)

• Arrays (with zero or more dimensions)

• Hash tables

• Streams (for reading and writing)

• Structures

• Functions, including lambda functions

Page 51: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Basic Lisp Functions

• Numeric functions: + - * / incf decf

• List access: car (first), second … tenth, nth, cdr (rest), last, length

• List construction: cons, append, list

• Advanced list processing: assoc, mapcar, mapcan

• Predicates: listp, numberp, stringp, atom, null, equal, eql, and, or, not

• Special forms: setq/setf, quote, defun, if, cond, case, progn, loop

Page 52: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Useful Help Facilities

• (apropos ‘str) list of symbols whose name contains ‘str

• (describe ‘symbol) description of symbol• (describe #’fn) description of function• (trace fn) print a trace of fn as it runs• (print “string”) print output• (format …) formatted output (see Norvig p. 84)• :a abort one level out of debugger

Page 53: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Great! How Can I Get Started?

• On sunserver (CS) and gl machines, run /usr/local/bin/clisp

• From http://clisp.cons.org you can download CLISP for your own PC (Windows or Linux)

• Great Lisp resource page: http://www.apl.jhu.edu/~hall/lisp.html

Page 54: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu

Homework

• Pretest (due next Thursday, 9/8)

• Download clisp

• Write some Lisp programs

• Get started on HW 1 (due Thursday 9/15)

Page 55: CMSC 471 Fall 2011 Class #1 Thu 9/1/11 Course Overview / Lisp Introduction Professor Marie desJardins, mariedj@cs.umbc.edu, ITE 337, x53967mariedj@cs.umbc.edu