Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What does question II.1. mean by “identify all the places in the HMTC type checker where a contextual error in a MiniTriangle program can be flagged”?

0
Posted

What does question II.1. mean by “identify all the places in the HMTC type checker where a contextual error in a MiniTriangle program can be flagged”?

0

Basically, in the contextual checker, there is a code fragment for each contextual error that implements the test needed to see if that error is present in the program being compiled or not. You are asked to find those places/code fragments because that’s the easiest way to find out what all possible contextual errors are. Now, the easiest way to find those places/code fragments, is to look for the error messages, and the easiest way to find THOSE is to look for where the monadic error reporting “commands” are used, in particular “emitErrD”. However, “emitErrD” is often used indirectly in the compiler through the convenience function “require” (and others). So you need to do some light-weight detective work. The point of the question is to: • make you familiar with the concept of contextual errors, • make you familiar with the source code of the compiler.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123