Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Explain the essentials of functions defined below. What targets do they achieve? Refer to definitions images below. Explain in what sense they are mutual inverses

Explain the essentials of functions defined below. What targets do they achieve? Refer to definitions images below. Explain in what sense they are mutual inverses of each other and why

image text in transcribed

image text in transcribed

image text in transcribed

the index of the rightmost x in removenamesr (x) removenamesi. (AX.ti) -, removenamesi..x (ti) removenamesr(ti t2)removenamesrx(ti) removenamesr,x(t2) restorenamesr (k) restorenamesr(.t1) the kth name in where x is the first name not in dom(T) -restorenamesr.x(t) restorenamesr.x(t2) restorenamesr (ti DEFINITIONTERMS: Let T be the smallest family of sets To, T1, T2, ...J such that 1. k ETn whenever 0sk 0, then .ti ET,-1; 3. if ti E Tn and t2 E Tn, then (ti t2) E Tn (Note that this is a standard inductive definition, except that what we are defining is a family of sets indexed by numbers, rather than a single set.) The elements of each T are called n-terms. The elements of Tn are terms with at most n free variables, numbered between 0 and n 1: a given element of Tn need not have free variables with all these numbers, or indeed any free variables at all. When t is closed, for example, it will be an element of Tn for every n. Note that each (closed) ordinary term has just one de Bruijn representa tion, and that two ordinary terms are equivalent modulo renaming of bound variables iff they have the same de Bruijn representation. To deal with terms containing free variables, we need the idea of a naming context. For example, suppose we want to represent .y x as a nameless term. We know what to do with x, but we cannot see the binder for y, so it is not clear how "far away" it might be and we do not know what number to assign to it. The solution is to choose, once and for all, an assignment (called a naming context) of de Bruijn indices to free variables, and use this assignment consistently when we need to choose numbers for free variables. For example, suppose that we choose to work under the following naming context: Then x (y z) would be represented as 4 (3 2), while . y w would be repre- sented as . 4 0 and . .xas ..6. Since the order in which the variables appear in I determines their numer ical indices, we can write it compactly as a sequence. DEFINITION: Suppose xo through xn are variable names from V. The naming context I-Xn, Xn-1 ...x1, Xo assigns to each x, the de Bruijn index i. Note that the rightmost variable in the sequence is given the index 0; this matches the way we count A binders-from right to left-when converting a named term to nameless form. We write dom(I) for the set xn, ..., Xol of variable names mentioned in 1. the index of the rightmost x in removenamesr (x) removenamesi. (AX.ti) -, removenamesi..x (ti) removenamesr(ti t2)removenamesrx(ti) removenamesr,x(t2) restorenamesr (k) restorenamesr(.t1) the kth name in where x is the first name not in dom(T) -restorenamesr.x(t) restorenamesr.x(t2) restorenamesr (ti DEFINITIONTERMS: Let T be the smallest family of sets To, T1, T2, ...J such that 1. k ETn whenever 0sk 0, then .ti ET,-1; 3. if ti E Tn and t2 E Tn, then (ti t2) E Tn (Note that this is a standard inductive definition, except that what we are defining is a family of sets indexed by numbers, rather than a single set.) The elements of each T are called n-terms. The elements of Tn are terms with at most n free variables, numbered between 0 and n 1: a given element of Tn need not have free variables with all these numbers, or indeed any free variables at all. When t is closed, for example, it will be an element of Tn for every n. Note that each (closed) ordinary term has just one de Bruijn representa tion, and that two ordinary terms are equivalent modulo renaming of bound variables iff they have the same de Bruijn representation. To deal with terms containing free variables, we need the idea of a naming context. For example, suppose we want to represent .y x as a nameless term. We know what to do with x, but we cannot see the binder for y, so it is not clear how "far away" it might be and we do not know what number to assign to it. The solution is to choose, once and for all, an assignment (called a naming context) of de Bruijn indices to free variables, and use this assignment consistently when we need to choose numbers for free variables. For example, suppose that we choose to work under the following naming context: Then x (y z) would be represented as 4 (3 2), while . y w would be repre- sented as . 4 0 and . .xas ..6. Since the order in which the variables appear in I determines their numer ical indices, we can write it compactly as a sequence. DEFINITION: Suppose xo through xn are variable names from V. The naming context I-Xn, Xn-1 ...x1, Xo assigns to each x, the de Bruijn index i. Note that the rightmost variable in the sequence is given the index 0; this matches the way we count A binders-from right to left-when converting a named term to nameless form. We write dom(I) for the set xn, ..., Xol of variable names mentioned in 1<><>

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

Big Data With Hadoop MapReduce A Classroom Approach

Authors: Rathinaraja Jeyaraj ,Ganeshkumar Pugalendhi ,Anand Paul

1st Edition

1774634848, 978-1774634844

More Books

Students also viewed these Databases questions