{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# `context`.`cerny`(_`n`_)\n",
"\n",
"Create the Černý automaton with $n$ states.\n",
"\n",
"Preconditions:\n",
"- the labelset is free\n",
"- the labelset has at least two generators\n",
"\n",
"The Černý automata are $n$-states DFA defined by the following transition function:\n",
"\n",
"$$\\delta(s, l) =\n",
"\\begin{cases}\n",
" (q + 1)~\\text{mod}~n & \\text{if}~l = a\\\\\n",
" q & \\text{if}~l = b \\wedge q \\neq n - 1\\\\\n",
" 0 & \\text{if}~l = b \\wedge q = n - 1\\\\\n",
"\\end{cases}$$\n",
"\n",
"where $a$ and $b$ denote two letters of the labelsets.\n",
"\n",
"See also:\n",
"- [automaton.synchronizing_word](automaton.synchronizing_word.ipynb)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Examples"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import vcsn\n",
"b = vcsn.context('lal_char(ab), b')"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
"mutable_automaton, b>>"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"b.cerny(4)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.4"
}
},
"nbformat": 4,
"nbformat_minor": 0
}