Main Function

def main():
    """Main Function"""
    alphabet = list(string.lowercase)  # + ["<", ">"]

    # Create an SFA for the regular expression .*<t>.*
    sfa = SFA(alphabet)

    # sfa.add_arc(0,0,SetPredicate([ i for i in alphabet if i != "<" ]))
    # sfa.add_arc(0,1,SetPredicate(list("<")))
    #
    # sfa.add_arc(1,2,SetPredicate(list("t")))
    # sfa.add_arc(1,0,SetPredicate([ i for i in alphabet if i != "t" ]))
    #
    # sfa.add_arc(2,3,SetPredicate(list(">")))
    # sfa.add_arc(2,0,SetPredicate([ i for i in alphabet if i != ">" ]))
    #
    # sfa.add_arc(3,3,SetPredicate(alphabet))
    #
    # sfa.states[3].final = True

    sfa.add_arc(0, 7, SetPredicate([i for i in alphabet if i != "d" and i != "input_string"]))
    sfa.add_arc(1, 7, SetPredicate([i for i in alphabet if i != "i"]))
    sfa.add_arc(2, 7, SetPredicate([i for i in alphabet if i != "p"]))
    sfa.add_arc(3, 7, SetPredicate([i for i in alphabet if i != "v"]))
    sfa.add_arc(5, 7, SetPredicate(list(alphabet)))
    sfa.add_arc(4, 7, SetPredicate([i for i in alphabet if i != "a"]))
    sfa.add_arc(6, 7, SetPredicate([i for i in alphabet if i != "n"]))
    sfa.add_arc(7, 7, SetPredicate(list(alphabet)))

    sfa.add_arc(0, 1, SetPredicate(list("d")))
    sfa.add_arc(1, 3, SetPredicate(list("i")))
    sfa.add_arc(3, 5, SetPredicate(list("v")))

    sfa.add_arc(0, 2, SetPredicate(list("input_string")))
    sfa.add_arc(2, 4, SetPredicate(list("p")))
    sfa.add_arc(4, 6, SetPredicate(list("a")))
    sfa.add_arc(6, 5, SetPredicate(list("n")))

    sfa.states[5].final = True

    dfa = sfa.concretize()
    # dfa.minimize()
    dfa.save('concrete_re_sfa.dfa')

    # Consume some input
    input_string = "koukouroukou"
    print 'SFA-DFA result on {}: {} - {}'.format(input_string, sfa.consume_input(input_string),
                                                 dfa.consume_input(input_string))

    input_string = "divspan"
    print 'SFA-DFA result on {}: {} - {}'.format(input_string, sfa.consume_input(input_string),
                                                 dfa.consume_input(input_string))

    input_string = "div"
    print 'SFA-DFA result on {}: {} - {}'.format(input_string, sfa.consume_input(input_string),
                                                 dfa.consume_input(input_string))

    input_string = "span"
    print 'SFA-DFA result on {}: {} - {}'.format(input_string, sfa.consume_input(input_string),
                                                 dfa.consume_input(input_string))