R5RS Scheme (Dr.Racket)

;; Towards a Scheme Interpreter for the Lambda Calculus — Part 1: Syntax

;; 5 points

;; , and pre-requisite for all subsequent parts of the project


;; All programming is to be carried out using the pure functional sublanguage of R5RS Scheme.


;; You might want to have a look at


;; 1. The lambda calculus is a particularly simple programming language consisting only of

;; variable references, lambda expressions with a single formal parameter, and function

;; applications.  A BNF definition of lambda calculus expressions is

;; <expr> ::= <variable> | (lambda ( <variable> ) <expr> )  |  ( <expr> <expr> )

;; Design a data type for the lambda calculus, with constructors, selectors, and classifiers.

;; For concrete representation, use Scheme, as follows:  an identifier should be represented as

;; a quoted Scheme variable, a lambda expression (lambda (x) E) as the quoted 3-element list

;; ‘(lambda (x) [list representing E]), and an application  (E1 E2) as the quoted 2-element list

;; ‘([list representing E1]  [list representing E2])

;; 2.  In (lambda (<variable>) <expr>), we say that <variable> is a binder that

;; binds all occurrences of that variable in the body, <expr>, unless some intervening

;; binder of the same variable occurs. Thus in (lambda (x) (x (lambda (x) x))),

;; the first occurrence of x binds the second occurrence of x, but not

;; the fourth.  The third occurrence of x binds the fourth occurrence of x.

;; A variable x occurs free in an expression E if there is some occurrence of x which is not

;; bound by any binder of x in E.  A variable x occurs bound in an expression E if it is

;; not free in E.  Thus x occurs free in (lambda (y) x), bound in (lambda (x) x), and both

;; free and bound in (lambda (y) (x (lambda (x) x))).

;; As a consequence of this definition, we can say that a variable x occurs free in a

;; lambda calculus expression E iff one of the following holds:

;;   (i) E = x

;;   (ii) E = (lambda (y) E’), where x is distinct from y and x occurs free in E’

;;   (iii) E = (E’ E”) and x occurs free in E’ or x occurs free in E”

;; Observe that this is an inductive definition, exploiting the structure of lambda calculus

;; expressions.

;; Similarly, a variable x occurs bound in a lambda calculus expression E iff one of the

;; following holds:

;;   (i) E = (lambda (x) E’) and x occurs free in E’

;;   (ii) E = (lambda (y) E’), and x occurs bound in E’: here, y may be x, or distinct from x

;;   (iii) E = (E1 E2) and x occurs bound in either E1 or E2

;; Develop and prove correct a procedure free-vars that inputs a list representing a lambda calculus

;; expression E and outputs a list without repetitions (that is, a set) of the variables occurring

;; free in E.

;; Develop and prove correct a procedure bound-vars that inputs a list representing a lambda calculus

;; expression E and outputs the set of variables which occur bound in E.

;; 3.  Define a function all-ids which returns the set of all symbols — free or bound variables,

;; as well as the lambda identifiers for which there are no bound occurrences — which occur in

;; a lambda calculus expression E.  

Calculate the price
Make an order in advance and get the best price
Pages (550 words)
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with Homework Mules
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Business Studies
Great paper thanks!
Customer 452543, January 23rd, 2023
Thank you very much!! I should definitely pass my class now. I appreciate you!!
Customer 452591, June 18th, 2022
Political science
I like the way it is organized, summarizes the main point, and compare the two articles. Thank you!
Customer 452701, February 12th, 2023
Thank you so much, Reaserch writer. you are so helpfull. I appreciate all the hard works. See you.
Customer 452701, February 12th, 2023
Thank you for your help. I made a few minor adjustments to the paper but overall it was good.
Customer 452591, November 11th, 2021
Thank you. I will forward critique once I receive it.
Customer 452467, July 25th, 2020
Political science
Thank you!
Customer 452701, February 12th, 2023
I requested a revision and it was returned in less than 24 hours. Great job!
Customer 452467, November 15th, 2020
Thank you for your work
Customer 452551, October 22nd, 2021
Customer reviews in total
Current satisfaction rate
3 pages
Average paper length
Customers referred by a friend
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat
Show more