Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

00 Verizon 4:56 PM An interpreder for a langaage L maps progras written in L to their answers Remember that a language is a set

image text in transcribed
00 Verizon 4:56 PM An interpreder for a langaage L maps progras written in L to their answers Remember that a language is a set of words Let us define our language Lmas inductively as follows 1. The words 0, 1, and 2 are in 2 Assune that both A and B stand foe words in the language L. Thn (a) (A+B) are ako in L- Examples of add-mo3 expessios are(1 2) +0) and (1+(2 + 2)). However, 1 + 1 is not in the language (parenthesis are missing Give a rewrite system that auates or "computes" the value of expressions in L The optatoes + corresponds to the standard In xlulo 3 ackliton findti HB given Ixkm: 2 0 0 0 1. Define a rewrite system for moxdulo 3 expressions in Lit-mods that produces the final value of the expression. A final value is rpresented by cither 0, 1 or 2. Your rewrite system is basically an interpeter for Lali-mat For example, our two expressions ((1 2) 0) and ((22)) shoukl be rewritten to 0 axl 2, respectively. You can assune that your rewrite system will only be presented with corect Ldmts expressions, so don't worry about error messages 2. Shou your rewrite system steps that are performed for our two example expressions given above. For cach step clearly show the kft-hand side of the rule in the current expression that you are rewriting 3. Is the choice of your next rewrite rule and its left-hand side always unique in your rewrite system? If ot, show an example. 00 Verizon 4:56 PM An interpreder for a langaage L maps progras written in L to their answers Remember that a language is a set of words Let us define our language Lmas inductively as follows 1. The words 0, 1, and 2 are in 2 Assune that both A and B stand foe words in the language L. Thn (a) (A+B) are ako in L- Examples of add-mo3 expessios are(1 2) +0) and (1+(2 + 2)). However, 1 + 1 is not in the language (parenthesis are missing Give a rewrite system that auates or "computes" the value of expressions in L The optatoes + corresponds to the standard In xlulo 3 ackliton findti HB given Ixkm: 2 0 0 0 1. Define a rewrite system for moxdulo 3 expressions in Lit-mods that produces the final value of the expression. A final value is rpresented by cither 0, 1 or 2. Your rewrite system is basically an interpeter for Lali-mat For example, our two expressions ((1 2) 0) and ((22)) shoukl be rewritten to 0 axl 2, respectively. You can assune that your rewrite system will only be presented with corect Ldmts expressions, so don't worry about error messages 2. Shou your rewrite system steps that are performed for our two example expressions given above. For cach step clearly show the kft-hand side of the rule in the current expression that you are rewriting 3. Is the choice of your next rewrite rule and its left-hand side always unique in your rewrite system? If ot, show an example

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

What are some career development methods?

Answered: 1 week ago

Question

How will the members be held accountable?

Answered: 1 week ago

Question

a. How will the leader be selected?

Answered: 1 week ago