Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Frontull Samuel
alpha
Commits
5a773a38
Commit
5a773a38
authored
Jul 27, 2021
by
Frontull Samuel
Browse files
commented last functions
parent
50b7e255
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
pcp/pcp.hs
pcp/pcp.hs
+5
-0
No files found.
pcp/pcp.hs
View file @
5a773a38
...
...
@@ -232,20 +232,25 @@ pcp = \x -> ycomb (\f x y ->
-- PCP Problems
-- [(a, ab), (bb, b)]
problem_1
::
ListStrPairs
problem_1
=
cons
(
pair
a
ab
)
(
cons
(
pair
bb
b
)
nil
)
-- [(a, abbb), (bb, b)]
problem_2
::
ListStrPairs
problem_2
=
cons
(
pair
a
abbb
)
(
cons
(
pair
bb
b
)
nil
)
-- [(bba, b), (b, ab), (a, bba)]
problem_3
::
ListStrPairs
-- undecidable
problem_3
=
cons
(
pair
bba
b
)
(
cons
(
pair
b
ab
)
(
cons
(
pair
a
bba
)
nil
))
-- PARSE LC ENCODINGS TO STRINGS
-- string encoding to String
lcstr_tostr
::
LCStr
->
String
lcstr_tostr
=
\
s
->
unString
s
(
\
a
->
"a"
++
a
)
(
\
b
->
"b"
++
b
)
(
""
)
-- bool encoding to String
lcbool_tostr
::
LCBool
->
String
lcbool_tostr
=
\
b
->
ite
b
"True"
"False"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment