Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pysemigroup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab upgrade completed. Current version is 17.8.2.
Show more breadcrumbs
PAPERMAN Charles
pysemigroup
Commits
ec3707dd
Commit
ec3707dd
authored
1 year ago
by
cha
Browse files
Options
Downloads
Patches
Plain Diff
fixing test
parent
0deb13eb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pysemigroup/automata.py
+1
-1
1 addition, 1 deletion
pysemigroup/automata.py
pysemigroup/tests/test_automata.py
+8
-7
8 additions, 7 deletions
pysemigroup/tests/test_automata.py
with
9 additions
and
8 deletions
pysemigroup/automata.py
+
1
−
1
View file @
ec3707dd
...
...
@@ -383,7 +383,7 @@ class SemiNFA:
return
nx
.
isomorphism
.
is_isomorphic
(
self
.
get_digraph_encoding
(),
other
.
get_digraph_encoding
(),
node_match
)
)
and
type
(
self
)
==
type
(
other
)
def
isormorph_hash
(
self
)
->
str
:
return
hashlib
.
sha1
(
...
...
This diff is collapsed.
Click to expand it.
pysemigroup/tests/test_automata.py
+
8
−
7
View file @
ec3707dd
...
...
@@ -213,7 +213,7 @@ class TestNFA:
J
=
[(
0
,
"
a
"
,
1
),
(
0
,
"
b
"
,
0
),
(
1
,
"
a
"
,
1
),
(
1
,
"
b
"
,
0
)]
C
=
automata
.
DFA
(
J
,
0
,
[
1
])
assert
C
.
normalize
()
==
B
.
normalize
(
)
assert
C
.
isomorphism
(
B
,
C
)
def
test_reverse
(
self
):
I
=
[(
0
,
"
a
"
,
1
),
(
1
,
"
b
"
,
2
)]
...
...
@@ -244,18 +244,19 @@ class TestNFA:
J
=
[(
0
,
"
a
"
,
1
),
(
1
,
"
b
"
,
0
),
(
0
,
"
b
"
,
2
),
(
1
,
"
a
"
,
2
),
(
2
,
"
a
"
,
2
),
(
2
,
"
b
"
,
2
)]
C
=
automata
.
DFA
(
J
,
0
,
[
0
]).
normalize
()
assert
C
==
B
assert
B
.
isomorphism
(
B
)
class
TestDFA
:
def
test_normalize
(
self
):
I
=
[(
"
xdsqd
"
,
"
a
"
,
"
ds
"
),
(
"
ds
"
,
"
b
"
,
"
xdsqd
"
)]
A
=
automata
.
DFA
(
I
,
"
xdsqd
"
,
[
"
xdsqd
"
])
B
=
A
.
normalize
()
assert
B
==
B
.
normalize
()
C
=
B
.
normalize
()
assert
B
.
isomorphism
(
C
)
J
=
[(
0
,
"
a
"
,
1
),
(
1
,
"
b
"
,
2
)]
A
=
automata
.
DFA
(
J
,
[
0
]
,
[
2
])
assert
A
.
normalize
()
==
B
.
normalize
(
)
D
=
automata
.
DFA
(
J
,
0
,
[
2
])
assert
C
.
isomorphism
(
B
)
def
test_eq
(
self
):
I
=
[(
"
xdsqd
"
,
"
a
"
,
"
ds
"
),
(
"
ds
"
,
"
b
"
,
"
xdsqd
"
)]
...
...
@@ -265,7 +266,7 @@ class TestDFA:
J
=
[(
520
,
"
a
"
,
100
),
(
100
,
"
b
"
,
520
)]
B
=
automata
.
DFA
(
J
,
520
,
[
520
])
return
A
==
B
return
A
.
isomorphism
(
B
)
def
test_minimize
(
self
):
I
=
[(
0
,
"
a
"
,
1
),
(
1
,
"
b
"
,
2
),
(
2
,
"
a
"
,
3
),
(
3
,
"
b
"
,
2
)]
...
...
@@ -275,5 +276,5 @@ class TestDFA:
J
=
[(
0
,
"
a
"
,
1
),
(
1
,
"
b
"
,
0
),
(
0
,
"
b
"
,
2
),
(
1
,
"
a
"
,
2
),
(
2
,
"
a
"
,
2
),
(
2
,
"
b
"
,
2
)]
C
=
automata
.
DFA
(
J
,
0
,
[
0
]).
normalize
()
assert
C
==
B
assert
C
.
isomorphism
(
B
)
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