Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 4 [10pt] Using the pure -calculus, we can encode a pair of -terms as where a term PAIR takes three -terms a, b, p
Problem 4 [10pt] Using the pure -calculus, we can encode a pair of -terms as where a term PAIR takes three -terms a, b, p and applies p to a and b. That is, we can define PAIR as (Aabppab). (p (At f . t)). Show that under a) Based on this definition, we can encode function LEFT as LEFT A Ap b) Try to define a function RIGHT in -calculus so that given a pair, it returns the second term in the pair. c) Try to define a function FLIP in -calculus so that given a pair, it returns a new pair where the elements such encoding, LEFT (PAIR x y) evaluates to x. For example, RIGHT (PAIR x y) should evaluate to y under your encoding. are flipped. For example, FLIP (PAIR y) should evaluate to (PAIRy r) (or some equivalent term under a18-reduction)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started