def test_afw_to_nfa_conversion_language_bis_bis(self):
""" Test a correct afw conversion to nfa comparing the language read
by the two automaton """
nfa_01 = AFW.afw_to_nfa_conversion(self.afw_nonemptiness_check_test_2)
# automata_IO.nfa_to_dot(nfa_01, 'afw_to_nfa_strange')
i = 0
last = 7
while i <= last:
base = list(itertools.repeat('a', i))
base += list(itertools.repeat('b', i))
# build all permutation of 'a' and 'b' till length i
word_set = set(itertools.permutations(base, i))
for word in word_set:
word = list(word)
# print(word)
afw_acceptance = AFW.afw_word_acceptance(
self.afw_nonemptiness_check_test_2, word)
nfa_acceptance = NFA.nfa_word_acceptance(nfa_01, word)
self.assertEqual(afw_acceptance, nfa_acceptance)
i += 1
评论列表
文章目录