summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Guschin <guschin.drew@gmail.com>2022-05-15 17:30:56 +0400
committerAndrew Guschin <guschin.drew@gmail.com>2022-05-15 17:30:56 +0400
commitc04fd874af4e641aeeba2e4a4a991fd81225a5d3 (patch)
tree5205602f3828ec4f343887381c3754f087353e4f
parent8a57d07922f0298a67ef2742f203c74c19e79662 (diff)
Добавление тестов пятой лабы
-rw-r--r--lab5/lab5.py14
-rw-r--r--lab5/report/images/test1.pngbin0 -> 427686 bytes
-rw-r--r--lab5/report/images/test2.pngbin0 -> 447961 bytes
-rw-r--r--lab5/report/lab5.tex18
4 files changed, 24 insertions, 8 deletions
diff --git a/lab5/lab5.py b/lab5/lab5.py
index 5cf5027..eeda67c 100644
--- a/lab5/lab5.py
+++ b/lab5/lab5.py
@@ -119,6 +119,15 @@ def print_cayley(semigroup, cayley):
print()
+def print_ideals(semigroup, right_ideals, left_ideals):
+ for element in semigroup:
+ r = right_ideals[element]
+ l = right_ideals[element]
+ print(f"({element}] = {{{', '.join(r)}}}")
+ print(f"[{element}) = {{{', '.join(l)}}}")
+ print(f"[{element}] = {{{', '.join(r | l)}}}")
+
+
def make_semigroup():
print("Введите элементы полугруппы:")
semigroup = set(input().split())
@@ -126,9 +135,9 @@ def make_semigroup():
print("Введите количество преобразований:")
k = int(input())
+ print(f"Введите преобразования:")
translations = []
for _ in range(k):
- print(f"Введите преобразование: ")
key, val = input().split()
translations.append((key, val))
@@ -169,6 +178,9 @@ def main():
d = r + l
print(d.astype(int))
+ print("Идеалы:")
+ print_ideals(semigroup, right_ideals, left_ideals)
+
print("egg-box диаграмма:")
egg_box = get_egg_box(d, semigroup)
print(egg_box)
diff --git a/lab5/report/images/test1.png b/lab5/report/images/test1.png
new file mode 100644
index 0000000..90d1e3f
--- /dev/null
+++ b/lab5/report/images/test1.png
Binary files differ
diff --git a/lab5/report/images/test2.png b/lab5/report/images/test2.png
new file mode 100644
index 0000000..d00fd40
--- /dev/null
+++ b/lab5/report/images/test2.png
Binary files differ
diff --git a/lab5/report/lab5.tex b/lab5/report/lab5.tex
index dbd941f..5088580 100644
--- a/lab5/report/lab5.tex
+++ b/lab5/report/lab5.tex
@@ -66,7 +66,7 @@
\begin{example}
В полугруппе натуральных чисел с операцией сложения $\mathbb{N} = (\mathbb{N},
- +)$ главные идеалы $(n] = {n, n + 1, n + 2, \dots}$ образуют бесконечную
+ +)$ главные идеалы $(n] = \{ n, n + 1, n + 2, \dots \}$ образуют бесконечную
последовательность с пустым пересечением.
\end{example}
@@ -236,13 +236,17 @@ $R$ мощности $M$ определяющих соотношений.
\section{Результаты тестирования}
-Картинки
+\begin{figure}[H]
+ \centering
+ \includegraphics[width=0.7\textwidth]{test1.png}
+ \caption{Вычисленная полугруппа и её таблица Кэли}
+\end{figure}
-% \begin{figure}[H]
-% \centering
-% \includegraphics[width=0.7\textwidth]{test1.png}
-% \caption{}
-% \end{figure}
+\begin{figure}[H]
+ \centering
+ \includegraphics[width=0.7\textwidth]{test2.png}
+ \caption{Идеалы полугруппы и egg"=box"=диаграмма}
+\end{figure}
\section{Решение задач}