110 likes | 139 Views
Regular Languages: Deterministic Finite Automata (DFA). a. aa abab abaaaabbb. 0. 1. a. b. b. b. b. a. 2. 3. a. {w {a,b} * | # a W and # a W both even}. DFA = NFA (Non-deterministic) = REG. Learning DFA’s: 2) MCA(S+). S+ = (c, abc, ababc}. Maximal Canonical Automaton. a.
E N D
Regular Languages: Deterministic Finite Automata (DFA) a aa abab abaaaabbb 0 1 a b b b b a 2 3 a {w {a,b}* | # aW and # aW both even} DFA = NFA (Non-deterministic) = REG
Learning DFA’s: 2) MCA(S+) S+ = (c, abc, ababc} Maximal Canonical Automaton a b a b c 0 1 2 3 4 5 a b c 6 7 8 c 9
Learning DFA’s: 4) State Merging (Oncina,Vidal 92, Lang 98) S+ = (c, abc, ababc} Evidence Driven State merging: 0,2 a b a b c 0 1 2 3 4 5 c 8 c 9
Learning DFA’s: 4) State Merging (Oncina,Vidal 92, Lang 98) S+ = (c, abc, ababc} Evidence Driven State merging: 1,3 and 8,9 a a b c 0 1 3 4 5 c b 8 c 9
Learning DFA’s: 4) State Merging (Oncina,Vidal 92, Lang 98) S+ = (c, abc, ababc} Evidence Driven State merging: 0,4 a b c 0 1 4 5 b c 9
Learning DFA’s: 4) State Merging (Oncina,Vidal 92, Lang 98) S+ = (c, abc, ababc} Evidence Driven State merging: 9,5 a c 0 1 5 b c 9
Learning DFA’s: 4) State Merging (Oncina,Vidal 92, Lang 98) S+ = (c, abc, ababc} Evidence Driven State merging: 0,4 and 9,5 a 0 1 b c 9
Learning DFA’s via evidence driven state merging • Input S+, S- • Output: DFA • 1) Form MCA(S+)2) Form PTA(S+)3) Do until no merging is possible: - choose merging of two states - perform cascade of forced mergings to get a deterministic automaton - if resulting DFA accepts sentences of S- backtrack and choose another couple4) End • Drawback: we need negative examples!!!
Learning DFA using only positive examples with MDL S+ = (c, cab, cabab, cababab, cababababab } a a L1 L2 c 0 0 1 2 c b b Coding in bits: |L1| 5 log2 (3+1) 2 log2 (1+1) = 20 |L2| 5 log2 (3+1) 2 log2 (1+3) = 40 # arrows # letters Empty letter # states Outside world
Learning DFA using only positive examples with MDL S+ = (c, cab, cabab, cababab, cababababab } a a L1 L2 c 0 0 1 2 c b b Coding in bits: |L1| 5 log2 (3+1) 2 log2 (1+1) = 20 |L2| 5 log2 (3+1) 2 log2 (1+3) = 40 But: L1 has 4 choices in state 0: |L1(S+)|= 26 log2 4 = 52 L2 has 2 choices in state 1: |L2(S+)|= 16 log2 2 = 16 |L2| + |L2(S+)|= 40 + 16 < |L1| + |L1(S+)|= 20 + 52 L2 is the better theory according to MDL
Learning DFA’s using only positive examples with MDL • Input S+ • Output: DFA • 1) Form MCA(S+)2) Form DFA = PTA(S+)3) Do until no merging is possible: - choose merging of two states - perform cascade of forced mergings to get a deterministic automaton DFA’ - if |DFA’|+|DFA’(S+)| |DFA|+|DFA(S+)| backtrack and choose another couple4) End • Drawback: Local minima!