Skip to main content
. 2021 Apr 19;7:e436. doi: 10.7717/peerj-cs.436

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 N (matrix) then
8:   yes++
9:  else
10:   no++
11:  end if
12: end for
13: return yes >= no