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
7d5e947e
Commit
7d5e947e
authored
Jul 27, 2021
by
Frontull Samuel
Browse files
added two difficult pcp problems
parent
16bf96f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
pcp/pcp.hs
pcp/pcp.hs
+11
-0
No files found.
pcp/pcp.hs
View file @
7d5e947e
...
...
@@ -128,6 +128,9 @@ ba = LCStr $ \a b x -> b (a x)
bb
::
LCStr
bb
=
LCStr
$
\
a
b
x
->
b
(
b
x
)
baa
::
LCStr
baa
=
LCStr
$
\
a
b
x
->
b
(
a
(
a
x
))
bba
::
LCStr
bba
=
LCStr
$
\
a
b
x
->
b
(
b
(
a
x
))
...
...
@@ -244,6 +247,14 @@ problem_2 = cons (pair a abbb) (cons (pair bb b) nil)
problem_3
::
ListStrPairs
-- undecidable
problem_3
=
cons
(
pair
bba
b
)
(
cons
(
pair
b
ab
)
(
cons
(
pair
a
bba
)
nil
))
-- [(baa, b), (a, baa), (b, a)]
problem_4
::
ListStrPairs
-- has a solution of length 74
problem_4
=
cons
(
pair
baa
b
)
(
cons
(
pair
a
baa
)
(
cons
(
pair
b
a
)
nil
))
-- [(ab, a), (ab, bba), (a, baa), (baa, ba)]
problem_5
::
ListStrPairs
-- has a solution of length 76
problem_5
=
cons
(
pair
ab
a
)
(
cons
(
pair
ab
bba
)
(
cons
(
pair
a
baa
)
(
cons
(
pair
baa
ba
)
nil
)))
-- PARSE LC ENCODINGS TO STRINGS
-- string encoding to String
...
...
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