Repository navigation
Conversation
semrosin
commented
Oct 19, 2026
- С использованием возможности pyformlang для работы с контекстно-свободными грамматиками реализована функция преобразования контекстно-свободной грамматики в ослабленную нормальную форму Хомского (ОНФХ).
- Реализована функция, основанная на алгоритме Хеллингса, решающая задачу достижимости между всеми парами вершин для заданного графа и заданной КС грамматики (не обязательно в ОНФХ).
- Добавлены собственные тесты:
- Преобразования в ОНФХ: корректность формы правил, сохранение языка и ε, удаление бесполезных символов.
- Хеллингса на граничные случаи: пустые графы и грамматики, фильтры вершин, параллельные рёбра, многосимвольные метки и нестандартный стартовый символ.
…е DOT (#1) * feat: get graph info * feat: save two cycles graph in dot format * test: unit tests for getting graph info * test: unit tests for saving two cycles graph * test: fix data in two cycles graph test * feat: return graph statistics as GraphInfo * test: cover graph library failure scenarios * test: add DOT graph round-trip coverage * test: simplify graph library test coverage * refactor: remove double comparison from tests * refactor: fix type annotation * fix format * test: fix ci failures caused by pydot bug
…ию и НКА по графу (#2) * feat: add regex to dfa function * feat: add graph to nfa function * test: add tests for task 2 * fix: graph to nfa declaration * docs: add more docs for functions
…осов через разреженные матрицы (#3) * feat: add sparse adjacency-matrix FA * feat: add automata intersection * feat: add tensor-based RPQ * test: sparse adjacency-matrix FA, automata intersection, and tensor-based RPQ
The frontier is now a (len(starts) * |Q_dfa|) x |V| Boolean matrix with one row block per start node. Every BFS layer is computed with Boolean matrix products: the frontier is shifted along the graph edges of a symbol and advanced inside every block by the block-diagonal DFA transition matrix.
The try block now imports from project.msbfs_rpq instead of the non-existent project.rpq, so the RPQ autotests run instead of being skipped.
* feat: add multiple-source RPQ solver * test: add RPQ regression coverage * test: resolve RPQ test naming collision * refactor: rename files * refactor: use blocked Boolean matrix BFS for multiple-source RPQ The frontier is now a (len(starts) * |Q_dfa|) x |V| Boolean matrix with one row block per start node. Every BFS layer is computed with Boolean matrix products: the frontier is shifted along the graph edges of a symbol and advanced inside every block by the block-diagonal DFA transition matrix. * test: fix ms_bfs_based_rpq import in RPQ autotest The try block now imports from project.msbfs_rpq instead of the non-existent project.rpq, so the RPQ autotests run instead of being skipped. * refactor: delegate start/final handling to graph_to_nfa in ms_bfs_based_rpq * test: rename msbfs test to reflect isolated-vertex semantics * fix: rename autotests file back * fix: switch from numpy arrays to scupy matrices
fix(task 3): использование разреженных матриц SciPy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.