I have been reading the paper of F. Cohen about viruses, here is the link:https://web.eecs.umich.edu/~aprakash/eecs588/handouts/cohen-viruses.htmlI quite not get the following part:Detection of VirusesIn order to determine that a given program 'P' is a virus, it must be    determined that P infects other programs. This is undecidable since P    could invoke the decision procedure 'D' and infect other programs if    and only if D determines that P is not a virus. We conclude that a    program that precisely discerns a virus from any other program by    examining its appearance is infeasible. In the following modification    to program V, we use the hypothetical decision procedure D which    returns true iff its argument is a virus, to exemplify the    undecidability of D.program contradictory-virus:={...main-program:= {if ~D(contradictory-virus) then    {infect-executable;    if trigger-pulled then do-damage;    } goto next; }}I mean, why does P (which I believe is the program called contradictory-virus) has to decide if it is a virus or not? or in other words, why will only infect other programs if D determines that P (contradictory-virus) is not a virus? I kind of feel that this part of the proof is a little bit awkward and forced to get a contradictory result.Any detailed explanation about this it would be great. Thanks.
proof of undecidability of computer viruses
undecidability