Kat H.

asked • 04/14/23

Denotational Semantic Mapping

Which of the following shows a denotational semantic mapping for evaluating a Boolean expression?


Ma(x=E,s) ≜
  if Me(E, s) == error
then error
else s' = {<i1,v1'>,<i2,v2'>,...,<in,vn'>}, where
for j = 1,2,...,n
if ij == x
then vj' = Me(E,s)
else vj = VARMAP(ij,s)
Mpf(for var in init_expr .. final_expr loop L end loop, s)  ≜
     if VARMAP(i, s) == undef for var or some i in init_expr or final_expr
          then error
          else if Me(init_expr, s) > Me(final_expr, s)
              then s
              else Ml(while init_expr - 1 <= final_expr do L, Ma(var := init_expr + 1, s))
Mb(B, s) ≜
if VARMAP(i, s) == undef for some i in B
          then error
          else B', where B' is the result of
              evaluating B after setting each
                variable i in B to VARMAP(i, s)


1 Expert Answer

By:

Jonathan M. answered • 05/15/23

Tutor
New to Wyzant

IT Professional Sharing the Knowledge

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.