Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
prob-teaching-notebooks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
prob-teaching-notebooks
Commits
15c2a0e6
Commit
15c2a0e6
authored
5 years ago
by
Michael Leuschel
Browse files
Options
Downloads
Patches
Plain Diff
fix PP_SEQUENCES preference
parent
3bd07894
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
info4/kapitel-3/PDA-Kellerautomaten.ipynb
+145
-145
145 additions, 145 deletions
info4/kapitel-3/PDA-Kellerautomaten.ipynb
with
145 additions
and
145 deletions
info4/kapitel-3/PDA-Kellerautomaten.ipynb
+
145
−
145
View file @
15c2a0e6
...
...
@@ -31,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count":
44
,
"execution_count":
59
,
"metadata": {},
"outputs": [
{
...
...
@@ -40,7 +40,7 @@
"Loaded machine: PDA"
]
},
"execution_count":
44
,
"execution_count":
59
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -60,7 +60,7 @@
" ANIMATION_FUNCTION == {2}*α ∪ {3}*(γ);\n",
" ANIMATION_FUNCTION1 == {(1,0,\"z: \"),(2,0,\"α:\"),(3,0,\"γ:\")};\n",
" ANIMATION_STR_JUSTIFY_LEFTx == TRUE;\n",
" SET_PREF_P
RETTY_PRINT
_SEQUENCES == TRUE\n",
" SET_PREF_P
P
_SEQUENCES == TRUE\n",
"CONSTANTS δ\n",
"PROPERTIES\n",
" /* Der PDA für {a^m b^m| m>=1} ; Beispiel von Info 4 (Folie 95ff) */\n",
...
...
@@ -104,7 +104,7 @@
},
{
"cell_type": "code",
"execution_count":
45
,
"execution_count":
60
,
"metadata": {},
"outputs": [
{
...
...
@@ -113,7 +113,7 @@
"Machine constants set up using operation 0: $setup_constants()"
]
},
"execution_count":
45
,
"execution_count":
60
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -124,7 +124,7 @@
},
{
"cell_type": "code",
"execution_count":
4
6,
"execution_count": 6
1
,
"metadata": {},
"outputs": [
{
...
...
@@ -133,7 +133,7 @@
"Machine initialised using operation 1: $initialise_machine()"
]
},
"execution_count":
4
6,
"execution_count": 6
1
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -144,7 +144,7 @@
},
{
"cell_type": "code",
"execution_count":
47
,
"execution_count":
62
,
"metadata": {},
"outputs": [
{
...
...
@@ -178,7 +178,7 @@
"<Animation function visualisation>"
]
},
"execution_count":
47
,
"execution_count":
62
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -189,7 +189,7 @@
},
{
"cell_type": "code",
"execution_count":
48
,
"execution_count":
63
,
"metadata": {},
"outputs": [
{
...
...
@@ -200,10 +200,10 @@
"Constants: δ\n",
"Variables: z, α, γ\n",
"Operations: \n",
"Schritt(z0,
{(1|->A),(2|->
BOT
)}
)"
"Schritt(z0,
[A,
BOT
]
)"
]
},
"execution_count":
48
,
"execution_count":
63
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -214,16 +214,16 @@
},
{
"cell_type": "code",
"execution_count": 4
9
,
"execution_count":
6
4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Executed operation: Schritt(z0,
{(1|->A),(2|->
BOT
)}
)"
"Executed operation: Schritt(z0,
[A,
BOT
]
)"
]
},
"execution_count": 4
9
,
"execution_count":
6
4,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -234,7 +234,7 @@
},
{
"cell_type": "code",
"execution_count": 5
0
,
"execution_count":
6
5,
"metadata": {},
"outputs": [
{
...
...
@@ -265,7 +265,7 @@
"<Animation function visualisation>"
]
},
"execution_count": 5
0
,
"execution_count":
6
5,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -276,19 +276,19 @@
},
{
"cell_type": "code",
"execution_count":
51
,
"execution_count":
66
,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"$(\\mathit{z0}\\mapsto
\\{(1\\mapsto \\mathit{a}),(2\\mapsto \\mathit{b}),(3\\mapsto \\mathit{b})\\}\\mapsto\\{(1\\mapsto \\mathit{A}),(2\\mapsto \\mathit{BOT})\\}
)$"
"$(\\mathit{z0}\\mapsto
[a,\\mathit{b},b]\\mapsto [A,BOT]
)$"
],
"text/plain": [
"(z0↦
{(1↦a),(2↦b),(3↦b)}↦{(1↦A),(2↦
BOT
)}
)"
"(z0↦
[a,b,b]↦[A,
BOT
]
)"
]
},
"execution_count":
51
,
"execution_count":
66
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -299,7 +299,7 @@
},
{
"cell_type": "code",
"execution_count":
52
,
"execution_count":
67
,
"metadata": {},
"outputs": [
{
...
...
@@ -310,10 +310,10 @@
"Constants: δ\n",
"Variables: z, α, γ\n",
"Operations: \n",
"Schritt(z0,
{(1|->A),(2|->A)}
)"
"Schritt(z0,
[A,A]
)"
]
},
"execution_count":
52
,
"execution_count":
67
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -324,16 +324,16 @@
},
{
"cell_type": "code",
"execution_count":
53
,
"execution_count":
68
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Executed operation: Schritt(z0,
{(1|->A),(2|->A)}
)"
"Executed operation: Schritt(z0,
[A,A]
)"
]
},
"execution_count":
53
,
"execution_count":
68
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -344,7 +344,7 @@
},
{
"cell_type": "code",
"execution_count":
54
,
"execution_count":
69
,
"metadata": {},
"outputs": [
{
...
...
@@ -375,7 +375,7 @@
"<Animation function visualisation>"
]
},
"execution_count":
54
,
"execution_count":
69
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -386,7 +386,7 @@
},
{
"cell_type": "code",
"execution_count":
55
,
"execution_count":
70
,
"metadata": {},
"outputs": [
{
...
...
@@ -397,10 +397,10 @@
"Constants: δ\n",
"Variables: z, α, γ\n",
"Operations: \n",
"Schritt(z1,
{}
)"
"Schritt(z1,
[]
)"
]
},
"execution_count":
55
,
"execution_count":
70
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -411,16 +411,16 @@
},
{
"cell_type": "code",
"execution_count":
56
,
"execution_count":
71
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Executed operation: Schritt(z1,
{}
)"
"Executed operation: Schritt(z1,
[]
)"
]
},
"execution_count":
56
,
"execution_count":
71
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -431,7 +431,7 @@
},
{
"cell_type": "code",
"execution_count":
5
7,
"execution_count": 7
2
,
"metadata": {},
"outputs": [
{
...
...
@@ -459,7 +459,7 @@
"<Animation function visualisation>"
]
},
"execution_count":
5
7,
"execution_count": 7
2
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -470,7 +470,7 @@
},
{
"cell_type": "code",
"execution_count":
58
,
"execution_count":
73
,
"metadata": {},
"outputs": [
{
...
...
@@ -481,10 +481,10 @@
"Constants: δ\n",
"Variables: z, α, γ\n",
"Operations: \n",
"Schritt(z1,
{}
)"
"Schritt(z1,
[]
)"
]
},
"execution_count":
58
,
"execution_count":
73
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -495,16 +495,16 @@
},
{
"cell_type": "code",
"execution_count":
59
,
"execution_count":
74
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Executed operation: Schritt(z1,
{}
)"
"Executed operation: Schritt(z1,
[]
)"
]
},
"execution_count":
59
,
"execution_count":
74
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -515,7 +515,7 @@
},
{
"cell_type": "code",
"execution_count":
60
,
"execution_count":
75
,
"metadata": {},
"outputs": [
{
...
...
@@ -540,7 +540,7 @@
"<Animation function visualisation>"
]
},
"execution_count":
60
,
"execution_count":
75
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -551,7 +551,7 @@
},
{
"cell_type": "code",
"execution_count": 6
1
,
"execution_count":
7
6,
"metadata": {},
"outputs": [
{
...
...
@@ -562,10 +562,10 @@
"Constants: δ\n",
"Variables: z, α, γ\n",
"Operations: \n",
"LambdaSchritt(z1,
{}
)"
"LambdaSchritt(z1,
[]
)"
]
},
"execution_count": 6
1
,
"execution_count":
7
6,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -576,16 +576,16 @@
},
{
"cell_type": "code",
"execution_count":
62
,
"execution_count":
77
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Executed operation: LambdaSchritt(z1,
{}
)"
"Executed operation: LambdaSchritt(z1,
[]
)"
]
},
"execution_count":
62
,
"execution_count":
77
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -596,7 +596,7 @@
},
{
"cell_type": "code",
"execution_count":
63
,
"execution_count":
78
,
"metadata": {},
"outputs": [
{
...
...
@@ -621,7 +621,7 @@
"<Animation function visualisation>"
]
},
"execution_count":
63
,
"execution_count":
78
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -632,7 +632,7 @@
},
{
"cell_type": "code",
"execution_count":
64
,
"execution_count":
79
,
"metadata": {},
"outputs": [
{
...
...
@@ -646,7 +646,7 @@
"Akzeptieren()"
]
},
"execution_count":
64
,
"execution_count":
79
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -657,7 +657,7 @@
},
{
"cell_type": "code",
"execution_count":
65
,
"execution_count":
80
,
"metadata": {},
"outputs": [
{
...
...
@@ -666,7 +666,7 @@
"Executed operation: Akzeptieren()"
]
},
"execution_count":
65
,
"execution_count":
80
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -693,23 +693,23 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 3
4
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Loaded machine: PDA"
"Loaded machine: PDA
_für_kfG
"
]
},
"execution_count": 3,
"execution_count": 3
4
,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"::load\n",
"MACHINE PDA\n",
"MACHINE PDA
_für_kfG
\n",
"/* B Modell eines PDA */\n",
"SETS\n",
" Z = {z0}; // die Zustände des Automaten, z0 ist der Startzustand\n",
...
...
@@ -723,7 +723,7 @@
" ANIMATION_FUNCTION == {2}*α ∪ {3}*(γ);\n",
" ANIMATION_FUNCTION1 == {(1,0,\"z: \"),(2,0,\"α:\"),(3,0,\"γ:\")};\n",
" ANIMATION_STR_JUSTIFY_LEFTx == TRUE;\n",
" SET_PREF_P
RETTY_PRINT
_SEQUENCES == TRUE\n",
" SET_PREF_P
P
_SEQUENCES == TRUE\n",
"CONSTANTS P, δ\n",
"PROPERTIES\n",
"/* Die Grammatik Regeln */\n",
...
...
@@ -773,7 +773,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count":
3
5,
"metadata": {},
"outputs": [
{
...
...
@@ -782,7 +782,7 @@
"Machine constants set up using operation 0: $setup_constants()"
]
},
"execution_count": 5,
"execution_count":
3
5,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -793,7 +793,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count":
3
6,
"metadata": {},
"outputs": [
{
...
...
@@ -802,7 +802,7 @@
"Machine initialised using operation 1: $initialise_machine()"
]
},
"execution_count": 6,
"execution_count":
3
6,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -813,7 +813,7 @@
},
{
"cell_type": "code",
"execution_count": 3
3
,
"execution_count": 3
7
,
"metadata": {},
"outputs": [
{
...
...
@@ -821,28 +821,28 @@
"text/markdown": [
"|z|x|X|z2|Xs|\n",
"|---|---|---|---|---|\n",
"|$\\
renewcommand{\\emptyset}{\\mathord\\varnothing}\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\
mathit{z0}$|$\\mathit{a}$|$\\mathit{a}$|$\\mathit{z0}$|$
\\emptyset
$|\n",
"|$\\mathit{z0}$|$\\mathit{b}$|$\\mathit{b}$|$\\mathit{z0}$|$
\\emptyset
$|\n",
"|$\\mathit{z0}$|$\\mathit{S}$|$\\mathit{S}$|$\\mathit{z0}$|$
\\emptyset
$|\n",
"|$\\mathit{z0}$|$\\mathit{C}$|$\\mathit{C}$|$\\mathit{z0}$|$
\\emptyset
$|\n",
"|$\\mathit{z0}$|$\\mathit{lambda}$|$\\mathit{S}$|$\\mathit{z0}$|$
\\{(1\\mapsto \\mathit{C})\\}
$|\n",
"|$\\mathit{z0}$|$\\mathit{lambda}$|$\\mathit{S}$|$\\mathit{z0}$|$
\\{(1\\mapsto \\mathit{a}),(2\\mapsto \\mathit{S}),(3\\mapsto \\mathit{b})\\}
$|\n",
"|$\\mathit{z0}$|$\\mathit{lambda}$|$\\mathit{C}$|$\\mathit{z0}$|$
\\{(1\\mapsto \\mathit{a}),(2\\mapsto \\mathit{b})\\}
$|\n",
"|$\\mathit{z0}$|$\\mathit{lambda}$|$\\mathit{lambda}$|$\\mathit{z0}$|$
\\emptyset
$|\n"
"|$\\mathit{z0}$|$\\mathit{a}$|$\\mathit{a}$|$\\mathit{z0}$|$
[]
$|\n",
"|$\\mathit{z0}$|$\\mathit{b}$|$\\mathit{b}$|$\\mathit{z0}$|$
[]
$|\n",
"|$\\mathit{z0}$|$\\mathit{S}$|$\\mathit{S}$|$\\mathit{z0}$|$
[]
$|\n",
"|$\\mathit{z0}$|$\\mathit{C}$|$\\mathit{C}$|$\\mathit{z0}$|$
[]
$|\n",
"|$\\mathit{z0}$|$\\mathit{lambda}$|$\\mathit{S}$|$\\mathit{z0}$|$
[C]
$|\n",
"|$\\mathit{z0}$|$\\mathit{lambda}$|$\\mathit{S}$|$\\mathit{z0}$|$
[a,\\mathit{S},b]
$|\n",
"|$\\mathit{z0}$|$\\mathit{lambda}$|$\\mathit{C}$|$\\mathit{z0}$|$
[a,b]
$|\n",
"|$\\mathit{z0}$|$\\mathit{lambda}$|$\\mathit{lambda}$|$\\mathit{z0}$|$
[]
$|\n"
],
"text/plain": [
"z\tx\tX\tz2\tXs\n",
"z0\ta\ta\tz0\t
{}
\n",
"z0\tb\tb\tz0\t
{}
\n",
"z0\tS\tS\tz0\t
{}
\n",
"z0\tC\tC\tz0\t
{}
\n",
"z0\tlambda\tS\tz0\t
{(1|->C)}
\n",
"z0\tlambda\tS\tz0\t
{(1|->a),(2|->S),(3|->b)}
\n",
"z0\tlambda\tC\tz0\t
{(1|->a),(2|->b)}
\n",
"z0\tlambda\tlambda\tz0\t
{}
\n"
"z0\ta\ta\tz0\t
[]
\n",
"z0\tb\tb\tz0\t
[]
\n",
"z0\tS\tS\tz0\t
[]
\n",
"z0\tC\tC\tz0\t
[]
\n",
"z0\tlambda\tS\tz0\t
[C]
\n",
"z0\tlambda\tS\tz0\t
[a,S,b]
\n",
"z0\tlambda\tC\tz0\t
[a,b]
\n",
"z0\tlambda\tlambda\tz0\t
[]
\n"
]
},
"execution_count": 3
3
,
"execution_count": 3
7
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -853,7 +853,7 @@
},
{
"cell_type": "code",
"execution_count":
7
,
"execution_count":
38
,
"metadata": {},
"outputs": [
{
...
...
@@ -887,7 +887,7 @@
"<Animation function visualisation>"
]
},
"execution_count":
7
,
"execution_count":
38
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -898,22 +898,22 @@
},
{
"cell_type": "code",
"execution_count":
8
,
"execution_count":
39
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Machine: PDA\n",
"Machine: PDA
_für_kfG
\n",
"Sets: Z, SYMBOLE\n",
"Constants: P, δ\n",
"Variables: z, α, γ\n",
"Operations: \n",
"LambdaSchritt(z0,
{(1|->C)}
)\n",
"LambdaSchritt(z0,
{(1|->a),(2|->S),(3|->b)}
)"
"LambdaSchritt(z0,
[C]
)\n",
"LambdaSchritt(z0,
[a,S,b]
)"
]
},
"execution_count":
8
,
"execution_count":
39
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -924,16 +924,16 @@
},
{
"cell_type": "code",
"execution_count":
9
,
"execution_count":
40
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Executed operation: LambdaSchritt(z0,
{(1|->a),(2|->S),(3|->b)}
)"
"Executed operation: LambdaSchritt(z0,
[a,S,b]
)"
]
},
"execution_count":
9
,
"execution_count":
40
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -944,7 +944,7 @@
},
{
"cell_type": "code",
"execution_count": 1
0
,
"execution_count":
4
1,
"metadata": {},
"outputs": [
{
...
...
@@ -978,7 +978,7 @@
"<Animation function visualisation>"
]
},
"execution_count": 1
0
,
"execution_count":
4
1,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -989,21 +989,21 @@
},
{
"cell_type": "code",
"execution_count":
11
,
"execution_count":
42
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Machine: PDA\n",
"Machine: PDA
_für_kfG
\n",
"Sets: Z, SYMBOLE\n",
"Constants: P, δ\n",
"Variables: z, α, γ\n",
"Operations: \n",
"Schritt(z0,
{}
)"
"Schritt(z0,
[]
)"
]
},
"execution_count":
11
,
"execution_count":
42
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1014,16 +1014,16 @@
},
{
"cell_type": "code",
"execution_count":
1
3,
"execution_count":
4
3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Executed operation: Schritt(z0,
{}
)"
"Executed operation: Schritt(z0,
[]
)"
]
},
"execution_count":
1
3,
"execution_count":
4
3,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1034,7 +1034,7 @@
},
{
"cell_type": "code",
"execution_count":
1
4,
"execution_count":
4
4,
"metadata": {},
"outputs": [
{
...
...
@@ -1065,7 +1065,7 @@
"<Animation function visualisation>"
]
},
"execution_count":
1
4,
"execution_count":
4
4,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1076,22 +1076,22 @@
},
{
"cell_type": "code",
"execution_count":
1
5,
"execution_count":
4
5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Machine: PDA\n",
"Machine: PDA
_für_kfG
\n",
"Sets: Z, SYMBOLE\n",
"Constants: P, δ\n",
"Variables: z, α, γ\n",
"Operations: \n",
"LambdaSchritt(z0,
{(1|->C)}
)\n",
"LambdaSchritt(z0,
{(1|->a),(2|->S),(3|->b)}
)"
"LambdaSchritt(z0,
[C]
)\n",
"LambdaSchritt(z0,
[a,S,b]
)"
]
},
"execution_count":
1
5,
"execution_count":
4
5,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1102,16 +1102,16 @@
},
{
"cell_type": "code",
"execution_count":
1
6,
"execution_count":
4
6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Executed operation: LambdaSchritt(z0,
{(1|->C)}
)"
"Executed operation: LambdaSchritt(z0,
[C]
)"
]
},
"execution_count":
1
6,
"execution_count":
4
6,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1122,7 +1122,7 @@
},
{
"cell_type": "code",
"execution_count":
1
7,
"execution_count":
4
7,
"metadata": {},
"outputs": [
{
...
...
@@ -1153,7 +1153,7 @@
"<Animation function visualisation>"
]
},
"execution_count":
1
7,
"execution_count":
4
7,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1164,21 +1164,21 @@
},
{
"cell_type": "code",
"execution_count":
1
8,
"execution_count":
4
8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Machine: PDA\n",
"Machine: PDA
_für_kfG
\n",
"Sets: Z, SYMBOLE\n",
"Constants: P, δ\n",
"Variables: z, α, γ\n",
"Operations: \n",
"LambdaSchritt(z0,
{(1|->a),(2|->b)}
)"
"LambdaSchritt(z0,
[a,b]
)"
]
},
"execution_count":
1
8,
"execution_count":
4
8,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1189,16 +1189,16 @@
},
{
"cell_type": "code",
"execution_count":
1
9,
"execution_count":
4
9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Executed operation: LambdaSchritt(z0,
{(1|->a),(2|->b)}
)"
"Executed operation: LambdaSchritt(z0,
[a,b]
)"
]
},
"execution_count":
1
9,
"execution_count":
4
9,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1209,7 +1209,7 @@
},
{
"cell_type": "code",
"execution_count":
2
0,
"execution_count":
5
0,
"metadata": {},
"outputs": [
{
...
...
@@ -1240,7 +1240,7 @@
"<Animation function visualisation>"
]
},
"execution_count":
2
0,
"execution_count":
5
0,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1251,21 +1251,21 @@
},
{
"cell_type": "code",
"execution_count":
22
,
"execution_count":
51
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Machine: PDA\n",
"Machine: PDA
_für_kfG
\n",
"Sets: Z, SYMBOLE\n",
"Constants: P, δ\n",
"Variables: z, α, γ\n",
"Operations: \n",
"Schritt(z0,
{}
)"
"Schritt(z0,
[]
)"
]
},
"execution_count":
22
,
"execution_count":
51
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1276,16 +1276,16 @@
},
{
"cell_type": "code",
"execution_count": 2
3
,
"execution_count":
5
2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Executed operation: Schritt(z0,
{}
)"
"Executed operation: Schritt(z0,
[]
)"
]
},
"execution_count": 2
3
,
"execution_count":
5
2,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1296,7 +1296,7 @@
},
{
"cell_type": "code",
"execution_count":
24
,
"execution_count":
53
,
"metadata": {},
"outputs": [
{
...
...
@@ -1324,7 +1324,7 @@
"<Animation function visualisation>"
]
},
"execution_count":
24
,
"execution_count":
53
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1335,16 +1335,16 @@
},
{
"cell_type": "code",
"execution_count":
2
5,
"execution_count": 5
4
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Executed operation: Schritt(z0,
{}
)"
"Executed operation: Schritt(z0,
[]
)"
]
},
"execution_count":
2
5,
"execution_count": 5
4
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1355,7 +1355,7 @@
},
{
"cell_type": "code",
"execution_count":
26
,
"execution_count":
55
,
"metadata": {},
"outputs": [
{
...
...
@@ -1380,7 +1380,7 @@
"<Animation function visualisation>"
]
},
"execution_count":
26
,
"execution_count":
55
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1391,16 +1391,16 @@
},
{
"cell_type": "code",
"execution_count":
27
,
"execution_count":
56
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Executed operation: Schritt(z0,
{}
)"
"Executed operation: Schritt(z0,
[]
)"
]
},
"execution_count":
27
,
"execution_count":
56
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1411,7 +1411,7 @@
},
{
"cell_type": "code",
"execution_count":
28
,
"execution_count":
57
,
"metadata": {},
"outputs": [
{
...
...
@@ -1436,7 +1436,7 @@
"<Animation function visualisation>"
]
},
"execution_count":
28
,
"execution_count":
57
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1447,7 +1447,7 @@
},
{
"cell_type": "code",
"execution_count":
30
,
"execution_count":
58
,
"metadata": {},
"outputs": [
{
...
...
@@ -1456,7 +1456,7 @@
"Executed operation: Akzeptieren()"
]
},
"execution_count":
30
,
"execution_count":
58
,
"metadata": {},
"output_type": "execute_result"
}
...
...
%% Cell type:markdown id: tags:
# PDA (Push Down Automata - Kellerautomaten)
%% Cell type:markdown id: tags:
Ein __(nichtdeterministischer) Kellerautomat__
(kurz PDA für __push-down automaton__) ist ein $6$-Tupel
$M = (
\S
igma,
\G
amma, Z,
\d
elta , z_0,
\#
)$, wobei
*
$
\S
igma$ das Eingabe-Alphabet ist,
*
$
\G
amma$ das Kelleralphabet,
*
$Z$ eine endliche Menge von Zuständen,
*
$
\d
elta : Z
\t
imes (
\S
igma
\c
up
\{\l
ambda
\}
)
\t
imes
\G
amma
\r
ightarrow
\m
athfrak{P}_e(Z
\t
imes
\G
amma^{
\a
st})$ die
Überführungsfunktion,
*
$z_0
\i
n Z$ der Startzustand,
*
$
\#
\i
n
\G
amma$ das Bottom-Symbol im Keller.
Anmerkung: $
\m
athfrak{P}_e(Z
\t
imes
\G
amma^{
\a
st})$ ist die Menge aller
__endlichen__ Teilmengen von $Z
\t
imes
\G
amma^{
\a
st}$.
%% Cell type:code id: tags:
```
prob
::load
MACHINE PDA
/* B Modell eines PDA */
SETS
Z = {z0,z1}; // die Zustände des Automaten, z0 ist der Startzustand
SYMBOLE={a,b, A, BOT, lambda} /* BOT = # = Bottom-Symbol im Keller*/
DEFINITIONS
Σ == {a,b}; // das Eingabe-Alphabet
Γ == {A,BOT}; // das Kelleralphabet
ANIMATION_FUNCTION_DEFAULT == {(1,1,z)};
ANIMATION_FUNCTION == {2}*α ∪ {3}*(γ);
ANIMATION_FUNCTION1 == {(1,0,"z: "),(2,0,"α:"),(3,0,"γ:")};
ANIMATION_STR_JUSTIFY_LEFTx == TRUE;
SET_PREF_P
RETTY_PRINT
_SEQUENCES == TRUE
SET_PREF_P
P
_SEQUENCES == TRUE
CONSTANTS δ
PROPERTIES
/* Der PDA für {a^m b^m| m>=1} ; Beispiel von Info 4 (Folie 95ff) */
δ = { (z0,a,BOT) ↦ (z0,[A,BOT]),
(z0,a,A) ↦ (z0,[A,A]),
(z0,b,A) ↦ (z1,[]),
(z1,lambda,BOT) ↦ (z1,[]),
(z1,b,A) ↦ (z1,[]) }
// Anmerkung: δ ist hier als Relation anstatt als Funktion zu Mengen definiert
// Deshalb entspricht δ[{(z,a,g)}] in der B Maschine δ(z,a,g) aus dem Skript
VARIABLES
z, α, γ // Konfiguration in dem sich der PDA befindet
INVARIANT
z ∈ Z ∧ // der aktuelle Zustand
α ∈ seq(Σ) ∧ // der noch zu lesende Teil des Eingabeworts
γ ∈ seq(Γ) // aktuelle Kellerinhalt
INITIALISATION
z := z0 ||
γ := [BOT] || // Initialisierung des Stapels
α := [a,a,b,b] // das Eingabewort
OPERATIONS
// die Operationen Schritt und LambdaSchritt modellieren
// Schritte in der Ableitungsrelation
Schritt(z‘,s) = PRE α ≠ ∅ ∧ γ ≠ ∅ ∧
z‘↦s ∈ δ[{(z,first(α),first(γ))}] THEN
z := z‘ || // in den neuen Zustand wechseln
α := tail(α) || // das erste Symbol auf der Eingabe löschen
γ := s^tail(γ) // s auf den Stapel packen
END;
LambdaSchritt(z‘,s) = PRE γ ≠ ∅ ∧
z‘↦s ∈ δ[{(z,lambda,first(γ))}] THEN
z := z‘ || // in den neuen Zustand wechseln
γ := s^tail(γ) // s auf den Stapel packen
END;
Akzeptieren = PRE γ = ∅ ∧ α = ∅ THEN
/* Wir akzeptieren wenn Eingabe und Stapel leer sind */
skip END
END
```
%% Output
Loaded machine: PDA
%% Cell type:code id: tags:
```
prob
:constants
```
%% Output
Machine constants set up using operation 0: $setup_constants()
%% Cell type:code id: tags:
```
prob
:init
```
%% Output
Machine initialised using operation 1: $initialise_machine()
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table style="font-family:monospace"><tbody>
<tr>
<td style="padding:10px">z: </td>
<td style="padding:10px">z0</td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">α:</td>
<td style="padding:10px">a</td>
<td style="padding:10px">a</td>
<td style="padding:10px">b</td>
<td style="padding:10px">b</td>
</tr>
<tr>
<td style="padding:10px">γ:</td>
<td style="padding:10px">BOT</td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:browse
```
%% Output
Machine: PDA
Sets: Z, SYMBOLE
Constants: δ
Variables: z, α, γ
Operations:
Schritt(z0,
{(1|->A),(2|->
BOT
)}
)
Schritt(z0,
[A,
BOT
]
)
%% Cell type:code id: tags:
```
prob
:exec Schritt
```
%% Output
Executed operation: Schritt(z0,
{(1|->A),(2|->
BOT
)}
)
Executed operation: Schritt(z0,
[A,
BOT
]
)
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table style="font-family:monospace"><tbody>
<tr>
<td style="padding:10px">z: </td>
<td style="padding:10px">z0</td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">α:</td>
<td style="padding:10px">a</td>
<td style="padding:10px">b</td>
<td style="padding:10px">b</td>
</tr>
<tr>
<td style="padding:10px">γ:</td>
<td style="padding:10px">A</td>
<td style="padding:10px">BOT</td>
<td style="padding:0px"></td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
(z,α,γ)
```
%% Output
$(\mathit{z0}\mapsto
\{(1\mapsto \mathit{a}),(2\mapsto \mathit{b}),(3\mapsto \mathit{b})\}\mapsto\{(1\mapsto \mathit{A}),(2\mapsto \mathit{BOT})\}
)$
(z0↦
{(1↦a),(2↦b),(3↦b)}↦{(1↦A),(2↦
BOT
)}
)
$(\mathit{z0}\mapsto
[a,\mathit{b},b]\mapsto [A,BOT]
)$
(z0↦
[a,b,b]↦[A,
BOT
]
)
%% Cell type:code id: tags:
```
prob
:browse
```
%% Output
Machine: PDA
Sets: Z, SYMBOLE
Constants: δ
Variables: z, α, γ
Operations:
Schritt(z0,
{(1|->A),(2|->A)}
)
Schritt(z0,
[A,A]
)
%% Cell type:code id: tags:
```
prob
:exec Schritt
```
%% Output
Executed operation: Schritt(z0,
{(1|->A),(2|->A)}
)
Executed operation: Schritt(z0,
[A,A]
)
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table style="font-family:monospace"><tbody>
<tr>
<td style="padding:10px">z: </td>
<td style="padding:10px">z0</td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">α:</td>
<td style="padding:10px">b</td>
<td style="padding:10px">b</td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">γ:</td>
<td style="padding:10px">A</td>
<td style="padding:10px">A</td>
<td style="padding:10px">BOT</td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:browse
```
%% Output
Machine: PDA
Sets: Z, SYMBOLE
Constants: δ
Variables: z, α, γ
Operations:
Schritt(z1,
{}
)
Schritt(z1,
[]
)
%% Cell type:code id: tags:
```
prob
:exec Schritt
```
%% Output
Executed operation: Schritt(z1,
{}
)
Executed operation: Schritt(z1,
[]
)
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table style="font-family:monospace"><tbody>
<tr>
<td style="padding:10px">z: </td>
<td style="padding:10px">z1</td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">α:</td>
<td style="padding:10px">b</td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">γ:</td>
<td style="padding:10px">A</td>
<td style="padding:10px">BOT</td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:browse
```
%% Output
Machine: PDA
Sets: Z, SYMBOLE
Constants: δ
Variables: z, α, γ
Operations:
Schritt(z1,
{}
)
Schritt(z1,
[]
)
%% Cell type:code id: tags:
```
prob
:exec Schritt
```
%% Output
Executed operation: Schritt(z1,
{}
)
Executed operation: Schritt(z1,
[]
)
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table style="font-family:monospace"><tbody>
<tr>
<td style="padding:10px">z: </td>
<td style="padding:10px">z1</td>
</tr>
<tr>
<td style="padding:10px">α:</td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">γ:</td>
<td style="padding:10px">BOT</td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:browse
```
%% Output
Machine: PDA
Sets: Z, SYMBOLE
Constants: δ
Variables: z, α, γ
Operations:
LambdaSchritt(z1,
{}
)
LambdaSchritt(z1,
[]
)
%% Cell type:code id: tags:
```
prob
:exec LambdaSchritt
```
%% Output
Executed operation: LambdaSchritt(z1,
{}
)
Executed operation: LambdaSchritt(z1,
[]
)
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table style="font-family:monospace"><tbody>
<tr>
<td style="padding:10px">z: </td>
<td style="padding:10px">z1</td>
</tr>
<tr>
<td style="padding:10px">α:</td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">γ:</td>
<td style="padding:0px"></td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:browse
```
%% Output
Machine: PDA
Sets: Z, SYMBOLE
Constants: δ
Variables: z, α, γ
Operations:
Akzeptieren()
%% Cell type:code id: tags:
```
prob
:exec Akzeptieren
```
%% Output
Executed operation: Akzeptieren()
%% Cell type:markdown id: tags:
Das Eingabewort
``aabb``
wurde akzeptiert.
%% Cell type:markdown id: tags:
## PDA für eine kfG
Aus einer kontextfreien Grammatik kann man einen PDA konstruieren der die gleiche Sprache akzeptiert.
%% Cell type:code id: tags:
```
prob
::load
MACHINE PDA
MACHINE PDA
_für_kfG
/* B Modell eines PDA */
SETS
Z = {z0}; // die Zustände des Automaten, z0 ist der Startzustand
SYMBOLE={a,b, S, C, lambda} /* BOT = # = Bottom-Symbol im Keller*/
DEFINITIONS
Σ == {a,b}; // das Eingabe-Alphabet
BOT == S;
Γ == {S,C}; // das Kelleralphabet
ANIMATION_FUNCTION_DEFAULT == {(1,1,z)};
ANIMATION_FUNCTION == {2}*α ∪ {3}*(γ);
ANIMATION_FUNCTION1 == {(1,0,"z: "),(2,0,"α:"),(3,0,"γ:")};
ANIMATION_STR_JUSTIFY_LEFTx == TRUE;
SET_PREF_P
RETTY_PRINT
_SEQUENCES == TRUE
SET_PREF_P
P
_SEQUENCES == TRUE
CONSTANTS P, δ
PROPERTIES
/* Die Grammatik Regeln */
P = { S ↦ [a,S,b], S ↦ [C],
C ↦ [a,b] } ∧
/* Berechnung von δ aus P */
δ = /* lässt sich eine Regel auf das Top-Symbol im Keller anwenden tue
dies ohne etwas zu lesen :*/
{ lhs,rhs | ∃(A,q).( A↦q ∈ P ∧ lhs=(z0,lambda,A) ∧ rhs=(z0,q))}
∪
/* ist das Top-Symbol im Keller ein Terminalzeichen a welches
auf der Eingabe steht, so wird dies aus dem Keller gePOPt */
{ lhs,rhs | ∃a.(a∈Σ ∧ lhs = (z0,a,a) & rhs = (z0,[]))}
VARIABLES
z, α, γ // Konfiguration in dem sich der PDA befindet
INVARIANT
z ∈ Z ∧ // der aktuelle Zustand
α ∈ seq(Σ) ∧ // der noch zu lesende Teil des Eingabeworts
γ ∈ seq(Γ) // aktuelle Kellerinhalt
INITIALISATION
z := z0 ||
γ := [BOT] || // Initialisierung des Stapels
α := [a,a,b,b] // das Eingabewort
OPERATIONS
// die Operationen Schritt und LambdaSchritt modellieren
// Schritte in der Ableitungsrelation
Schritt(z‘,s) = PRE α ≠ ∅ ∧ γ ≠ ∅ ∧
z‘↦s ∈ δ[{(z,first(α),first(γ))}] THEN
z := z‘ || // in den neuen Zustand wechseln
α := tail(α) || // das erste Symbol auf der Eingabe löschen
γ := s^tail(γ) // s auf den Stapel packen
END;
LambdaSchritt(z‘,s) = PRE γ ≠ ∅ ∧
z‘↦s ∈ δ[{(z,lambda,first(γ))}] THEN
z := z‘ || // in den neuen Zustand wechseln
γ := s^tail(γ) // s auf den Stapel packen
END;
Akzeptieren = PRE γ = ∅ ∧ α = ∅ THEN
/* Wir akzeptieren wenn Eingabe und Stapel leer sind */
skip END
END
```
%% Output
Loaded machine: PDA
Loaded machine: PDA
_für_kfG
%% Cell type:code id: tags:
```
prob
:constants
```
%% Output
Machine constants set up using operation 0: $setup_constants()
%% Cell type:code id: tags:
```
prob
:init
```
%% Output
Machine initialised using operation 1: $initialise_machine()
%% Cell type:code id: tags:
```
prob
:table {z,x,X,z2,Xs| ((z,x,X)↦(z2,Xs)) : δ}
```
%% Output
|z|x|X|z2|Xs|
|---|---|---|---|---|
|$\
renewcommand{\emptyset}{\mathord\varnothing}\renewcommand{\emptyset}{\mathord\varnothing}\renewcommand{\emptyset}{\mathord\varnothing}\renewcommand{\emptyset}{\mathord\varnothing}\renewcommand{\emptyset}{\mathord\varnothing}\
mathit{z0}$|$\mathit{a}$|$\mathit{a}$|$\mathit{z0}$|$
\emptyset
$|
|$\mathit{z0}$|$\mathit{b}$|$\mathit{b}$|$\mathit{z0}$|$
\emptyset
$|
|$\mathit{z0}$|$\mathit{S}$|$\mathit{S}$|$\mathit{z0}$|$
\emptyset
$|
|$\mathit{z0}$|$\mathit{C}$|$\mathit{C}$|$\mathit{z0}$|$
\emptyset
$|
|$\mathit{z0}$|$\mathit{lambda}$|$\mathit{S}$|$\mathit{z0}$|$
\{(1\mapsto \mathit{C})\}
$|
|$\mathit{z0}$|$\mathit{lambda}$|$\mathit{S}$|$\mathit{z0}$|$
\{(1\mapsto \mathit{a}),(2\mapsto \mathit{S}),(3\mapsto \mathit{b})\}
$|
|$\mathit{z0}$|$\mathit{lambda}$|$\mathit{C}$|$\mathit{z0}$|$
\{(1\mapsto \mathit{a}),(2\mapsto \mathit{b})\}
$|
|$\mathit{z0}$|$\mathit{lambda}$|$\mathit{lambda}$|$\mathit{z0}$|$
\emptyset
$|
|$\mathit{z0}$|$\mathit{a}$|$\mathit{a}$|$\mathit{z0}$|$
[]
$|
|$\mathit{z0}$|$\mathit{b}$|$\mathit{b}$|$\mathit{z0}$|$
[]
$|
|$\mathit{z0}$|$\mathit{S}$|$\mathit{S}$|$\mathit{z0}$|$
[]
$|
|$\mathit{z0}$|$\mathit{C}$|$\mathit{C}$|$\mathit{z0}$|$
[]
$|
|$\mathit{z0}$|$\mathit{lambda}$|$\mathit{S}$|$\mathit{z0}$|$
[C]
$|
|$\mathit{z0}$|$\mathit{lambda}$|$\mathit{S}$|$\mathit{z0}$|$
[a,\mathit{S},b]
$|
|$\mathit{z0}$|$\mathit{lambda}$|$\mathit{C}$|$\mathit{z0}$|$
[a,b]
$|
|$\mathit{z0}$|$\mathit{lambda}$|$\mathit{lambda}$|$\mathit{z0}$|$
[]
$|
z x X z2 Xs
z0 a a z0
{}
z0 b b z0
{}
z0 S S z0
{}
z0 C C z0
{}
z0 lambda S z0
{(1|->C)}
z0 lambda S z0
{(1|->a),(2|->S),(3|->b)}
z0 lambda C z0
{(1|->a),(2|->b)}
z0 lambda lambda z0
{}
z0 a a z0
[]
z0 b b z0
[]
z0 S S z0
[]
z0 C C z0
[]
z0 lambda S z0
[C]
z0 lambda S z0
[a,S,b]
z0 lambda C z0
[a,b]
z0 lambda lambda z0
[]
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table style="font-family:monospace"><tbody>
<tr>
<td style="padding:10px">z: </td>
<td style="padding:10px">z0</td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">α:</td>
<td style="padding:10px">a</td>
<td style="padding:10px">a</td>
<td style="padding:10px">b</td>
<td style="padding:10px">b</td>
</tr>
<tr>
<td style="padding:10px">γ:</td>
<td style="padding:10px">S</td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:browse
```
%% Output
Machine: PDA
Machine: PDA
_für_kfG
Sets: Z, SYMBOLE
Constants: P, δ
Variables: z, α, γ
Operations:
LambdaSchritt(z0,
{(1|->C)}
)
LambdaSchritt(z0,
{(1|->a),(2|->S),(3|->b)}
)
LambdaSchritt(z0,
[C]
)
LambdaSchritt(z0,
[a,S,b]
)
%% Cell type:code id: tags:
```
prob
:exec LambdaSchritt s = [a,S,b]
```
%% Output
Executed operation: LambdaSchritt(z0,
{(1|->a),(2|->S),(3|->b)}
)
Executed operation: LambdaSchritt(z0,
[a,S,b]
)
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table style="font-family:monospace"><tbody>
<tr>
<td style="padding:10px">z: </td>
<td style="padding:10px">z0</td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">α:</td>
<td style="padding:10px">a</td>
<td style="padding:10px">a</td>
<td style="padding:10px">b</td>
<td style="padding:10px">b</td>
</tr>
<tr>
<td style="padding:10px">γ:</td>
<td style="padding:10px">a</td>
<td style="padding:10px">S</td>
<td style="padding:10px">b</td>
<td style="padding:0px"></td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:browse
```
%% Output
Machine: PDA
Machine: PDA
_für_kfG
Sets: Z, SYMBOLE
Constants: P, δ
Variables: z, α, γ
Operations:
Schritt(z0,
{}
)
Schritt(z0,
[]
)
%% Cell type:code id: tags:
```
prob
:exec Schritt
```
%% Output
Executed operation: Schritt(z0,
{}
)
Executed operation: Schritt(z0,
[]
)
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table style="font-family:monospace"><tbody>
<tr>
<td style="padding:10px">z: </td>
<td style="padding:10px">z0</td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">α:</td>
<td style="padding:10px">a</td>
<td style="padding:10px">b</td>
<td style="padding:10px">b</td>
</tr>
<tr>
<td style="padding:10px">γ:</td>
<td style="padding:10px">S</td>
<td style="padding:10px">b</td>
<td style="padding:0px"></td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:browse
```
%% Output
Machine: PDA
Machine: PDA
_für_kfG
Sets: Z, SYMBOLE
Constants: P, δ
Variables: z, α, γ
Operations:
LambdaSchritt(z0,
{(1|->C)}
)
LambdaSchritt(z0,
{(1|->a),(2|->S),(3|->b)}
)
LambdaSchritt(z0,
[C]
)
LambdaSchritt(z0,
[a,S,b]
)
%% Cell type:code id: tags:
```
prob
:exec LambdaSchritt s = [C]
```
%% Output
Executed operation: LambdaSchritt(z0,
{(1|->C)}
)
Executed operation: LambdaSchritt(z0,
[C]
)
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table style="font-family:monospace"><tbody>
<tr>
<td style="padding:10px">z: </td>
<td style="padding:10px">z0</td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">α:</td>
<td style="padding:10px">a</td>
<td style="padding:10px">b</td>
<td style="padding:10px">b</td>
</tr>
<tr>
<td style="padding:10px">γ:</td>
<td style="padding:10px">C</td>
<td style="padding:10px">b</td>
<td style="padding:0px"></td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:browse
```
%% Output
Machine: PDA
Machine: PDA
_für_kfG
Sets: Z, SYMBOLE
Constants: P, δ
Variables: z, α, γ
Operations:
LambdaSchritt(z0,
{(1|->a),(2|->b)}
)
LambdaSchritt(z0,
[a,b]
)
%% Cell type:code id: tags:
```
prob
:exec LambdaSchritt s=[a,b]
```
%% Output
Executed operation: LambdaSchritt(z0,
{(1|->a),(2|->b)}
)
Executed operation: LambdaSchritt(z0,
[a,b]
)
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table style="font-family:monospace"><tbody>
<tr>
<td style="padding:10px">z: </td>
<td style="padding:10px">z0</td>
<td style="padding:0px"></td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">α:</td>
<td style="padding:10px">a</td>
<td style="padding:10px">b</td>
<td style="padding:10px">b</td>
</tr>
<tr>
<td style="padding:10px">γ:</td>
<td style="padding:10px">a</td>
<td style="padding:10px">b</td>
<td style="padding:10px">b</td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:browse
```
%% Output
Machine: PDA
Machine: PDA
_für_kfG
Sets: Z, SYMBOLE
Constants: P, δ
Variables: z, α, γ
Operations:
Schritt(z0,
{}
)
Schritt(z0,
[]
)
%% Cell type:code id: tags:
```
prob
:exec Schritt
```
%% Output
Executed operation: Schritt(z0,
{}
)
Executed operation: Schritt(z0,
[]
)
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table style="font-family:monospace"><tbody>
<tr>
<td style="padding:10px">z: </td>
<td style="padding:10px">z0</td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">α:</td>
<td style="padding:10px">b</td>
<td style="padding:10px">b</td>
</tr>
<tr>
<td style="padding:10px">γ:</td>
<td style="padding:10px">b</td>
<td style="padding:10px">b</td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:exec Schritt
```
%% Output
Executed operation: Schritt(z0,
{}
)
Executed operation: Schritt(z0,
[]
)
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table style="font-family:monospace"><tbody>
<tr>
<td style="padding:10px">z: </td>
<td style="padding:10px">z0</td>
</tr>
<tr>
<td style="padding:10px">α:</td>
<td style="padding:10px">b</td>
</tr>
<tr>
<td style="padding:10px">γ:</td>
<td style="padding:10px">b</td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:exec Schritt
```
%% Output
Executed operation: Schritt(z0,
{}
)
Executed operation: Schritt(z0,
[]
)
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table style="font-family:monospace"><tbody>
<tr>
<td style="padding:10px">z: </td>
<td style="padding:10px">z0</td>
</tr>
<tr>
<td style="padding:10px">α:</td>
<td style="padding:0px"></td>
</tr>
<tr>
<td style="padding:10px">γ:</td>
<td style="padding:0px"></td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:exec Akzeptieren
```
%% Output
Executed operation: Akzeptieren()
%% Cell type:markdown id: tags:
Das Wort
``aabb``
wird sowohl von der Grammatik generiert als auch von diesem generierten PDA akzeptiert.
%% Cell type:code id: tags:
```
prob
```
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment