Ai-scheme - Scheme A"small variant of Lisp 1 Basics Why Lisp Learning lisp in the study of AI is like learning French if you are going to

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Scheme A “small” variant of Lisp
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Basics Why Lisp? Learning lisp in the study of AI is like learning French if you are going to France (Charniak & McDermot) Interpreted language Prefix operator notation, with parentheses Functional style
Background image of page 2
3 Overview Dr Scheme Constants: Quoting More functions: List construction Defining variables Flow of control Defining functions
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Dr. Scheme See web site for downloads Has different language levels: “Language” “Choose Language” “Full Scheme” Two windows Top: program editing (“definitions”) window Define functions, variables, comments Bottom: interactive evaluation window: interpreted Evaluate functions, test code
Background image of page 4
5 Characters are: A…Z, a…z, 0…9, ! % $ * + - / = ? Atom String of one or more characters with no spaces between; Examples: 123, 1xyz, fred #\ used for character constants; e.g., #\newline #t, #f (true, false) Upper/lower case only distinguished in constants
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Math Form of function application is prefix Syntax: operator value value Expressions are parenthesized, e.g., (+ 1 2) Math operators: + - / *; other examples: Other examples: abs, sqrt, modulo, remainder Nested expressions often used: (abs (* (- 2 3) (- 0 1)))
Background image of page 6
“Interactions” window > (+ 3 4) 7 > > (+ (- 6 3) 10) WARNING: Interactions window is out of sync with the definitions window. Click Execute. 13
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/20/2011 for the course CS 6810 taught by Professor Hecker during the Spring '10 term at CSU East Bay.

Page1 / 25

Ai-scheme - Scheme A"small variant of Lisp 1 Basics Why Lisp Learning lisp in the study of AI is like learning French if you are going to

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online