ai-scheme

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 pages 1–8. Sign up to view the full content.

1 Scheme A “small” variant of Lisp

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

View Full Document
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
3 Overview Dr Scheme Constants: Quoting More functions: List construction Defining variables Flow of control Defining functions

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

View Full Document
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
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

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

View Full Document
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)))
“Interactions” window > (+ 3 4) 7 > > (+ (- 6 3) 10) WARNING: Interactions window is out of sync with the definitions window. Click Execute. 13

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

View Full Document
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
Ask a homework question - tutors are online