Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Context/overview: Common Lisp is an object-oriented , functional programming language frequently used for resolving AI problems. In addition, CLISP is an ANSI Common Lisp implementation.

Context/overview: Common Lisp is an object-oriented , functional programming language frequently used for resolving AI problems. In addition, CLISP is an ANSI Common Lisp implementation.

Resources to consult:

CLISP-Web site: http://clisp.org/

Sourceforge: CLISP an ANSI Common LISP download: https://sourceforge.net/projects/clisp/

Paul Grahams Lisp page: http://www.paulgraham.com/lisp.html

Specific questions or items to address:

Specific questions:

Visit the Sourceforge web site, and download appropriate version of CLISP for your machine.

Install the CLISP on your machine by following installation instructions provided in the lecture section

Use your favorite editor (Emacs, notepad, etc) and edit (write) the code for the problems provided below. Once the code is edited, fully debug the code, and then compile it

To load the code, use the load command:

User (1)load c:\\lisp\\test.lisp )

To compile the code, one that is fully debugged, use the following command:

User (2)compile-file c:\\lisp\\test.lisp )

Problem 1: Exponential function

Assume that both B(base), and e (exponent) are non-negative integer numbers. Implement the function power that calculates the B for the given E. Enter your function definition into a text file. Then load it into LISP. Execute the function for the values (power 3 3).

Take a screenshot of the execution, and paste it into MS word document. Provide the appropriate description of the screenshot.

Additionally, attach and submit your Notepad file into the assignment dropbox.

Problem 2: Calculating Fibonacci Series

The Fibonacci sequence is a sequence of numbers in which each successive number in the sequence is obtained by adding the two previous numbers in the sequence.

If we know that :

Fib(0)=1

Fib(1)=1

Fib(n) = Fib(n-1) + Fib(n-2) for n>1

Implement the function Fib that calculates Fibonacci sequence for given n

Enter your function definition into a text file. Then load it into LISP. Execute the function for the value (Fib 5).

Take a screenshot of the execution, and paste it into MS Word document.

Additionally, attach and submit your Notepad file into the assignment dropbox.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

3. How frequently do the assessments occur?

Answered: 1 week ago