# Thread: Does this problem have more than what it seems to me ?

1. ## Does this problem have more than what it seems to me ?

It seems, to me that the program/function always terminates.
(Though it doesn't produce the intended result (the function is named 'mu' which I guess, is for multiplication) for a < 0).
And the 'Q' required is just the Loop Invariant (right?), which I think is "y=i*b".

Or am I missing something large, considering that this is for a post grad paper and I've just begun my college education(two weeks, to be exact).

(The whole question paper is here)

2. I have a hunch that condition P is about finding/avoiding boundary conditions to get an infinite loop, but that is most likely wrong.
If the loop invariant were say
i <= a
i < a
, then we have an infinite loop at
mu(INT_MAX,x)
.
For the given case though, I couldn't find any.

3. O_o

Yeah, I'm not getting it either; the instructions are crazy vague.

Code:
`if (0 = 0) do exit`
Does that insanity actually fit both roles?

Soma

4. Q should be some expression involving a,b,i,y (those things involved in the loop)

5. Q should be some expression involving a,b,i,y (those things involved in the loop)
Bwahahaa!

Okay, so, just to confirm here, this isn't about writing code at all is it? It is about reasoning through existing code isn't it?

Soma

6. I think so.
Something conceptually similar to assert.
Thats why I think Q will be "y==i*b".
But I have no idea what P can be.

(W.r.t the first comment, shouldn't language/implementation based things like INT_MAX, be left out of consideration in algorithms? )