Series
On this page

Foundations: From L-star to Syntactic Monoids

The target is stronger than a minimal DFA

Let L⊆Σ∗L\subseteq\Sigma^* be a regular language. Two words are syntactically congruent when no left or right context can distinguish them:

u∼Lv⟺∀x,y∈Σ∗,  xuy∈L  ⟺  xvy∈L.u\sim_L v \quad\Longleftrightarrow\quad \forall x,y\in\Sigma^*,\;xuy\in L\iff xvy\in L.

This is a congruence with respect to concatenation. If [u][u] denotes the equivalence class of uu, multiplication is defined by

[u]⋅[v]=[uv].[u]\cdot[v]=[uv].

The quotient

M(L)=Σ∗/∼LM(L)=\Sigma^*/{\sim_L}

is the syntactic monoid of LL. It is the smallest monoid recognizing LL and is isomorphic to the transition monoid of the minimal DFA for LL.

Classical L-star learning distinguishes words by their future behavior. That is enough to identify minimal-DFA states, but syntactic congruence also quantifies over prefixes placed before a word. The extended learner must therefore collect both right experiments and left contexts.

Query access

The learner does not inspect the target language directly. It communicates with a teacher through two interfaces.

Membership query

For a chosen word w∈Σ∗w\in\Sigma^*, the teacher returns its characteristic value

χL(w)={1,w∈L,0,w∉L.\chi_L(w)= \begin{cases} 1,&w\in L,\\ 0,&w\notin L. \end{cases}

In the implementation, a membership query is abbreviated as MQ(w).

Equivalence query

The learner submits a hypothesis DFA H\mathcal H. An exact teacher answers whether

L(H)=L.L(\mathcal H)=L.

If the languages differ, the teacher returns a counterexample in their symmetric difference. The current experimental Oracle knows the target DFA and uses breadth-first search to return a shortest counterexample.

This exact EQ model is useful for validating the algorithm. It is not assumed to be a realistic interface for every black-box system; the distinction becomes important in the experimental cost model.

The observation structure

The learner maintains three finite sets:

  • I⊆Σ∗I\subseteq\Sigma^*: current representative words;
  • P⊆Σ∗P\subseteq\Sigma^*: known left contexts;
  • S⊆Σ∗S\subseteq\Sigma^*: known suffix experiments.

All three initially contain only ϵ\epsilon. The one-letter right boundary of the representative set is

IΣ={ia∣i∈I,  a∈Σ}.I\Sigma=\{ia\mid i\in I,\;a\in\Sigma\}.

The finite observation function is

T(p,i,s)=χL(pis),T(p,i,s)=\chi_L(pis),

where p∈Pp\in P, i∈I∪IΣi\in I\cup I\Sigma and s∈Ss\in S. This can be viewed as a three-dimensional table, although the current implementation also keeps a global query cache keyed by the complete word pispis.

Full rows and suffix rows

For any word ww, its full row is the vector

row⁡P,S(w)=(χL(pws))(p,s)∈P×S.\operatorname{row}_{P,S}(w) = \bigl(\chi_L(pws)\bigr)_{(p,s)\in P\times S}.

Two words are status-equivalent under the current finite observation when

u≡P,Sv⟺row⁡P,S(u)=row⁡P,S(v).u\equiv_{P,S}v \quad\Longleftrightarrow\quad \operatorname{row}_{P,S}(u)=\operatorname{row}_{P,S}(v).

This is only a finite approximation to syntactic congruence. Enlarging PP or SS can split a class that looked equal before.

Right consistency uses a second, deliberately narrower row:

row⁡S(w)=(χL(ws))s∈S.\operatorname{row}_{S}(w) = \bigl(\chi_L(ws)\bigr)_{s\in S}.

Keeping these notions separate matters. Full rows represent the current two-sided quotient, while suffix rows maintain the ordinary right behavior required for a well-formed hypothesis DFA.

From rows to a hypothesis

Once every boundary word in IΣI\Sigma has a representative with the same full row, the distinct rows of II become hypothesis states:

Q={row⁡P,S(i)∣i∈I}.Q=\{\operatorname{row}_{P,S}(i)\mid i\in I\}.

The initial state is the row of ϵ\epsilon. A state is accepting when its representative belongs to LL. For a∈Σa\in\Sigma, its transition is determined by the row of the representative followed by aa:

δ(row⁡P,S(i),a)=row⁡P,S(ia).\delta\bigl(\operatorname{row}_{P,S}(i),a\bigr) =\operatorname{row}_{P,S}(ia).

Closedness guarantees that this target row is represented inside II. Right consistency ensures that choosing equivalent representatives does not change the transition behavior.

The next article develops these two refinement conditions and explains why language equivalence alone is not yet enough to certify the learned monoid.