Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write in DrRacket or Racket you will work the little la nguage ::= | (lambda ( ) ) | ( ) | (let (

please write in DrRacket or Racket

you will work the little language

  ::=  | (lambda () ) | ( ) | (let ( ) )

Write a structurally recursive function named (free-vars exp) that takes as input an expression in the core language, and returns a set of all of the variables that occur free in expression. For example:

 > (free-vars 'x) (x) > (free-vars '(square x)) (x square) > (free-vars '(lambda (y) (x y))) (x) > (free-vars '((lambda (y) (y (square x))) (lambda (y) (f y)))) (f x square) > (free-vars (preprocess '(let (a b) (let (c (lambda (d) a)) (c a)))) (b)

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

Step: 3

blur-text-image

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

Oracle 12c SQL

Authors: Joan Casteel

3rd edition

1305251032, 978-1305251038

More Books

Students also viewed these Databases questions