Skip to content

Graph query semantic formalization#2

Open
fedorovr wants to merge 24 commits intoYaccConstructor:masterfrom
fedorovr:master
Open

Graph query semantic formalization#2
fedorovr wants to merge 24 commits intoYaccConstructor:masterfrom
fedorovr:master

Conversation

@fedorovr
Copy link
Member

@fedorovr fedorovr commented May 8, 2017

#1

Definition getLabels VV AA xl1 xl2 (walk : D_walk VV AA xl1 xl2 VL AL) : list symbol := getLabels' AL.
Definition getLength VV AA xl1 xl2 (walk : D_walk VV AA xl1 xl2 VL AL) : nat := getLength' AL.

Record CFPQ_Relational_query_result : Type := {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не нашёл ничего про связь ответа с языком, заданным грамматикой.

}.

Record CFPQ_All_path_query_result : Type := {
g'' : grammar;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Возрастающее кол-во штрихов не улучшает читабельность кода.

CCFPQ/CCFPQ.v Outdated
Inductive CCFPQ_Builder : V_set -> Nat_set -> list var_EitherVertexNat_pair -> Type :=
| Empty_query : CCFPQ_Builder V_empty Nat_empty []
| Add_free_var : forall (v : V_set) (n : Nat_set) (var_evnp_l : list var_EitherVertexNat_pair)
| Add_free_var : forall (v : V_set) (n : Nat_set) (var_evnp_l : list var_EitherVertexNat_pair)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Дайте, пожалуйста, нормальные имена всем сущьностям. Читать код с V_Set и прочим очень тяжело.

Derivability_relation g V A x' x2 v2) ->
Derivability_relation g V A x1 x2 v.

Theorem Parse_tree_to_relation : forall (g : Grammar) (V : V_set) (A : A_set)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сложно, слишком много "сторонних" параметров. В конечном итоге должно получиться утверждение про грамматику, граф и формулу. Всё остальное должно исчезнуть.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

То же самое про остальные теоремы, лемы и т.д.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Все эти сущности используются в определениях, без них обойтись нельзя

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Странно, а в нормальных утверждениях их нету. Что-то тут не так. Есть просто граф и грамматика. Если что-то нужно ещё, значит надо это "прятать".

Copy link
Member Author

@fedorovr fedorovr May 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Эта теорема показывает, что из дерева разбора можно построить отношение выводимости.
Определение из статьи:
image
В Тексте граф G = В коде граф это (V : Vertex_set) (A : Arc_set) - вершины и ребра
В Тексте грамматика С = В коде грамматика (g : Grammar)
В тексте вершины m n = В коде (x1 x2 : Vertex)
Параметризуемый стартовый нетерминал грамматики в тексте а = В коде (v : var).
Само утверждение теоремы: Parse_tree g V A x1 x2 v -> Derivability_relation g V A x1 x2 v
Из любого дерева разбора строим отношение

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну, вот хотя бы набор рёбер и вершин можно спрятать в один тип "граф". Это и читабельность повысит и снимет вопросы из разряда "вообще-то граф это не просто несвязанный набор вершин и рёбер. Как минимум, вершины часть инцедентны каким-то рёбрам".

GKerfImf added a commit that referenced this pull request Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants