A computer uses some fixed operating system under which all its programs run. A “program” can be thought of as a functio

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

A computer uses some fixed operating system under which all its programs run. A “program” can be thought of as a functio

Post by answerhappygod »

A computer uses some fixed operating system under which all its
programs run. A “program” can be
thought of as a function that takes one string as input and
produces another string as output. On the
other hand, a program written in a specific language can be thought
of as a string itself. (For example,
it can be similar to the encoding we learned.) By definition, a
program P spreads a virus on input x if
running P with input x causes the operating system to be altered.
It is safe on input x if this doesn’t
happen, and it is safe if it is safe on every input string.
A virus tester is a program IsSafe that when given the input P x,
where P is a program and x is a string,
produces the output “YES” if P is safe on input x and “NO”
otherwise. (We make the assumption that in a string of the form P
x, there is no ambiguity as to where the program P stops.) Prove
that if there
is the actual possibility of a virus, i.e., there is a program and
an input that would cause the operating
system to be altered then there can be no virus tester that is both
safe and correct.
Hint: Suppose there is such a virus tester IsSafe. Then it is
possible to write a program D (for “diago-
nal”) that operates as follows when given a program P as input. It
evaluates IsSafe(P P ); if the result
is “NO”, it prints “XXX”, and otherwise it alters the operating
system. Now consider what D does on
input D.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply