1
$\begingroup$

I'm looking for an effective method to simulate a program. Why I am needing this is because sometimes I can only have the program's description, code, and all I have left is pen and paper when I want to calculate the result at the end, or the n-th loop, or step n-th ..etc..

For example :

Declare @i int 

While @i < 1000 
begin
    print @i 
    set @i = @i + 1
end

needless to say, this is a very simple program, everyone can understand it within a glance, but what about more complicated ones?

I can make it with pen and paper, but it consumes alot of time, and I think maybe there will be some methods, which will make this problem a lot easier!

$\endgroup$
  • 1
    $\begingroup$ I can't understand what you are looking for. The way you simulate an algorithm by hand is, well, by simulating what the computer would do. There is in general no way to speed this up (if there were, we would have a faster computer), though of course in some special cases sometimes you can see ways to improve it -- but there is no general answer. So I think your question is unanswerable, if I understand it correctly. Have I misunderstood? $\endgroup$ – D.W. Oct 14 '14 at 5:23
  • 1
    $\begingroup$ There are some smart methods used in software verification (abstract interpretations). $\endgroup$ – Yuval Filmus Oct 14 '14 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.