0

I am trying to get my head around this problem. Hopefully someone can help.

Imagine we have a program called Confusion;

Program confusion
if(Virus-Finder(Confusion) = false) then
   infect-executable
else
   halt
End program confusion

Obviously this is pseudo code, so won't run.

For any program P, we can run Virus-Finder(P) the result will be True if it is a virus, and False if it is not.

infect-executable is a module that scans the memory for executable programs and replicates the program Confusion in those executables.

We have no direction as to what Virus-Finder actually does, only that it returns True if the input is a virus, or False if it is not,.

Is it possible to determine if Virus-Finder can correctly decide whether Confusion is a virus or not? My initial thought is no, it cannot. But I cannot get my head around the logic.

Sam
  • 602
  • 9
  • 21
  • 1
    I suspect any algorithm that tries to statically determine what some non-trivial program does is effectively equivalent to the halting problem. – Barmar May 06 '15 at 15:09
  • What you describe here is Fred Cohen's proof that computer virus detection is undecidable: See "Detection of Viruses" in https://web.eecs.umich.edu/~aprakash/eecs588/handouts/cohen-viruses.html – Karsten Hahn Nov 29 '21 at 07:16

1 Answers1

0

What you say is not well defined, but supposing the following :
Virus-finder(p) returns true if p executes infect-executable

In that case, it is easy to prove that Virus-finder(p) is not decidable, and your pseudo-code does it exactly :
Suppose that Virus-finder(p) is decidable, so it always returns true (resp. false) if p executes (resp. does not execute) infect-executable. Then your pseudo-code shows that Virus-finder can not decide whether it is a virus or not.

As Barmar mentionned, such a reasoning is often a way to prove the undecidability of some problem, in particular the halting problem (the other well-known method is to reduce to an other undecidable problem).

Bromind
  • 1,065
  • 8
  • 23