CPSC 322 Introduction to Artificial Intelligence September 27, 2004.

Slides:



Advertisements
Similar presentations
R for Macroecology Aarhus University, Spring 2011.
Advertisements

1 Scheme and Functional Programming Aaron Bloomfield CS 415 Fall 2005.
8 Queens. Problem: Placing 8 queens on a chessboard such that they don’t attack each other Three different Prolog programs are suggessted as solutions.
Lists in Lisp and Scheme a. Lists are Lisp’s fundamental data structures, but there are others – Arrays, characters, strings, etc. – Common Lisp has moved.
Lisp II. How EQUAL could be defined (defun equal (x y) ; this is how equal could be defined (cond ((numberp x) (= x y)) ((atom x) (eq x y)) ((atom y)
Lisp II. How EQUAL could be defined (defun equal (x y) ; this is how equal could be defined (cond ((numberp x) (= x y)) ((atom x) (eq x y)) ((atom y)
Lambda Calculus and Lisp PZ03J. Lambda Calculus The lambda calculus is a model for functional programming like Turing machines are models for imperative.
Chapter 3 Functional Programming. Outline Introduction to functional programming Scheme: an untyped functional programming language.
LISP Programming. LISP – simple and powerful mid-1950’s by John McCarthy at M.I.T. “ LIS t P rocessing language” Artificial Intelligence programs LISP.
Honors Appendix Advanced Integrated Math I. Warm-Up: April 20, 2015.
What if you don’t choose well? light(l1). light(l2). down(s1). up(s2). up(s3). ok(l1). ok(l2). ok(cb1). ok(cb2). connected_to(l1, w0). connected_to(w0,
CIS101 Introduction to Computing Week 11 Spring 2004.
CPSC 322 Introduction to Artificial Intelligence October 13, 2004.
Preliminaries Attendance sheets –I remembered! HW1 due tonight –progress report Stage 1 due on Friday –progress report.
Preliminaries Attendance sheets –I remembered! Survey links –HW1 time survey –Anonymous feedback survey HW discussion (4PM, Commons 9)
No homework this week Stage 2 starts next week. Code review Team with N members is assigned N submissions to review Discuss submissions within team Everyone.
Lisp. Versions of LISP Lisp is an old language with many variants –LISP is an acronym for List Processing language Lisp is alive and well today Most modern.
6.001 SICP SICP – September ? 6001-Introduction Trevor Darrell 32-D web page: section.
Common Lisp Derek Debruin Mark Larue Vinh Doan. Problem Domains There was a need in the early 1960s to define a programming language whose computational.
Functional programming: LISP Originally developed for symbolic computing First interactive, interpreted language Dynamic typing: values have types, variables.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 22 Jim Martin.
Recursion. Definitions I A recursive definition is a definition in which the thing being defined occurs as part of its own definition Example: A list.
Spring 2008Programming Development Techniques 1 Topic 6 Hierarchical Data and the Closure Property Section September 2008.
Comp. Eng. SW Lab II: FP with Scheme 1 Computer Eng. Software Lab II , Semester 2, Who I am: Andrew Davison CoE, WiG Lab Office.
PYTHON PROGRAMMING Week 10 – Wednesday. TERMS – CHAPTER 1 Write down definitions for these terms:  Computation  Computability  Computing  Artificial.
Arbitrarily Long Data Structures: Lists and Recursion CMSC Introduction to Computer Programming October 4, 2002.
1 Lisp Functions –Built-in functions –Defining functions –Function Evaluation and Special Forms defun, if Control statements –Conditional if, cond –Repetition.
ISBN Chapter 15 Functional Programming Languages.
CS 330 Programming Languages 11 / 21 / 2006 Instructor: Michael Eckmann.
Scheme & Functional Programming. ( ) >> 64 ( ) >> 666 (* ) >> 1200 (+ (* 3 5) (- 10 6)) >> 19.
Recursion: Linear and Tree Recursive Processes and Iteration CMSC Introduction to Computer Programming October 7, 2002.
1 Lecture 6 Logic Programming introduction to Prolog, facts, rules Ras Bodik Shaon Barman Thibaud Hottelier Hack Your Language! CS164: Introduction to.
CS 403: Programming Languages Lecture 6 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
14-October-2002cse Lists © 2002 University of Washington1 Lists CSE 413, Autumn 2002 Programming Languages
BIT 115: Introduction To Programming. 2 What’s Due When Listed in Course Schedule Let’s look at that now!
COP4020 Programming Languages Functional Programming Prof. Xin Yuan.
A Second Look At ML 1. Outline Patterns Local variable definitions A sorting example 2.
Programming in Lisp; Instructor: Alok Mehta Programming in Lisp Introduction to Lisp.
CS535 Programming Languages Chapter - 10 Functional Programming With Lists.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 19: Environments.
PPL Lazy Lists. Midterm 2012 (define sum-vals (λ (ts) (if (ts-simple? ts) (ts-val ts) (accumulate + 0 (map ts-val (ts-inner-slots ts))))))
Chapter SevenModern Programming Languages1 A Second Look At ML.
CMPT 308 — Computability and Complexity Fall 2004 Instructor: Andrei Bulatov, TA: Ramsay Dyer, Learning.
Juggling Your Priorities. Use your ABCs: Make a list of what has to be done today (A), what needs to be done this week (B), and what needs to be done.
CS 360 Lab 1 Professor: Krzysztof Nowak TA: Mark Boady.
LISP LISt Processing. History & Overview b b One of the oldest high level programming languages. b b First developed in 1958 by John McCarthy. b b Later.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 8: Cons car cdr sdr wdr.
Functional Programming
CS 3304 Comparative Languages
Edited by Original material by Eric Grimson
CS 550 Programming Languages Jeremy Johnson
PPL Lazy Lists.
Lists in Lisp and Scheme
LISP LISt Processing.
CS 270 Math Foundations of CS Jeremy Johnson
Foundations of Visualization 8/30/05 Lecture Notes
Introduction to Functional Programming in Racket
Day 93 Explicit and recursive form for sequences (day 1)
نجاح وفشل المنشآت الصغيرة
Lecture #8 מבוא מורחב.
Day 94 Explicit and recursive form for sequences (day 2)
Introduction to Functional Programming in Racket
6.001 SICP Data Mutation Primitive and Compound Data Mutators
LISP LISt Processing.
Abstraction and Repetition
Discrete Math (2) Haiming Chen Associate Professor, PhD
CPSC 322 Introduction to Artificial Intelligence
LISP LISt Processing.
Introduction to Finite Element Methods
Programming Languages
Presentation transcript:

CPSC 322 Introduction to Artificial Intelligence September 27, 2004

Things to look for Homework assignment tonight Midterm exam one week from today

The Awesome Power of Recursion or how getting the representation right makes everything else so easy....

The Maze r11 - r12 - r13 - r14 - r15 - r16 - r17 r18 | | | | | r21 r22 r23 - r24 r25 - r26 r27 - r28 | | | | r31 r32 r33 - r34 - r35 r36 r37 - r38 | | | | | | r41 r42 r43 r44 - r45 - r46 r47 r48 | | | | | | r51 r52 - r53 r54 r55 r56 r57 - r58 | | | | | | r61 r62 - r63 r64 - r65 r66 - r67 r68 | | | | r71 r72 r73 r74 - r75 - r76 r77 - r78 | | | | | r81 - r82 r83 - r84 r85 - r86 r87 - r88

It’s time for a CILOG break! cilog: load ‘maze.ci’. compare tell path(X,Y) <- nowall(X,Z) & path(Z,Y). tell path(X,Y) <- nowall(X,Y). to tell path(X,Y) <- path(X,Z) & path(Z,Y). tell path(X,Y) <- nowall(X,Y).

The List An ordered sequence of elements: [larry, moe, curly] Consists of two parts: head and rest or [larry | [moe, curly]] head and tail equivalent to: car and cdr the “root” of all lists is the empty list [] for example [larry | [moe | [curly | []]]]

Equivalent forms of lists Cons pair syntaxElement syntax [a | [ ]][a] [a | [b | [ ]]][a,b] [a | [b | [c | [ ]]]][a,b,c][a | X] [a | [b | X]][a,b | X]

No more slides today The rest of the class was done on the computer and on the board...