R5rs scheme (dr.racket) | Computer Science homework help

;; 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 http://www.cs.unc.edu/~stotts/723/Lambda/overview.html

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; 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.  

Order a unique copy of this paper
(550 words)

Approximate price: $22

Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

We value our customers and so we ensure that what we do is 100% original..
At Custom Writing, we believe in exemplary services that are fully geared toward customer satisfaction. That is why we don’t shy away from giving you the following guarantees;

Money-back guarantee

Trusting us with your work is the best decision you have made, our pleasure lies in seeing you satisfied at 100%. If in the rear chance it happens that you are not satisfied, then know that we will equally not be satisfied. But worry not, our 30 days- Money back guarantee is all you need and that is what we promise you..

Read more

Zero-plagiarism guarantee

We utilize profoundly equipped and gifted writers who produce unique papers liberated from any form of plagiarism. To guarantee this, we run all papers finished by our scholars through a Plagiarism checker to ensure uniqueness and originality. In any case, on the off chance that you have vulnerabilities about the originality or falsification of any paper we have finished and conveyed to you, please get in touch with us straight away. We will quickly investigate, and if the paper is seen as counterfeited, we will take suitable actions including but not limited to, revising the paper for free and in extreme cases we will activate the money back guarantee.

Read more

Free-revision policy

We have an obligation deliver great and specially composed assignments. Our revision strategy endeavors to ensure total client satisfaction, comfort, and a genuine feelings of serenity. We make minor updates and corrections to the underlying request as part of our continuous assistance. However, revisions should just incorporate changes and alterations that were not effectively met, in the underlying request and that are inside the rules as per the current request structure..

Read more

Privacy policy

Our client's Data is an Integral part of our business but clearly, we are not in the business of offering our clients' very own data to others. We realize that you care how your online data is utilized and shared, we equally value your trust that we will do so cautiously and sensibly. We Promise to ensure the security of your own data during transmission by utilizing encryption conventions and programming. Likewise assist us with securing your information by not sharing your passwords and usernames.

Read more

Fair-cooperation guarantee

In submitting a request with us, you consent to the services we give. We will strive to take the necessary steps to convey a far reaching paper according to your prerequisites. Equally we depend on your cooperation to guarantee that we convey on this order.

Read more

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency