In this problem, you must add to SLang 1 a "special" function called gt1 that takes in a space-separated list of 1 or more real numbers and returns the first one (from left to right) that is larger than 1.0. Here are some sample programs and their value:

gt1 [ 0.2 0.1 8.9 3.4 6.4 ] returns [ "RealExp" , 8.9 ]

gt1 [ 0.2 8.9 lambda x . x ] returns [ "RealExp" , 8.9 ]. Note that there is no syntax error in this case: the parser accepts one or more <exp> non-terminals between the brackets. The restriction that the expressions be real numbers is not enforced in the grammar, but at run-time, that is, in the interpreter.

gt1 [ lambda x . x 0.2 8.9 ] causes the interpreter to generate a runtime error. Note that a runtime error is not a syntax error.

gt1 [ 0.7 0.2 ] causes the interpreter to generate a runtime error because the argument list does not contain any real numbers greater than 1.

For your answer, check each and every file below that MUST be altered to implement this modification.





[ $('#absyn').prop('checked'), $('#grammar').prop('checked'), $('#env').prop('checked'), $('#interpreter').prop('checked') ]
return RP23part4Validate(guess);

Remember that you are modifying the code that you obtained at the end of the previous exercise, not the code that was discussed in class.

Does this change impact the concrete syntax or the abstract syntax of SLang 1 (or both)?

Are we adding new types of denoted values or modifying the existing ones?

Are we adding new types of expressions?

Must the main function of the interpreter be extended? Does the overall evaluation process need to handle additional cases?

Why is gt1 a special function?