Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help! The expression to base answers off of is provided... Requirements: Following the formal type system introduced in the Simply Typed Lambda Calculus Primer

Please help! The expression to base answers off of is provided... image text in transcribed
image text in transcribed
Requirements: Following the formal type system introduced in the Simply Typed Lambda Calculus Primer in this Topic, add pair data structure term to the language. For example, we'll use the Haskell notation of parentheses to represent our pair data structure in the Lambda Calculus. We'll use a Java like notation of a "." to represent the first (fst) and second (snd) functions. Hence, in an Applied Calculus with Boolean and Natural Number types, we might have, 1. (true, 1) (true, 1).fst> tdlue (true, 1).snd 1 Give the new syntax and value extensions (Table 1 and 3) a. Give the new evaluation rules (Table 2). Hints: you'll need to give two rules capturing the direct implementations of the fst and snd. You'll need to give four more rules capturing what it means to take a reduction step for the terms used in the fst and snd functions. Consider rules for a fully evaluated pair and partially evaluated pairs. Here's the last and most difficult the needed six rules: b. To further assist you, here's an evaluation (pay attention fo the order this evaluation/reduction takes place since the evaluation rules must force this ordering (i.e. it's like the discussion of the call-by-name vs. value associated with the Beta-reduction rule in this Topic's notes. (succ 4, if false then true else false).fst {5, if false then true else false).fst 5, false).fst Give the new typing rules (Table 4). Hint, a 2-tuple is a binary relation, whose value types can be represented with a cartesan-product Ti x T2 Hint: type the evaluation rules that form a pair, fst, and snd. c. true i false l 0 l succt l pred t l isZero t l if then t else t true I false | nu 01 succ nv ::= 7 :- nv ::= Requirements: Following the formal type system introduced in the Simply Typed Lambda Calculus Primer in this Topic, add pair data structure term to the language. For example, we'll use the Haskell notation of parentheses to represent our pair data structure in the Lambda Calculus. We'll use a Java like notation of a "." to represent the first (fst) and second (snd) functions. Hence, in an Applied Calculus with Boolean and Natural Number types, we might have, 1. (true, 1) (true, 1).fst> tdlue (true, 1).snd 1 Give the new syntax and value extensions (Table 1 and 3) a. Give the new evaluation rules (Table 2). Hints: you'll need to give two rules capturing the direct implementations of the fst and snd. You'll need to give four more rules capturing what it means to take a reduction step for the terms used in the fst and snd functions. Consider rules for a fully evaluated pair and partially evaluated pairs. Here's the last and most difficult the needed six rules: b. To further assist you, here's an evaluation (pay attention fo the order this evaluation/reduction takes place since the evaluation rules must force this ordering (i.e. it's like the discussion of the call-by-name vs. value associated with the Beta-reduction rule in this Topic's notes. (succ 4, if false then true else false).fst {5, if false then true else false).fst 5, false).fst Give the new typing rules (Table 4). Hint, a 2-tuple is a binary relation, whose value types can be represented with a cartesan-product Ti x T2 Hint: type the evaluation rules that form a pair, fst, and snd. c. true i false l 0 l succt l pred t l isZero t l if then t else t true I false | nu 01 succ nv ::= 7 :- nv ::=

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

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

More Books

Students also viewed these Databases questions

Question

Write a program to check an input year is leap or not.

Answered: 1 week ago

Question

Write short notes on departmentation.

Answered: 1 week ago

Question

What are the factors affecting organisation structure?

Answered: 1 week ago

Question

What are the features of Management?

Answered: 1 week ago

Question

Briefly explain the advantages of 'Management by Objectives'

Answered: 1 week ago

Question

Conduct an effective performance feedback session. page 360

Answered: 1 week ago