Question: Modify the yesOnStringViaMod - template.py . A positive instance of the decision procedure Mod 2 InMod 3 Out ( P ) I ( P (
Modify the yesOnStringViaModtemplate.py
A positive instance of the decision procedure ModInModOutPIPI I such that II That is the length of Ps output mod equals the length of
its input mod plus Consider these examples:
def inString: return inString
def inString:
if leninString: return C
else: return CGT
is a negative instance of ModInModOut, because if instring GT lenGT lenGT
is also a negative instance of ModInModOut, although it does handle even length input correctly. However, if instring A lenA lenCGT Show that ModInModOutP is undecidable by modifying yesOnStringViaModtemplate.py included HW materials to implement YesOnStringPIT ModInModOutP In the multiline comment at the end of the file, argue that you have shown that ModInModOutP is undecidable.
yesOnStringViaModtemplate.py:
# "Oracle" function assume exists to show contradiction
#
import ModInModut
import utils
from utils import
from universal import universal
# Complete for the final exam by filling in the ellipses
def alterYesToModinString:
result universal progString newInString
# Complete for the final exam by filling in the ellipses. For the
# call to modInModut supply a nd argument if needed.
def yesViaModprogString inString:
result mod InModut
alterYesToMod.py:dots
ModInModut is undecidable because...
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
