Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 5: Let Mstate be a denotational semantic mapping that takes a syntax rule and a state and produces a state. Define the Mstate mapping

image text in transcribed

Problem 5: Let Mstate be a denotational semantic mapping that takes a syntax rule and a state and produces a state. Define the Mstate mapping for the following three syntax rules assuming we allow side effects, that is, assuming expressions and conditions can change the values of variables. + = if then else while Assume we have the following mappings defined: Mvalue takes a syntax rule and a state and produces a numeric value (or an error condition). Mboolean takes a syntax rule and a state and produces a true / false value (or an error condition). Mname takes a syntax rule and produces a name (or an error condition). Add takes a name, a value, and a state and produces a state that adds the pair (name, value to the state. Remove takes a name and a state and produces a state that removes any pair that contains the name as the first element. You may assume the Add and Remove mappings do not produce errors. Problem 5: Let Mstate be a denotational semantic mapping that takes a syntax rule and a state and produces a state. Define the Mstate mapping for the following three syntax rules assuming we allow side effects, that is, assuming expressions and conditions can change the values of variables. + = if then else while Assume we have the following mappings defined: Mvalue takes a syntax rule and a state and produces a numeric value (or an error condition). Mboolean takes a syntax rule and a state and produces a true / false value (or an error condition). Mname takes a syntax rule and produces a name (or an error condition). Add takes a name, a value, and a state and produces a state that adds the pair (name, value to the state. Remove takes a name and a state and produces a state that removes any pair that contains the name as the first element. You may assume the Add and Remove mappings do not produce errors

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 3 Lnai 8726

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448440, 978-3662448441

More Books

Students also viewed these Databases questions