· Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property...

32
Categorical Automata Learning Framework Gerco van Heerdt Matteo Sammartino Alexandra Silva LiVe @ ETAPS 2017 calf-project.org

Transcript of  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property...

Page 1:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

CategoricalAutomataLearningFramework

Gerco van Heerdt Matteo Sammartino Alexandra Silva

LiVe @ ETAPS 2017

calf-project.org

Page 2:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Our team

Alexandra Silva UCL

Gerco van Heerdt UCL

Joshua Moerman Radboud University

Maverick Chardet ENS Lyon

Collaborators:

Bartek Klin Warsaw University

Michal Szynwelski Warsaw University

Matteo Sammartino UCL

Page 3:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Automata learning

Learnerqueries

answers

builds

Systemblack-box

S

automatonmodel of

S

Page 4:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Automata learning

Learnerqueries

answers

builds

Systemblack-box

S

automatonmodel of

S

No formal specification available? Learn it!

Page 5:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

set of system behaviors is a regular language

Finite alphabet of system’s actions A

L � A�

L* algorithm (D.Angluin ’87)

Page 6:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

set of system behaviors is a regular language

Finite alphabet of system’s actions A

L � A�

L* algorithm (D.Angluin ’87)

Learner TeacherL

Page 7:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

set of system behaviors is a regular language

Finite alphabet of system’s actions A

L � A�

L* algorithm (D.Angluin ’87)

Learner TeacherL

Q:w � L?A: Y/N

Page 8:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

set of system behaviors is a regular language

Finite alphabet of system’s actions A

L � A�

L* algorithm (D.Angluin ’87)

Learner TeacherL

Q:w � L?A: Y/N

L(H) = L?Q:A: Y / N + counterexample

H = hypothesis automatonH

Page 9:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

set of system behaviors is a regular language

Finite alphabet of system’s actions A

L � A�

L* algorithm (D.Angluin ’87)

Learner TeacherL

Q:w � L?A: Y/N

Minimal DFA accepting L L

builds

L(H) = L?Q:A: Y / N + counterexample

H = hypothesis automatonH

Page 10:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Non-deterministic

Weighted

Register

Mealy Machines

A zoo of automata

AlternatingUniversal

Probabilistic

Page 11:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Non-deterministic

Weighted

Register

Mealy Machines

Algorithms Correctness proofs

involved and hard to check

A zoo of automata

AlternatingUniversal

Probabilistic

Page 12:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Non-deterministic

Weighted

Register

Mealy Machines

Algorithms Correctness proofs

involved and hard to check

A zoo of automata

AlternatingUniversal

Probabilistic

Category theory comes to the rescue!

Page 13:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Abstract automata

DFAs

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Endofunctor = automaton typeF : C � C

Category = universe of state-spacesC

Page 14:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Abstract automata

DFAs

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Endofunctor = automaton typeF : C � C

Category = universe of state-spacesC

DFAs

F = (�)⇥A

C = Set

Page 15:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Abstract automata

DFAs

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Endofunctor = automaton typeF : C � C

Category = universe of state-spacesC

Q⇥ADFAs

F = (�)⇥A

C = Set

Page 16:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Abstract automata

DFAs

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Endofunctor = automaton typeF : C � C

Category = universe of state-spacesC

Q⇥A

1

DFAs

F = (�)⇥A

C = Set

Page 17:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Abstract automata

DFAs

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Endofunctor = automaton typeF : C � C

Category = universe of state-spacesC

Q⇥A

1q0 2 Q

DFAs

F = (�)⇥A

C = Set

Page 18:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Abstract automata

DFAs

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Endofunctor = automaton typeF : C � C

Category = universe of state-spacesC

Q⇥A

1q0 2 Q

2

DFAs

F = (�)⇥A

C = Set

Page 19:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Abstract automata

DFAs

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Endofunctor = automaton typeF : C � C

Category = universe of state-spacesC

Q⇥A

1q0 2 Q F ✓ Q

2

DFAs

F = (�)⇥A

C = Set

Page 20:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Abstract learning

Abstract observation data structure

Page 21:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Abstract learning

Abstract observation data structure

approximates

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Target minimal automaton

Page 22:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Abstract learning

Abstract observation data structure

approximates

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Target minimal automaton

Hypothesis automaton

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FH

H

I Y

”H

outHinitH

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

abstract closedness and consistency

Page 23:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Abstract learning

Abstract observation data structure

General correctness theorem=Guidelines for implementation

approximates

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Target minimal automaton

Hypothesis automaton

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FH

H

I Y

”H

outHinitH

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

abstract closedness and consistency

Page 24:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Abstract learning

Abstract observation data structure

General correctness theorem=Guidelines for implementation

approximates

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FQ

Q

I Y

”Q

outQinitQ

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

Target minimal automaton

Hypothesis automaton

Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7

property stating that for all s1

, s2

œ S such that ›(s1

) = ›(s2

) we must have L(s1

) = L(s2

).The Lı algorithm ensures this by having Á œ E, using that L(s) = ›(s)(Á) for any s œ S.

4 A General Correctness Theorem

In this section we work towards a general correctness theorem. We then show how it appliesto the ID algorithm, to the algorithm by Arbib and Zeiger and to Lı.

S T

H P

e fi„

m

S H

T P

e

‡ mÂ

fi

(3)

The key observation for the correctness theoremis the following. Let w = (S ୾ T, T

fi≠æ P ) bea wrapper with minimization (S e≠æ H, H

m≠æ P ).If ‡ œ E , then the factorization system gives us aunique diagonal „ in the left square of (3), which by (the dual of) Proposition ?? satisfies„ œ E . Similarly, if fi œ M, we have  in the right square of (3), with  œ M. Composing thetwo diagrams and using again the diagonal property, one sees that „ and  must be mutuallyinverse. We can conclude that H and T are isomorphic. Now, if w is a wrapper producedby a learning algorithm and T is the state space of the target minimal automaton, as inExample 2, our reasoning hints at a correctness criterion: ‡ œ E and fi œ M upon terminationensure that H is (isomorphic to) T . Of course, the criterion will have to guarantee that theautomata, not just the state spaces, are isomorphic.

We first show that the argument above lifts to F -algebras f : FT æ T , for an arbitraryendofunctor F : C æ C preserving E .

I Lemma 11. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E, then w is f -closed; iffi œ M, then w is f-consistent.

Proof. If ‡ œ E , then let „ be as in (3) and define closef = „ ¶ f ¶ F‡; if fi œ M, then let Âbe as in (3) and define consf = fi ¶ f ¶ FÂ. J

I Proposition 12. For a wrapper w = (‡, fi) and an F -algebra f , if ‡ œ E and w is f-consistent, then „ as given in (3) is an F -algebra homomorphism (T, f) æ (H, ◊f ); if fi œ Mand w is f-closed, then  as given in (3) is an F -algebra homomorphism (H, ◊f ) æ (T, f).Proof. Assume that ‡ œ E and w is FT T H

FS P

FT FH H

f „

fi m›f

F ‡ F e closef

F ‡ 1

2

F „

3

4

5

◊f

m

1 definition of ›f

2 (3)3 functoriality, (3)4 definition of ◊f

5 closedness

f -consistent. The proof for the otherpart is analogous. Using Lemma 11 wesee that ◊f indeed exists. Because F‡is epic and m monic, it su�ces to showm¶„¶f ¶F‡ = m¶◊f ¶F„¶F‡, whichis done on the right. (The definition of◊f can be found in the proof of Proposition 9.) J

I Corollary 13. If ‡ œ E and fi œ M, then „ as given in (3) is an F -algebra isomorphism(T, f) æ (H, ◊f ).

Now we enrich F -algebras with initial and final states, obtaining a notion of automaton in acategory. Then we give the full correctness theorem for automata. We fix objects I and Y inC, which will serve as initial state selector and output of the automaton, respectively.I Definition 14 (Automaton). An automaton in C is an object Q FH

H

I Y

”H

outHinitH

of C equipped with an initial state map initQ : I æ Q, an outputmap outQ : Q æ Y , and dynamics ”Q : FQ æ Q. An input systemis an automaton without an output map; an output system is anautomaton without an initial state map.

abstract closedness and consistency

CALF: Categorical Automata Learning FrameworkGerco van Heerdt, Matteo Sammartino, Alexandra Silva

(arXiv:1704.05676)

Page 25:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Other automata & optimizations

Page 26:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

NomVect

Set DFAsNominal automataWeighted automata

Change base category

Other automata & optimizations

Page 27:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

NomVect

Set DFAsNominal automataWeighted automata

Change base category

Other automata & optimizations

Side-effects (via monads)NFAs

Partial automata

Universal automataAlternating automata

PowersetPowerset with intersection

Double powersetMaybe monad

Page 28:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

NomVect

Set DFAsNominal automataWeighted automata

Change base categoryObservation tables

Discrimination trees

Change main data structure

Other automata & optimizations

Side-effects (via monads)NFAs

Partial automata

Universal automataAlternating automata

PowersetPowerset with intersection

Double powersetMaybe monad

Page 29:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

NomVect

Set DFAsNominal automataWeighted automata

Change base categoryObservation tables

Discrimination trees

Change main data structureLearning Nominal Automata (POPL ’17)

Joshua Moerman, Matteo Sammartino, Alexandra Silva, Bartek Klin, Michal Szynwelski

Other automata & optimizations

Side-effects (via monads)NFAs

Partial automata

Universal automataAlternating automata

PowersetPowerset with intersection

Double powersetMaybe monad

Page 30:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

NomVect

Set DFAsNominal automataWeighted automata

Change base categoryObservation tables

Discrimination trees

Change main data structureLearning Nominal Automata (POPL ’17)

Joshua Moerman, Matteo Sammartino, Alexandra Silva, Bartek Klin, Michal Szynwelski

Other automata & optimizations

Side-effects (via monads)NFAs

Partial automata

Universal automataAlternating automata

PowersetPowerset with intersection

Double powersetMaybe monad

Learning Automata with Side-effectsGerco van Heerdt, Matteo Sammartino, Alexandra Silva

(arXiv:1704.08055)

Page 31:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Automaton type

Optimizations

Minimization algorithms Testing algorithms

Automata Learning algorithms

Connections with other algorithms

Page 32:  · Abstract automata DFAs Gerco van Heerdt, Matteo Sammartino, and Alexandra Silva 7 property stating that for all s1 ,s2 œ S such that › (s1 )=› (s2 ) we must have L(s1 )=L(s2

Ongoing and future work

• Library & tool to learn control + data-flow models (as nominal automata)

• Applications:

• Specification mining • Network verification, with • Verification of cryptographic protocols • Ransomware detection