Algorithm 3. Membership query M Q(w).
Input: a word w |
Output: true if w is accepted, otherwise false |
1: matrix set = γw(w) |
2: if matrix_set == null then |
3: return false |
4: end if |
5: yes = 0, no = 0 |
6: for matrix in matrix_set do |
7: if (matrix) then |
8: yes++ |
9: else |
10: no++ |
11: end if |
12: end for |
13: return yes >= no |