示例#1
0
def renameSortVars(libItemSort, term):
    i = 0
    svs = ASTUtils.getSortVars(libItemSort)
    for sv in svs:
        newsv = getSortVarNotInTerm(sv, term)
        libItemSort = ASTUtils.replaceAllSubTerms(libItemSort, sv, newsv)

    return libItemSort
def _processProg(prog, cmts):
    newProgs = []
    sortVars = ASTUtils.getSortVars(prog)
    if sortVars:
        sortVar = sortVars[0]
        progress = True
        for cmt in cmts:
            newProg = substOne(sortVar, cmt, prog)
            newProgs.append(newProg)
    else:
        # Add the program as it is
        progress = False
        newProgs.append(prog)

    return newProgs, progress