Removing conflicts of LR(1) parsing tables
The ambiguity comes from

I -&gt; id


because that rule means that both I ans E derive id, which in turn means that return id could be a derivation of either: 

S -&gt; return E ; S


or

S -&gt; return I ; S


Also, id1 = id2 could be derived from:

I -&gt; id = E


or

I -&gt; id = I


It doesn't make sense for id to be a statement if id + 3 is not; I'd just drop the I -&gt; id production.