
For your homework, I want these ranges of variables, as seen.

But if you want true challenges, here are some more.

For instance, you can go and also record the types of variables,

say, the type of x is the same as the type of 2.

Or you could go and check for set patterns.

For instance, you could report that the variable x

is in the list of values 2, 4, and 16.

The relationships between variables

In the square root function, the y variable always has the same value as the return value.

That's not very surprising, because we actually return y, but that's an interesting property.

Likewise, the return value of a square root function

is always less or equal to the value that we want to compute the square root for.

You can obtain such relationships between variables

by coming up with a pattern, say like equal or less than,

and instantiating that pattern with all variables,

and then seeing which patterns actually hold over multiple runs.

With that, enjoy building your own dynamic invariant checker,

and make it easier for future generations to write assertions. Thank you.