Gx: G(x) Gtrue bool Gfalse: bool Gn: int Gel t1 G, x: t1e2: t2 Glet x el in e2 t2 Gel bool Ge2 bool Gel and e2: bool Ge: int Geq0e bool Gel bool Ge2: t Ge3: t Gif el then e2 else e3: t Which of the following is the correct typing rule for a conditional expression (if e1 then e2 else e3) according to the image? Ge1: int, Ge2: int, G - e3: int Ge1: bool, Ge2: t, Ge3: t Ge1: int, Ge2: bool, G - e3: bool Ge1: bool, Ge2: bool, G - e3: int Gx: G(x) Gtrue bool Gfalse: bool Gn: int Gelt1 G,x: t1e2: t2 Glet x el in e2: t2 Gel bool Ge2 bool Gel and e2: bool Ge: int Gel bool Ge2t Ge3: t Geq0 e bool Gif el then e2 else e3: t Using the typing rules above, determine if the following expressions are well-typed:

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter2: Elements Of High-quality Programs
Section: Chapter Questions
Problem 5RQ
icon
Related questions
Question
Gx: G(x) Gtrue bool
Gfalse: bool
Gn: int
Gel t1 G, x: t1e2: t2
Glet x el in e2 t2
Gel bool Ge2 bool
Gel and e2: bool
Ge: int
Geq0e bool
Gel bool Ge2: t Ge3: t
Gif el then e2 else e3: t
Which of the following is the correct typing rule for a conditional expression (if e1 then e2 else e3)
according to the image?
Ge1: int, Ge2: int, G - e3: int
Ge1: bool, Ge2: t, Ge3: t
Ge1: int, Ge2: bool, G - e3: bool
Ge1: bool, Ge2: bool, G - e3: int
Transcribed Image Text:Gx: G(x) Gtrue bool Gfalse: bool Gn: int Gel t1 G, x: t1e2: t2 Glet x el in e2 t2 Gel bool Ge2 bool Gel and e2: bool Ge: int Geq0e bool Gel bool Ge2: t Ge3: t Gif el then e2 else e3: t Which of the following is the correct typing rule for a conditional expression (if e1 then e2 else e3) according to the image? Ge1: int, Ge2: int, G - e3: int Ge1: bool, Ge2: t, Ge3: t Ge1: int, Ge2: bool, G - e3: bool Ge1: bool, Ge2: bool, G - e3: int
Gx: G(x) Gtrue bool
Gfalse: bool
Gn: int
Gelt1 G,x: t1e2: t2
Glet x el in e2: t2
Gel bool Ge2 bool
Gel and e2: bool
Ge: int
Gel bool
Ge2t Ge3: t
Geq0 e bool
Gif el then e2 else e3: t
Using the typing rules above, determine if the following expressions are well-typed:
Transcribed Image Text:Gx: G(x) Gtrue bool Gfalse: bool Gn: int Gelt1 G,x: t1e2: t2 Glet x el in e2: t2 Gel bool Ge2 bool Gel and e2: bool Ge: int Gel bool Ge2t Ge3: t Geq0 e bool Gif el then e2 else e3: t Using the typing rules above, determine if the following expressions are well-typed:
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage