homework1sol - Introduction to AI. Lab1 1. FALL 09. Each...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 Introduction to AI. Lab1 1. FALL 09. Each problem is 20 points. Please name the functions as I have named them here. You may use any auxilliary functions you deem necessary. 1. Write a function, WFF, that will return t, if an expression in the following language is well formed, nil otherwise. Binary operators: %, &, *. Unary operators: not. The variables in this language are: a, b, c, d, e, f. The input to your function should be a list. (WFF '(* a (% b c))) T (WFF '(not a)) T (WFF '(not (% a (* b d)))) T (WFF '(% a b c)) NIL (WFF '(& a) ) NIL (WFF '(& a w) ) NIL 2. Write a function, COMMUTE, that reverse the order of any atom immediately followed by another atom. The structure of the list should remain the same. Any given atom is commuted only once. (COMMUTE '(a b c)) = (b a c) (COMMUTE '(a b c d)) = (b a d c) (COMMUTE '(a d (a b c d))) = (d a (b a d c)) (COMMUTE '((a(k)))) = ((a(k))) (COMMUTE '((a(k a)))) = ((a(a k))) 3. Write a function, APPEAR-ANYWHERE that returns t, if an atom appears
Background image of page 1

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

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

This note was uploaded on 11/01/2009 for the course CECS 4630 taught by Professor Fernandogomez during the Fall '09 term at University of Central Florida.

Page1 / 4

homework1sol - Introduction to AI. Lab1 1. FALL 09. Each...

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

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