def recYesOnString(inString): (progString, newInString) = utils.DESS(inString) val = universal(progString, newInString) if val == 'yes': return 'yes' else: return 'no'
def alterGAGAtoTATA(inString): (progString, newInString) = utils.DESS(inString) val = universal(progString, newInString) if val == 'GAGA': return 'TATA' else: return val
def alterYesToGAGA(inString): (progString, newInString) = utils.DESS(inString) val = universal(progString, newInString) if val == 'yes': return 'GAGA' else: return 'no'
def alterYesToNumChars(inString): (progString, newInString) = utils.DESS(inString) val = universal(progString, newInString) if val == 'yes': # return a string with three characters return 'xxx' else: # return a string with two characters return 'xx'
def alterYesToHalt(inString): (progString, newInString) = utils.DESS(inString) val = universal(progString, newInString) if val == 'yes': # return value is irrelevant, since returning any string halts return 'halted' else: # deliberately enter infinite loop utils.loop()
def simulateTM1(inString): (progString, newInString) = utils.DESS(inString) return simulateTM(progString, newInString)
def universal1arg(inString): progString, newInString = utils.DESS(inString) return universal(progString, newInString)
def repeat(inString): (progString, newInString) = utils.DESS(inString) val = universal(progString, newInString) val == val + val return val