Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the following why is ( d ) rorrert please explain the green answer to d ? ? in the image ( b ) Write

Given the following why is (d)rorrert please explain the green answer to d?? in the image
(b) Write a variant for the alstract syntax of this language.
(c) Formally define the big step semantics of this language.
vinZv!tv Num
E11-t1(x,t3,E2),E11-t2v1,E2[xv1]+t32E1+t1t2v2 CALL.
E1-t1||v1,E-t12E-t1+t2v1+t2ADD
E:-t1v1EP-t1v2B-t1-t2v1-v2 SUB
(d) Write an evaluator for this language based on your big step semantics.
defun eval Et
match t with
case m(n)n
case Var(x)E(x)
case FuncExpr(v,t)(FuncExpr(v,t),E)
case BopExpr(x,b,y)
let
xlarrevalEx
ylarrevalEy
in
match b with
case Add x+y
case Sub x-y
case lx**y
case Div xy
case CallExpr(f,x)
match , eval Ex with
case ((FuncExpr(v,t),E),x)
eval E[v|x]t
otherwise ERROR
image text in transcribed

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

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions