Question: Considering the operator definition: name ( input 1 _ type, input 2 _ type, . . . ) - > output _ type . You

Considering the operator definition:
name(input1_type, input2_type, ...)-> output_type
. You are given the following operators:
+(int, int)-> int (plus)
(int, int)-> int (minus)
&&(boolean, boolean)-> boolean (and)
||(boolean, boolean)-> boolean (or)
==(int, int)-> boolean (equality)
==(boolean, boolean)-> boolean (equality)
Note: Operator: +(int, int)-> int, means it takes two integers, performs an add operation
on them, and outputs an integer.
Using the given operators, decide whether the following expressions ((a) to (e)) are ty-
peable or not. If the expression is typeable (able to be reduced to a typed expression), give
its type and expected output. Otherwise, give an explanation of why it is not typeable.
1. True && False
2.100- x; given x = "unicorn"
3.99.5+50.5
4.(5-3)== False
5.(4+5)==(2+7)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!