Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph query semantic formalization #2

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions CCFPQ/CCFPQ.v
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Require Import Definitions.
Require Import CF_Definitions.
Require Import Graph.
Require Import List.
Import ListNotations.

Unset Implicit Arguments.
Set Strict Implicit.

Expand Down Expand Up @@ -31,10 +34,10 @@ Section CCFPQ.

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 и прочим очень тяжело.

(x : Vertex),
CCFPQ_Builder v n var_evnp_l -> CCFPQ_Builder (V_union v (V_single x)) n var_evnp_l
| Add_bound_var : forall (v : V_set) (n : Nat_set) (var_evnp_l : list var_EitherVertexNat_pair)
| Add_bound_var : forall (v : V_set) (n : Nat_set) (var_evnp_l : list var_EitherVertexNat_pair)
(bv : nat),
CCFPQ_Builder v n var_evnp_l -> CCFPQ_Builder v (Nat_union n (Nat_single bv)) var_evnp_l
| Add_conj_vertex_vertex : forall v n var_evnp_l nt (x1 x2 : Vertex),
Expand Down Expand Up @@ -99,15 +102,16 @@ Section CCFPQ.
| (nt, _)::tl => nt::get_nonterminals tl
end.

Fixpoint get_all_vars (G : grammar) : list var :=
Fixpoint get_all_vars (G : Grammar) : list var :=
match G with
| [] => []
| R A u::Gr => A::(get_all_vars Gr)
| (Rv A v1 v2)::Gr => A::(get_all_vars Gr)
| x::Gr => get_all_vars Gr
end.

Record CCFPQ_on_grammar : Type := {
ccfpq : CCFPQ;
gr : grammar;
gr : Grammar;

nonterminals_in_grammar : forall (nt : var),
In nt (get_nonterminals (var_evnp_l ccfpq)) -> In nt (get_all_vars gr)
Expand Down
Loading