예제 #1
0
def recYesOnString(inString):
    (progString, newInString) = utils.DESS(inString) 
    val = universal(progString, newInString)  
    if val == 'yes':
        return 'yes'
    else:
        return 'no'  
예제 #2
0
def alterGAGAtoTATA(inString):
    (progString, newInString) = utils.DESS(inString)
    val = universal(progString, newInString)
    if val == 'GAGA':
        return 'TATA'
    else:
        return val
예제 #3
0
def alterYesToGAGA(inString):
    (progString, newInString) = utils.DESS(inString)
    val = universal(progString, newInString)
    if val == 'yes':
        return 'GAGA'
    else:
        return 'no'
예제 #4
0
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'
예제 #5
0
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()
예제 #6
0
def simulateTM1(inString):
    (progString, newInString) = utils.DESS(inString)
    return simulateTM(progString, newInString)
예제 #7
0
def universal1arg(inString):
    progString, newInString = utils.DESS(inString)
    return universal(progString, newInString)
예제 #8
0
def repeat(inString):
    (progString, newInString) = utils.DESS(inString)
    val = universal(progString, newInString)
    val == val + val
    return val