Closed ik1ne closed 3 years ago
Try unfold optimize_1mult at 1
, unfold optimize_1mult at 2
, etc.
(optimize_1mult (AMult a1 a2)))
is not the same as (AMult (optimize_1mult a1) (optimize_1mult a2))
The counterexample is the case of a1=ANum 1
and a2=ANum 2
.
(optimize 1)×(optimize 2)=1×2 doesn't give you the same formula as optimize (1×2)=2.
May I ask if there is any progress on this issue?
I think it is already ended, since it dealt with the last assignment.
Oh, yes, I found that I was proving wrong way, so I haven't used unfolding some portion in assignment 7. However, I used it in assignment 08. Thank you!
While solving 7_2, I managed to simplify my goal into this:
AMult (optimize_1mult a1) (optimize_1mult a2) = optimize_1mult (AMult a1 a2)
And this must be very simple to proof, sinceFixpoint optimize_1mult
hasmatch a with | AMult e1 e2 ...
so I cansimpl
(orunfold optimize_1mult
) right hand side only and then usereflexivity
. But, when I trysimpl
tactics, it also unfoldsoptimize_1mult
in the left side, making the goal nearly impossible to proof without induction/destruct. Do I have to use induction for this goal?